- Rewrote the card controller system.

- Converted Control Magic auras to continuous static abilities.
This commit is contained in:
Sloth
2013-03-16 23:28:18 +00:00
parent 8dc331ed14
commit f22b7aee0f
46 changed files with 146 additions and 273 deletions

View File

@@ -1,11 +1,11 @@
Name:Abduction Name:Abduction
ManaCost:2 U U ManaCost:2 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, untap enchanted creature. T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, untap enchanted creature.
SVar:TrigUntap:AB$Untap | Cost$ 0 | Defined$ Enchanted SVar:TrigUntap:AB$ Untap | Cost$ 0 | Defined$ Enchanted
T:Mode$ ChangesZone | ValidCard$ Card.AttachedBy | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigReturnOwner | TriggerDescription$ When enchanted creature dies, return that card to the battlefield under its owner's control. T:Mode$ ChangesZone | ValidCard$ Card.AttachedBy | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigReturnOwner | TriggerDescription$ When enchanted creature dies, return that card to the battlefield under its owner's control.
SVar:TrigReturnOwner:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Battlefield SVar:TrigReturnOwner:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Battlefield
SVar:PlayMain1:TRUE SVar:PlayMain1:TRUE

View File

@@ -1,9 +1,9 @@
Name:Annex Name:Annex
ManaCost:2 U U ManaCost:2 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted land.
K:Enchant land K:Enchant land
A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Land | AILogic$ GainControl A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Land | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Land.EnchantedBy | GainControl$ You | Description$ You control enchanted land.
SVar:Picture:http://www.wizards.com/global/images/magic/general/annex.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/annex.jpg
Oracle:Enchant land (Target a land as you cast this. This card enters the battlefield attached to that land.)\nYou control enchanted land. Oracle:Enchant land (Target a land as you cast this. This card enters the battlefield attached to that land.)\nYou control enchanted land.
SetInfo:ONS Uncommon SetInfo:ONS Uncommon

View File

@@ -1,12 +1,11 @@
Name:Biting Tether Name:Biting Tether
ManaCost:4 U ManaCost:4 U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 4 U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 4 U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, put a -1/-1 counter on enchanted creature. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, put a -1/-1 counter on enchanted creature.
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | Defined$ Enchanted | CounterType$ M1M1 | CounterNum$ 1 SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | Defined$ Enchanted | CounterType$ M1M1 | CounterNum$ 1
SVar:PlayMain1:TRUE
SVar:Picture:http://www.wizards.com/global/images/magic/general/biting_tether.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/biting_tether.jpg
Oracle:Enchant creature\nYou control enchanted creature.\nAt the beginning of your upkeep, put a -1/-1 counter on enchanted creature. Oracle:Enchant creature\nYou control enchanted creature.\nAt the beginning of your upkeep, put a -1/-1 counter on enchanted creature.
SetInfo:SHM Uncommon SetInfo:SHM Uncommon

View File

@@ -1,10 +1,9 @@
Name:Confiscate Name:Confiscate
ManaCost:4 U U ManaCost:4 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted permanent.
K:Enchant permanent K:Enchant permanent
A:SP$ Attach | Cost$ 4 U U | ValidTgts$ Permanent | AILogic$ GainControl A:SP$ Attach | Cost$ 4 U U | ValidTgts$ Permanent | AILogic$ GainControl
SVar:PlayMain1:TRUE S:Mode$ Continuous | Affected$ Permanent.EnchantedBy | GainControl$ You | Description$ You control enchanted permanent.
SVar:Picture:http://www.wizards.com/global/images/magic/general/confiscate.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/confiscate.jpg
Oracle:Enchant permanent (Target a permanent as you cast this. This card enters the battlefield attached to that permanent.)\nYou control enchanted permanent. Oracle:Enchant permanent (Target a permanent as you cast this. This card enters the battlefield attached to that permanent.)\nYou control enchanted permanent.
SetInfo:8ED Uncommon SetInfo:8ED Uncommon

View File

@@ -1,9 +1,9 @@
Name:Conquer Name:Conquer
ManaCost:3 R R ManaCost:3 R R
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted land.
K:Enchant land K:Enchant land
A:SP$ Attach | Cost$ 3 R R | ValidTgts$ Land | AILogic$ GainControl A:SP$ Attach | Cost$ 3 R R | ValidTgts$ Land | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Land.EnchantedBy | GainControl$ You | Description$ You control enchanted land.
SVar:Picture:http://www.wizards.com/global/images/magic/general/conquer.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/conquer.jpg
Oracle:Enchant land\nYou control enchanted land. Oracle:Enchant land\nYou control enchanted land.
SetInfo:ICE Uncommon SetInfo:ICE Uncommon

View File

@@ -1,9 +1,9 @@
Name:Control Magic Name:Control Magic
ManaCost:2 U U ManaCost:2 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
SVar:Picture:http://www.wizards.com/global/images/magic/general/control_magic.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/control_magic.jpg
Oracle:Enchant creature\nYou control enchanted creature. Oracle:Enchant creature\nYou control enchanted creature.
SetInfo:2ED Uncommon SetInfo:2ED Uncommon

View File

