mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
add AILogic for Tough Cookie
This commit is contained in:
@@ -12,6 +12,7 @@ import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.ApiType;
|
||||
import forge.game.ability.effects.AnimateEffectBase;
|
||||
import forge.game.card.*;
|
||||
import forge.game.combat.Combat;
|
||||
import forge.game.cost.CostPutCounter;
|
||||
import forge.game.phase.PhaseHandler;
|
||||
import forge.game.phase.PhaseType;
|
||||
@@ -386,6 +387,19 @@ public class AnimateAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
|
||||
if (logic.equals("ValuableAttackerOrBlocker")) {
|
||||
if (ph.inCombat()) {
|
||||
final Combat combat = ph.getCombat();
|
||||
CardCollection list = CardLists.getTargetableCards(ai.getGame().getCardsIn(ZoneType.Battlefield), sa);
|
||||
for (Card c : list) {
|
||||
Card animated = becomeAnimated(c, sa);
|
||||
boolean isValuableAttacker = ph.is(PhaseType.MAIN1, ai) && ComputerUtilCard.doesSpecifiedCreatureAttackAI(ai, animated);
|
||||
boolean isValuableBlocker = combat != null && combat.getDefendingPlayers().contains(ai) && ComputerUtilCard.doesSpecifiedCreatureBlock(ai, animated);
|
||||
if (isValuableAttacker || isValuableBlocker)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// This is reasonable for now. Kamahl, Fist of Krosa and a sorcery or
|
||||
// two are the only things
|
||||
// that animate a target. Those can just use AI:RemoveDeck:All until
|
||||
|
||||
@@ -4,7 +4,7 @@ Types:Artifact Creature Food Golem
|
||||
PT:2/2
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigFood | TriggerDescription$ When CARDNAME enters the battlefield, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.")
|
||||
SVar:TrigFood:DB$ Token | TokenAmount$ 1 | TokenScript$ c_a_food_sac | TokenOwner$ You
|
||||
A:AB$ Animate | Cost$ 2 G | ValidTgts$ Artifact.nonCreature+YouCtrl | TgtPrompt$ Select target noncreature artifact you control | Power$ 4 | Toughness$ 4 | Types$ Artifact,Creature | SpellDescription$ Target noncreature artifact you control becomes a 4/4 artifact creature until end of turn.
|
||||
A:AB$ Animate | Cost$ 2 G | ValidTgts$ Artifact.nonCreature+YouCtrl | TgtPrompt$ Select target noncreature artifact you control | Power$ 4 | Toughness$ 4 | Types$ Artifact,Creature | AILogic$ ValuableAttackerOrBlocker | SpellDescription$ Target noncreature artifact you control becomes a 4/4 artifact creature until end of turn.
|
||||
A:AB$ GainLife | Cost$ 2 T Sac<1/CARDNAME> | LifeAmount$ 3 | SpellDescription$ You gain 3 life.
|
||||
DeckHas:Ability$LifeGain|Sacrifice|Token & Type$Food
|
||||
DeckHints:Type$Artifact
|
||||
|
||||
Reference in New Issue
Block a user