- PumpAll AI should respect AIPreference:SacCost if specified.

- Specified a basic AIPreference for Maw of the Obzedat, marked it as AI playable.
This commit is contained in:
Agetian
2017-06-19 04:58:32 +00:00
parent b19efd6c0d
commit 927575fbfa
2 changed files with 10 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import com.google.common.base.Predicate;
import forge.ai.ComputerUtil;
import forge.ai.ComputerUtilCard;
import forge.ai.ComputerUtilCombat;
import forge.ai.ComputerUtilCost;
import forge.game.Game;
import forge.game.GameObject;
import forge.game.ability.AbilityUtils;
@@ -12,6 +13,7 @@ import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.card.CardLists;
import forge.game.combat.Combat;
import forge.game.cost.Cost;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
@@ -33,6 +35,7 @@ public class PumpAllAi extends PumpAiBase {
final Card source = sa.getHostCard();
final Game game = ai.getGame();
final Combat combat = game.getCombat();
final Cost abCost = sa.getPayCosts();
final int power = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumAtt"), sa);
final int defense = AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumDef"), sa);
@@ -44,6 +47,12 @@ public class PumpAllAi extends PumpAiBase {
return false;
}
if (abCost != null && source.hasSVar("AIPreference")) {
if (!ComputerUtilCost.checkSacrificeCost(ai, abCost, source, true)) {
return false;
}
}
if (sa.hasParam("ValidCards")) {
valid = sa.getParam("ValidCards");
}

View File

@@ -3,6 +3,6 @@ ManaCost:3 W B
Types:Creature Thrull
PT:3/3
A:AB$ PumpAll | Cost$ Sac<1/Creature> | ValidCards$ Creature.YouCtrl | NumAtt$ 1 | NumDef$ 1 | SpellDescription$ Creatures you control get +1/+1 until end of turn.
SVar:RemAIDeck:True
SVar:AIPreference:SacCost$Creature.token+powerLE2,Creature.cmcLE2+powerLE2
SVar:Picture:http://www.wizards.com/global/images/magic/general/maw_of_the_obzedat.jpg
Oracle:Sacrifice a creature: Creatures you control get +1/+1 until end of turn.