*Changed Characteristics-handling from an array to a Map.

*Renamed AF_ChangeState to AF_SetState. SetState can be used with a Transform,Flip or NewState parameter.
*Rewrote Clones to use Characteristics.
*Rewrote Morph to use Characteristics.
*Added
	Ixidron
	Sakashima, the Impostor
This commit is contained in:
Hellfish
2011-11-15 17:14:53 +00:00
parent d4fe16cc7a
commit cbf36eeef0
55 changed files with 501 additions and 383 deletions

4
.gitattributes vendored
View File

@@ -4169,6 +4169,7 @@ res/cardsfolder/i/ivy_dancer.txt svneol=native#text/plain
res/cardsfolder/i/ivy_elemental.txt svneol=native#text/plain
res/cardsfolder/i/iwamori_of_the_open_fist.txt svneol=native#text/plain
res/cardsfolder/i/ixidors_will.txt svneol=native#text/plain
res/cardsfolder/i/ixidron.txt -text
res/cardsfolder/i/izzet_boilerworks.txt svneol=native#text/plain
res/cardsfolder/i/izzet_chronarch.txt svneol=native#text/plain
res/cardsfolder/i/izzet_signet.txt svneol=native#text/plain
@@ -6925,6 +6926,7 @@ res/cardsfolder/s/sage_owl.txt svneol=native#text/plain
res/cardsfolder/s/sages_dousing.txt svneol=native#text/plain
res/cardsfolder/s/sages_knowledge.txt svneol=native#text/plain
res/cardsfolder/s/sailmonger.txt svneol=native#text/plain
res/cardsfolder/s/sakashima_the_impostor.txt -text
res/cardsfolder/s/sakura_tribe_elder.txt svneol=native#text/plain
res/cardsfolder/s/sakura_tribe_scout.txt svneol=native#text/plain
res/cardsfolder/s/salt_flats.txt svneol=native#text/plain
@@ -10489,7 +10491,6 @@ src/main/java/forge/card/abilityfactory/AbilityFactory.java svneol=native#text/p
src/main/java/forge/card/abilityfactory/AbilityFactoryAlterLife.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryAttach.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryChangeState.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryCharm.java -text svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryChoose.java svneol=native#text/plain
@@ -10514,6 +10515,7 @@ src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java svneol=native#te
src/main/java/forge/card/abilityfactory/AbilityFactoryRegenerate.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactorySacrifice.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactorySetState.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryToken.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryTurns.java svneol=native#text/plain
src/main/java/forge/card/abilityfactory/AbilityFactoryZoneAffecting.java svneol=native#text/plain

View File

@@ -5,7 +5,7 @@ Text:no text
PT:3/3
K:Flying
A:AB$Token | Cost$ T | TokenAmount$ 1 | TokenOwner$ You | TokenName$ Vampire | TokenColors$ Black | TokenTypes$ Creature,Vampire | TokenPower$ 2 | TokenToughness$ 2 | TokenKeywords$ Flying | SpellDescription$ Put a 2/2 black Vampire creature token with flying onto the battlefield.
A:AB$ChangeState | Cost$ B | Defined$ Self | CheckSVar$ X | SVarCompare$ GE5 | SpellDescription$ Transform CARDNAME.Activate this ability only if you control five or more Vampires.
A:AB$SetState | Cost$ B | Defined$ Self | CheckSVar$ X | SVarCompare$ GE5 | Transform$ True | SpellDescription$ Transform CARDNAME.Activate this ability only if you control five or more Vampires.
SVar:X:Count$Valid Card.Vampire+YouCtrl
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/bloodline_keeper.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Human Monk
Text:no text
PT:2/1
A:AB$ChangeZone | Cost$ T | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land | ChangeNum$ 1 | OptionalDecider$ You | SubAbility$ DBFlip | SpellDescription$ You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip CARDNAME.
SVar:DBFlip:DB$ChangeState | Defined$ Self | CheckSVar$ X | SVarCompare$ GE10
SVar:DBFlip:DB$SetState | Defined$ Self | CheckSVar$ X | SVarCompare$ GE10 | Flip$ True
SVar:X:Count$Valid Land.YouCtrl
SVar:Rarity:Rare
AlternateMode:Flip

View File

@@ -6,7 +6,7 @@ PT:2/2
T:Mode$ SpellCast | ValidCard$ Card.Spirit,Card.Arcane | ValidControllingPlayer$ You | Execute$ TrigPutCounter | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, you may put a ki counter on CARDNAME.
T:Mode$ Phase | Phase$ End of Turn | IsPresent$ Card.Self+counters_GE2_KI | Execute$ TrigFlip | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the end step, if there are two or more ki counters on Budoka Pupil, you may flip it.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ KI | CounterNum$ 1
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/budoka_pupil.jpg
AlternateMode:Flip

View File

@@ -4,7 +4,7 @@ Types:Creature Human Soldier
Text:no text
PT:1/1
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.DamagedBy | TriggerZones$ Battlefield | Execute$ TrigFlip | TriggerDescription$ When a creature dealt damage by CARDNAME this turn dies, flip CARDNAME.
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Uncommon
AlternateMode:Flip
SVar:Picture:http://www.wizards.com/global/images/magic/general/bushi_tenderfoot.jpg

View File

@@ -6,7 +6,7 @@ PT:2/2
T:Mode$ SpellCast | ValidCard$ Card.Spirit,Card.Arcane | ValidControllingPlayer$ You | Execute$ TrigPutCounter | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, you may put a ki counter on CARDNAME.
T:Mode$ Phase | Phase$ End of Turn | IsPresent$ Card.Self+counters_GE2_KI | Execute$ TrigFlip | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the end step, if there are two or more ki counters on CARDNAME, you may flip it.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ KI | CounterNum$ 1
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/callow_jushi.jpg
AlternateMode:Flip

View File

@@ -4,7 +4,7 @@ Types:Creature Human
Text:no text
PT:1/1
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTransform | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/cloistered_youth.jpg

View File

@@ -6,7 +6,7 @@ PT:2/2
T:Mode$ SpellCast | ValidCard$ Card.Spirit,Card.Arcane | ValidControllingPlayer$ You | Execute$ TrigPutCounter | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, you may put a ki counter on CARDNAME.
T:Mode$ Phase | Phase$ End of Turn | IsPresent$ Card.Self+counters_GE2_KI | Execute$ TrigFlip | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the end step, if there are two or more ki counters on CARDNAME, you may flip it.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ KI | CounterNum$ 1
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/cunning_bandit.jpg
AlternateMode:Flip

View File

@@ -5,7 +5,7 @@ Text:no text
PT:2/2
A:AB$DealDamage | Cost$ T | ValidTgts$ Creature.withFlying | TgtPrompt$ Select target creature with flying. | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to target creature with flying.
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Rare
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/daybreak_ranger.jpg
@@ -25,7 +25,7 @@ SVar:DamageThis:DB$DealDamage | Defined$ Self | DamageSource$ Targeted | NumDmg$
SVar:X:Count$CardPower
SVar:Y:Targeted$CardPower
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/nightfall_predator.jpg
SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/176b.jpg

View File

@@ -5,7 +5,7 @@ Text:no text
PT:1/1
K:Flying
T:Mode$ SpellCast | CheckSVar$ NumCast | SVarCompare$ EQ4 | Execute$ TrigFlip | TriggerZones$ Battlefield | TriggerDescription$ Whenever the fourth spell of a turn is cast, flip CARDNAME.
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:NumCast:Count$ThisTurnCast_Card
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/erayo_soratami_ascendant.jpg

View File

