Merge branch 'puzzle-engine' into 'master'

Added puzzle PS_GRN6, added a way to put a card on top of the library in dev mode.

See merge request core-developers/forge!1109
This commit is contained in:
Michael Kamensky
2018-11-17 07:09:04 +00:00
3 changed files with 32 additions and 4 deletions

View File

@@ -77,7 +77,7 @@ public class Zone implements java.io.Serializable, Iterable<Card> {
} }
public final void add(final Card c, final Integer index) { 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) { public void add(final Card c, final Integer index, final Card latestState) {

View File

@@ -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

View File

@@ -1937,6 +1937,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
private SpellAbility lastAddedSA; private SpellAbility lastAddedSA;
private boolean lastTrigs; private boolean lastTrigs;
private boolean lastSummoningSickness; private boolean lastSummoningSickness;
private boolean lastTopOfTheLibrary;
private DevModeCheats() { private DevModeCheats() {
} }
@@ -2347,9 +2348,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
game.getAction().invoke(new Runnable() { game.getAction().invoke(new Runnable() {
@Override @Override
public void run() { public void run() {
if (targetZone != ZoneType.Battlefield) { if (targetZone == ZoneType.Battlefield) {
game.getAction().moveTo(targetZone, forgeCard, null);
} else {
if (noTriggers) { if (noTriggers) {
if (forgeCard.isPermanent() && !forgeCard.isAura()) { if (forgeCard.isPermanent() && !forgeCard.isAura()) {
if (forgeCard.isCreature()) { if (forgeCard.isCreature()) {
@@ -2405,6 +2404,18 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
// playSa could fire some triggers // playSa could fire some triggers
game.getStack().addAllTriggeredAbilitiesToStack(); 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; lastAdded = f;