From cfcbde62b2b3e55d8f13a4f851f23bdea445d60d Mon Sep 17 00:00:00 2001 From: swordshine Date: Thu, 15 Aug 2013 04:55:40 +0000 Subject: [PATCH] - More cards ready for multiplayer - Converted several cards to replacement effects --- res/cardsfolder/a/ashlings_prerogative.txt | 4 ++-- res/cardsfolder/l/lich.txt | 5 +++-- res/cardsfolder/m/minion_of_the_wastes.txt | 5 +++-- res/cardsfolder/n/nameless_race.txt | 5 +++-- res/cardsfolder/p/phyrexian_processor.txt | 5 +++-- res/cardsfolder/p/primal_plasma.txt | 12 +++++++----- res/cardsfolder/w/waiting_in_the_weeds.txt | 7 +++---- .../forge/card/ability/ai/ChoosePlayerAi.java | 18 ++++++++++++++++++ 8 files changed, 42 insertions(+), 19 deletions(-) diff --git a/res/cardsfolder/a/ashlings_prerogative.txt b/res/cardsfolder/a/ashlings_prerogative.txt index ec0665279a4..ffa80ed189f 100644 --- a/res/cardsfolder/a/ashlings_prerogative.txt +++ b/res/cardsfolder/a/ashlings_prerogative.txt @@ -1,8 +1,8 @@ Name:Ashling's Prerogative ManaCost:1 R Types:Enchantment -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseMode | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose odd or even. (Zero is even.) -SVar:ChooseMode:AB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ 1 | ListTitle$ Choose ODD or EVEN (0=Even; 1=Odd) | SpellDescription$ Choose odd or even (Zero is even.) +K:ETBReplacement:Other:ChooseMode +SVar:ChooseMode:DB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ 1 | ListTitle$ Choose ODD or EVEN (0=Even; 1=Odd) | SpellDescription$ As CARDNAME enters the battlefield, choose odd or even. (Zero is even.) S:Mode$ Continuous | Affected$ Creature.cmcM2X | AddKeyword$ Haste | Description$ Each creature with converted mana cost of the chosen value has haste. S:Mode$ ETBTapped | ValidCard$ Creature.cmcM2Y | Description$ Each creature without converted mana cost of the chosen value enters the battlefield tapped. # The next 2 static abilities add text to the card panel for convenience indicating choice. diff --git a/res/cardsfolder/l/lich.txt b/res/cardsfolder/l/lich.txt index 89b362bbc54..79154e1f0fa 100644 --- a/res/cardsfolder/l/lich.txt +++ b/res/cardsfolder/l/lich.txt @@ -1,8 +1,9 @@ Name:Lich ManaCost:B B B B Types:Enchantment -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Static$ True | Execute$ TrigLoseLife | TriggerDescription$ As CARDNAME enters the battlefield, you lose life equal to your life total. -SVar:TrigLoseLife:DB$LoseLife | Cost$ 0 | LifeAmount$ LifeTotal +R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ MoveToPlay | Description$ As CARDNAME enters the battlefield, you lose life equal to your life total. +SVar:MoveToPlay:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ All | Destination$ Battlefield | SubAbility$ TrigLoseLife +SVar:TrigLoseLife:DB$ LoseLife | Cost$ 0 | LifeAmount$ LifeTotal | References$ LifeTotal SVar:LifeTotal:Count$YourLifeTotal S:Mode$ Continuous | Affected$ You | AddKeyword$ You don't lose the game for having 0 or less life. | Description$ You don't lose the game for having 0 or less life. R:Event$ GainLife | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ Draw | Description$ If you would gain life, draw that many cards instead. diff --git a/res/cardsfolder/m/minion_of_the_wastes.txt b/res/cardsfolder/m/minion_of_the_wastes.txt index 1e3d2c72b33..a12645cd68c 100644 --- a/res/cardsfolder/m/minion_of_the_wastes.txt +++ b/res/cardsfolder/m/minion_of_the_wastes.txt @@ -3,8 +3,9 @@ ManaCost:3 B B B Types:Creature Minion PT:*/* K:Trample -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ PayLife | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, pay any amount of life. -SVar:PayLife:AB$ StoreSVar | Cost$ PayLife | References$ X | SVar$ LifePaidOnETB | Type$ CountSVar | Expression$ ChosenX +R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ PayLife | Description$ As CARDNAME enters the battlefield, pay any amount of life. +SVar:PayLife:AB$ StoreSVar | Cost$ PayLife | References$ X | SVar$ LifePaidOnETB | Type$ CountSVar | Expression$ ChosenX | SubAbility$ MoveToPlay +SVar:MoveToPlay:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ All | Destination$ Battlefield S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ LifePaidOnETB | SetToughness$ LifePaidOnETB | References$ LifePaidOnETB | Description$ CARDNAME's power and toughness are each equal to the life paid as it entered the battlefield. SVar:X:XChoice SVar:LifePaidOnETB:Number$0 diff --git a/res/cardsfolder/n/nameless_race.txt b/res/cardsfolder/n/nameless_race.txt index 38903fb9bde..b0197e98860 100644 --- a/res/cardsfolder/n/nameless_race.txt +++ b/res/cardsfolder/n/nameless_race.txt @@ -3,8 +3,9 @@ ManaCost:3 B Types:Creature PT:*/* K:Trample -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ PayLife | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, pay any amount of life. The amount you pay can't be more than the total number of white nontoken permanents your opponents control plus the total number of white cards in their graveyards. -SVar:PayLife:AB$ StoreSVar | Cost$ PayLife | References$ X,Limit,Active,Buried | SVar$ LifePaidOnETB | Type$ CountSVar | Expression$ ChosenX +R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ PayLife | Description$ As CARDNAME enters the battlefield, pay any amount of life. The amount you pay can't be more than the total number of white nontoken permanents your opponents control plus the total number of white cards in their graveyards. +SVar:PayLife:AB$ StoreSVar | Cost$ PayLife | References$ X,Limit,Active,Buried | SVar$ LifePaidOnETB | Type$ CountSVar | Expression$ ChosenX | SubAbility$ MoveToPlay +SVar:MoveToPlay:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ All | Destination$ Battlefield S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ LifePaidOnETB | SetToughness$ LifePaidOnETB | References$ LifePaidOnETB | Description$ CARDNAME's power and toughness are each equal to the life paid as it entered the battlefield. SVar:X:XChoice/LimitMax.Limit SVar:Limit:SVar$Active/Plus.Buried diff --git a/res/cardsfolder/p/phyrexian_processor.txt b/res/cardsfolder/p/phyrexian_processor.txt index 7231b64f7a5..5730229772e 100644 --- a/res/cardsfolder/p/phyrexian_processor.txt +++ b/res/cardsfolder/p/phyrexian_processor.txt @@ -1,8 +1,9 @@ Name:Phyrexian Processor ManaCost:4 Types:Artifact -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ PayLife | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, pay any amount of life. -SVar:PayLife:AB$ StoreSVar | Cost$ PayLife | References$ X | SVar$ LifePaidOnETB | Type$ CountSVar | Expression$ ChosenX +R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ PayLife | Description$ As CARDNAME enters the battlefield, pay any amount of life. +SVar:PayLife:AB$ StoreSVar | Cost$ PayLife | References$ X | SVar$ LifePaidOnETB | Type$ CountSVar | Expression$ ChosenX | SubAbility$ MoveToPlay +SVar:MoveToPlay:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ All | Destination$ Battlefield A:AB$ Token | Cost$ 4 T | TokenAmount$ 1 | TokenName$ Minion | TokenTypes$ Creature,Minion | TokenOwner$ You | TokenColors$ Black | TokenPower$ LifePaidOnETB | TokenToughness$ LifePaidOnETB | TokenImage$ B X X Minion | SpellDescription$ Put an X/X black Minion creature token onto the battlefield, where X is the life paid as Phyrexian Processor entered the battlefield. SVar:X:XChoice SVar:LifePaidOnETB:Number$0 diff --git a/res/cardsfolder/p/primal_plasma.txt b/res/cardsfolder/p/primal_plasma.txt index 6facd307a17..37d1a237043 100644 --- a/res/cardsfolder/p/primal_plasma.txt +++ b/res/cardsfolder/p/primal_plasma.txt @@ -2,10 +2,12 @@ Name:Primal Plasma ManaCost:3 U Types:Creature Elemental Shapeshifter PT:*/* -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ PlasmaChoice | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, it becomes your choice of a 3/3 creature, a 2/2 creature with flying, or a 1/6 creature with defender. -SVar:PlasmaChoice:AB$ Charm | Cost$ 0 | Defined$ You | Choices$ GroundPlasma,AirPlasma,WallPlasma | CharmNum$ 1 -SVar:GroundPlasma:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 3 | Toughness$ 3 | SpellDescription$ CARDNAME is 3/3 -SVar:AirPlasma:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 2 | Toughness$ 2 | Keywords$ Flying | SpellDescription$ CARDNAME is 2/2 with flying -SVar:WallPlasma:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 1 | Toughness$ 6 | Keywords$ Defender | SpellDescription$ CARDNAME is 1/6 with defender +R:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ PlasmaChoice | Description$ As CARDNAME enters the battlefield, it becomes your choice of a 3/3 creature, a 2/2 creature with flying, or a 1/6 creature with defender. +SVar:PlasmaChoice:AB$ GenericChoice | Cost$ 0 | Defined$ You | Choices$ GroundPlasma,AirPlasma,WallPlasma +SVar:GroundPlasma:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 3 | Toughness$ 3 | ChoiceDescription$ CARDNAME is 3/3 | SubAbility$ DBMove +SVar:AirPlasma:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 2 | Toughness$ 2 | Keywords$ Flying | ChoiceDescription$ CARDNAME is 2/2 with flying | SubAbility$ DBMove +SVar:WallPlasma:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 1 | Toughness$ 6 | Keywords$ Defender | ChoiceDescription$ CARDNAME is 1/6 with defender | SubAbility$ DBMove +SVar:DBMove:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ All | Destination$ Battlefield +SVar:RemAIDeck:True SVar:Picture:http://resources.wizards.com/magic/cards/plc/en-us/card124757.jpg Oracle:As Primal Plasma enters the battlefield, it becomes your choice of a 3/3 creature, a 2/2 creature with flying, or a 1/6 creature with defender. \ No newline at end of file diff --git a/res/cardsfolder/w/waiting_in_the_weeds.txt b/res/cardsfolder/w/waiting_in_the_weeds.txt index 0fbe450e7da..4554a226180 100644 --- a/res/cardsfolder/w/waiting_in_the_weeds.txt +++ b/res/cardsfolder/w/waiting_in_the_weeds.txt @@ -1,10 +1,9 @@ Name:Waiting in the Weeds ManaCost:1 G G Types:Sorcery -A:SP$ Token | Cost$ 1 G G | TokenAmount$ ForestYou | References$ ForestYou | TokenName$ Cat | TokenTypes$ Creature,Cat | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 | SubAbility$ DBToken | SpellDescription$ Each player puts a 1/1 green Cat creature token onto the battlefield for each untapped Forest he or she controls. -SVar:DBToken:DB$Token | TokenAmount$ ForestOpp | References$ ForestOpp | TokenName$ Cat | TokenTypes$ Creature,Cat | TokenOwner$ Opponent | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 -SVar:ForestYou:Count$Valid Forest.untapped+YouCtrl -SVar:ForestOpp:Count$Valid Forest.untapped+YouDontCtrl +A:SP$ RepeatEach | Cost$ 1 G G | RepeatSubAbility$ DBToken | RepeatPlayers$ Player | SpellDescription$ Each player puts a 1/1 green Cat creature token onto the battlefield for each untapped Forest he or she controls. +SVar:DBToken:DB$ Token | TokenAmount$ CountForest | References$ CountForest | TokenName$ Cat | TokenTypes$ Creature,Cat | TokenOwner$ Player.IsRemembered | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 +SVar:CountForest:Count$Valid Forest.untapped+RememberedPlayerCtrl SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/waiting_in_the_weeds.jpg Oracle:Each player puts a 1/1 green Cat creature token onto the battlefield for each untapped Forest he or she controls. \ No newline at end of file diff --git a/src/main/java/forge/card/ability/ai/ChoosePlayerAi.java b/src/main/java/forge/card/ability/ai/ChoosePlayerAi.java index 22ab3e0c072..78c78dacb47 100644 --- a/src/main/java/forge/card/ability/ai/ChoosePlayerAi.java +++ b/src/main/java/forge/card/ability/ai/ChoosePlayerAi.java @@ -66,6 +66,24 @@ public class ChoosePlayerAi extends SpellAbilityAi { cardsInHand = hand; } } + } else if ("MostCardsInHand".equals(sa.getParam("AILogic"))) { + int cardsInHand = 0; + for (final Player p : choices) { + int hand = p.getCardsIn(ZoneType.Hand).size(); + if (hand >= cardsInHand) { + chosen = p; + cardsInHand = hand; + } + } + } else if ("LeastCreatures".equals(sa.getParam("AILogic"))) { + int creats = 50; + for (final Player p : choices) { + int curr = p.getCreaturesInPlay().size(); + if (curr <= creats) { + chosen = p; + creats = curr; + } + } } else { System.out.println("Default player choice logic."); chosen = choices.contains(ai) ? ai : choices.get(0);