diff --git a/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java index 556a2157fa1..83ed95b96b8 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ControlGainEffect.java @@ -143,24 +143,31 @@ public class ControlGainEffect extends SpellAbilityEffect { } if (lose != null) { + final GameCommand loseControl = getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws); if (lose.contains("LeavesPlay")) { - sa.getHostCard().addLeavesPlayCommand(getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws)); + sa.getHostCard().addLeavesPlayCommand(loseControl); } if (lose.contains("Untap")) { - sa.getHostCard().addUntapCommand(getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws)); + sa.getHostCard().addUntapCommand(loseControl); } if (lose.contains("LoseControl")) { - sa.getHostCard().addChangeControllerCommand(getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws)); + sa.getHostCard().addChangeControllerCommand(loseControl); } if (lose.contains("EOT")) { - game.getEndOfTurn().addUntil(getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws)); + game.getEndOfTurn().addUntil(loseControl); tgtC.setSVar("SacMe", "6"); } if (lose.contains("StaticCommandCheck")) { String leftVar = sa.getSVar(sa.getParam("StaticCommandCheckSVar")); String rightVar = sa.getParam("StaticCommandSVarCompare"); - sa.getHostCard().addStaticCommandList(new Object[]{leftVar, rightVar, tgtC, - getLoseControlCommand(tgtC, tStamp, bTapOnLose, source, kws)}); + sa.getHostCard().addStaticCommandList(new Object[]{leftVar, rightVar, tgtC, loseControl}); + } + if (lose.contains("UntilTheEndOfYourNextTurn")) { + if (game.getPhaseHandler().isPlayerTurn(sa.getActivatingPlayer())) { + game.getEndOfTurn().registerUntilEnd(sa.getActivatingPlayer(), loseControl); + } else { + game.getEndOfTurn().addUntilEnd(sa.getActivatingPlayer(), loseControl); + } } } diff --git a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java index e6c9e781eb3..bffeb0cda1e 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java @@ -264,6 +264,13 @@ public class EffectEffect extends SpellAbilityEffect { else if (duration.equals("UntilEndOfCombat")) { game.getEndOfCombat().addUntil(endEffect); } + else if (duration.equals("UntilTheEndOfYourNextTurn")) { + if (game.getPhaseHandler().isPlayerTurn(controller)) { + game.getEndOfTurn().registerUntilEnd(controller, endEffect); + } else { + game.getEndOfTurn().addUntilEnd(controller, endEffect); + } + } else if (duration.equals("ThisTurnAndNextTurn")) { game.getUntap().addAt(new GameCommand() { private static final long serialVersionUID = -5054153666503075717L; diff --git a/forge-game/src/main/java/forge/game/phase/PhaseHandler.java b/forge-game/src/main/java/forge/game/phase/PhaseHandler.java index 3fbde336028..815b3a8c811 100644 --- a/forge-game/src/main/java/forge/game/phase/PhaseHandler.java +++ b/forge-game/src/main/java/forge/game/phase/PhaseHandler.java @@ -372,6 +372,8 @@ public class PhaseHandler implements java.io.Serializable { game.getEndOfCombat().executeUntil(); //Repeat here in case Time Stop et. al. ends combat early game.getEndOfTurn().executeUntil(); + game.getEndOfTurn().executeUntilEndOfPhase(playerTurn); + game.getEndOfTurn().registerUntilEndCommand(playerTurn); for (Player player : game.getPlayers()) { player.onCleanupPhase(); diff --git a/forge-gui/res/cardsfolder/c/commune_with_lava.txt b/forge-gui/res/cardsfolder/c/commune_with_lava.txt index 091bc727b13..1e92a30b3f8 100644 --- a/forge-gui/res/cardsfolder/c/commune_with_lava.txt +++ b/forge-gui/res/cardsfolder/c/commune_with_lava.txt @@ -1,16 +1,10 @@ Name:Commune with Lava ManaCost:X R R Types:Instant -A:SP$ Mill | Cost$ X R R | Defined$ You | NumCards$ X | Destination$ Exile | RememberMilled$ True | References$ X | SubAbility$ DBStoreTurn | SpellDescription$ Exile the top X cards of your library. Until the end of your next turn, you may play those cards. -SVar:DBStoreTurn:DB$ StoreSVar | SVar$ CurrentTurn | Type$ Count | Expression$ YourTurns | SubAbility$ DBMayBePlay -SVar:DBMayBePlay:DB$ Effect | StaticAbilities$ STCommuned | Duration$ Permanent | RememberObjects$ Remembered | Triggers$ TrigDuration | SVars$ DBDuration,EndDuration,CurrentTurn | ForgetOnMoved$ Exile -# Even though the Effect is "Permanent", it's not really permanent +A:SP$ Mill | Cost$ X R R | Defined$ You | NumCards$ X | Destination$ Exile | RememberMilled$ True | References$ X | SubAbility$ DBMayBePlay | SpellDescription$ Exile the top X cards of your library. Until the end of your next turn, you may play those cards. +SVar:DBMayBePlay:DB$ Effect | StaticAbilities$ STCommuned | Duration$ UntilTheEndOfYourNextTurn | RememberObjects$ Remembered | ForgetOnMoved$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:STCommuned:Mode$ Continuous | Affected$ Card.IsRemembered | EffectZone$ Command | AffectedZone$ Exile | MayPlay$ True | Description$ Until the end of your next turn, you may play those cards. -SVar:TrigDuration:Mode$ Phase | Phase$ Cleanup | Static$ True | TriggerZones$ Command | Execute$ DBDuration | CheckSVar$ EndDuration | SVarCompare$ GTCurrentTurn -SVar:DBDuration:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile -SVar:EndDuration:Count$YourTurns -SVar:CurrentTurn:Number$0 SVar:X:Count$xPaid SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/commune_with_lava.jpg diff --git a/forge-gui/res/cardsfolder/n/nimbus_champion.txt b/forge-gui/res/cardsfolder/n/nimbus_champion.txt new file mode 100644 index 00000000000..cb1a1d4771b --- /dev/null +++ b/forge-gui/res/cardsfolder/n/nimbus_champion.txt @@ -0,0 +1,12 @@ +Name:Nimbus Champion +ManaCost:5 U +Types:Creature Avatar Warrior +PT:4/4 +K:Flying +T:Mode$ Attacks | ValidCard$ Card.Self | OptionalDecider$ You | TriggerZones$ Battlefield | Execute$ TrigBounce | TriggerDescription$ Whenever CARDNAME attacks, you may return target creature to its owner's hand if that creature's power is less than or equal to the number of Warriors your team controls. +SVar:TrigBounce:DB$ ChangeZone | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand | IsCurse$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ1 | References$ X,Y +SVar:Y:Count$Valid Warrior.YourTeamCtrl +SVar:X:Targeted$Valid Creature.powerLEY +SVar:HasAttackEffect:TRUE +SVar:BuffedBy:Warrior +Oracle:Flying\nWhenever Nimbus Champion attacks, you may return target creature to its owner’s hand if that creature’s power is less than or equal to the number of Warriors your team controls. diff --git a/forge-gui/res/cardsfolder/p/primordial_mist.txt b/forge-gui/res/cardsfolder/p/primordial_mist.txt new file mode 100644 index 00000000000..3f626ac5b1d --- /dev/null +++ b/forge-gui/res/cardsfolder/p/primordial_mist.txt @@ -0,0 +1,9 @@ +Name:Primordial Mist +ManaCost:4 U +Types:Enchantment +T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigManifest | OptionalDecider$ You | TriggerDescription$ At the beginning of your end step, you may manifest the top card of your library. +SVar:TrigManifest:DB$ Manifest | Amount$ 1 | Defined$ TopOfLibrary +A:AB$ Effect | Cost$ Exile<1/Permanent.faceDown>| RememberObjects$ ExiledCards | StaticAbilities$ Play | SubAbility$ DBCleanup | ExileOnMoved$ Exile | SpellDescription$ Exile a face-down permanent you control face up: You may play that card this turn. (You still pay its costs. Timing rules still apply.) +SVar:Play:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may play remembered card. +SVar:RemAIDeck:True +Oracle:At the beginning of your end step, you may manifest the top card of your library. (Put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)\nExile a face-down permanent you control face up: You may play that card this turn. (You still pay its costs. Timing rules still apply.) diff --git a/forge-gui/res/cardsfolder/s/sage_eye_avengers.txt b/forge-gui/res/cardsfolder/s/sage_eye_avengers.txt index fd8fa8dbdfa..856c1cfb880 100644 --- a/forge-gui/res/cardsfolder/s/sage_eye_avengers.txt +++ b/forge-gui/res/cardsfolder/s/sage_eye_avengers.txt @@ -4,7 +4,7 @@ Types:Creature Djinn Monk PT:4/5 K:Prowess T:Mode$ Attacks | ValidCard$ Card.Self | OptionalDecider$ You | Execute$ TrigBounce | TriggerDescription$ Whenever CARDNAME attacks, you may return target creature to its owner's hand if its power is less than Sage-Eye Avengers's power. -SVar:TrigBounce:DB$ ChangeZone | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand | Curse$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ1 | References$ X,Y +SVar:TrigBounce:DB$ ChangeZone | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand | IsCurse$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ1 | References$ X,Y SVar:Y:Count$CardPower SVar:X:Targeted$Valid Creature.powerLTY SVar:HasAttackEffect:TRUE diff --git a/forge-gui/res/cardsfolder/t/treasure_nabber.txt b/forge-gui/res/cardsfolder/t/treasure_nabber.txt new file mode 100644 index 00000000000..68d2bad4a93 --- /dev/null +++ b/forge-gui/res/cardsfolder/t/treasure_nabber.txt @@ -0,0 +1,7 @@ +Name:Treasure Nabber +ManaCost:2 R +Types:Creature Goblin Rogue +PT:3/2 +T:Mode$ TapsForMana | ValidCard$ Artifact.OppCtrl | TriggerZones$ Battlefield | Execute$ TrigControl | TriggerDescription$ Whenever an opponent taps an artifact for mana, gain control of that artifact until the end of your next turn. +SVar:TrigControl:DB$ GainControl | Defined$ TriggeredCard | LoseControl$ UntilTheEndOfYourNextTurn +Oracle:Whenever an opponent taps an artifact for mana, gain control of that artifact until the end of your next turn.