replace player with PN

master
melvin 2012-09-22 09:56:30 +08:00
parent 7a1d9fb10d
commit 21c483e570
6 changed files with 37 additions and 49 deletions

View File

@ -12,19 +12,16 @@ import magic.model.trigger.MagicAtUpkeepTrigger;
public class Ajani_s_Mantra {
public static final MagicAtUpkeepTrigger T = new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
final MagicPlayer player = permanent.getController();
return (player == data) ?
new MagicEvent(
permanent,
player,
new MagicSimpleMayChoice(
player + " may gain 1 life.",
MagicSimpleMayChoice.GAIN_LIFE,
1,
MagicSimpleMayChoice.DEFAULT_YES),
this,
player + " may$ gain 1 life.") :
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
1,
MagicSimpleMayChoice.DEFAULT_YES),
this,
"PN may$ gain 1 life.") :
MagicEvent.NONE;
}
@Override

View File

@ -20,14 +20,14 @@ public class Elvish_Pioneer {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
new MagicMayChoice(
player + " may put a basic land card from his or her hand into play tapped.",
MagicTargetChoice.TARGET_BASIC_LAND_CARD_FROM_HAND),
new MagicGraveyardTargetPicker(true),
this,
player + " may$ put a basic land card$ from his or her hand into play tapped.");
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_BASIC_LAND_CARD_FROM_HAND
),
new MagicGraveyardTargetPicker(true),
this,
"PN may$ put a basic land card$ from his or her hand into play tapped."
);
}
@Override
public void executeEvent(

View File

@ -17,9 +17,8 @@ public class Goblin_Marshal {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
this,
player + " puts two 1/1 red Goblin creature tokens onto the battlefield.");
"PN puts two 1/1 red Goblin creature tokens onto the battlefield.");
}
@Override
public void executeEvent(
@ -40,13 +39,11 @@ public class Goblin_Marshal {
public static final MagicWhenPutIntoGraveyardTrigger T3 = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
final MagicPlayer player = permanent.getController();
return (MagicLocationType.Play == triggerData.fromLocation) ?
new MagicEvent(
permanent,
player,
this,
player + " puts two 1/1 red Goblin creature tokens onto the battlefield.") :
"PN puts two 1/1 red Goblin creature tokens onto the battlefield.") :
MagicEvent.NONE;
}
@Override

View File

@ -28,17 +28,15 @@ public class Ib_Halfheart__Goblin_Tactician {
public static final MagicWhenBecomesBlockedTrigger T = new MagicWhenBecomesBlockedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPermanent otherPermanent) {
final MagicPlayer player = permanent.getController();
return (permanent != otherPermanent &&
otherPermanent.getController() == player &&
otherPermanent.isFriend(permanent) &&
otherPermanent.isCreature() &&
otherPermanent.hasSubType(MagicSubType.Goblin)) ?
new MagicEvent(
permanent,
player,
new Object[]{otherPermanent},
this,
player + " sacrifices " + otherPermanent + ". If " + player + " does, " + otherPermanent + " deals 4 damage to each creature blocking it."
"PN sacrifices " + otherPermanent + ". If PN does, " + otherPermanent + " deals 4 damage to each creature blocking it."
):
MagicEvent.NONE;
}
@ -76,12 +74,10 @@ public class Ib_Halfheart__Goblin_Tactician {
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
MagicPlayer player = source.getController();
return new MagicEvent(
source,
player,
this,
player + " puts two 1/1 red Goblin creature tokens into play."
"PN puts two 1/1 red Goblin creature tokens into play."
);
}

View File

@ -20,16 +20,15 @@ public class Mnemonic_Wall {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
new MagicMayChoice(
player + " may return target instant or sorcery card " +
"from his or her graveyard to his or her hand.",
MagicTargetChoice.TARGET_INSTANT_OR_SORCERY_CARD_FROM_GRAVEYARD),
new MagicGraveyardTargetPicker(false),
this,
player + " may$ return target instant or sorcery card$ " +
"from his or her graveyard to his or her hand.");
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_INSTANT_OR_SORCERY_CARD_FROM_GRAVEYARD
),
new MagicGraveyardTargetPicker(false),
this,
"PN may$ return target instant or sorcery card$ " +
"from his or her graveyard to his or her hand."
);
}
@Override

View File

@ -33,13 +33,12 @@ public class Stitcher_s_Apprentice {
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
final MagicPlayer player = source.getController();
return new MagicEvent(
source,
player,
this,
player + " puts a 2/2 blue Homunculus creature token " +
"onto the battlefield, then sacrifices a creature.");
source,
this,
"PN puts a 2/2 blue Homunculus creature token " +
"onto the battlefield, then sacrifices a creature."
);
}
@Override
public void executeEvent(