mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Prevented NPE for getPhaseType().
This commit is contained in:
parent
f2fc548f08
commit
02df3f49a7
4 changed files with 5 additions and 5 deletions
|
@ -143,8 +143,8 @@ class FuryOfTheHordeAddPhasesEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
// 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created.
|
||||
if (game.getTurn().getPhaseType().equals(TurnPhase.PRECOMBAT_MAIN)
|
||||
|| game.getTurn().getPhaseType().equals(TurnPhase.POSTCOMBAT_MAIN) ) {
|
||||
if (TurnPhase.PRECOMBAT_MAIN.equals(game.getTurn().getPhaseType())
|
||||
|| TurnPhase.POSTCOMBAT_MAIN.equals(game.getTurn().getPhaseType()) ) {
|
||||
// we can't add two turn modes at once, will add additional post combat on delayed trigger resolution
|
||||
TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false);
|
||||
game.getState().getTurnMods().add(combat);
|
||||
|
|
|
@ -110,7 +110,7 @@ class SpinalEmbraceEffect extends ContinuousRuleModifiyingEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) {
|
||||
return !game.getTurn().getPhaseType().equals(TurnPhase.COMBAT);
|
||||
return !TurnPhase.COMBAT.equals(game.getTurn().getPhaseType());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ class RelentlessAssaultAddPhasesEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
// 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created.
|
||||
if (game.getTurn().getPhaseType().equals(TurnPhase.PRECOMBAT_MAIN) || game.getTurn().getPhaseType().equals(TurnPhase.POSTCOMBAT_MAIN)) {
|
||||
if (TurnPhase.PRECOMBAT_MAIN.equals(game.getTurn().getPhaseType()) || TurnPhase.POSTCOMBAT_MAIN.equals(game.getTurn().getPhaseType())) {
|
||||
// we can't add two turn modes at once, will add additional post combat on delayed trigger resolution
|
||||
TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false);
|
||||
game.getState().getTurnMods().add(combat);
|
||||
|
|
|
@ -47,7 +47,7 @@ public class IsPhaseCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.getTurn().getPhaseType().equals(turnPhase);
|
||||
return turnPhase.equals(game.getTurn().getPhaseType());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue