fix Obeka, Splitter of Seconds' extra phase calling beginning of turn method

This commit is contained in:
Susucre 2024-04-25 12:16:37 +02:00
parent 110e9903f5
commit ff4bd9b430
3 changed files with 41 additions and 5 deletions

View file

@ -2,18 +2,24 @@
package mage.game.turn;
import java.util.UUID;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.events.GameEvent.EventType;
import java.util.UUID;
/**
* @author BetaSteward_at_googlemail.com
*/
public class BeginningPhase extends Phase {
private final boolean isExtra;
public BeginningPhase() {
this(false);
}
public BeginningPhase(boolean isExtra) {
this.type = TurnPhase.BEGINNING;
this.event = EventType.BEGINNING_PHASE;
this.preEvent = EventType.BEGINNING_PHASE_PRE;
@ -21,17 +27,20 @@ public class BeginningPhase extends Phase {
this.steps.add(new UntapStep());
this.steps.add(new UpkeepStep());
this.steps.add(new DrawStep());
this.isExtra = isExtra;
}
@Override
public boolean beginPhase(Game game, UUID activePlayerId) {
game.getBattlefield().beginningOfTurn(game);
if (!isExtra) {
game.getBattlefield().beginningOfTurn(game);
}
return super.beginPhase(game, activePlayerId);
}
protected BeginningPhase(final BeginningPhase phase) {
super(phase);
this.isExtra = phase.isExtra;
}
@Override

View file

@ -246,7 +246,7 @@ public class Turn implements Serializable {
Phase phase;
switch (extraPhase) {
case BEGINNING:
phase = new BeginningPhase();
phase = new BeginningPhase(true);
break;
case PRECOMBAT_MAIN:
phase = new PreCombatMainPhase();