@@ -1,9 +1,9 @@
Name:Corrupted Conscience Name:Corrupted Conscience
ManaCost:3 U U ManaCost:3 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Infect | Description$ Enchanted creature has infect. (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Infect | Description$ Enchanted creature has infect. (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)
SVar:Picture:http://www.wizards.com/global/images/magic/general/corrupted_conscience.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/corrupted_conscience.jpg
Oracle:Enchant creature\nYou control enchanted creature.\nEnchanted creature has infect. (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) Oracle:Enchant creature\nYou control enchanted creature.\nEnchanted creature has infect. (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)

View File

@@ -1,12 +1,11 @@
Name:Domestication Name:Domestication
ManaCost:2 U U ManaCost:2 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | IsPresent$ Card.AttachedBy+powerGE4 | Execute$ TrigSac | TriggerDescription$ At the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice CARDNAME. T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | IsPresent$ Card.AttachedBy+powerGE4 | Execute$ TrigSac | TriggerDescription$ At the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice CARDNAME.
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self
SVar:PlayMain1:TRUE
SVar:Picture:http://www.wizards.com/global/images/magic/general/domestication.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/domestication.jpg
Oracle:Enchant creature\nYou control enchanted creature.\nAt the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice Domestication. Oracle:Enchant creature\nYou control enchanted creature.\nAt the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice Domestication.
SetInfo:ROE Uncommon SetInfo:ROE Uncommon

View File

@@ -16,9 +16,9 @@ Name:Dominating Licid
ManaCost:1 U U ManaCost:1 U U
Colors:blue Colors:blue
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
A:AB$ SetState | Cost$ U | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. A:AB$ SetState | Cost$ U | Defined$ Self | NewState$ Original | SpellDescription$ End this effect.
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/dominating_licid.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/dominating_licid.jpg

View File

@@ -3,7 +3,7 @@ ManaCost:1 U U
Types:Enchantment Aura Types:Enchantment Aura
K:Enchant artifact creature K:Enchant artifact creature
A:SP$ Attach | Cost$ 1 U U | ValidTgts$ Creature.Artifact | AILogic$ GainControl | SpellDescription$ You control enchanted artifact creature. A:SP$ Attach | Cost$ 1 U U | ValidTgts$ Creature.Artifact | AILogic$ GainControl | SpellDescription$ You control enchanted artifact creature.
SVar:PlayMain1:TRUE S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You
SVar:Picture:http://www.wizards.com/global/images/magic/general/domineer.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/domineer.jpg
Oracle:Enchant artifact creature\nYou control enchanted artifact creature. Oracle:Enchant artifact creature\nYou control enchanted artifact creature.
SetInfo:MRD Uncommon SetInfo:MRD Uncommon

View File

@@ -1,9 +1,9 @@
Name:Enslave Name:Enslave
ManaCost:4 B B ManaCost:4 B B
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 4 B B | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 4 B B | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ At the beginning of your upkeep, enchanted creature deals 1 damage to its owner. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ At the beginning of your upkeep, enchanted creature deals 1 damage to its owner.
SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ EnchantedOwner | DamageSource$ Enchanted | NumDmg$ 1 SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ EnchantedOwner | DamageSource$ Enchanted | NumDmg$ 1
SVar:PlayMain1:TRUE SVar:PlayMain1:TRUE

View File

@@ -1,10 +1,10 @@
Name:Krovikan Whispers Name:Krovikan Whispers
ManaCost:3 U ManaCost:3 U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
K:Cumulative upkeep:UB K:Cumulative upkeep:UB
A:SP$ Attach | Cost$ 3 U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 3 U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigLoseLife | ValidCard$ Card.Self | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield, you lose 2 life for each age counter on it. T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigLoseLife | ValidCard$ Card.Self | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield, you lose 2 life for each age counter on it.
SVar:TrigLoseLife:AB$ LoseLife | Cost$ 0 | LifeAmount$ X | References$ X SVar:TrigLoseLife:AB$ LoseLife | Cost$ 0 | LifeAmount$ X | References$ X
SVar:X:TriggeredCard$CardCounters.AGE/Times.2 SVar:X:TriggeredCard$CardCounters.AGE/Times.2

View File

@@ -1,9 +1,9 @@
Name:Mark of the Oni Name:Mark of the Oni
ManaCost:2 B ManaCost:2 B
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | IsPresent$ Demon.YouCtrl | PresentCompare$ EQ0 | Execute$ TrigSac | TriggerDescription$ At the beginning of the end step, if you control no Demons, sacrifice CARDNAME. T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | IsPresent$ Demon.YouCtrl | PresentCompare$ EQ0 | Execute$ TrigSac | TriggerDescription$ At the beginning of the end step, if you control no Demons, sacrifice CARDNAME.
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self
SVar:PlayMain1:TRUE SVar:PlayMain1:TRUE

View File

@@ -1,10 +1,9 @@
Name:Mind Control Name:Mind Control
ManaCost:3 U U ManaCost:3 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl
SVar:PlayMain1:TRUE S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
SVar:Picture:http://www.wizards.com/global/images/magic/general/mind_control.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mind_control.jpg
Oracle:Enchant creature\nYou control enchanted creature. Oracle:Enchant creature\nYou control enchanted creature.
SetInfo:M11 Uncommon SetInfo:M11 Uncommon

View File

@@ -1,11 +1,10 @@
Name:Mind Harness Name:Mind Harness
ManaCost:U ManaCost:U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant red or green creature K:Enchant red or green creature
K:Cumulative upkeep:1 K:Cumulative upkeep:1
A:SP$ Attach | Cost$ U | ValidTgts$ Creature.Red,Creature.Green | TgtPrompt$ Select target Red or Green Creature | AILogic$ GainControl A:SP$ Attach | Cost$ U | ValidTgts$ Creature.Red,Creature.Green | TgtPrompt$ Select target Red or Green Creature | AILogic$ GainControl
SVar:PlayMain1:TRUE S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/mind_harness.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mind_harness.jpg
Oracle:Enchant red or green creature\nCumulative upkeep {1} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)\nYou control enchanted creature. Oracle:Enchant red or green creature\nCumulative upkeep {1} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)\nYou control enchanted creature.

View File

@@ -1,10 +1,9 @@
Name:Persuasion Name:Persuasion
ManaCost:3 U U ManaCost:3 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl
SVar:PlayMain1:TRUE S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
SVar:Picture:http://www.wizards.com/global/images/magic/general/persuasion.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/persuasion.jpg
Oracle:Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)\nYou control enchanted creature. Oracle:Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)\nYou control enchanted creature.
SetInfo:ODY Rare SetInfo:ODY Rare

View File

@@ -1,9 +1,9 @@
Name:Soul Ransom Name:Soul Ransom
ManaCost:2 U B ManaCost:2 U B
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 2 U B | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 2 U B | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
A:AB$ Sacrifice | Cost$ Discard<2/Card> | AnyOpponent$ True | SacValid$ Self | SubAbility$ DBDraw | SpellDescription$ CARDNAME's controller sacrifices it, then draws two cards. Only any opponent may activate this ability. A:AB$ Sacrifice | Cost$ Discard<2/Card> | AnyOpponent$ True | SacValid$ Self | SubAbility$ DBDraw | SpellDescription$ CARDNAME's controller sacrifices it, then draws two cards. Only any opponent may activate this ability.
SVar:DBDraw:DB$ Draw | NumCards$ 2 | Defined$ SourceController SVar:DBDraw:DB$ Draw | NumCards$ 2 | Defined$ SourceController
SVar:Picture:http://www.wizards.com/global/images/magic/general/soul_ransom.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/soul_ransom.jpg

View File

@@ -16,9 +16,9 @@ Name:Ghastly Haunting
ManaCost:no cost ManaCost:no cost
Colors:blue Colors:blue
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/ghastly_haunting.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/ghastly_haunting.jpg
Oracle:Enchant creature\nYou control enchanted creature. Oracle:Enchant creature\nYou control enchanted creature.

View File

