mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
Fixed NPE errors
This commit is contained in:
parent
dc7ccc6c4e
commit
e39dc1124b
12 changed files with 29 additions and 70 deletions
|
|
@ -1,14 +1,13 @@
|
|||
|
||||
package mage.abilities;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public abstract class StateTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
|
@ -23,11 +22,7 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
public boolean canTrigger(Game game) {
|
||||
//20100716 - 603.8
|
||||
Boolean triggered = (Boolean) game.getState().getValue(getSourceId().toString() + "triggered");
|
||||
if (triggered == null) {
|
||||
triggered = Boolean.FALSE;
|
||||
}
|
||||
return !triggered;
|
||||
return !Boolean.TRUE.equals(game.getState().getValue(getSourceId().toString() + "triggered"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,10 +28,7 @@ public class UntapSourceDuringEachOtherPlayersUntapStepEffect extends Continuous
|
|||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Boolean applied = (Boolean) game.getState().getValue(source.getSourceId() + "applied");
|
||||
if (applied == null) {
|
||||
applied = Boolean.FALSE;
|
||||
}
|
||||
boolean applied = Boolean.TRUE.equals(game.getState().getValue(source.getSourceId() + "applied"));
|
||||
if (!applied && layer == Layer.RulesEffects) {
|
||||
if (!source.isControlledBy(game.getActivePlayerId())
|
||||
&& game.getStep() != null
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS
|
|||
}
|
||||
|
||||
public boolean isBuybackActivated(Game game) {
|
||||
return (Boolean) game.getState().getValue(this.getSourceId().toString() + "_activatedBuyback");
|
||||
return Boolean.TRUE.equals(game.getState().getValue(this.getSourceId().toString() + "_activatedBuyback"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue