- Added Sentinel Dispatch

This commit is contained in:
swordshine
2014-08-03 07:28:01 +00:00
parent e0507cfd63
commit c7c75e576b
4 changed files with 26 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ public class PhaseHandler implements java.io.Serializable {
private final transient Map<PhaseType, Stack<PhaseType>> extraPhases = new HashMap<PhaseType, Stack<PhaseType>>();
private int nUpkeepsThisTurn = 0;
private int nUpkeepsThisGame = 0;
private int nCombatsThisTurn = 0;
private boolean bPreventCombatDamageThisTurn = false;
private int planarDiceRolledthisTurn = 0;
@@ -259,6 +260,7 @@ public class PhaseHandler implements java.io.Serializable {
case UPKEEP:
this.nUpkeepsThisTurn++;
this.nUpkeepsThisGame++;
game.getUpkeep().executeUntil(this.getPlayerTurn());
game.getUpkeep().executeAt();
break;
@@ -930,6 +932,17 @@ public class PhaseHandler implements java.io.Serializable {
return (this.nUpkeepsThisTurn == 1);
}
/**
* <p>
* isFirstUpkeepThisGame.
* </p>
*
* @return a boolean.
*/
public final boolean isFirstUpkeepThisGame() {
return (this.nUpkeepsThisGame == 1);
}
/**
* <p>
* isPreCombatMain.

View File

@@ -188,6 +188,12 @@ public abstract class Trigger extends TriggerReplacementBase {
}
}
if (this.mapParams.containsKey("FirstUpkeepThisGame")) {
if (!phaseHandler.isFirstUpkeepThisGame()) {
return false;
}
}
if (this.mapParams.containsKey("FirstCombat")) {
if (!phaseHandler.isFirstCombat()) {
return false;