@@ -6,7 +6,7 @@ PT:2/2
T:Mode$ SpellCast | ValidCard$ Card.Spirit,Card.Arcane | ValidControllingPlayer$ You | Execute$ TrigPutCounter | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, you may put a ki counter on CARDNAME.
T:Mode$ Phase | Phase$ End of Turn | IsPresent$ Card.Self+counters_GE2_KI | Execute$ TrigFlip | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the end step, if there are two or more ki counters on CARDNAME, you may flip it.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ KI | CounterNum$ 1
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/faithful_squire.jpg
AlternateMode:Flip

View File

@@ -8,7 +8,7 @@ A:AB$ DealDamage | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target crea
A:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Wolf | TokenColors$ Green | TokenTypes$ Creature,Wolf | TokenOwner$ You | TokenPower$ 2 | TokenToughness$ 2 | Planeswalker$ True | SpellDescription$ Put a 2/2 green Wolf creature token onto the battlefield.
SVar:DamageThis:DB$DealDamage | Defined$ Self | DamageSource$ Targeted | NumDmg$ Y
SVar:Y:Targeted$CardPower
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
AlternateMode:DoubleFaced
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/garruk_relentless.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Human Werewolf
Text:no text
PT:2/2
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/gatstaf_shepherd.jpg
AlternateMode:DoubleFaced
@@ -21,7 +21,7 @@ Text:no text
PT:3/3
K:Intimidate
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/gatstaf_howler.jpg
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/182b.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Human Werewolf
Text:no text
PT:4/4
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/grizzled_outcasts.jpg
@@ -20,7 +20,7 @@ Types:Creature Werewolf
Text:no text
PT:7/7
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/krallenhorde_wantons.jpg
SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/185b.jpg

View File

@@ -5,7 +5,7 @@ Text:no text
PT:1/5
K:Defender
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/hanweir_watchkeep.jpg
@@ -22,7 +22,7 @@ Text:no text
PT:5/5
K:CARDNAME attacks each turn if able.
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/bane_of_hanweir.jpg
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/145b.jpg

View File

@@ -6,7 +6,7 @@ PT:2/2
T:Mode$ SpellCast | ValidCard$ Card.Spirit,Card.Arcane | ValidControllingPlayer$ You | Execute$ TrigPutCounter | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, you may put a ki counter on CARDNAME.
T:Mode$ Phase | Phase$ End of Turn | IsPresent$ Card.Self+counters_GE2_KI | Execute$ TrigFlip | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the end step, if there are two or more ki counters on CARDNAME, you may flip it.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ KI | CounterNum$ 1
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/hired_muscle.jpg
AlternateMode:Flip

View File

@@ -6,7 +6,7 @@ PT:4/4
K:CARDNAME can't block.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ When CARDNAME dies, return it to the battlefield flipped.
SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Graveyard | Destination$ Battlefield | SubAbility$ TrigFlip
SVar:TrigFlip:DB$ChangeState | Defined$ Self
SVar:TrigFlip:DB$SetState | Defined$ Self | Flip$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/homura_human_ascendant.jpg
AlternateMode:Flip

View File

@@ -5,7 +5,7 @@ Text:no text
PT:2/2
A:AB$DealDamage | Cost$ T | ValidTgts$ Creature.wasDealtDamageThisTurn | TgtPrompt$ Select target creature that was dealt damage this turn. | NumDmg$ 1 | RememberTargets$ True | SpellDescription$ CARDNAME deals 1 damage to target creature that was dealt damage this turn.
T:Mode$ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.IsRemembered | Execute$ TrigFlip | TriggerZones$ Battlefield | TriggerDescription$ When that creature dies this turn, flip CARDNAME.
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self | SubAbility$ TrigCleanup
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True | SubAbility$ TrigCleanup
T:Mode$Phase | Phase$ End of Turn | Static$ True | Execute$ TrigCleanup | Secondary$ True | TriggerDescription$ Forgets remembered cards at eot.
SVar:TrigCleanup:DB$Cleanup | ClearRemembered$ True
SVar:Rarity:Uncommon

View File

@@ -5,7 +5,7 @@ Text:no text
PT:2/3
S:Mode$ Continuous | Affected$ Creature.attacking+YouCtrl | AddPower$ 1 | Description$ Attacking creatures you control get +1/+0.
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/instigator_gang.jpg
AlternateMode:DoubleFaced
@@ -23,7 +23,7 @@ PT:5/5
K:Trample
S:Mode$ Continuous | Affected$ Creature.attacking+YouCtrl | AddPower$ 3 | Description$ Attacking creatures you control get +3/+0.
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/wildblood_pack.jpg
SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/149b.jpg

View File

