replace player with PN

master
melvin 2012-09-22 10:19:41 +08:00
parent 96629c6841
commit 52bcd93903
8 changed files with 40 additions and 54 deletions

View File

@ -13,9 +13,9 @@ public class Flight_of_Fancy {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) { public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent( return new MagicEvent(
permanent, permanent,
player,
this, this,
player + " draws two cards."); "PN draws two cards."
);
} }
@Override @Override
public void executeEvent( public void executeEvent(

View File

@ -22,10 +22,12 @@ public class Jayemdae_Tome {
@Override @Override
public MagicEvent[] getCostEvent(final MagicSource source) { public MagicEvent[] getCostEvent(final MagicSource source) {
return new MagicEvent[] { new MagicPayManaCostTapEvent( return new MagicEvent[] {
new MagicPayManaCostTapEvent(
source, source,
source.getController(), source.getController(),
MagicManaCost.FOUR) MagicManaCost.FOUR
)
}; };
} }
@ -33,12 +35,10 @@ public class Jayemdae_Tome {
public MagicEvent getPermanentEvent( public MagicEvent getPermanentEvent(
final MagicPermanent source, final MagicPermanent source,
final MagicPayedCost payedCost) { final MagicPayedCost payedCost) {
final MagicPlayer player = source.getController();
return new MagicEvent( return new MagicEvent(
source, source,
player,
this, this,
player + " draws a card."); "PN draws a card.");
} }
@Override @Override

View File

@ -17,13 +17,11 @@ public class Maalfeld_Twins {
final MagicGame game, final MagicGame game,
final MagicPermanent permanent, final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) { final MagicGraveyardTriggerData triggerData) {
final MagicPlayer player = permanent.getController();
return (MagicLocationType.Play == triggerData.fromLocation) ? return (MagicLocationType.Play == triggerData.fromLocation) ?
new MagicEvent( new MagicEvent(
permanent, permanent,
player,
this, this,
player + " puts two 2/2 black Zombie " + "PN puts two 2/2 black Zombie " +
"creature tokens onto the battlefield.") : "creature tokens onto the battlefield.") :
MagicEvent.NONE; MagicEvent.NONE;
} }

View File

@ -17,20 +17,18 @@ public class Mask_of_Riddles {
final MagicGame game, final MagicGame game,
final MagicPermanent permanent, final MagicPermanent permanent,
final MagicDamage damage) { final MagicDamage damage) {
final MagicPlayer player = permanent.getController();
return (permanent.getEquippedCreature() == damage.getSource() && return (permanent.getEquippedCreature() == damage.getSource() &&
damage.getTarget().isPlayer() && damage.getTarget().isPlayer() &&
damage.isCombat()) ? damage.isCombat()) ?
new MagicEvent( new MagicEvent(
permanent, permanent,
player,
new MagicSimpleMayChoice( new MagicSimpleMayChoice(
player + " may draw a card.",
MagicSimpleMayChoice.DRAW_CARDS, MagicSimpleMayChoice.DRAW_CARDS,
1, 1,
MagicSimpleMayChoice.DEFAULT_NONE), MagicSimpleMayChoice.DEFAULT_NONE),
this, this,
player + " may$ draw a card.") : "PN may$ draw a card."
) :
MagicEvent.NONE; MagicEvent.NONE;
} }

View File

@ -16,20 +16,18 @@ import magic.model.trigger.MagicWhenOtherSpellIsCastTrigger;
public class Myrsmith { public class Myrsmith {
public static final MagicWhenOtherSpellIsCastTrigger T = new MagicWhenOtherSpellIsCastTrigger() { public static final MagicWhenOtherSpellIsCastTrigger T = new MagicWhenOtherSpellIsCastTrigger() {
@Override @Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack data) { public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack spell) {
final MagicPlayer player = permanent.getController(); return (permanent.isFriend(spell) &&
final MagicCard card = data.getCard(); spell.getCardDefinition().isArtifact()) ?
return (card.getOwner() == player &&
data.getCardDefinition().isArtifact()) ?
new MagicEvent( new MagicEvent(
permanent, permanent,
player,
new MagicMayChoice( new MagicMayChoice(
"You may pay {1}.", new MagicPayManaCostChoice(MagicManaCost.ONE)
new MagicPayManaCostChoice(MagicManaCost.ONE)), ),
this, this,
player + " may$ pay {1}$. If you do, put a 1/1 " + "PN may$ pay {1}$. If you do, put a 1/1 " +
"colorless Myr artifact creature token onto the battlefield."): "colorless Myr artifact creature token onto the battlefield."
) :
MagicEvent.NONE; MagicEvent.NONE;
} }

View File

@ -15,14 +15,12 @@ public class Nagao__Bound_by_Honor {
public static final MagicWhenAttacksTrigger T3 = new MagicWhenAttacksTrigger() { public static final MagicWhenAttacksTrigger T3 = new MagicWhenAttacksTrigger() {
@Override @Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) { public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
final MagicPlayer player = creature.getController();
return (permanent == creature) ? return (permanent == creature) ?
new MagicEvent( new MagicEvent(
permanent, permanent,
player,
this, this,
"Samurai creatures " + player + "Samurai creatures PN controls get +1/+1 until end of turn."
" controls get +1/+1 until end of turn.") : ) :
MagicEvent.NONE; MagicEvent.NONE;
} }

View File

@ -13,15 +13,13 @@ public class Soul_Link {
public static final MagicWhenDamageIsDealtTrigger T1 = new MagicWhenDamageIsDealtTrigger() { public static final MagicWhenDamageIsDealtTrigger T1 = new MagicWhenDamageIsDealtTrigger() {
@Override @Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) { public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicPlayer player=permanent.getController();
final int amount=damage.getDealtAmount(); final int amount=damage.getDealtAmount();
return (damage.getSource()==permanent.getEnchantedCreature()) ? return (damage.getSource()==permanent.getEnchantedCreature()) ?
new MagicEvent( new MagicEvent(
permanent, permanent,
player,
new Object[]{amount}, new Object[]{amount},
this, this,
player + " gains " + amount + " life.") : "PN gains " + amount + " life.") :
MagicEvent.NONE; MagicEvent.NONE;
} }
@Override @Override
@ -38,15 +36,13 @@ public class Soul_Link {
public static final MagicWhenDamageIsDealtTrigger T2 = new MagicWhenDamageIsDealtTrigger() { public static final MagicWhenDamageIsDealtTrigger T2 = new MagicWhenDamageIsDealtTrigger() {
@Override @Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) { public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicPlayer player=permanent.getController();
final int amount=damage.getDealtAmount(); final int amount=damage.getDealtAmount();
return (damage.getTarget()==permanent.getEnchantedCreature()) ? return (damage.getTarget()==permanent.getEnchantedCreature()) ?
new MagicEvent( new MagicEvent(
permanent, permanent,
player,
new Object[]{amount}, new Object[]{amount},
this, this,
player + " gains " + amount + " life.") : "PN gains " + amount + " life.") :
MagicEvent.NONE; MagicEvent.NONE;
} }
@Override @Override

View File

@ -28,12 +28,10 @@ public class Urza_s_Blueprints {
public MagicEvent getPermanentEvent( public MagicEvent getPermanentEvent(
final MagicPermanent source, final MagicPermanent source,
final MagicPayedCost payedCost) { final MagicPayedCost payedCost) {
final MagicPlayer player = source.getController();
return new MagicEvent( return new MagicEvent(
source, source,
player,
this, this,
player + " draws a card."); "PN draws a card.");
} }
@Override @Override