diff --git a/forge-game/src/main/java/forge/game/ability/effects/RestartGameEffect.java b/forge-game/src/main/java/forge/game/ability/effects/RestartGameEffect.java index 4641d05d75f..61848eba1f3 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/RestartGameEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/RestartGameEffect.java @@ -70,6 +70,7 @@ public class RestartGameEffect extends SpellAbilityEffect { player.setStartingLife(psc.getStartingLife()); player.setPoisonCounters(0, sa.getHostCard()); + player.resetSpellCastThisGame(); player.setLandsPlayedLastTurn(0); player.resetLandsPlayedThisTurn(); player.resetInvestigatedThisTurn(); diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index dde9459e34d..4490a81a8e4 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -917,6 +917,10 @@ public class CardFactoryUtil { return doXMath(cc.getSurveilThisTurn(), m, c); } + if (sq[0].equals("YouCastThisGame")) { + return doXMath(cc.getSpellsCastThisGame(), m, c); + } + if (sq[0].equals("FirstSpellTotalManaSpent")) { try{ return doXMath(c.getFirstSpellAbility().getTotalManaSpent(), m, c); @@ -926,6 +930,7 @@ public class CardFactoryUtil { } } + if (sq[0].equals("StormCount")) { return doXMath(game.getStack().getSpellsCastThisTurn().size() - 1, m, c); } diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index f03e5a075a7..b7aec94aa23 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -84,6 +84,7 @@ public class Player extends GameEntity implements Comparable { private final Map assignedDamage = Maps.newHashMap(); private final Map assignedCombatDamage = Maps.newHashMap(); private int spellsCastThisTurn = 0; + private int spellsCastThisGame = 0; private int spellsCastLastTurn = 0; private int landsPlayedThisTurn = 0; private int landsPlayedLastTurn = 0; @@ -2209,6 +2210,7 @@ public class Player extends GameEntity implements Comparable { } public final void addSpellCastThisTurn() { spellsCastThisTurn++; + spellsCastThisGame++; achievementTracker.spellsCast++; if (spellsCastThisTurn > achievementTracker.maxStormCount) { achievementTracker.maxStormCount = spellsCastThisTurn; @@ -2220,7 +2222,12 @@ public class Player extends GameEntity implements Comparable { public final void setSpellsCastLastTurn(int num) { spellsCastLastTurn = num; } - + public final int getSpellsCastThisGame() { + return spellsCastThisGame; + } + public final void resetSpellCastThisGame() { + spellsCastThisGame = 0; + } public final int getLifeGainedByTeamThisTurn() { return lifeGainedByTeamThisTurn; } diff --git a/forge-gui/res/cardsfolder/upcoming/once_upon_a_time.txt b/forge-gui/res/cardsfolder/upcoming/once_upon_a_time.txt new file mode 100644 index 00000000000..13c6d4baada --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/once_upon_a_time.txt @@ -0,0 +1,7 @@ +Name:Once Upon a Time +ManaCost:1 G +Types:Instant +S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ All | CheckSVar$ X | SVarCompare$ EQ0 | MayPlay$ True | MayPlayWithoutManaCost$ True | Description$ If this spell is the first spell you've cast this game, you may cast it without paying its mana cost. +SVar:X:Count$YouCastThisGame +A:SP$ Dig | Cost$ 1 G | DigNum$ 5 | ChangeNum$ 1 | Optional$ True | ForceRevealToController$ True | ChangeValid$ Card.Creature,Card.Land | RestRandomOrder$ True | SpellDescription$ Look at the top five cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. +Oracle:If this spell is the first spell you've cast this game, you may cast it without paying its mana cost.\nLook at the top five cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.