- Updated AI of some more cards with ChooseColor effects.

This commit is contained in:
Sloth
2014-10-20 14:19:48 +00:00
parent 66f66f5a69
commit fc5bec6b9c
7 changed files with 15 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
import forge.util.MyRandom;
public class ChooseColorAi extends SpellAbilityAi {
@@ -36,6 +37,14 @@ public class ChooseColorAi extends SpellAbilityAi {
source.setSVar("PayX", Integer.toString(x));
return true;
}
if ("Addle".equals(sa.getHostCard().getName())) {
PhaseHandler ph = game.getPhaseHandler();
if (ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) || ai.getOpponent().getCardsIn(ZoneType.Hand).isEmpty()) {
return false;
}
return true;
}
boolean chance = MyRandom.getRandom().nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());
return chance;
}

View File

@@ -3,5 +3,6 @@ ManaCost:2 W
Types:Instant
A:SP$ PumpAll | Cost$ 2 W | ValidCards$ Creature.YouCtrl | NumDef$ +2 | SubAbility$ ChooseColor | SpellDescription$ Creatures you control get +0/+2 until end of turn. Threshold - If seven or more cards are in your graveyard, choose a color. Creatures you control also gain protection from the chosen color until end of turn.
SVar:ChooseColor:DB$ ProtectionAll | Condition$ Threshold | ValidCards$ Creature.YouCtrl | Gains$ Choice | Choices$ AnyColor
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/aven_warcraft.jpg
Oracle:Creatures you control get +0/+2 until end of turn.\nThreshold - If seven or more cards are in your graveyard, choose a color. Creatures you control also gain protection from the chosen color until end of turn.

View File

@@ -4,7 +4,7 @@ Types:Enchantment Aura
K:Enchant creature
A:SP$ Attach | Cost$ 1 W U | ValidTgts$ Creature | AILogic$ Pump
K:ETBReplacement:Other:ChooseColor
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | SpellDescription$ As CARDNAME enters the battlefield, choose a color.
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInHumanDeck | SpellDescription$ As CARDNAME enters the battlefield, choose a color.
K:etbCounter:SLEIGHT:1
S:Mode$ PreventDamage | Target$ Creature.EnchantedBy | Source$ Card.ChosenColor | Description$ Prevent all damage that would be dealt to enchanted creature by sources of the last chosen color.
A:AB$ PutCounter | Cost$ X | Defined$ Self | CounterType$ SLEIGHT | CounterNum$ 1 | SubAbility$ ChooseColor | References$ X | SpellDescription$ Put a sleight counter on CARDNAME and choose a color. X is the number of sleight counters on CARDNAME.

View File

@@ -3,8 +3,7 @@ ManaCost:2
Types:Snow Artifact
K:CARDNAME enters the battlefield tapped.
K:ETBReplacement:Other:ChooseColor
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | SpellDescription$ As CARDNAME enters the battlefield, choose a color.
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInComputerDeck | SpellDescription$ As CARDNAME enters the battlefield, choose a color.
A:AB$ Mana | Cost$ T | Produced$ Chosen | SpellDescription$ Add one mana of the chosen color to your mana pool.
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/coldsteel_heart.jpg
Oracle:Coldsteel Heart enters the battlefield tapped.\nAs Coldsteel Heart enters the battlefield, choose a color.\n{T}: Add one mana of the chosen color to your mana pool.

View File

@@ -5,5 +5,6 @@ K:ETBReplacement:Other:ChooseColor
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | SpellDescription$ As CARDNAME enters the battlefield, choose a color. | AILogic$ MostProminentInHumanDeck
T:Mode$ SpellCast | ValidCard$ Card.ChosenColor | TriggerZones$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ Whenever a player casts a spell of the chosen color, that player loses 1 life.
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ TriggeredActivator | LifeAmount$ 1
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/curse_of_wizardry.jpg
Oracle:As Curse of Wizardry enters the battlefield, choose a color.\nWhenever a player casts a spell of the chosen color, that player loses 1 life.

View File

@@ -6,5 +6,6 @@ SVar:TrigChoose:AB$ ChooseColor | Cost$ 0 | Defined$ TriggeredPlayer | AILogic$
SVar:DBEffect:DB$ Effect | ReplacementEffects$ ReplaceChosen | SVars$ ProduceChosen
SVar:ReplaceChosen:Event$ ProduceMana | ActiveZones$ Command | ValidCard$ Land | ManaReplacement$ ProduceChosen | Description$ Lands tapped for mana produce mana of the chosen color instead of any other color.
SVar:ProduceChosen:Colorless->Chosen & U->Chosen & B->Chosen & R->Chosen & G->Chosen & W->Chosen
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/hall_of_gemstone.jpg
Oracle:At the beginning of each player's upkeep, that player chooses a color. Until end of turn, lands tapped for mana produce mana of the chosen color instead of any other color.

View File

@@ -2,11 +2,10 @@ Name:Harsh Judgment
ManaCost:2 W W
Types:Enchantment
K:ETBReplacement:Other:ChooseColor
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | SpellDescription$ As CARDNAME enters the battlefield, choose a color. | AILogic$ MostProminentInHumanDeck
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInHumanDeck | SpellDescription$ As CARDNAME enters the battlefield, choose a color.
R:Event$ DamageDone | ValidTarget$ You | ActiveZones$ Battlefield | ValidSource$ Instant.ChosenColor,Sorcery.ChosenColor | IsCombat$ False | ReplaceWith$ HarshDmg | Description$ If an instant or sorcery spell of the chosen color would deal damage to you, it deals that damage to its controller instead.
SVar:HarshDmg:AB$ DealDamage | Cost$ 0 | Defined$ ReplacedSourceController | DamageSource$ ReplacedSource | NumDmg$ HarshX | References$ HarshX
SVar:HarshX:ReplaceCount$DamageAmount
SVar:RemRandomDeck:True
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/harsh_judgment.jpg
Oracle:As Harsh Judgment enters the battlefield, choose a color.\nIf an instant or sorcery spell of the chosen color would deal damage to you, it deals that damage to its controller instead.