Two Topsy Turvies cancel out

This commit is contained in:
Adam Pantel
2021-03-20 15:30:17 -04:00
parent 8643503082
commit 05547bfda6
3 changed files with 5 additions and 4 deletions

View File

@@ -435,7 +435,7 @@ public class Game {
* The Direction in which the turn order of this Game currently proceeds.
*/
public final Direction getTurnOrder() {
if (phaseHandler.getPlayerTurn() != null && phaseHandler.getPlayerTurn().hasKeyword("The turn order is reversed.")) {
if (phaseHandler.getPlayerTurn() != null && phaseHandler.getPlayerTurn().getAmountOfKeyword("The turn order is reversed.") % 2 == 1) {
return turnOrder.getOtherDirection();
}
return turnOrder;

View File

@@ -20,7 +20,7 @@ public class AddPhaseEffect extends SpellAbilityEffect {
@Override
public void resolve(SpellAbility sa) {
boolean isTopsy = sa.getActivatingPlayer().hasKeyword("The phases of your turn are reversed.");
boolean isTopsy = sa.getActivatingPlayer().getAmountOfKeyword("The phases of your turn are reversed.") % 2 == 1;
PhaseHandler phaseHandler = sa.getActivatingPlayer().getGame().getPhaseHandler();
PhaseType currentPhase = phaseHandler.getPhase();

View File

@@ -167,7 +167,7 @@ public class PhaseHandler implements java.io.Serializable {
private void advanceToNextPhase() {
PhaseType oldPhase = phase;
boolean isTopsy = playerTurn.hasKeyword("The phases of your turn are reversed.");
boolean isTopsy = playerTurn.getAmountOfKeyword("The phases of your turn are reversed.") % 2 == 1;
boolean turnEnded = false;
if (bRepeatCleanup) { // for when Cleanup needs to repeat itself
@@ -1154,7 +1154,8 @@ public class PhaseHandler implements java.io.Serializable {
}
public final boolean devAdvanceToPhase(PhaseType targetPhase) {
while (phase.isBefore(targetPhase, playerTurn.hasKeyword("The phases of your turn are reversed."))) {
boolean isTopsy = playerTurn.getAmountOfKeyword("The phases of your turn are reversed.") % 2 == 1;
while (phase.isBefore(targetPhase, isTopsy)) {
if (checkStateBasedEffects()) {
return false;
}