fix Obeka, Splitter of Seconds (#12085)

Now adding BeginningPhases with all but Upkeep skipped.
Previously upkeep steps were added during combat phase, which was incorrect.

fix #12085
This commit is contained in:
Susucre 2024-04-11 13:24:56 +02:00
parent add0fa4f58
commit 8a29dcc735
5 changed files with 46 additions and 7 deletions

View file

@ -42,7 +42,7 @@ public class TurnMod implements Serializable, Copyable<TurnMod> {
private Step extraStep;
private PhaseStep skipStep;
private PhaseStep skipAllButExtraStep; // for extra phase skipping all but a specific step.
private TurnPhase afterPhase;
private PhaseStep afterStep;
@ -66,6 +66,7 @@ public class TurnMod implements Serializable, Copyable<TurnMod> {
this.extraStep = mod.extraStep.copy();
}
this.skipStep = mod.skipStep;
this.skipAllButExtraStep = mod.skipAllButExtraStep;
this.afterPhase = mod.afterPhase;
this.afterStep = mod.afterStep;
if (mod.subsequentTurnMod != null) {
@ -126,6 +127,18 @@ public class TurnMod implements Serializable, Copyable<TurnMod> {
return withExtraPhase(extraPhase, null);
}
/**
* Adds an extra step in a new extra phase after this one.
* All steps that are not the right one are skipped in the extra phase.
* e.g. [[Obeka, Splitter of Seconds]]
*/
public TurnMod withExtraStepInExtraPhase(PhaseStep extraStep, TurnPhase extraPhase) {
this.extraPhase = extraPhase;
this.skipAllButExtraStep = extraStep;
lock();
return this;
}
public TurnMod withExtraPhase(TurnPhase extraPhase, TurnPhase addAfterPhase) {
this.extraPhase = extraPhase;
this.afterPhase = addAfterPhase;
@ -192,6 +205,10 @@ public class TurnMod implements Serializable, Copyable<TurnMod> {
return skipPhase;
}
public PhaseStep getSkipAllButExtraStep() {
return skipAllButExtraStep;
}
public PhaseStep getSkipStep() {
return skipStep;
}