From d277ba04200b24efcb0bb438afa2c8ab459940e9 Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 17 Nov 2018 09:40:54 +0300 Subject: [PATCH 1/2] - Added puzzle PS_GRN6. --- forge-gui/res/puzzle/PS_GRN6.pzl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 forge-gui/res/puzzle/PS_GRN6.pzl diff --git a/forge-gui/res/puzzle/PS_GRN6.pzl b/forge-gui/res/puzzle/PS_GRN6.pzl new file mode 100644 index 00000000000..b4da1658c06 --- /dev/null +++ b/forge-gui/res/puzzle/PS_GRN6.pzl @@ -0,0 +1,17 @@ +[metadata] +Name:Possibility Storm - Guilds of Ravnica #06 +URL:https://i1.wp.com/www.possibilitystorm.com/wp-content/uploads/2018/11/088.-GRN6.jpg +Goal:Win +Turns:1 +Difficulty:Uncommon +Description:Win this turn. Assume any cards that could be drawn are irrelevant to the puzzle. +[state] +humanlife=20 +ailife=3 +turn=1 +activeplayer=human +activephase=MAIN1 +humanhand=Arcane Flight;Huatli, Warrior Poet;Disperse;Curious Obsession;Sea Legs +humanlibrary=Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog;Fog +humanbattlefield=Surge Mare|Id:5;Helm of the Host|Attaching:5;Valduk, Keeper of the Flame;Divine Visitation;Steam Vents|NoETBTrigs;Steam Vents|NoETBTrigs;Steam Vents|NoETBTrigs;Glacial Fortress;Glacial Fortress;t:Angel,P:4,T:4,Cost:no cost,Color:W,Types:Creature-Angel,Keywords:Flying-Vigilance,Image:w_4_4_angel_flying_vigilance_grn +aibattlefield=Murmuring Mystic;t:Bird Illusion,P:1,T:1,Cost:no cost,Color:U,Types:Creature-Bird-Illusion,Keywords:Flying,Image:u_1_1_bird_illusion_flying_grn;t:Bird Illusion,P:1,T:1,Cost:no cost,Color:U,Types:Creature-Bird-Illusion,Keywords:Flying,Image:u_1_1_bird_illusion_flying_grn;t:Bird Illusion,P:1,T:1,Cost:no cost,Color:U,Types:Creature-Bird-Illusion,Keywords:Flying,Image:u_1_1_bird_illusion_flying_grn;t:Bird Illusion,P:1,T:1,Cost:no cost,Color:U,Types:Creature-Bird-Illusion,Keywords:Flying,Image:u_1_1_bird_illusion_flying_grn;t:Bird Illusion,P:1,T:1,Cost:no cost,Color:U,Types:Creature-Bird-Illusion,Keywords:Flying,Image:u_1_1_bird_illusion_flying_grn;Dreamcaller Siren From 8b566c0bbbdaf6734032e9654c19f1a3421c80b5 Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 17 Nov 2018 10:08:11 +0300 Subject: [PATCH 2/2] - Dev mode: added a way to add a card to top of the library instead of the bottom. - Fixed a bug that caused the zone index not to be accounted for during changeZone (not sure how many things were affected by this, but it prevented putting a card on top of the library via moveToLibrary). --- .../src/main/java/forge/game/zone/Zone.java | 2 +- .../forge/player/PlayerControllerHuman.java | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/forge-game/src/main/java/forge/game/zone/Zone.java b/forge-game/src/main/java/forge/game/zone/Zone.java index 6e887369fd2..35f9f785410 100644 --- a/forge-game/src/main/java/forge/game/zone/Zone.java +++ b/forge-game/src/main/java/forge/game/zone/Zone.java @@ -77,7 +77,7 @@ public class Zone implements java.io.Serializable, Iterable { } public final void add(final Card c, final Integer index) { - add(c, null, null); + add(c, index, null); } public void add(final Card c, final Integer index, final Card latestState) { diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index 4f12d185493..ad37ec775f2 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -1937,6 +1937,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont private SpellAbility lastAddedSA; private boolean lastTrigs; private boolean lastSummoningSickness; + private boolean lastTopOfTheLibrary; private DevModeCheats() { } @@ -2347,9 +2348,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont game.getAction().invoke(new Runnable() { @Override public void run() { - if (targetZone != ZoneType.Battlefield) { - game.getAction().moveTo(targetZone, forgeCard, null); - } else { + if (targetZone == ZoneType.Battlefield) { if (noTriggers) { if (forgeCard.isPermanent() && !forgeCard.isAura()) { if (forgeCard.isCreature()) { @@ -2405,6 +2404,18 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont // playSa could fire some triggers game.getStack().addAllTriggeredAbilitiesToStack(); } + } else if (targetZone == ZoneType.Library) { + if (!repeatLast) { + lastTopOfTheLibrary = getGui().confirm(forgeCard.getView(), + TextUtil.concatWithSpace("Should", forgeCard.toString(), "be added to the top or to the bottom of the library?"), true, Arrays.asList("Top", "Bottom")); + } + if (lastTopOfTheLibrary) { + game.getAction().moveToLibrary(forgeCard, null, null); + } else { + game.getAction().moveToBottomOfLibrary(forgeCard, null, null); + } + } else { + game.getAction().moveTo(targetZone, forgeCard, null); } lastAdded = f;