diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index dd35bf5ad53..0c985d805ea 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -1602,9 +1602,7 @@ public class GameAction { } // recheck the game over condition at this point to make sure no other win conditions apply now. - if (!game.isGameOver()) { - checkGameOverCondition(); - } + checkGameOverCondition(); if (game.getAge() != GameStage.Play) { return false; @@ -1885,6 +1883,10 @@ public class GameAction { } public void checkGameOverCondition() { + if (game.isGameOver()) { + return; + } + // award loses as SBE GameEndReason reason = null; List losers = null; diff --git a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java index 96bc1c9c6e1..f9e8358fa23 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -1069,7 +1069,7 @@ public abstract class SpellAbilityEffect { // if ability was granted use that source so they can be kept apart later if (cause.isCopiedTrait()) { exilingSource = cause.getOriginalHost(); - } else if (cause.getKeyword() != null && cause.getKeyword().getStatic() != null) { + } else if (!cause.isSpell() && cause.getKeyword() != null && cause.getKeyword().getStatic() != null) { exilingSource = cause.getKeyword().getStatic().getOriginalHost(); } movedCard.setExiledWith(exilingSource); diff --git a/forge-game/src/main/java/forge/game/cost/Cost.java b/forge-game/src/main/java/forge/game/cost/Cost.java index dec565a9282..8cf784c6e7e 100644 --- a/forge-game/src/main/java/forge/game/cost/Cost.java +++ b/forge-game/src/main/java/forge/game/cost/Cost.java @@ -237,17 +237,17 @@ public class Cost implements Serializable { CostPartMana parsedMana = null; for (String part : parts) { if (part.startsWith("XMin")) { - xMin = (part); + xMin = part; } else if ("Mandatory".equals(part)) { this.isMandatory = true; } else { CostPart cp = parseCostPart(part, tapCost, untapCost); if (null != cp) - if (cp instanceof CostPartMana) { - parsedMana = (CostPartMana) cp; + if (cp instanceof CostPartMana p) { + parsedMana = p; } else { - if (cp instanceof CostPartWithList) { - ((CostPartWithList)cp).setIntrinsic(intrinsic); + if (cp instanceof CostPartWithList p) { + p.setIntrinsic(intrinsic); } this.costParts.add(cp); } diff --git a/forge-gui/res/cardsfolder/a/aladdins_lamp.txt b/forge-gui/res/cardsfolder/a/aladdins_lamp.txt index 98413ef0f7d..fbc2487a83d 100644 --- a/forge-gui/res/cardsfolder/a/aladdins_lamp.txt +++ b/forge-gui/res/cardsfolder/a/aladdins_lamp.txt @@ -1,14 +1,12 @@ Name:Aladdin's Lamp ManaCost:10 Types:Artifact -A:AB$ StoreSVar | Cost$ XMin1 X T | SVar$ DigNum | Type$ Count | Expression$ xPaid | SubAbility$ TheMagic | SpellDescription$ The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0. -SVar:TheMagic:DB$ Effect | Name$ Aladdin's Wish | ReplacementEffects$ DrawReplace +A:AB$ Effect | Cost$ XMin1 X T | Name$ Aladdin's Wish | ReplacementEffects$ DrawReplace | SetChosenNumber$ X | SpellDescription$ The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0. SVar:DrawReplace:Event$ Draw | ValidPlayer$ You | ReplaceWith$ AladdinDraw | Description$ The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. -SVar:AladdinDraw:DB$ Dig | DigNum$ DigNum | ChangeNum$ 1 | RestRandomOrder$ True | DestinationZone$ Library | LibraryPosition$ 0 | SubAbility$ DBDraw +SVar:AladdinDraw:DB$ Dig | DigNum$ Count$ChosenNumber | ChangeNum$ 1 | RestRandomOrder$ True | DestinationZone$ Library | LibraryPosition$ 0 | SubAbility$ DBDraw SVar:DBDraw:DB$ Draw | SubAbility$ ExileEffect SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:X:Count$xPaid -SVar:DigNum:Number$0 AI:RemoveDeck:Random AI:RemoveDeck:All Oracle:{X}, {T}: The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0. diff --git a/forge-gui/res/cardsfolder/d/droning_bureaucrats.txt b/forge-gui/res/cardsfolder/d/droning_bureaucrats.txt index 57d193f3a96..31de2a29884 100644 --- a/forge-gui/res/cardsfolder/d/droning_bureaucrats.txt +++ b/forge-gui/res/cardsfolder/d/droning_bureaucrats.txt @@ -2,10 +2,8 @@ Name:Droning Bureaucrats ManaCost:3 W Types:Creature Human Advisor PT:1/4 -A:AB$ StoreSVar | Cost$ X T | SVar$ DroningX | Type$ Count | Expression$ xPaid | SubAbility$ CreateDroningEffect | SpellDescription$ Each creature with mana value X can't attack or block this turn. -SVar:CreateDroningEffect:DB$ Effect | StaticAbilities$ NoCombat -SVar:NoCombat:Mode$ Continuous | Affected$ Creature.cmcEQDroningX | AddHiddenKeyword$ CARDNAME can't attack or block. | Description$ Each creature with mana value X can't attack or block this turn. +A:AB$ Effect | Cost$ X T | StaticAbilities$ NoCombat | SetChosenNumber$ X | SpellDescription$ Each creature with mana value X can't attack or block this turn. +SVar:NoCombat:Mode$ Continuous | Affected$ Creature.cmcChosen | AddHiddenKeyword$ CARDNAME can't attack or block. | Description$ Each creature with mana value X can't attack or block this turn. SVar:X:Count$xPaid -SVar:DroningX:Number$0 AI:RemoveDeck:All Oracle:{X}, {T}: Each creature with mana value X can't attack or block this turn.