VampireFangs targets hero with highest HP
This commit is contained in:
parent
c34b065ff5
commit
8b539e1b5c
3 changed files with 17 additions and 4 deletions
|
|
@ -21,6 +21,19 @@ public class VampireFangsMCard : MonsterCard
|
|||
}
|
||||
|
||||
private BattleParticipant DetermineTarget(MonsterViewpoint monsterViewpoint) {
|
||||
return monsterViewpoint.Heroes[0];
|
||||
return GetHeroWithHighestHP(monsterViewpoint);
|
||||
}
|
||||
|
||||
private BattleHero GetHeroWithHighestHP(MonsterViewpoint monsterViewpoint) {
|
||||
int highestHPHeroIndex = -1;
|
||||
int highestHP = -1;
|
||||
for (int i = 0; i < monsterViewpoint.Heroes.Length; i++) {
|
||||
int heroHP = monsterViewpoint.Heroes[i].GetHP();
|
||||
if (heroHP > highestHP) {
|
||||
highestHPHeroIndex = i;
|
||||
highestHP = heroHP;
|
||||
}
|
||||
}
|
||||
return monsterViewpoint.Heroes[highestHPHeroIndex];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue