- Added AI for Pongify and Rapid Hybridization that compares the token's value to the destroyed target

This commit is contained in:
excessum
2014-05-17 08:48:44 +00:00
parent cb46b9c0c3
commit 08039be686
3 changed files with 10 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ import forge.game.card.CounterType;
import forge.game.cost.Cost; import forge.game.cost.Cost;
import forge.game.cost.CostPart; import forge.game.cost.CostPart;
import forge.game.cost.CostSacrifice; import forge.game.cost.CostSacrifice;
import forge.game.phase.PhaseType;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions; import forge.game.spellability.TargetRestrictions;
@@ -143,6 +144,13 @@ public class DestroyAi extends SpellAbilityAi {
return false; return false;
} }
} }
if ("Pongify".equals(logic)) {
Card token = TokenAi.spawnToken(ai.getOpponent(), sa.getSubAbility());
if (source.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS) || //prevent surprise combatant
ComputerUtilCard.evaluateCreature(choice) < 1.5 * ComputerUtilCard.evaluateCreature(token)) {
return false;
}
}
} else if (CardLists.getNotType(list, "Land").isEmpty()) { } else if (CardLists.getNotType(list, "Land").isEmpty()) {
choice = ComputerUtilCard.getBestLandAI(list); choice = ComputerUtilCard.getBestLandAI(list);
} else { } else {

View File

@@ -1,8 +1,7 @@
Name:Pongify Name:Pongify
ManaCost:U ManaCost:U
Types:Instant Types:Instant
A:SP$ Destroy | Cost$ U | ValidTgts$ Creature | TgtPrompt$ Select a creature | SubAbility$ DBToken | NoRegen$ True | SpellDescription$ Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Ape creature token into play. A:SP$ Destroy | Cost$ U | ValidTgts$ Creature | TgtPrompt$ Select a creature | AILogic$ Pongify | SubAbility$ DBToken | NoRegen$ True | SpellDescription$ Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Ape creature token into play.
SVar:DBToken:DB$Token | TokenAmount$ 1 | TokenName$ Ape | TokenTypes$ Creature,Ape | TokenOwner$ TargetedController | TokenColors$ Green | TokenPower$ 3 | TokenToughness$ 3 SVar:DBToken:DB$Token | TokenAmount$ 1 | TokenName$ Ape | TokenTypes$ Creature,Ape | TokenOwner$ TargetedController | TokenColors$ Green | TokenPower$ 3 | TokenToughness$ 3
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/pongify.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/pongify.jpg
Oracle:Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Ape creature token onto the battlefield. Oracle:Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Ape creature token onto the battlefield.

View File

@@ -1,8 +1,7 @@
Name:Rapid Hybridization Name:Rapid Hybridization
ManaCost:U ManaCost:U
Types:Instant Types:Instant
A:SP$ Destroy | Cost$ U | ValidTgts$ Creature | TgtPrompt$ Select a creature | SubAbility$ DBToken | NoRegen$ True | SpellDescription$ Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Frog Lizard creature token onto the battlefield. A:SP$ Destroy | Cost$ U | ValidTgts$ Creature | TgtPrompt$ Select a creature | AILogic$ Pongify | SubAbility$ DBToken | NoRegen$ True | SpellDescription$ Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Frog Lizard creature token onto the battlefield.
SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenName$ Frog Lizard | TokenTypes$ Creature,Frog,Lizard | TokenOwner$ TargetedController | TokenColors$ Green | TokenPower$ 3 | TokenToughness$ 3 SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenName$ Frog Lizard | TokenTypes$ Creature,Frog,Lizard | TokenOwner$ TargetedController | TokenColors$ Green | TokenPower$ 3 | TokenToughness$ 3
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/rapid_hybridization.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/rapid_hybridization.jpg
Oracle:Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Frog Lizard creature token onto the battlefield. Oracle:Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Frog Lizard creature token onto the battlefield.