@@ -1,9 +1,9 @@
Name:Spirit Away Name:Spirit Away
ManaCost:5 U U ManaCost:5 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 5 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 5 U U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 2 | AddToughness$ 2 | AddKeyword$ Flying | Description$ Enchanted creature gets +2/+2 and has flying. S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 2 | AddToughness$ 2 | AddKeyword$ Flying | Description$ Enchanted creature gets +2/+2 and has flying.
SVar:Picture:http://www.wizards.com/global/images/magic/general/spirit_away.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/spirit_away.jpg
Oracle:Enchant creature\nYou control enchanted creature.\nEnchanted creature gets +2/+2 and has flying. Oracle:Enchant creature\nYou control enchanted creature.\nEnchanted creature gets +2/+2 and has flying.

View File

@@ -1,9 +1,9 @@
Name:Steal Artifact Name:Steal Artifact
ManaCost:2 U U ManaCost:2 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted artifact.
K:Enchant artifact K:Enchant artifact
A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Artifact | AILogic$ GainControl A:SP$ Attach | Cost$ 2 U U | ValidTgts$ Artifact | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Artifact.EnchantedBy | GainControl$ You | Description$ You control enchanted artifact.
SVar:Picture:http://www.wizards.com/global/images/magic/general/steal_artifact.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/steal_artifact.jpg
Oracle:Enchant artifact\nYou control enchanted artifact. Oracle:Enchant artifact\nYou control enchanted artifact.
SetInfo:8ED Uncommon SetInfo:8ED Uncommon

View File

@@ -1,9 +1,9 @@
Name:Steal Enchantment Name:Steal Enchantment
ManaCost:U U ManaCost:U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted enchantment.
K:Enchant enchantment K:Enchant enchantment
A:SP$ Attach | Cost$ U U | ValidTgts$ Enchantment | AILogic$ GainControl A:SP$ Attach | Cost$ U U | ValidTgts$ Enchantment | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Enchantment.EnchantedBy | GainControl$ You | Description$ You control enchanted enchantment.
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/steal_enchantment.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/steal_enchantment.jpg
Oracle:Enchant enchantment\nYou control enchanted enchantment. Oracle:Enchant enchantment\nYou control enchanted enchantment.

View File

@@ -1,9 +1,9 @@
Name:Take Possession Name:Take Possession
ManaCost:5 U U ManaCost:5 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted permanent.
K:Split second K:Split second
K:Enchant permanent K:Enchant permanent
S:Mode$ Continuous | Affected$ Permanent.EnchantedBy | GainControl$ You | Description$ You control enchanted permanent.
A:SP$ Attach | Cost$ 5 U U | ValidTgts$ Permanent | AILogic$ GainControl A:SP$ Attach | Cost$ 5 U U | ValidTgts$ Permanent | AILogic$ GainControl
SVar:PlayMain1:TRUE SVar:PlayMain1:TRUE
SVar:Picture:http://resources.wizards.com/magic/cards/fut/en-us/card136199.jpg SVar:Picture:http://resources.wizards.com/magic/cards/fut/en-us/card136199.jpg

View File

@@ -1,9 +1,9 @@
Name:Treachery Name:Treachery
ManaCost:3 U U ManaCost:3 U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 3 U U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, untap up to five lands. T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, untap up to five lands.
SVar:TrigUntap:AB$ Untap | Cost$ 0 | UntapUpTo$ True | UntapType$ Land | Amount$ 5 SVar:TrigUntap:AB$ Untap | Cost$ 0 | UntapUpTo$ True | UntapType$ Land | Amount$ 5
SVar:PlayMain1:TRUE SVar:PlayMain1:TRUE

View File

@@ -1,9 +1,9 @@
Name:Vapor Snare Name:Vapor Snare
ManaCost:4 U ManaCost:4 U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 4 U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 4 U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigChangeZone | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless you return a land you control to its owner's hand. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigChangeZone | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless you return a land you control to its owner's hand.
SVar:TrigChangeZone:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | Hidden$ True | ChangeType$ Land.YouCtrl | RememberChanged$ True | SubAbility$ DBSac SVar:TrigChangeZone:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | Hidden$ True | ChangeType$ Land.YouCtrl | RememberChanged$ True | SubAbility$ DBSac
SVar:DBSac:DB$ Sacrifice | Cost$ 0 | Defined$ Self | SubAbility$ DBCleanup | ConditionCheckSVar$ X | ConditionSVarCompare$ LT1 SVar:DBSac:DB$ Sacrifice | Cost$ 0 | Defined$ Self | SubAbility$ DBCleanup | ConditionCheckSVar$ X | ConditionSVarCompare$ LT1

View File

@@ -1,11 +1,11 @@
Name:Volition Reins Name:Volition Reins
ManaCost:3 U U U ManaCost:3 U U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted permanent.
K:Enchant permanent K:Enchant permanent
A:SP$ Attach | Cost$ 3 U U U | ValidTgts$ Permanent | AILogic$ GainControl A:SP$ Attach | Cost$ 3 U U U | ValidTgts$ Permanent | AILogic$ GainControl
T:Mode$ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, if enchanted permanent is tapped, untap it. S:Mode$ Continuous | Affected$ Permanent.EnchantedBy | GainControl$ You | Description$ You control enchanted permanent.
SVar:TrigUntap:AB$Untap | Cost$ 0 | Defined$ Enchanted T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigUntap | TriggerDescription$ When CARDNAME enters the battlefield, if enchanted permanent is tapped, untap it.
SVar:TrigUntap:AB$ Untap | Cost$ 0 | Defined$ Enchanted
SVar:PlayMain1:TRUE SVar:PlayMain1:TRUE
SVar:Picture:http://www.wizards.com/global/images/magic/general/volition_reins.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/volition_reins.jpg
Oracle:Enchant permanent\nWhen Volition Reins enters the battlefield, if enchanted permanent is tapped, untap it.\nYou control enchanted permanent. Oracle:Enchant permanent\nWhen Volition Reins enters the battlefield, if enchanted permanent is tapped, untap it.\nYou control enchanted permanent.

View File

