- Improved AI using Vraska the Unseen.

This commit is contained in:
Sloth
2013-05-03 13:49:40 +00:00
parent 145a10e7f0
commit 7a901e33cd
2 changed files with 14 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ Name:Vraska the Unseen
ManaCost:3 B G ManaCost:3 B G
Types:Planeswalker Vraska Types:Planeswalker Vraska
Loyalty:5 Loyalty:5
A:AB$ Animate | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Defined$ Self | Triggers$ TrigVraska | sVars$ VraskaGaze | UntilYourNextTurn$ True | SpellDescription$ Until your next turn, whenever a creature deals combat damage to CARDNAME, destroy that creature. | StackDescription$ Until your next turn, whenever a creature deals combat damage to CARDNAME, destroy that creature. A:AB$ Animate | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Defined$ Self | Triggers$ TrigVraska | sVars$ VraskaGaze | UntilYourNextTurn$ True | AILogic$ EOT | SpellDescription$ Until your next turn, whenever a creature deals combat damage to CARDNAME, destroy that creature. | StackDescription$ Until your next turn, whenever a creature deals combat damage to CARDNAME, destroy that creature.
SVar:TrigVraska:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ Card.Self | TriggerZones$ Battlefield | CombatDamage$ True | Execute$ VraskaGaze | TriggerDescription$ Until your next turn, whenever a creature deals combat damage to CARDNAME, destroy that creature. SVar:TrigVraska:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ Card.Self | TriggerZones$ Battlefield | CombatDamage$ True | Execute$ VraskaGaze | TriggerDescription$ Until your next turn, whenever a creature deals combat damage to CARDNAME, destroy that creature.
SVar:VraskaGaze:AB$ Destroy | Cost$ 0 | Defined$ TriggeredSource SVar:VraskaGaze:AB$ Destroy | Cost$ 0 | Defined$ TriggeredSource
A:AB$ Destroy | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent | SpellDescription$ Destroy target nonland permanent. A:AB$ Destroy | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent | SpellDescription$ Destroy target nonland permanent.

View File

@@ -68,7 +68,7 @@ public class AnimateAi extends SpellAbilityAi {
} }
// don't activate during main2 unless this effect is permanent // don't activate during main2 unless this effect is permanent
if (game.getPhaseHandler().is(PhaseType.MAIN2) && !sa.hasParam("Permanent")) { if (game.getPhaseHandler().is(PhaseType.MAIN2) && !sa.hasParam("Permanent") && !sa.hasParam("UntilYourNextTurn")) {
return false; return false;
} }
@@ -76,13 +76,21 @@ public class AnimateAi extends SpellAbilityAi {
final List<Card> defined = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa); final List<Card> defined = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa);
boolean bFlag = false; boolean bFlag = false;
for (final Card c : defined) { if (sa.hasParam("AILogic")) {
bFlag |= (!c.isCreature() && !c.isTapped() if ("EOT".equals(sa.getParam("AILogic"))) {
if (game.getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)) {
return false;
} else {
bFlag = true;
}
}
} else for (final Card c : defined) {
bFlag |= !c.isCreature() && !c.isTapped()
&& !(c.getTurnInZone() == game.getPhaseHandler().getTurn()) && !(c.getTurnInZone() == game.getPhaseHandler().getTurn())
&& !c.isEquipping()); && !c.isEquipping();
// for creatures that could be improved (like Figure of Destiny) // for creatures that could be improved (like Figure of Destiny)
if (c.isCreature() && (sa.hasParam("Permanent") || (!c.isTapped() && !c.isSick()))) { if (!bFlag && c.isCreature() && (sa.hasParam("Permanent") || (!c.isTapped() && !c.isSick()))) {
int power = -5; int power = -5;
if (sa.hasParam("Power")) { if (sa.hasParam("Power")) {
power = AbilityUtils.calculateAmount(source, sa.getParam("Power"), sa); power = AbilityUtils.calculateAmount(source, sa.getParam("Power"), sa);