mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Added a special turn ID correction for puzzles that begin right before the beginning of the human's turn (e.g. INQ01).
- Added support for "Gain Control of Specified Permanents" goal type to Puzzle Mode.
This commit is contained in:
@@ -6,6 +6,7 @@ import forge.game.Game;
|
|||||||
import forge.game.GameType;
|
import forge.game.GameType;
|
||||||
import forge.game.ability.AbilityFactory;
|
import forge.game.ability.AbilityFactory;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
|
import forge.game.phase.PhaseType;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.trigger.Trigger;
|
import forge.game.trigger.Trigger;
|
||||||
import forge.game.trigger.TriggerHandler;
|
import forge.game.trigger.TriggerHandler;
|
||||||
@@ -110,6 +111,10 @@ public class Puzzle extends GameState implements InventoryItem, Comparable<Puzzl
|
|||||||
goalCard.addType("Effect");
|
goalCard.addType("Effect");
|
||||||
goalCard.setOracleText(getGoalDescription());
|
goalCard.setOracleText(getGoalDescription());
|
||||||
|
|
||||||
|
if (game.getPhaseHandler().getPhase() == PhaseType.CLEANUP) {
|
||||||
|
turns++;
|
||||||
|
}
|
||||||
|
|
||||||
// Default goal: win the game; lose on turn X
|
// Default goal: win the game; lose on turn X
|
||||||
String trig = "Mode$ Phase | Phase$ Cleanup | TriggerZones$ Command | Static$ True | " +
|
String trig = "Mode$ Phase | Phase$ Cleanup | TriggerZones$ Command | Static$ True | " +
|
||||||
"TurnCount$ " + turns + " | TriggerDescription$ At the beginning of your cleanup step, you lose the game.";
|
"TurnCount$ " + turns + " | TriggerDescription$ At the beginning of your cleanup step, you lose the game.";
|
||||||
@@ -157,6 +162,20 @@ public class Puzzle extends GameState implements InventoryItem, Comparable<Puzzl
|
|||||||
String countPerm = "Count$Valid " + targets;
|
String countPerm = "Count$Valid " + targets;
|
||||||
goalCard.setSVar("PermCount", countPerm);
|
goalCard.setSVar("PermCount", countPerm);
|
||||||
break;
|
break;
|
||||||
|
case "gain control of specified permanents":
|
||||||
|
if (targets == null) {
|
||||||
|
targets = "Card.inZoneBattlefield+OppCtrl"; // by default, gain control of all opponent's permanents
|
||||||
|
}
|
||||||
|
String trigClear = "Mode$ ChangesController | ValidCards$ " + targets + " | Static$ True | " +
|
||||||
|
"TriggerDescription$ When the last permanent controlled by the opponent leaves the battlefield, you win the game.";
|
||||||
|
String effClear = "DB$ WinsGame | Defined$ You | ConditionCheckSVar$ PermCount | ConditionSVarCompare$ EQ0";
|
||||||
|
final Trigger triggerClear = TriggerHandler.parseTrigger(trigClear, goalCard, true);
|
||||||
|
triggerClear.setOverridingAbility(AbilityFactory.getAbility(effClear, goalCard));
|
||||||
|
goalCard.addTrigger(triggerClear);
|
||||||
|
|
||||||
|
String countOTB = "Count$Valid " + targets;
|
||||||
|
goalCard.setSVar("PermCount", countOTB);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user