@@ -1,11 +1,10 @@
Name:Yavimaya's Embrace Name:Yavimaya's Embrace
ManaCost:5 G U U ManaCost:5 G U U
Types:Enchantment Aura Types:Enchantment Aura
Text:You control enchanted creature.
K:Enchant creature K:Enchant creature
A:SP$ Attach | Cost$ 5 G U U | ValidTgts$ Creature | AILogic$ GainControl A:SP$ Attach | Cost$ 5 G U U | ValidTgts$ Creature | AILogic$ GainControl
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 2 | AddToughness$ 2 | AddKeyword$ Trample | Description$ Enchanted creature gets +2/+2 and has trample. S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 2 | AddToughness$ 2 | AddKeyword$ Trample | Description$ Enchanted creature gets +2/+2 and has trample.
SVar:PlayMain1:TRUE S:Mode$ Continuous | Affected$ Creature.EnchantedBy | GainControl$ You | Description$ You control enchanted creature.
SVar:Picture:http://www.wizards.com/global/images/magic/general/yavimayas_embrace.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/yavimayas_embrace.jpg
Oracle:Enchant creature\nYou control enchanted creature.\nEnchanted creature gets +2/+2 and has trample. Oracle:Enchant creature\nYou control enchanted creature.\nEnchanted creature gets +2/+2 and has trample.
SetInfo:APC Rare SetInfo:APC Rare

View File

