The old issue of splash damage rendering certain creatures useless.
Just an idea:
An area attack could get a limit to the number of creatures it can hit at once, for example:
Mortor wood ant acid splash hits in a group of spiderlings,
from the spiderlings that are in range randomly select x spiderlings, (x being any whole number)
apply the damage to each selected spiderling.
What I meant would look a bit like this, I think?:
int maxHitsAtOnce;//The maximum number of creatures this attack can hit in one hit
getHitCreaturesInArea(ArrayList<Creature> creaturesInArea) {//creaturesInArea is a list of all the creatures that are candidates to get hit
ArrayList<Creature> hitCreatures;//hitCreatures is a list of the creatures that damage and hit effects will apply to
if(creaturesInArea.size() > maxHitsAtOnce) {//If there are more creatures in the attack area than we can hit
hitCreatures = new ArrayList<Creature>();//hitCreatures is a new empty list
while(hitCreatures.size() < maxHitsAtOnce) {//As long as we have not hit enough enemies with the attack
int chosenIndex = Math.round(Math.random() * creaturesInArea.size() + 0.5;//Get a random enemy from the hit candidates
hitCreatures.add(creaturesInArea.get(chosenIndex);//Add the randomly chosen creature to the hit list
creaturesInArea.remove(chosenIndex);//Remove the hit creature from the hit candidates list
}
} else {//In case there are fewer creatures in the attack area than we can hit
hitCreatures = creaturesInArea//Use the creatures in area as hit creatures, hit all creatures in the area
}
for(Creature c: hitCreatures) {//Iterate over all creatures that are hit and apply attack damage and effects on them
c.takeDamage(this.attackDamage);
c.takeEffect(this.attackEffect);
}
}
I love watching the dev streams, watching them inspired me to learn to program, over the last few weeks I am trying to learn some Java. (I am really grateful, as I find programming can feel really rewarding.)
Edit:
The forum text editor did not save spaces...