mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Implemented AI for Sorin, Grim Nemesis
This commit is contained in:
@@ -11,6 +11,7 @@ import forge.game.card.Card;
|
||||
import forge.game.card.CardCollection;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.card.CounterType;
|
||||
import forge.game.cost.Cost;
|
||||
import forge.game.phase.PhaseHandler;
|
||||
import forge.game.phase.PhaseType;
|
||||
@@ -71,6 +72,21 @@ public class DamageDealAi extends DamageAiBase {
|
||||
dmg = Aggregates.sum(wolves, CardPredicates.Accessors.fnGetNetPower);
|
||||
}
|
||||
|
||||
if (source.getName().equals("Sorin, Grim Nemesis")) {
|
||||
int loyalty = source.getCounters(CounterType.LOYALTY);
|
||||
for (; loyalty > 0; loyalty--) {
|
||||
if (this.damageTargetAI(ai, sa, loyalty, false)) {
|
||||
dmg = ComputerUtilCombat.getEnoughDamageToKill(sa.getTargetCard(), loyalty, source, false, false);
|
||||
if (dmg > loyalty) {
|
||||
continue; // in case the calculation gets messed up somewhere
|
||||
}
|
||||
source.setSVar("ChosenX", "Number$" + dmg);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dmg <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user