mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +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.CardCollection;
|
||||||
import forge.game.card.CardLists;
|
import forge.game.card.CardLists;
|
||||||
import forge.game.card.CardPredicates;
|
import forge.game.card.CardPredicates;
|
||||||
|
import forge.game.card.CounterType;
|
||||||
import forge.game.cost.Cost;
|
import forge.game.cost.Cost;
|
||||||
import forge.game.phase.PhaseHandler;
|
import forge.game.phase.PhaseHandler;
|
||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
@@ -70,6 +71,21 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
List<Card> wolves = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), "Creature.Wolf+untapped+YouCtrl+Other", ai, source);
|
List<Card> wolves = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), "Creature.Wolf+untapped+YouCtrl+Other", ai, source);
|
||||||
dmg = Aggregates.sum(wolves, CardPredicates.Accessors.fnGetNetPower);
|
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) {
|
if (dmg <= 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user