@@ -0,0 +1,13 @@
Name:Ixidron
ManaCost:3 U U
Types:Creature Illusion
Text:no text
PT:*/*
T:Mode$ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigTurnFaceDown | TriggerDescription$ As CARDNAME enters the battlefield, turn all other nontoken creatures face down. (They're 2/2 creatures.)
SVar:TrigTurnFaceDown:AB$SetStateAll | Cost$ 0 | ValidCards$ Creature.Other | NewState$ FaceDown
S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ X | Description$ CARDNAME's power and toughness are each equal to the number of face-down creatures on the battlefield.
SVar:X:Count$Valid Creature.faceDown
SVar:Rarity:Rare
Oracle:As Ixidron enters the battlefield, turn all other nontoken creatures face down. (They're 2/2 creatures.)\nIxidron's power and toughness are each equal to the number of face-down creatures on the battlefield.
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/65.jpg
End

View File

@@ -4,7 +4,7 @@ Types:Creature Human Wizard
Text:no text
PT:1/2
A:AB$Draw | Cost$ 2 U T | Defined$ You | NumCards$ 1 | SubAbility$ DBFlip | SpellDescription$ Draw a card. If you have nine or more cards in hand, flip CARDNAME.
SVar:DBFlip:DB$ChangeState | Defined$ Self | ConditionCheckSVar$ HandSize | ConditionSVarCompare$ GE9
SVar:DBFlip:DB$SetState | Defined$ Self | ConditionCheckSVar$ HandSize | ConditionSVarCompare$ GE9 | Flip$ True
SVar:HandSize:Count$InYourHand
SVar:Rarity:Rare
AlternateMode:Flip

View File

@@ -5,7 +5,7 @@ Text:no text
PT:2/4
T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | CheckSVar$ X | SVarCompare$ GE3 | Execute$ TrigFlip | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the end step, if three or more creatures died this turn, flip CARDNAME.
SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/kuon_ogre_ascendant.jpg
AlternateMode:Flip

View File

@@ -6,7 +6,7 @@ PT:0/3
K:Defender
A:AB$PutCounter | Cost$ 1 U | Defined$ Self | CounterType$ HATCHLING | CounterNum$ 1 | SubAbility$ DBTransform | SpellDescription$ Put a hatchling counter on CARDNAME. Then if there are five or more hatchling counters on it, remove all of them and transform it.
SVar:DBRemCounter:DB$ RemoveCounter | CounterType$ HATCHLING | CounterNum$ All | ConditionCheckSVar$ X
SVar:DBTransform:DB$ChangeState | Defined$ Self | ConditionCheckSVar$ X | SubAbility$ DBRemCounter
SVar:DBTransform:DB$SetState | Defined$ Self | ConditionCheckSVar$ X | SubAbility$ DBRemCounter | Transform$ True
SVar:X:Count$Valid Card.Self+counters_GE5_HATCHLING
SVar:All:Count$CardCounters.HATCHLING
SVar:Rarity:Rare

View File

@@ -5,7 +5,7 @@ Text:no text
PT:1/1
S:Mode$ Continuous | Affected$ Creature.Human+Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other Human creatures you control get +1/+1.
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mayor_of_avabruck.jpg
AlternateMode:DoubleFaced

View File

@@ -2,7 +2,7 @@ Name:Moonmist
ManaCost:1 G
Types:Instant
Text:no text
A:SP$ChangeStateAll | Cost$ 1 G | ValidCards$ Creature.Human+DoubleFaced | SubAbility$ DBCurseNonWolves | SpellDescription$ Transform all Humans. Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves. (Only double-faced cards can be transformed.)
A:SP$SetStateAll | Cost$ 1 G | ValidCards$ Creature.Human+DoubleFaced | Transform$ True | SubAbility$ DBCurseNonWolves | SpellDescription$ Transform all Humans. Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves. (Only double-faced cards can be transformed.)
SVar:DBCurseNonWolves:DB$Effect | Name$ Moonmist Effect. | StaticAbilities$ Curse
SVar:Curse:Mode$ PreventDamage | Source$ Creature.nonWerewolf+nonWolf | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves.
SVar:Rarity:Common

View File

@@ -4,7 +4,7 @@ Types:Creature Rat Rogue
Text:no text
PT:2/1
A:AB$ ChangeZone | Cost$ 1 B | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Card.YouDontCtrl | SubAbility$ DBFlip | SpellDescription$ Exile target card from an opponent's graveyard. If no cards are in that graveyard, flip CARDNAME.
SVar:DBFlip:DB$ChangeState | Defined$ Self | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0
SVar:DBFlip:DB$SetState | Defined$ Self | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | Flip$ True
SVar:X:Count$InOppYard
SVar:Rarity:Uncommon
AlternateMode:Flip

View File

@@ -4,7 +4,7 @@ Types:Creature Rat Rogue
Text:no text
PT:1/1
A:AB$ Discard | Cost$ 1 B T | ValidTgts$ Opponent | NumCards$ 1 | Mode$ TgtChoose | SubAbility$ DBFlip | SpellDescription$ Target opponent discards a card. Then if that player has no cards in hand, flip Nezumi Shortfang.
SVar:DBFlip:DB$ChangeState | Defined$ Self | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0
SVar:DBFlip:DB$SetState | Defined$ Self | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | Flip$ True
SVar:X:Count$InOppHand
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/nezumi_shortfang.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Snake Shaman
Text:no text
PT:1/1
A:AB$Token | Cost$ 2 G T | TokenAmount$ 1 | TokenOwner$ You | TokenName$ Snake | TokenTypes$ Creature,Snake | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 | SubAbility$ DBFlip | SpellDescription$ Put a 1/1 green Snake creature token onto the battlefield. If you control ten or more creatures, flip CARDNAME.
SVar:DBFlip:DB$ChangeState | Defined$ Self | CheckSVar$ X | SVarCompare$ GE10
SVar:DBFlip:DB$SetState | Defined$ Self | CheckSVar$ X | SVarCompare$ GE10 | Flip$ True
SVar:X:Count$Valid Creature.YouCtrl
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/orochi_eggwatcher.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Human Rogue Werewolf
Text:no text
PT:1/1
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/reckless_waif.jpg
@@ -20,7 +20,7 @@ Types:Creature Werewolf
Text:no text
PT:3/2
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/merciless_predator.jpg
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/159b.jpg

View File

@@ -4,7 +4,7 @@ Types:Legendary Creature Fox Monk
Text:no text
PT:2/2
T:Mode$ Always | LifeTotal$ You | LifeAmount$ GE30 | TriggerZones$ Battlefield | Execute$ TrigFlip | TriggerDescription$ When you have 30 or more life, flip CARDNAME.
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rune_tail_kitsune_ascendant.jpg
AlternateMode:Flip

View File

@@ -0,0 +1,10 @@
Name:Sakashima the Impostor
ManaCost:2 U U
Types:Legendary Creature Human Rogue
Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except its name is still CARDNAME, it's legendary in addition to its other types, and it gains "2 U U: Return CARDNAME to its owner's hand at the beginning of the next end step."
PT:3/1
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashima_the_impostor.jpg
Oracle:You may have Sakashima the Impostor enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains "{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step."
SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/53.jpg
End

View File

@@ -5,7 +5,7 @@ Text:no text
PT:2/2
K:Flying
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTransform | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may pay 2 B B. If you do, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 2 B B | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 2 B B | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/screeching_bat.jpg
@@ -21,7 +21,7 @@ Types:Creature Vampire
Text:no text
PT:5/5
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTransform | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may pay 2 B B. If you do, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 2 B B | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 2 B B | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/stalking_vampire.jpg
Oracle:Creature - Vampire\n5/5\nAt the beginning of your upkeep, you may pay {2}{B}{B}. If you do, transform Stalking Vampire.

View File

@@ -4,7 +4,7 @@ Types:Creature Human Wizard
Text:no text
PT:1/1
T:Mode$ Always | IsPresent$ Card.Self+withFlying | TriggerZones$ Battlefield | Execute$ TrigFlip | TriggerDescription$ When CARDNAME has flying, flip it.
SVar:TrigFlip:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigFlip:AB$SetState | Cost$ 0 | Defined$ Self | Flip$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/student_of_elements.jpg
AlternateMode:Flip

View File

@@ -5,7 +5,7 @@ Text:no text
PT:2/2
K:Vigilance
T:Mode$ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.Other+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigTransform | OptionalDecider$ You | TriggerDescription$ Whenever another creature you control dies, you may transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/thraben_sentry.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Human Warrior Werewolf
Text:no text
PT:3/2
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/tormented_pariah.jpg
@@ -20,7 +20,7 @@ Types:Creature Werewolf
Text:no text
PT:6/4
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/rampaging_werewolf.jpg
SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/165b.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Human Shaman Werewolf
Text:no text
PT:3/3
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/ulvenwald_mystics.jpg
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/208a.jpg
@@ -20,7 +20,7 @@ Text:no text
PT:5/5
A:AB$ Regenerate | Cost$ G | SpellDescription$ Regenerate CARDNAME.
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ TRue
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/ulvenwald_primordials.jpg
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/208b.jpg

View File

@@ -5,7 +5,7 @@ Text:no text
PT:1/1
K:First Strike
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/village_ironsmith.jpg
@@ -22,7 +22,7 @@ Text:no text
PT:3/1
K:First Strike
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/ironfang.jpg
SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/168b.jpg

View File

@@ -4,7 +4,7 @@ Types:Creature Human Werewolf
Text:no text
PT:2/3
T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/villagers_of_estwald.jpg
@@ -20,7 +20,7 @@ Types:Creature Werewolf
Text:no text
PT:4/6
T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Transform$ True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/howlpack_of_estwald.jpg
SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/209b.jpg

View File

@@ -4,10 +4,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
import com.esotericsoftware.minlog.Log;
@@ -41,46 +43,97 @@ public class Card extends GameEntity implements Comparable<Card> {
private int uniqueNumber = nextUniqueNumber++;
private long value;
private Map<String, CardCharacteristics> characteristicsMap = new HashMap<String,CardCharacteristics>();
private String curCharacteristics = "Original";
private String preTFDCharacteristic = "Original";
private CardCharacteristics[] characteristics = new CardCharacteristics[] { new CardCharacteristics(), null };
private int currentCharacteristic = 0;
private boolean isDoubleFaced = false;
private boolean isFlip = false;
public Card() {
characteristicsMap.put("Original", new CardCharacteristics());
characteristicsMap.put("FaceDown", CardUtil.getFaceDownCharacteristic());
}
public boolean setState(String state) {
if(state.equals("FaceDown") && isDoubleFaced) {
return false; //Doublefaced cards can't be turned face-down.
}
if(!characteristicsMap.containsKey(state)) {
System.out.println(getName() + " tried to switch to non-existant state \"" + state + "\"!");
return false; //Nonexistant state.
}
if(state.equals(curCharacteristics)) {
return false;
}
curCharacteristics = state;
return true;
}
public Set<String> getStates() {
return characteristicsMap.keySet();
}
public String getCurState() {
return curCharacteristics;
}
public void switchStates(String from,String to)
{
CardCharacteristics tmp = characteristicsMap.get(from);
characteristicsMap.put(from, characteristicsMap.get(to));
characteristicsMap.put(to, tmp);
}
public void clearStates(String state) {
characteristicsMap.remove(state);
}
public void turnFaceDown() {
if(!isDoubleFaced) {
preTFDCharacteristic = curCharacteristics;
curCharacteristics = "FaceDown";
}
}
public void turnFaceUp() {
if(curCharacteristics.equals("FaceDown")) {
curCharacteristics = preTFDCharacteristic;
}
}
public boolean isCloned() {
for(String state : characteristicsMap.keySet()) {
if(state.equals("Cloner")) {
return true;
}
}
return false;
}
public CardCharacteristics getState(String state) {
return characteristicsMap.get(state);
}
/**
* Gets the characteristics.
*
* @return the characteristics
*/
public CardCharacteristics getCharacteristics() {
return characteristics[currentCharacteristic];
return characteristicsMap.get(curCharacteristics);
}
/**
*
* addAlternateState.
*/
public final void addAlternateState() {
characteristics[1] = new CardCharacteristics();
}
/**
*
* clearAlternateState.
*/
public final void clearAlternateState() {
if (currentCharacteristic == 1) {
changeState();
}
characteristics[1] = null;
}
/**
*
* clearOtherState.
*/
public final void clearOtherState() {
characteristics[1 - currentCharacteristic] = null;
public final void addAlternateState(String state) {
characteristicsMap.put(state,new CardCharacteristics());
}
/*
@@ -110,7 +163,7 @@ public class Card extends GameEntity implements Comparable<Card> {
* @return boolean
*/
public final boolean isInAlternateState() {
return currentCharacteristic == 1;
return !(curCharacteristics.equals("Original") || curCharacteristics.equals("Cloned"));
}
/**
@@ -120,23 +173,7 @@ public class Card extends GameEntity implements Comparable<Card> {
* @return boolean
*/
public final boolean hasAlternateState() {
return characteristics[1] != null;
}
/**
*
* changeState.
*
* @return boolean
*/
public final boolean changeState() {
if (characteristics[1 - currentCharacteristic] != null) {
currentCharacteristic = 1 - currentCharacteristic;
return true;
}
return false;
return characteristicsMap.keySet().size() > 2;
}
/**
@@ -231,7 +268,6 @@ public class Card extends GameEntity implements Comparable<Card> {
private ArrayList<Card> mustBlockCards = new ArrayList<Card>();
private boolean canMorph = false;
private boolean faceDown = false;
private boolean kicked = false;
private boolean evoked = false;
@@ -2735,12 +2771,15 @@ public class Card extends GameEntity implements Comparable<Card> {
* @return ArrayList<SpellAbility>
*/
public final ArrayList<SpellAbility> getAllSpellAbilities() {
ArrayList<SpellAbility> res = new ArrayList<SpellAbility>(getSpellAbilities());
if (hasAlternateState()) {
changeState();
ArrayList<SpellAbility> res = new ArrayList<SpellAbility>();
String curState = curCharacteristics;
for(String key : characteristicsMap.keySet()) {
setState(key);
res.addAll(getSpellAbilities());
changeState();
}
setState(curState);
return res;
}
@@ -3064,18 +3103,6 @@ public class Card extends GameEntity implements Comparable<Card> {
return spellCopyingCard;
}
/**
* <p>
* setIsFaceDown.
* </p>
*
* @param b
* a boolean.
*/
public final void setIsFaceDown(final boolean b) {
faceDown = b;
}
/**
* <p>
* isFaceDown.
@@ -3084,7 +3111,7 @@ public class Card extends GameEntity implements Comparable<Card> {
* @return a boolean.
*/
public final boolean isFaceDown() {
return faceDown;
return curCharacteristics.equals("FaceDown");
}
/**

View File

@@ -456,8 +456,15 @@ public class CardReader implements Runnable {
card.addSet(new SetInfo(value)); // NOPMD by Braids on
// 8/18/11 11:08 PM
} else if (line.equals("ALTERNATE")) {
card.addAlternateState();
card.changeState();
String mode;
if(card.isFlip()) {
mode = "Flipped";
}
else {
mode = "Transformed";
}
card.addAlternateState(mode);
card.setState(mode);
} else if (line.startsWith("AlternateMode:")) {
final String value = line.substring("AlternateMode:".length());
if (value.equalsIgnoreCase("Flip")) {
@@ -494,10 +501,9 @@ public class CardReader implements Runnable {
}
if (card.isInAlternateState()) {
card.changeState();
card.setState("Original");
}
listRulesToFill.add(rulesReader.getCard());
mapToFill.put(card.getName(), card);
return card;

View File

@@ -13,6 +13,7 @@ import net.slightlymagic.maxmtg.Predicate;
import org.apache.commons.lang3.StringUtils;
import forge.card.CardCharacteristics;
import forge.card.mana.ManaCost;
import forge.card.spellability.SpellAbility;
import forge.card.spellability.SpellAbilityList;
@@ -960,5 +961,22 @@ public final class CardUtil {
return usableColors;
}
public static CardCharacteristics getFaceDownCharacteristic() {
ArrayList<String> types = new ArrayList<String>();
types.add("Creature");
CardCharacteristics ret = new CardCharacteristics();
ret.setBaseAttack(2);
ret.setBaseDefense(2);
ret.setName("");
ret.setType(types);
ret.setImageFilename("morph.jpg");
return ret;
}
} // end class CardUtil

View File

@@ -70,16 +70,9 @@ public class GameAction {
// Reset Activations per Turn
for (final Card card : all) {
for (final SpellAbility sa : card.getSpellAbility()) {
for (final SpellAbility sa : card.getAllSpellAbilities()) {
sa.getRestrictions().resetTurnActivations();
}
if (card.hasAlternateState()) {
card.changeState();
for (final SpellAbility sa : card.getSpellAbility()) {
sa.getRestrictions().resetTurnActivations();
}
card.changeState();
}
}
}
@@ -121,8 +114,13 @@ public class GameAction {
copied = c;
} else {
if (c.isInAlternateState()) {
c.changeState();
c.setState("Original");
}
if (c.isCloned()) {
c.switchStates("Cloner", "Original");
c.setState("Original");
}
copied = AllZone.getCardFactory().copyCard(c);
lastKnownInfo = CardUtil.getLKICopy(c);
@@ -545,7 +543,7 @@ public class GameAction {
if(c.isInAlternateState())
{
c.changeState();
c.setState("Original");
}
if ((p != null) && p.is(Constant.Zone.Battlefield)) {
@@ -1344,9 +1342,16 @@ public class GameAction {
AllZone.getHumanPlayer().getZone(Zone.Library).add(card);
if (card.hasAlternateState()) {
card.changeState();
if(card.isDoubleFaced()) {
card.setState("Transformed");
}
if(card.isFlip()) {
card.setState("Flipped");
}
card.setImageFilename(CardUtil.buildFilename(card));
card.changeState();
card.setState("Original");
}
}
}
@@ -1380,9 +1385,16 @@ public class GameAction {
}
if (card.hasAlternateState()) {
card.changeState();
if(card.isDoubleFaced()) {
card.setState("Transformed");
}
if(card.isFlip()) {
card.setState("Flipped");
}
card.setImageFilename(CardUtil.buildFilename(card));
card.changeState();
card.setState("Original");
}
}
}

View File

@@ -1486,24 +1486,8 @@ public final class GuiDisplayUtil {
}
} else if (info.equalsIgnoreCase("SummonSick:True")) {
c.setSickness(true);
} else if (info.equalsIgnoreCase("Morphed:True")) {
if (!c.getCanMorph()) {
System.out.println("Setup game state - Can't morph a card without the morph keyword!");
continue;
}
c.setIsFaceDown(true);
c.setManaCost("");
c.setColor(new ArrayList<CardColor>()); // remove all
// colors
c.addColor("0");
c.setBaseAttack(2);
c.setBaseDefense(2);
c.comesIntoPlay();
c.setIntrinsicKeyword(new ArrayList<String>()); // remove
// all
// keywords
c.setType(new ArrayList<String>()); // remove all types
c.addType("Creature");
} else if (info.equalsIgnoreCase("FaceDown:True")) {
c.setState("FaceDown");
}
}

View File

@@ -48,10 +48,15 @@ public class GuiDownloadPicturesLQ extends GuiDownloader {
String base = ForgeProps.getFile(NewConstants.IMAGE_BASE).getPath();
for (Card c : AllZone.getCardFactory()) {
cList.addAll(createDLObjects(c, base));
if (c.hasAlternateState()) {
c.changeState();
if (c.isFlip()) {
c.setState("Flip");
cList.addAll(createDLObjects(c, base));
}
if(c.isDoubleFaced()) {
c.setState("Transformed");
cList.addAll(createDLObjects(c, base));
}
c.setState("Original");
}
ArrayList<DownloadObject> list = new ArrayList<DownloadObject>();

View File

@@ -2482,26 +2482,16 @@ public class Upkeep implements java.io.Serializable {
* add new to play
*/
final Card newCopy = AllZone.getCardFactory().getCard(newTarget[0].getName(), player);
final Card newCopy = AllZone.getCardFactory().getCard(newTarget[0].getState("Original").getName(), player);
newCopy.setCurSetCode(newTarget[0].getCurSetCode());
newCopy.setImageFilename(newTarget[0].getImageFilename());
// need to add the leaves play command (2)
newCopy.addLeavesPlayCommand(c.getCloneLeavesPlayCommand());
c.removeTrigger(c.getCloneLeavesPlayCommand(), ZCTrigger.LEAVEFIELD);
newCopy.setCloneLeavesPlayCommand(c.getCloneLeavesPlayCommand());
newCopy.addExtrinsicKeyword(keyword);
newCopy.addColor("U", newCopy, false, true);
newCopy.setCloneOrigin(c.getCloneOrigin());
newCopy.getCloneOrigin().setCurrentlyCloningCard(newCopy);
c.setCloneOrigin(null);
// 5
final PlayerZone play = AllZone.getZoneOf(c);
play.remove(c);
play.add(newCopy);
newCopy.setState(newTarget[0].getCurState());
CardFactoryUtil.copyCharacteristics(newCopy, c);
c.addColor("U");
c.addExtrinsicKeyword(keyword);
}
}
};