@@ -199,7 +199,9 @@ public class Card extends GameEntity implements Comparable<Card> {
private String colorsPaid = ""; private String colorsPaid = "";
private Player owner = null; private Player owner = null;
private ArrayList<Object> controllerObjects = new ArrayList<Object>(); private Player controller = null;
private long controllerTimestamp = 0;
private TreeMap<Long, Player> tempControllers = new TreeMap<Long, Player>();
// private String rarity = ""; // private String rarity = "";
private String text = ""; private String text = "";
@@ -3523,6 +3525,13 @@ public class Card extends GameEntity implements Comparable<Card> {
this.changeControllerCommandList.add(c); this.changeControllerCommandList.add(c);
} }
public final void runChangeControllerCommands() {
for (final Command c : this.changeControllerCommandList) {
c.execute();
}
}
/** /**
* <p> * <p>
* Setter for the field <code>sickness</code>. * Setter for the field <code>sickness</code>.
@@ -3578,98 +3587,41 @@ public class Card extends GameEntity implements Comparable<Card> {
* @return a {@link forge.game.player.Player} object. * @return a {@link forge.game.player.Player} object.
*/ */
public final Player getController() { public final Player getController() {
if (this.controllerObjects.size() == 0) {
if (!this.tempControllers.isEmpty()) {
final long lastTimestamp = this.tempControllers.lastKey();
if (lastTimestamp > this.controllerTimestamp) {
return this.tempControllers.lastEntry().getValue();
}
}
if (this.controller != null) {
return this.controller;
}
return this.owner; return this.owner;
} }
final Object topController = this.controllerObjects.get(this.controllerObjects.size() - 1);
if (topController instanceof Player) { public final void addTempController(final Player player, final long tstamp) {
return (Player) topController; this.tempControllers.put(tstamp, player);
}
return ((Card) topController).getController();
} }
/** public final void removeTempController(final long tstamp) {
* this.tempControllers.remove(tstamp);
* TODO Write javadoc for this method.
*
* @param controllerObject
* an Object
*/
public final void addController(final Object controllerObject) {
final Object prevController = this.controllerObjects.size() == 0 ? this.owner : this.controllerObjects
.get(this.controllerObjects.size() - 1);
if (!controllerObject.equals(prevController)) {
if (controllerObject instanceof Player) {
for (int i = 0; i < this.controllerObjects.size(); i++) {
if (this.controllerObjects.get(i) instanceof Player) {
this.controllerObjects.remove(i);
}
}
}
this.controllerObjects.add(controllerObject);
if ((Singletons.getModel().getGame().getAction() != null) && (prevController != null)) {
Singletons.getModel().getGame().getAction().controllerChangeZoneCorrection(this);
} }
if (prevController != null) { public final void clearTempControllers() {
for (final Command c : this.changeControllerCommandList) { this.tempControllers.clear();
c.execute();
}
} }
this.updateObservers();
}
}
/**
*
* TODO Write javadoc for this method.
*
* @param controllerObject
* a Object
*/
public final void removeController(final Object controllerObject) {
final Object currentController = this.getController();
this.controllerObjects.remove(controllerObject);
if (!currentController.equals(this.getController())) {
Singletons.getModel().getGame().getAction().controllerChangeZoneCorrection(this);
for (final Command c : this.changeControllerCommandList) {
c.execute();
}
this.updateObservers();
}
}
/**
*
* TODO Write javadoc for this method.
*/
public final void clearControllers() { public final void clearControllers() {
this.controllerObjects.clear(); clearTempControllers();
this.controller = null;
} }
/** public final void setController(final Player player, final long tstamp) {
* clearTempControllers();
* TODO Write javadoc for this method. this.controller = player;
* this.controllerTimestamp = tstamp;
* @return an ArrayList<Object>
*/
public final ArrayList<Object> getControllerObjects() {
return this.controllerObjects;
}
/**
*
* TODO Write javadoc for this method.
*
* @param in
* an Object
*/
public final void setControllerObjects(final ArrayList<Object> in) {
this.controllerObjects = in;
} }
/** /**
@@ -3682,23 +3634,8 @@ public class Card extends GameEntity implements Comparable<Card> {
*/ */
public final void setOwner(final Player player) { public final void setOwner(final Player player) {
this.owner = player; this.owner = player;
//this.updateObservers();
} }
/**
* <p>
* Setter for the field <code>controller</code>.
* </p>
*
* @return the equipped by
*/
/*
* public void setController(Player player) { boolean sameController =
* controller == null ? false : controller.isPlayer(player); controller =
* player; if (null != controller && !sameController) { for (Command var :
* changeControllerCommandList) var.execute(); } this.updateObservers(); }
*/
/** /**
* <p> * <p>
* Getter for the field <code>equippedBy</code>. * Getter for the field <code>equippedBy</code>.

View File

@@ -330,6 +330,7 @@ public final class CardUtil {
newCopy.setUniqueNumber(in.getUniqueNumber()); newCopy.setUniqueNumber(in.getUniqueNumber());
newCopy.setCurSetCode(in.getCurSetCode()); newCopy.setCurSetCode(in.getCurSetCode());
newCopy.setOwner(in.getOwner()); newCopy.setOwner(in.getOwner());
newCopy.setController(in.getController(), 0);
newCopy.setFlipCard(in.isFlipCard()); newCopy.setFlipCard(in.isFlipCard());
newCopy.setDoubleFaced(in.isDoubleFaced()); newCopy.setDoubleFaced(in.isDoubleFaced());
newCopy.getCharacteristics().copy(in.getState(in.getCurState())); newCopy.getCharacteristics().copy(in.getState(in.getCurState()));
@@ -342,7 +343,6 @@ public final class CardUtil {
sa.setSourceCard(in); sa.setSourceCard(in);
} }
newCopy.setControllerObjects(in.getControllerObjects());
newCopy.setCounters(in.getCounters()); newCopy.setCounters(in.getCounters());
newCopy.setExtrinsicKeyword(in.getExtrinsicKeyword()); newCopy.setExtrinsicKeyword(in.getExtrinsicKeyword());
newCopy.setColor(in.getColor()); newCopy.setColor(in.getColor());

View File

@@ -185,6 +185,11 @@ public class StaticEffects {
for (int i = 0; i < affectedCards.size(); i++) { for (int i = 0; i < affectedCards.size(); i++) {
final Card affectedCard = affectedCards.get(i); final Card affectedCard = affectedCards.get(i);
// Gain control
if (params.containsKey("GainControl")) {
affectedCard.removeTempController(se.getTimestamp());
}
// remove set P/T // remove set P/T
if (!params.containsKey("CharacteristicDefining") && setPT) { if (!params.containsKey("CharacteristicDefining") && setPT) {
affectedCard.removeNewPT(se.getTimestamp()); affectedCard.removeNewPT(se.getTimestamp());

View File

@@ -1254,7 +1254,7 @@ public class ChangeZoneAi extends SpellAbilityAi {
c.setTapped(true); c.setTapped(true);
} }
if (sa.hasParam("GainControl")) { if (sa.hasParam("GainControl")) {
c.addController(sa.getSourceCard()); c.setController(sa.getActivatingPlayer(), Singletons.getModel().getGame().getNextTimestamp());
} }
if (sa.hasParam("AttachedTo")) { if (sa.hasParam("AttachedTo")) {

View File

@@ -29,7 +29,7 @@ public class AttachEffect extends SpellAbilityEffect {
// The Spell_Permanent (Auras) version of this AF needs to // The Spell_Permanent (Auras) version of this AF needs to
// move the card into play before Attaching // move the card into play before Attaching
sa.getSourceCard().addController(sa.getActivatingPlayer()); sa.getSourceCard().setController(sa.getActivatingPlayer(), 0);
final Card c = Singletons.getModel().getGame().getAction().moveTo(sa.getActivatingPlayer().getZone(ZoneType.Battlefield), sa.getSourceCard()); final Card c = Singletons.getModel().getGame().getAction().moveTo(sa.getActivatingPlayer().getZone(ZoneType.Battlefield), sa.getSourceCard());
sa.setSourceCard(c); sa.setSourceCard(c);
} }
@@ -92,8 +92,7 @@ public class AttachEffect extends SpellAbilityEffect {
// Spellweaver Volute, Dance of the Dead, Animate Dead // Spellweaver Volute, Dance of the Dead, Animate Dead
// Although honestly, I'm not sure if the three of those could // Although honestly, I'm not sure if the three of those could
// handle being scripted // handle being scripted
final boolean gainControl = "GainControl".equals(sa.getParam("AILogic")); handleAura(card, c);
handleAura(card, c, gainControl);
} else if (card.isEquipment()) { } else if (card.isEquipment()) {
card.equipCard(c); card.equipCard(c);
// else if (card.isFortification()) // else if (card.isFortification())
@@ -105,7 +104,7 @@ public class AttachEffect extends SpellAbilityEffect {
// Curse cards // Curse cards
final Player p = (Player) o; final Player p = (Player) o;
if (card.isAura()) { if (card.isAura()) {
handleAura(card, p, false); handleAura(card, p);
} }
} }
} }
@@ -120,7 +119,7 @@ public class AttachEffect extends SpellAbilityEffect {
* @param gainControl * @param gainControl
* the gain control * the gain control
*/ */
public static void handleAura(final Card card, final GameEntity tgt, final boolean gainControl) { public static void handleAura(final Card card, final GameEntity tgt) {
if (card.isEnchanting()) { if (card.isEnchanting()) {
// If this Card is already Enchanting something // If this Card is already Enchanting something
// Need to unenchant it, then clear out the commands // Need to unenchant it, then clear out the commands
@@ -132,72 +131,6 @@ public class AttachEffect extends SpellAbilityEffect {
card.clearTriggers(); // not sure if cleartriggers is needed? card.clearTriggers(); // not sure if cleartriggers is needed?
} }
if (gainControl) {
// Handle GainControl Auras
final Player[] pl = new Player[1];
if (tgt instanceof Card) {
pl[0] = ((Card) tgt).getController();
} else {
pl[0] = (Player) tgt;
}
final Command onEnchant = new Command() {
private static final long serialVersionUID = -2519887209491512000L;
@Override
public void execute() {
final Card crd = card.getEnchantingCard();
if (crd == null) {
return;
}
pl[0] = crd.getController();
crd.addController(card);
} // execute()
}; // Command
final Command onUnEnchant = new Command() {
private static final long serialVersionUID = 3426441132121179288L;
@Override
public void execute() {
final Card crd = card.getEnchantingCard();
if (crd == null) {
return;
}
if (crd.isInPlay()) {
crd.removeController(card);
}
} // execute()
}; // Command
final Command onChangesControl = new Command() {
/** automatically generated serialVersionUID. */
private static final long serialVersionUID = -65903786170234039L;
@Override
public void execute() {
final Card crd = card.getEnchantingCard();
if (crd == null) {
return;
}
crd.removeController(card); // This looks odd, but will
// simply refresh controller
crd.addController(card);
} // execute()
}; // Command
// Add Enchant Commands for Control changers
card.addEnchantCommand(onEnchant);
card.addUnEnchantCommand(onUnEnchant);
card.addChangeControllerCommand(onChangesControl);
}
final Command onLeavesPlay = new Command() { final Command onLeavesPlay = new Command() {
private static final long serialVersionUID = -639204333673364477L; private static final long serialVersionUID = -639204333673364477L;
@@ -251,7 +184,6 @@ public class AttachEffect extends SpellAbilityEffect {
} }
aura.setActivatingPlayer(source.getController()); aura.setActivatingPlayer(source.getController());
final Target tgt = aura.getTarget(); final Target tgt = aura.getTarget();
final boolean gainControl = "GainControl".equals(aura.getParam("AILogic"));
if (source.getController().isHuman()) { if (source.getController().isHuman()) {
if (tgt.canTgtPlayer()) { if (tgt.canTgtPlayer()) {
@@ -265,8 +197,7 @@ public class AttachEffect extends SpellAbilityEffect {
final Player p = GuiChoose.one(source + " - Select a player to attach to.", players); final Player p = GuiChoose.one(source + " - Select a player to attach to.", players);
if (p != null) { if (p != null) {
handleAura(source, p, false); handleAura(source, p);
//source.enchantEntity((Player) o);
return true; return true;
} }
} else { } else {
@@ -278,7 +209,7 @@ public class AttachEffect extends SpellAbilityEffect {
final Object o = GuiChoose.one(source + " - Select a card to attach to.", list); final Object o = GuiChoose.one(source + " - Select a card to attach to.", list);
if (o instanceof Card) { if (o instanceof Card) {
handleAura(source, (Card) o, gainControl); handleAura(source, (Card) o);
//source.enchantEntity((Card) o); //source.enchantEntity((Card) o);
return true; return true;
} }
@@ -289,11 +220,11 @@ public class AttachEffect extends SpellAbilityEffect {
final Object o = aura.getTarget().getTargets().get(0); final Object o = aura.getTarget().getTargets().get(0);
if (o instanceof Card) { if (o instanceof Card) {
//source.enchantEntity((Card) o); //source.enchantEntity((Card) o);
handleAura(source, (Card) o, gainControl); handleAura(source, (Card) o);
return true; return true;
} else if (o instanceof Player) { } else if (o instanceof Player) {
//source.enchantEntity((Player) o); //source.enchantEntity((Player) o);
handleAura(source, (Player) o, false); handleAura(source, (Player) o);
return true; return true;
} }
} }

View File

@@ -81,7 +81,7 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
} }
if (sa.hasParam("GainControl")) { if (sa.hasParam("GainControl")) {
c.addController(sa.getSourceCard()); c.setController(sa.getActivatingPlayer(), Singletons.getModel().getGame().getNextTimestamp());
Singletons.getModel().getGame().getAction().moveToPlay(c, sa.getActivatingPlayer()); Singletons.getModel().getGame().getAction().moveToPlay(c, sa.getActivatingPlayer());
} else { } else {
final Card movedCard = Singletons.getModel().getGame().getAction().moveTo(destination, c, libraryPos); final Card movedCard = Singletons.getModel().getGame().getAction().moveTo(destination, c, libraryPos);

View File

@@ -385,7 +385,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
tgtC.setTapped(true); tgtC.setTapped(true);
} }
if (sa.hasParam("GainControl")) { if (sa.hasParam("GainControl")) {
tgtC.addController(sa.getSourceCard()); tgtC.setController(sa.getActivatingPlayer(), Singletons.getModel().getGame().getNextTimestamp());
} }
if (sa.hasParam("AttachedTo")) { if (sa.hasParam("AttachedTo")) {
List<Card> list = AbilityUtils.getDefinedCards(hostCard, List<Card> list = AbilityUtils.getDefinedCards(hostCard,
@@ -669,7 +669,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
c.setTapped(true); c.setTapped(true);
} }
if (sa.hasParam("GainControl")) { if (sa.hasParam("GainControl")) {
c.addController(sa.getSourceCard()); c.setController(sa.getActivatingPlayer(), Singletons.getModel().getGame().getNextTimestamp());
} }
if (sa.hasParam("AttachedTo")) { if (sa.hasParam("AttachedTo")) {

View File

@@ -3,6 +3,7 @@ package forge.card.ability.effects;
import java.util.ArrayList; import java.util.ArrayList;
import forge.Card; import forge.Card;
import forge.Singletons;
import forge.card.ability.AbilityUtils; import forge.card.ability.AbilityUtils;
import forge.card.ability.SpellAbilityEffect; import forge.card.ability.SpellAbilityEffect;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
@@ -56,9 +57,10 @@ public class ControlExchangeEffect extends SpellAbilityEffect {
return; return;
} }
Player player2 = object2.getController(); final Player player2 = object2.getController();
object2.addController(object1.getController()); final long tStamp = Singletons.getModel().getGame().getNextTimestamp();
object1.addController(player2); object2.setController(object1.getController(), tStamp);
object1.setController(player2, tStamp);
} }
} }

View File

@@ -6,7 +6,6 @@ import java.util.List;
import forge.Card; import forge.Card;
import forge.Command; import forge.Command;
import forge.GameEntity;
import forge.Singletons; import forge.Singletons;
import forge.card.ability.AbilityUtils; import forge.card.ability.AbilityUtils;
import forge.card.ability.SpellAbilityEffect; import forge.card.ability.SpellAbilityEffect;
@@ -52,14 +51,12 @@ public class ControlGainEffect extends SpellAbilityEffect {
} }
private void doLoseControl(final Card c, final Card host, final boolean tapOnLose, private void doLoseControl(final Card c, final Card host, final boolean tapOnLose,
final List<String> addedKeywords, final GameEntity newController) { final List<String> addedKeywords, final long tStamp) {
if (null == c) { if (null == c) {
return; return;
} }
if (c.isInPlay()) { if (c.isInPlay()) {
c.removeController(newController); c.removeTempController(tStamp);
// Singletons.getModel().getGameAction().changeController(new ArrayList<Card>(c),
// c.getController(), originalController);
if (tapOnLose) { if (tapOnLose) {
c.tap(); c.tap();
@@ -105,14 +102,10 @@ public class ControlGainEffect extends SpellAbilityEffect {
controllers = tgt.getTargetPlayers(); controllers = tgt.getTargetPlayers();
} }
GameEntity newController; Player newController;
if (controllers.size() == 0) { if (controllers.size() == 0) {
if (sa.isSpell()) {
newController = sa.getActivatingPlayer(); newController = sa.getActivatingPlayer();
} else {
newController = source;
}
} else { } else {
newController = controllers.get(0); newController = controllers.get(0);
} }
@@ -124,22 +117,22 @@ public class ControlGainEffect extends SpellAbilityEffect {
return; return;
} }
final int size = tgtCards.size(); for (Card tgtC : tgtCards) {
for (int j = 0; j < size; j++) {
final Card tgtC = tgtCards.get(j);
final Player originalController = tgtC.getController();
if (!tgtC.equals(sa.getSourceCard()) && !sa.getSourceCard().getGainControlTargets().contains(tgtC)) { if (!tgtC.equals(sa.getSourceCard()) && !sa.getSourceCard().getGainControlTargets().contains(tgtC)) {
sa.getSourceCard().addGainControlTarget(tgtC); sa.getSourceCard().addGainControlTarget(tgtC);
} }
if (tgtC.isInPlay()) { if (!tgtC.isInPlay()) {
return;
if (!tgtC.equals(newController)) { }
tgtC.addController(newController);
long tStamp = Singletons.getModel().getGame().getNextTimestamp();
if (lose != null) {
tgtC.addTempController(newController, tStamp);
} else {
tgtC.setController(newController, tStamp);
} }
// Singletons.getModel().getGameAction().changeController(new ArrayList<Card>(tgtC),
// tgtC.getController(), newController.get(0));
if (bUntap) { if (bUntap) {
tgtC.untap(); tgtC.untap();
@@ -150,40 +143,36 @@ public class ControlGainEffect extends SpellAbilityEffect {
tgtC.addExtrinsicKeyword(kw); tgtC.addExtrinsicKeyword(kw);
} }
} }
}
// end copied
final Card hostCard = sa.getSourceCard();
if (lose != null) { if (lose != null) {
if (lose.contains("LeavesPlay")) { if (lose.contains("LeavesPlay")) {
sa.getSourceCard().addLeavesPlayCommand(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); sa.getSourceCard().addLeavesPlayCommand(this.getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws));
} }
if (lose.contains("Untap")) { if (lose.contains("Untap")) {
sa.getSourceCard().addUntapCommand(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); sa.getSourceCard().addUntapCommand(this.getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws));
} }
if (lose.contains("LoseControl")) { if (lose.contains("LoseControl")) {
sa.getSourceCard().addChangeControllerCommand(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); sa.getSourceCard().addChangeControllerCommand(this.getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws));
} }
if (lose.contains("EOT")) { if (lose.contains("EOT")) {
Singletons.getModel().getGame().getEndOfTurn().addAt(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); Singletons.getModel().getGame().getEndOfTurn().addAt(this.getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws));
} }
} }
if (destroyOn != null) { if (destroyOn != null) {
if (destroyOn.contains("LeavesPlay")) { if (destroyOn.contains("LeavesPlay")) {
sa.getSourceCard().addLeavesPlayCommand(this.getDestroyCommand(tgtC, hostCard, bNoRegen)); sa.getSourceCard().addLeavesPlayCommand(this.getDestroyCommand(tgtC, source, bNoRegen));
} }
if (destroyOn.contains("Untap")) { if (destroyOn.contains("Untap")) {
sa.getSourceCard().addUntapCommand(this.getDestroyCommand(tgtC, hostCard, bNoRegen)); sa.getSourceCard().addUntapCommand(this.getDestroyCommand(tgtC, source, bNoRegen));
} }
if (destroyOn.contains("LoseControl")) { if (destroyOn.contains("LoseControl")) {
sa.getSourceCard().addChangeControllerCommand(this.getDestroyCommand(tgtC, hostCard, bNoRegen)); sa.getSourceCard().addChangeControllerCommand(this.getDestroyCommand(tgtC, source, bNoRegen));
} }
} }
sa.getSourceCard().clearGainControlReleaseCommands(); sa.getSourceCard().clearGainControlReleaseCommands();
sa.getSourceCard().addGainControlReleaseCommand(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); sa.getSourceCard().addGainControlReleaseCommand(this.getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws));
} // end foreach target } // end foreach target
} }
@@ -239,13 +228,13 @@ public class ControlGainEffect extends SpellAbilityEffect {
* a {@link forge.game.player.Player} object. * a {@link forge.game.player.Player} object.
* @return a {@link forge.Command} object. * @return a {@link forge.Command} object.
*/ */
private Command getLoseControlCommand(final Card c, final Player originalController, final GameEntity newController, private Command getLoseControlCommand(final Card c, final long tStamp,
final boolean bTapOnLose, final Card hostCard, final List<String> kws) { final boolean bTapOnLose, final Card hostCard, final List<String> kws) {
final Command loseControl = new Command() { final Command loseControl = new Command() {
private static final long serialVersionUID = 878543373519872418L; private static final long serialVersionUID = 878543373519872418L;
@Override @Override
public void execute() { doLoseControl(c, hostCard, bTapOnLose, kws, newController); } // execute() public void execute() { doLoseControl(c, hostCard, bTapOnLose, kws, tStamp); }
}; };
return loseControl; return loseControl;

View File

@@ -86,7 +86,7 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
copy = CardFactory.getCard(CardDb.getCard(c), sa.getActivatingPlayer()); copy = CardFactory.getCard(CardDb.getCard(c), sa.getActivatingPlayer());
// when copying something stolen: // when copying something stolen:
copy.addController(controller); copy.setController(controller, 0);
copy.setToken(true); copy.setToken(true);
copy.setCopiedToken(true); copy.setCopiedToken(true);
@@ -97,7 +97,7 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
copy.setImageFilename(c.getImageFilename()); copy.setImageFilename(c.getImageFilename());
copy.setOwner(controller); copy.setOwner(controller);
copy.addController(controller); copy.setController(controller, 0);
copy.setManaCost(c.getManaCost()); copy.setManaCost(c.getManaCost());
copy.setColor(c.getColor()); copy.setColor(c.getColor());

View File

@@ -148,11 +148,11 @@ public class CounterEffect extends SpellAbilityEffect {
if (tgtSA instanceof SpellPermanent) { if (tgtSA instanceof SpellPermanent) {
Card c = tgtSA.getSourceCard(); Card c = tgtSA.getSourceCard();
System.out.println(c + " is SpellPermanent"); System.out.println(c + " is SpellPermanent");
c.addController(srcSA.getActivatingPlayer()); c.setController(srcSA.getActivatingPlayer(), 0);
Singletons.getModel().getGame().getAction().moveToPlay(c, srcSA.getActivatingPlayer()); Singletons.getModel().getGame().getAction().moveToPlay(c, srcSA.getActivatingPlayer());
} else { } else {
Card c = Singletons.getModel().getGame().getAction().moveToPlay(tgtSA.getSourceCard(), srcSA.getActivatingPlayer()); Card c = Singletons.getModel().getGame().getAction().moveToPlay(tgtSA.getSourceCard(), srcSA.getActivatingPlayer());
c.addController(srcSA.getActivatingPlayer()); c.setController(srcSA.getActivatingPlayer(), 0);
} }
} else if (destination.equals("BottomOfLibrary")) { } else if (destination.equals("BottomOfLibrary")) {
Singletons.getModel().getGame().getAction().moveToBottomOfLibrary(tgtSA.getSourceCard()); Singletons.getModel().getGame().getAction().moveToBottomOfLibrary(tgtSA.getSourceCard());

View File

@@ -131,7 +131,7 @@ public class DigUntilEffect extends SpellAbilityEffect {
while (itr.hasNext()) { while (itr.hasNext()) {
final Card c = itr.next(); final Card c = itr.next();
if (sa.hasParam("GainControl") && foundDest.equals(ZoneType.Battlefield)) { if (sa.hasParam("GainControl") && foundDest.equals(ZoneType.Battlefield)) {
c.addController(sa.getSourceCard()); c.setController(sa.getActivatingPlayer(), Singletons.getModel().getGame().getNextTimestamp());
Singletons.getModel().getGame().getAction().moveTo(c.getController().getZone(foundDest), c); Singletons.getModel().getGame().getAction().moveTo(c.getController().getZone(foundDest), c);
} else if (sa.hasParam("NoMoveFound") && foundDest.equals(ZoneType.Library)) { } else if (sa.hasParam("NoMoveFound") && foundDest.equals(ZoneType.Library)) {
//Don't do anything //Don't do anything

View File

@@ -17,7 +17,7 @@ public class PermanentCreatureEfect extends SpellAbilityEffect {
*/ */
@Override @Override
public void resolve(SpellAbility sa) { public void resolve(SpellAbility sa) {
sa.getSourceCard().addController(sa.getActivatingPlayer()); sa.getSourceCard().setController(sa.getActivatingPlayer(), 0);
final Card c = Singletons.getModel().getGame().getAction().moveTo(sa.getActivatingPlayer().getZone(ZoneType.Battlefield), sa.getSourceCard()); final Card c = Singletons.getModel().getGame().getAction().moveTo(sa.getActivatingPlayer().getZone(ZoneType.Battlefield), sa.getSourceCard());
sa.setSourceCard(c); sa.setSourceCard(c);
} }

View File

@@ -17,7 +17,7 @@ public class PermanentNoncreatureEffect extends SpellAbilityEffect {
*/ */
@Override @Override
public void resolve(SpellAbility sa) { public void resolve(SpellAbility sa) {
sa.getSourceCard().addController(sa.getActivatingPlayer()); sa.getSourceCard().setController(sa.getActivatingPlayer(), 0);
final Card c = Singletons.getModel().getGame().getAction().moveTo(sa.getActivatingPlayer().getZone(ZoneType.Battlefield), sa.getSourceCard()); final Card c = Singletons.getModel().getGame().getAction().moveTo(sa.getActivatingPlayer().getZone(ZoneType.Battlefield), sa.getSourceCard());
sa.setSourceCard(c); sa.setSourceCard(c);
} }

View File

@@ -575,7 +575,7 @@ public class SpellPermanent extends Spell {
@Override @Override
public void resolve() { public void resolve() {
Card c = this.getSourceCard(); Card c = this.getSourceCard();
c.addController(this.getActivatingPlayer()); c.setController(this.getActivatingPlayer(), 0);
Singletons.getModel().getGame().getAction().moveTo(ZoneType.Battlefield, c); Singletons.getModel().getGame().getAction().moveTo(ZoneType.Battlefield, c);
} }
} }

View File

@@ -137,6 +137,10 @@ public class StaticAbility {
return 0; return 0;
} }
if (this.params.containsKey("GainControl")) {
return 2;
}
if (this.params.containsKey("AddType") || this.params.containsKey("RemoveType") if (this.params.containsKey("AddType") || this.params.containsKey("RemoveType")
|| this.params.containsKey("RemoveCardType") || this.params.containsKey("RemoveSubType") || this.params.containsKey("RemoveCardType") || this.params.containsKey("RemoveSubType")
|| this.params.containsKey("RemoveSuperType")) { || this.params.containsKey("RemoveSuperType")) {

View File

@@ -319,6 +319,11 @@ public class StaticAbilityContinuous {
for (int i = 0; i < affectedCards.size(); i++) { for (int i = 0; i < affectedCards.size(); i++) {
final Card affectedCard = affectedCards.get(i); final Card affectedCard = affectedCards.get(i);
// Gain control
if (params.containsKey("GainControl")) {
affectedCard.addTempController(hostCard.getController(), hostCard.getTimestamp());
}
// set P/T // set P/T
if (params.containsKey("CharacteristicDefining")) { if (params.containsKey("CharacteristicDefining")) {
if (setPower != -1) { if (setPower != -1) {

View File

@@ -976,8 +976,17 @@ public class GameAction {
final HashMap<String, Object> runParams = new HashMap<String, Object>(); final HashMap<String, Object> runParams = new HashMap<String, Object>();
game.getTriggerHandler().runTrigger(TriggerType.Always, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Always, runParams, false);
for (Card c : game.getCardsIn(ZoneType.Battlefield)) { for (Player p : game.getPlayers()) {
for (Card c : p.getCardsIn(ZoneType.Battlefield)) {
if (!c.getController().equals(p)) {
controllerChangeZoneCorrection(c);
c.runChangeControllerCommands();
checkAgain = true;
}
}
}
for (Card c : game.getCardsIn(ZoneType.Battlefield)) {
if (c.isEquipped()) { if (c.isEquipped()) {
final List<Card> equipments = new ArrayList<Card>(c.getEquippedBy()); final List<Card> equipments = new ArrayList<Card>(c.getEquippedBy());
for (final Card equipment : equipments) { for (final Card equipment : equipments) {
@@ -988,7 +997,6 @@ public class GameAction {
} }
} // if isEquipped() } // if isEquipped()
if (c.isEquipping()) { if (c.isEquipping()) {
final Card equippedCreature = c.getEquipping().get(0); final Card equippedCreature = c.getEquipping().get(0);
if (!equippedCreature.isCreature() || !equippedCreature.isInPlay()) { if (!equippedCreature.isCreature() || !equippedCreature.isInPlay()) {
@@ -1089,7 +1097,7 @@ public class GameAction {
checkAgain = true; checkAgain = true;
} }
} // while it.hasNext() }
if (game.getTriggerHandler().runWaitingTriggers(true)) { if (game.getTriggerHandler().runWaitingTriggers(true)) {
checkAgain = true; checkAgain = true;

View File

@@ -550,8 +550,7 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable {
if (game.getType() == GameType.Planechase) { if (game.getType() == GameType.Planechase) {
Card p = game.getActivePlane(); Card p = game.getActivePlane();
if (p != null) { if (p != null) {
p.clearControllers(); p.setController(next, 0);
p.addController(next);
game.getAction().controllerChangeZoneCorrection(p); game.getAction().controllerChangeZoneCorrection(p);
} }
} }

View File

@@ -1850,7 +1850,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
*/ */
public final void playLand(final Card land) { public final void playLand(final Card land) {
if (this.canPlayLand(land)) { if (this.canPlayLand(land)) {
land.addController(this); land.setController(this, 0);
game.getAction().moveTo(this.getZone(ZoneType.Battlefield), land); game.getAction().moveTo(this.getZone(ZoneType.Battlefield), land);
CardFactoryUtil.playLandEffects(land); CardFactoryUtil.playLandEffects(land);
this.numLandsPlayed++; this.numLandsPlayed++;