forked from External/mage
Fixed potential NPE errors in getPhase usage (fixed Berserker's Frenzy, etc)
This commit is contained in:
parent
cfd7464b49
commit
a15a0daa04
81 changed files with 162 additions and 130 deletions
|
|
@ -7,6 +7,8 @@ import mage.abilities.effects.ContinuousEffect;
|
|||
import mage.abilities.effects.ContinuousEffects;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.cards.*;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.constants.Zone;
|
||||
import mage.designations.Designation;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
|
@ -22,6 +24,8 @@ import mage.game.permanent.PermanentCard;
|
|||
import mage.game.permanent.PermanentToken;
|
||||
import mage.game.stack.SpellStack;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.game.turn.Phase;
|
||||
import mage.game.turn.Step;
|
||||
import mage.game.turn.Turn;
|
||||
import mage.game.turn.TurnMods;
|
||||
import mage.players.Player;
|
||||
|
|
@ -572,6 +576,19 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
return turn;
|
||||
}
|
||||
|
||||
public PhaseStep getTurnStepType() {
|
||||
Turn turn = this.getTurn();
|
||||
Phase phase = turn != null ? turn.getPhase() : null;
|
||||
Step step = phase != null ? phase.getStep() : null;
|
||||
return step != null ? step.getType() : null;
|
||||
}
|
||||
|
||||
public TurnPhase getTurnPhaseType() {
|
||||
Turn turn = this.getTurn();
|
||||
Phase phase = turn != null ? turn.getPhase() : null;
|
||||
return phase != null ? phase.getType() : null;
|
||||
}
|
||||
|
||||
public Combat getCombat() {
|
||||
return combat;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue