replaced != MagicPermanent.NONE with isValid()

master
melvin 2011-09-04 18:47:16 +08:00
parent f8ef1420a4
commit ea008b725e
8 changed files with 10 additions and 10 deletions

View File

@ -13,7 +13,7 @@ public class Ezuri_s_Archers {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPermanent blocked=permanent.getBlockedCreature();
return (permanent==data &&
blocked!=MagicPermanent.NONE &&
blocked.isValid() &&
blocked.hasAbility(game,MagicAbility.Flying)) ?
new MagicEvent(
permanent,

View File

@ -22,7 +22,7 @@ public class Followed_Footsteps {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
final MagicPlayer player=permanent.getController();
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
return (player==data && enchantedCreature!=MagicPermanent.NONE) ?
return (player==data && enchantedCreature.isValid()) ?
new MagicEvent(
permanent,
player,
@ -40,7 +40,7 @@ public class Followed_Footsteps {
final Object[] choiceResults) {
final MagicPermanent permanent=(MagicPermanent)data[0];
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
if (enchantedCreature!=MagicPermanent.NONE) {
if (enchantedCreature.isValid()) {
game.doAction(new MagicPlayTokenAction((MagicPlayer)data[1],enchantedCreature.getCardDefinition()));
}
}

View File

@ -16,7 +16,7 @@ public class Mage_Slayer {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
final MagicPermanent equippedCreature=permanent.getEquippedCreature();
final MagicPlayer player=permanent.getController();
return (equippedCreature != MagicPermanent.NONE && equippedCreature==creature) ?
return (equippedCreature.isValid() && equippedCreature==creature) ?
new MagicEvent(
permanent,
player,

View File

@ -13,7 +13,7 @@ public class Meglonoth {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPermanent blocked=permanent.getBlockedCreature();
return (permanent==data && blocked!=MagicPermanent.NONE) ?
return (permanent==data && blocked.isValid()) ?
new MagicEvent(
permanent,
permanent.getController(),

View File

@ -21,7 +21,7 @@ public class Narcolepsy {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
return (enchantedCreature!=MagicPermanent.NONE&&!enchantedCreature.isTapped()) ?
return (enchantedCreature.isValid() && !enchantedCreature.isTapped()) ?
new MagicEvent(
permanent,
permanent.getController(),
@ -38,7 +38,7 @@ public class Narcolepsy {
final Object[] choiceResults) {
final MagicPermanent permanent=(MagicPermanent)data[0];
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
if (enchantedCreature!=MagicPermanent.NONE&&!enchantedCreature.isTapped()) {
if (enchantedCreature.isValid() && !enchantedCreature.isTapped()) {
game.doAction(new MagicTapAction(enchantedCreature,true));
}
}

View File

@ -12,7 +12,7 @@ public class Pride_Guardian {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPlayer player = permanent.getController();
return (permanent == data && permanent.getBlockedCreature() != MagicPermanent.NONE) ?
return (permanent == data && permanent.getBlockedCreature().isValid()) ?
new MagicEvent(
permanent,
player,

View File

@ -13,7 +13,7 @@ public class Shield_of_the_Righteous {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPermanent equippedCreature = permanent.getEquippedCreature();
final MagicPermanent blocked = equippedCreature.getBlockedCreature();
return (equippedCreature == data && blocked != MagicPermanent.NONE) ?
return (equippedCreature == data && blocked.isValid()) ?
new MagicEvent(
permanent,
permanent.getController(),

View File

@ -12,7 +12,7 @@ public class Wall_of_Frost {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPermanent blocked=permanent.getBlockedCreature();
return (permanent==data && blocked!=MagicPermanent.NONE) ?
return (permanent==data && blocked.isValid()) ?
new MagicEvent(
permanent,
permanent.getController(),