View File

@@ -1146,23 +1146,23 @@ public class AbilityFactory {
}
}
else if (this.api.equals("ChangeState")) {
else if (this.api.equals("SetState")) {
if (this.isAb) {
spellAbility = AbilityFactoryChangeState.getChangeStateAbility(this);
spellAbility = AbilityFactorySetState.getSetStateAbility(this);
} else if (this.isSp) {
spellAbility = AbilityFactoryChangeState.getChangeStateSpell(this);
spellAbility = AbilityFactorySetState.getSetStateSpell(this);
} else if (this.isDb) {
spellAbility = AbilityFactoryChangeState.getChangeStateDrawback(this);
spellAbility = AbilityFactorySetState.getSetStateDrawback(this);
}
}
else if (this.api.equals("ChangeStateAll")) {
else if (this.api.equals("SetStateAll")) {
if (this.isAb) {
spellAbility = AbilityFactoryChangeState.getChangeStateAllAbility(this);
spellAbility = AbilityFactorySetState.getSetStateAllAbility(this);
} else if (this.isSp) {
spellAbility = AbilityFactoryChangeState.getChangeStateAllSpell(this);
spellAbility = AbilityFactorySetState.getSetStateAllSpell(this);
} else if (this.isDb) {
spellAbility = AbilityFactoryChangeState.getChangeStateAllDrawback(this);
spellAbility = AbilityFactorySetState.getSetStateAllDrawback(this);
}
}

View File

@@ -843,7 +843,7 @@ public final class AbilityFactoryChangeZone {
} else {
movedCard = AllZone.getGameAction().moveTo(destZone, c);
if (params.containsKey("ExileFaceDown")) {
movedCard.setIsFaceDown(true);
movedCard.setState("FaceDown");
}
}
@@ -1007,7 +1007,7 @@ public final class AbilityFactoryChangeZone {
} else {
newCard = AllZone.getGameAction().moveTo(destZone, c);
if (params.containsKey("ExileFaceDown")) {
newCard.setIsFaceDown(true);
newCard.setState("FaceDown");
}
}
@@ -1793,7 +1793,7 @@ public final class AbilityFactoryChangeZone {
} else {
movedCard = AllZone.getGameAction().moveTo(pl.getZone(destination), tgtC);
if (params.containsKey("ExileFaceDown")) {
movedCard.setIsFaceDown(true);
movedCard.setState("FaceDown");
}
}
}
@@ -2199,7 +2199,7 @@ public final class AbilityFactoryChangeZone {
} else {
final Card movedCard = AllZone.getGameAction().moveTo(destination, c, libraryPos);
if (params.containsKey("ExileFaceDown")) {
movedCard.setIsFaceDown(true);
movedCard.setState("FaceDown");
}
}

View File

@@ -347,7 +347,7 @@ public final class AbilityFactoryCopy {
boolean wasInAlt = false;
if (c.isInAlternateState()) {
wasInAlt = true;
c.changeState();
c.setState("Original");
}
// start copied Kiki code
@@ -395,35 +395,22 @@ public final class AbilityFactoryCopy {
if (c.isDoubleFaced()) { // Cloned DFC's can't transform
if (wasInAlt) {
copy.changeState();
c.changeState();
copy.setState("Transformed");
}
copy.clearOtherState();
}
if (c.isFlip()) { // Cloned Flips CAN flip.
copy.changeState();
c.changeState();
copy.setState("Original");
c.setState("Original");
copy.setImageFilename(c.getImageFilename());
if (!c.isInAlternateState()) {
copy.changeState();
copy.setState("Flipped");
}
c.changeState();
c.setState("Flipped");
}
if (c.isFaceDown()) {
copy.setIsFaceDown(true);
copy.setManaCost("");
copy.setBaseAttack(2);
copy.setBaseDefense(2);
//remove all keywords
copy.setIntrinsicKeyword(new ArrayList<String>());
//remove all types
copy.setType(new ArrayList<String>());
copy.addType("Creature");
copy.clearSpellAbility(); // disallow "morph_up"
copy.setCurSetCode("");
copy.setImageFilename("morph.jpg");
c.setState("FaceDown");
}
copy = AllZone.getGameAction().moveToPlay(copy);

View File

@@ -20,7 +20,7 @@ import forge.card.spellability.Target;
* AbilityFactory for abilities that cause cards to change states.
*
*/
public class AbilityFactoryChangeState {
public class AbilityFactorySetState {
/**
* Gets the change state ability.
@@ -29,19 +29,19 @@ public class AbilityFactoryChangeState {
* the aF
* @return the change state ability
*/
public static SpellAbility getChangeStateAbility(final AbilityFactory abilityFactory) {
public static SpellAbility getSetStateAbility(final AbilityFactory abilityFactory) {
final SpellAbility ret = new AbilityActivated(abilityFactory.getHostCard(), abilityFactory.getAbCost(),
abilityFactory.getAbTgt()) {
private static final long serialVersionUID = -1083427558368639457L;
@Override
public String getStackDescription() {
return AbilityFactoryChangeState.changeStateStackDescription(abilityFactory, this);
return AbilityFactorySetState.setStateStackDescription(abilityFactory, this);
}
@Override
public void resolve() {
AbilityFactoryChangeState.changeStateResolve(abilityFactory, this);
AbilityFactorySetState.setStateResolve(abilityFactory, this);
}
};
@@ -55,18 +55,18 @@ public class AbilityFactoryChangeState {
* the aF
* @return the change state spell
*/
public static SpellAbility getChangeStateSpell(final AbilityFactory abilityFactory) {
public static SpellAbility getSetStateSpell(final AbilityFactory abilityFactory) {
final SpellAbility ret = new Spell(abilityFactory.getHostCard()) {
private static final long serialVersionUID = -7506856902233086859L;
@Override
public String getStackDescription() {
return AbilityFactoryChangeState.changeStateStackDescription(abilityFactory, this);
return AbilityFactorySetState.setStateStackDescription(abilityFactory, this);
}
@Override
public void resolve() {
AbilityFactoryChangeState.changeStateResolve(abilityFactory, this);
AbilityFactorySetState.setStateResolve(abilityFactory, this);
}
};
@@ -80,14 +80,14 @@ public class AbilityFactoryChangeState {
* the aF
* @return the change state drawback
*/
public static SpellAbility getChangeStateDrawback(final AbilityFactory abilityFactory) {
public static SpellAbility getSetStateDrawback(final AbilityFactory abilityFactory) {
final AbilitySub ret = new AbilitySub(abilityFactory.getHostCard(), abilityFactory.getAbTgt()) {
private static final long serialVersionUID = -3793247725721587468L;
@Override
public String getStackDescription() {
return AbilityFactoryChangeState.changeStateStackDescription(abilityFactory, this);
return AbilityFactorySetState.setStateStackDescription(abilityFactory, this);
}
@Override
@@ -113,7 +113,7 @@ public class AbilityFactoryChangeState {
@Override
public void resolve() {
AbilityFactoryChangeState.changeStateResolve(abilityFactory, this);
AbilityFactorySetState.setStateResolve(abilityFactory, this);
}
};
@@ -121,7 +121,7 @@ public class AbilityFactoryChangeState {
return ret;
}
private static String changeStateStackDescription(final AbilityFactory abilityFactory, final SpellAbility sa) {
private static String setStateStackDescription(final AbilityFactory abilityFactory, final SpellAbility sa) {
final Map<String, String> params = abilityFactory.getMapParams();
final StringBuilder sb = new StringBuilder();
@@ -176,7 +176,7 @@ public class AbilityFactoryChangeState {
return sb.toString();
}
private static void changeStateResolve(final AbilityFactory abilityFactory, final SpellAbility sa) {
private static void setStateResolve(final AbilityFactory abilityFactory, final SpellAbility sa) {
ArrayList<Card> tgtCards;
@@ -193,7 +193,32 @@ public class AbilityFactoryChangeState {
continue;
}
}
tgt.changeState();
if(abilityFactory.getMapParams().containsKey("Transform"))
{
if(tgt.getCurState().equals("Transformed")) {
tgt.setState("Original");
}
else if(tgt.hasAlternateState() && tgt.getCurState().equals("Original")) {
if(tgt.isDoubleFaced()) {
tgt.setState("Transformed");
}
}
}
else if(abilityFactory.getMapParams().containsKey("Flip"))
{
if(tgt.getCurState().equals("Flipped")) {
tgt.setState("Original");
}
else if(tgt.hasAlternateState()) {
if(tgt.isFlip() && tgt.getCurState().equals("Original")) {
tgt.setState("Flipped");
}
}
}
else
{
tgt.setState(abilityFactory.getMapParams().get("NewState"));
}
}
}
@@ -209,7 +234,7 @@ public class AbilityFactoryChangeState {
* the aF
* @return the change state all ability
*/
public static SpellAbility getChangeStateAllAbility(final AbilityFactory abilityFactory) {
public static SpellAbility getSetStateAllAbility(final AbilityFactory abilityFactory) {
final SpellAbility ret = new AbilityActivated(abilityFactory.getHostCard(), abilityFactory.getAbCost(),
abilityFactory.getAbTgt()) {
@@ -217,12 +242,12 @@ public class AbilityFactoryChangeState {
@Override
public String getStackDescription() {
return AbilityFactoryChangeState.changeStateAllStackDescription(abilityFactory, this);
return AbilityFactorySetState.setStateAllStackDescription(abilityFactory, this);
}
@Override
public void resolve() {
AbilityFactoryChangeState.changeStateAllResolve(abilityFactory, this);
AbilityFactorySetState.setStateAllResolve(abilityFactory, this);
}
};
@@ -237,19 +262,19 @@ public class AbilityFactoryChangeState {
* the aF
* @return the change state all spell
*/
public static SpellAbility getChangeStateAllSpell(final AbilityFactory abilityFactory) {
public static SpellAbility getSetStateAllSpell(final AbilityFactory abilityFactory) {
final SpellAbility ret = new Spell(abilityFactory.getHostCard()) {
private static final long serialVersionUID = 4217632586060204603L;
@Override
public String getStackDescription() {
return AbilityFactoryChangeState.changeStateAllStackDescription(abilityFactory, this);
return AbilityFactorySetState.setStateAllStackDescription(abilityFactory, this);
}
@Override
public void resolve() {
AbilityFactoryChangeState.changeStateAllResolve(abilityFactory, this);
AbilityFactorySetState.setStateAllResolve(abilityFactory, this);
}
};
@@ -263,14 +288,14 @@ public class AbilityFactoryChangeState {
* the aF
* @return the change state all drawback
*/
public static SpellAbility getChangeStateAllDrawback(final AbilityFactory abilityFactory) {
public static SpellAbility getSetStateAllDrawback(final AbilityFactory abilityFactory) {
final AbilitySub ret = new AbilitySub(abilityFactory.getHostCard(), abilityFactory.getAbTgt()) {
private static final long serialVersionUID = 4047514893482113436L;
@Override
public String getStackDescription() {
return AbilityFactoryChangeState.changeStateAllStackDescription(abilityFactory, this);
return AbilityFactorySetState.setStateAllStackDescription(abilityFactory, this);
}
@Override
@@ -292,7 +317,7 @@ public class AbilityFactoryChangeState {
@Override
public void resolve() {
AbilityFactoryChangeState.changeStateAllResolve(abilityFactory, this);
AbilityFactorySetState.setStateAllResolve(abilityFactory, this);
}
};
@@ -300,7 +325,7 @@ public class AbilityFactoryChangeState {
return ret;
}
private static void changeStateAllResolve(final AbilityFactory abilityFactory, final SpellAbility sa) {
private static void setStateAllResolve(final AbilityFactory abilityFactory, final SpellAbility sa) {
final HashMap<String, String> params = abilityFactory.getMapParams();
final Card card = sa.getSourceCard();
@@ -338,13 +363,43 @@ public class AbilityFactoryChangeState {
}
for (int i = 0; i < list.size(); i++) {
if (list.get(i).changeState()) {
card.addRemembered(list.get(i));
String mode = list.get(i).getCurState();
if(list.get(i).isDoubleFaced()) {
if(list.get(i).getCurState().equals("Original"))
{
mode = "Transformed";
}
else {
mode = "Original";
}
if(list.get(i).setState(mode) && remChanged) {
card.addRemembered(list.get(i));
}
}
else if(list.get(i).isFlip()) {
if(list.get(i).getCurState().equals("Original"))
{
mode = "Flipped";
}
else if(list.get(i).getCurState().equals("Flipped")){
mode = "Original";
}
if(list.get(i).setState(mode) && remChanged) {
card.addRemembered(list.get(i));
}
}
else {
if(list.get(i).setState(abilityFactory.getMapParams().get("NewState")) && remChanged) {
card.addRemembered(list.get(i));
}
}
}
}
private static String changeStateAllStackDescription(final AbilityFactory abilityFactory, final SpellAbility sa) {
private static String setStateAllStackDescription(final AbilityFactory abilityFactory, final SpellAbility sa) {
final Card host = abilityFactory.getHostCard();
final Map<String, String> params = abilityFactory.getMapParams();

View File

@@ -171,11 +171,14 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
CardFactoryUtil.copyCharacteristics(in, out);
if (in.hasAlternateState()) {
in.changeState();
out.changeState();
CardFactoryUtil.copyCharacteristics(in, out);
in.changeState();
out.changeState();
String curState = in.getCurState();
for(String state : in.getStates()) {
in.setState(state);
out.setState(state);
CardFactoryUtil.copyCharacteristics(in, out);
}
in.setState(curState);
out.setState(curState);
}
// I'm not sure if we really should be copying enchant/equip stuff over.
@@ -480,7 +483,7 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
card.addColor(card.getManaCost());
}
// may have to change the spell
// this is so permanents like creatures and artifacts have a "default"
// spell
if (card.isPermanent() && !card.isLand() && !card.isAura()) {
@@ -500,15 +503,18 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
}
if (card.hasAlternateState()) {
card.changeState();
this.addAbilityFactoryAbilities(card);
stAbs = card.getStaticAbilityStrings();
if (stAbs.size() > 0) {
for (int i = 0; i < stAbs.size(); i++) {
card.addStaticAbility(stAbs.get(i));
for(String state : card.getStates()) {
card.setState(state);
this.addAbilityFactoryAbilities(card);
stAbs = card.getStaticAbilityStrings();
if (stAbs.size() > 0) {
for (int i = 0; i < stAbs.size(); i++) {
card.addStaticAbility(stAbs.get(i));
}
}
}
card.changeState();
card.setState("Original");
}
// ******************************************************************

View File

@@ -2225,24 +2225,10 @@ public class CardFactoryCreatures {
else if (cardName.equals("Clone") || cardName.equals("Vesuvan Doppelganger")
|| cardName.equals("Quicksilver Gargantuan") || cardName.equals("Jwari Shapeshifter")
|| cardName.equals("Phyrexian Metamorph") || cardName.equals("Phantasmal Image")
|| cardName.equals("Body Double") || cardName.equals("Evil Twin")) {
|| cardName.equals("Body Double") || cardName.equals("Evil Twin")
|| cardName.equals("Sakashima the Impostor")) {
final CardFactoryInterface cfact = cf;
final Card[] copyTarget = new Card[1];
final Card[] cloned = new Card[1];
final Command leaves = new Command() {
private static final long serialVersionUID = 8590474793502538215L;
@Override
public void execute() {
final Card orig = cfact.getCard(card.getName(), card.getController());
final PlayerZone dest = AllZone.getZoneOf(card.getCurrentlyCloningCard());
AllZone.getGameAction().moveTo(dest, orig);
dest.remove(card.getCurrentlyCloningCard());
}
};
final SpellAbility copy = new Spell(card) {
private static final long serialVersionUID = 4496978456522751302L;
@@ -2257,107 +2243,80 @@ public class CardFactoryCreatures {
}
if (copyTarget[0] != null) {
final boolean wasInAlt = copyTarget[0].isInAlternateState();
/*
* This cannot just be copyStats with an addSpellAbility
* loop from copyTarget[0]. Unless we get a
* copySpellAbility. Adding the SpellAbility from the
* source card causes many weird and Bad Things to
* happen.
*/
try {
if (wasInAlt) {
copyTarget[0].changeState();
}
cloned[0] = cfact.getCard(copyTarget[0].getName(), card.getController());
if (wasInAlt) {
cloned[0].setImageFilename(copyTarget[0].getImageFilename());
copyTarget[0].changeState();
}
} catch (final RuntimeException re) {
// the copyTarget was not found in CardFactory
cloned[0] = CardFactoryUtil.copyStats(copyTarget[0]);
Card cloned;
cloned = cfact.getCard(copyTarget[0].getState("Original").getName(), card.getOwner());
card.addAlternateState("Cloner");
card.switchStates("Original", "Cloner");
card.setState("Original");
if(copyTarget[0].getCurState().equals("Transformed") && copyTarget[0].isDoubleFaced()) {
cloned.setState("Transformed");
}
cloned[0].setOwner(card.getController());
cloned[0].addController(card.getController());
if (cardName.equals("Phyrexian Metamorph")) {
cloned[0].addType("Artifact");
}
if (cardName.equals("Phantasmal Image")) {
cloned[0].addType("Illusion");
}
cloned[0].setCloneOrigin(card);
cloned[0].addLeavesPlayCommand(leaves);
cloned[0].setCloneLeavesPlayCommand(leaves);
cloned[0].setCurSetCode(copyTarget[0].getCurSetCode());
CardFactoryUtil.copyCharacteristics(cloned,card);
this.grantExtras();
if (copyTarget[0].isDoubleFaced()) { // Cloned DFC's
// can't transform
if (wasInAlt) {
cloned[0].changeState();
}
cloned[0].clearOtherState();
//If target is a flipped card, also copy the flipped state.
if(copyTarget[0].isFlip()) {
cloned.setState("Flipped");
cloned.setImageFilename(CardUtil.buildFilename(cloned));
card.addAlternateState("Flipped");
card.setState("Flipped");
CardFactoryUtil.copyCharacteristics(cloned,card);
this.grantExtras();
card.setFlip(true);
card.setState("Original");
}
if (copyTarget[0].isFlip()) { // Cloned Flips CAN flip.
cloned[0].changeState();
copyTarget[0].changeState();
cloned[0].setImageFilename(copyTarget[0].getImageFilename());
if (!copyTarget[0].isInAlternateState()) {
cloned[0].changeState();
}
copyTarget[0].changeState();
else {
card.setFlip(false);
}
if (cardName.equals("Vesuvan Doppelganger")) {
final StringBuilder sb = new StringBuilder();
sb.append("At the beginning of your upkeep, you may have ");
sb.append("this creature become a copy of target creature ");
sb.append("except it doesn't copy that creature's color. ");
sb.append("If you do, this creature gains this ability.");
cloned[0].addExtrinsicKeyword(sb.toString());
cloned[0].addColor("U", cloned[0], false, true);
} else if (cardName.equals("Quicksilver Gargantuan")) {
cloned[0].setBaseDefense(7);
cloned[0].setBaseAttack(7);
} else if (cardName.equals("Phantasmal Image")) {
final StringBuilder trigScript = new StringBuilder();
trigScript.append("Mode$ BecomesTarget | ValidTarget$ Card.Self | ");
trigScript.append("TriggerZones$ Battlefield | Execute$ ");
final StringBuilder svarName = new StringBuilder("TrigSac");
// Couple of hoops to jump through to make sure no
// svar is overwritten.
int iter = 0;
while (cloned[0].getSVar(svarName.toString()) != "") {
iter++;
if (svarName.length() == 7) {
svarName.append(iter);
} else {
svarName.delete(8, svarName.length());
svarName.append(iter);
}
}
trigScript.append(svarName.toString());
trigScript.append(" | TriggerDescription$ When this creature ");
trigScript.append("becomes the target of a spell or ability, sacrifice it.");
cloned[0].addTrigger(forge.card.trigger.TriggerHandler.parseTrigger(trigScript.toString(),
card, true));
cloned[0].setSVar(svarName.toString(), "AB$Sacrifice | Cost$ 0 | Defined$ Self");
}
if (cardName.equals("Evil Twin")) {
final AbilityFactory abilityFactory = new AbilityFactory();
final StringBuilder sbET = new StringBuilder();
sbET.append("AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | ");
sbET.append("TgtPrompt$ Select target creature with the same name. | ");
sbET.append("SpellDescription$ Destroy target creature with the same name as this creature.");
final SpellAbility destroySameName = abilityFactory.getAbility(sbET.toString(), cloned[0]);
cloned[0].addSpellAbility(destroySameName);
}
AllZone.getGameAction().moveToPlayFromHand(cloned[0]);
card.setCurrentlyCloningCard(cloned[0]);
}
AllZone.getGameAction().moveToPlay(card);
}
private void grantExtras() {
//Grant stuff from specific cloners
if(cardName.equals("Vesuvan Doppelganger")) {
final String keyword = "At the beginning of your upkeep, you may have this "
+ "creature become a copy of target creature except it doesn't copy that "
+ "creature's color. If you do, this creature gains this ability.";
card.addIntrinsicKeyword(keyword);
card.addColor("U");
}
else if(cardName.equals("Quicksilver Gargantuan")) {
card.setBaseAttack(7);
card.setBaseDefense(7);
}
else if(cardName.equals("Phyrexian Metamorph")) {
card.addType("Artifact");
}
else if(cardName.equals("Phantasmal Image")) {
Trigger t = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ TrigSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it.", card, true);
card.addTrigger(t);
card.setSVar("TrigSac", "AB$Sacrifice | Cost$ 0 | Defined$ Self");
}
else if(cardName.equals("Evil Twin")) {
AbilityFactory af = new AbilityFactory();
SpellAbility ab = af.getAbility("AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature.", card);
card.addSpellAbility(ab);
}
else if(cardName.equals("Sakashima the Impostor")) {
AbilityFactory af = new AbilityFactory();
SpellAbility ab = af.getAbility("AB$DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | TriggerDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step.",card);
card.addSpellAbility(ab);
card.setSVar("TrigReturnSak","AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand");
card.setName("Sakashima the Impostor");
card.addType("Legendary");
}
}
}; // SpellAbility
@@ -2735,6 +2694,35 @@ public class CardFactoryCreatures {
ability.setStackDescription(sbStack.toString());
} // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Ixidron")) {
Trigger tfdTrigger = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, turn all other nontoken creatures face down. (They're 2/2 creatures.)", card, true);
final SpellAbility triggeredAbility = new Ability(card, "0") {
@Override
public void resolve() {
CardList creatsInPlay = AllZoneUtil.getCreaturesInPlay();
creatsInPlay = creatsInPlay.filter(new CardListFilter() {
@Override
public boolean addCard(Card c) {
return !c.isToken() && !c.equals(card);
}
});
for(Card c : creatsInPlay) {
c.turnFaceDown();
}
}
};
tfdTrigger.setOverridingAbility(triggeredAbility);
card.addTrigger(tfdTrigger);
} // *************** END ************ END **************************
// ***************************************************
// end of card specific code
// ***************************************************

View File

@@ -918,20 +918,9 @@ public class CardFactoryUtil {
@Override
public void resolve() {
// card.setName("Morph");
sourceCard.setIsFaceDown(true);
sourceCard.setManaCost("");
sourceCard.setColor(new ArrayList<CardColor>()); // remove all
// colors
sourceCard.addColor("0");
sourceCard.setBaseAttack(2);
sourceCard.setBaseDefense(2);
sourceCard.turnFaceDown();
sourceCard.comesIntoPlay();
sourceCard.setIntrinsicKeyword(new ArrayList<String>()); // remove
// all
// keywords
sourceCard.setType(new ArrayList<String>()); // remove all types
sourceCard.addType("Creature");
AllZone.getGameAction().moveToPlay(sourceCard);
}
@@ -979,15 +968,8 @@ public class CardFactoryUtil {
@Override
public void resolve() {
// card.setName("Morph");
sourceCard.setIsFaceDown(false);
sourceCard.setManaCost(origManaCost);
sourceCard.addColor(origManaCost);
sourceCard.setBaseAttack(attack);
sourceCard.setBaseDefense(defense);
sourceCard.setIntrinsicKeyword(sourceCard.getPrevIntrinsicKeyword());
sourceCard.setType(sourceCard.getPrevType());
sourceCard.turnFaceUp();
// Run triggers
final Map<String, Object> runParams = new TreeMap<String, Object>();
runParams.put("Card", sourceCard);
@@ -998,6 +980,7 @@ public class CardFactoryUtil {
public boolean canPlay() {
// unMorphing a card is a Special Action, and not affected by
// Linvala
Card c = sourceCard;
return sourceCard.getController().equals(this.getActivatingPlayer()) && sourceCard.isFaceDown()
&& AllZoneUtil.isCardInPlay(sourceCard);
}
@@ -4235,12 +4218,16 @@ public class CardFactoryUtil {
CardFactoryUtil.copyCharacteristics(sim, c);
if (sim.hasAlternateState()) {
c.addAlternateState();
c.changeState();
sim.changeState();
CardFactoryUtil.copyCharacteristics(sim, c);
c.changeState();
sim.changeState();
String origState = sim.getCurState();
for(String state : sim.getStates()) {
c.addAlternateState(state);
c.setState(state);
sim.setState(state);
CardFactoryUtil.copyCharacteristics(sim, c);
}
sim.setState(origState);
c.setState(origState);
}
c.setFlip(sim.isFlip());
@@ -4278,7 +4265,7 @@ public class CardFactoryUtil {
to.setImageFilename(from.getImageFilename());
to.setTriggers(from.getTriggers());
to.setStaticAbilityStrings(from.getStaticAbilityStrings());
}
/**
@@ -5124,8 +5111,13 @@ public class CardFactoryUtil {
final String orgManaCost = card.getManaCost();
card.addSpellAbility(CardFactoryUtil.abilityMorphUp(card, cost, orgManaCost, attack, defense));
card.addSpellAbility(CardFactoryUtil.abilityMorphDown(card));
card.turnFaceDown();
card.addSpellAbility(CardFactoryUtil.abilityMorphUp(card, cost, orgManaCost, attack, defense));
card.turnFaceUp();
}
} // Morph

View File

@@ -122,7 +122,7 @@ public class CardPanelHeavy extends CardPanelBase {
public final void setCard(final Card c) {
if (this.picture.getCard() != null) {
if (this.picture.getCard().isInAlternateState()) {
this.picture.getCard().changeState();
this.picture.getCard().setState("Original");
}
}
this.picture.setCard(c);
@@ -149,7 +149,17 @@ public class CardPanelHeavy extends CardPanelBase {
*/
final void changeStateButtonActionPerformed(final ActionEvent e) {
final Card cur = this.picture.getCard();
cur.changeState();
if(cur.isInAlternateState()) {
cur.setState("Original");
}
else {
if(cur.isFlip()) {
cur.setState("Flipped");
}
if(cur.isDoubleFaced()) {
cur.setState("Transformed");
}
}
this.picture.setCard(cur);
this.detail.setCard(cur);

View File

@@ -110,7 +110,15 @@ public class CardPanelLite extends CardPanelBase {
private void bChangeStateActionPerformed(final ActionEvent e) {
final Card cur = this.detail.getCard();
if (cur != null) {
cur.changeState();
if(cur.isDoubleFaced()) {
if(cur.getCurState().equals("Transformed"))
{
cur.setState("Original");
}
else {
cur.setState("Transformed");
}
}
this.setCard(cur);
}

View File

@@ -267,10 +267,15 @@ public final class CardPrinted implements Comparable<CardPrinted>, InventoryItem
c.setCurSetCode(this.getSet());
c.setRandomPicture(this.artIndex + 1);
c.setImageFilename(this.getImageFilename());
if (c.hasAlternateState()) {
c.changeState();
if (c.isFlip()) {
c.setState("Flipped");
c.setImageFilename(CardUtil.buildFilename(c));
c.changeState();
c.setState("Original");
}
if (c.isDoubleFaced()) {
c.setState("Transformed");
c.setImageFilename(CardUtil.buildFilename(c));
c.setState("Original");
}
}
// else throw "Unsupported card";