replace player with PN

master
melvin 2012-09-22 11:34:08 +08:00
parent a50db2e228
commit 371220fb3e
7 changed files with 41 additions and 52 deletions

View File

@ -15,16 +15,15 @@ public class Caustic_Crawler {
public static final MagicLandfallTrigger T = new MagicLandfallTrigger() {
@Override
public MagicEvent getEvent(final MagicPermanent permanent) {
final MagicPlayer player = permanent.getController();
return new MagicEvent(
permanent,
player,
new MagicMayChoice(
player + " may have target creature get -1/-1 until end of turn.",
MagicTargetChoice.NEG_TARGET_CREATURE),
new MagicWeakenTargetPicker(1,1),
this,
player + " may$ have target creature$ get -1/-1 until end of turn.");
permanent,
new MagicMayChoice(
MagicTargetChoice.NEG_TARGET_CREATURE
),
new MagicWeakenTargetPicker(1,1),
this,
"PN may$ have target creature$ get -1/-1 until end of turn."
);
}
@Override

View File

@ -15,15 +15,13 @@ public class Exquisite_Blood {
final MagicGame game,
final MagicPermanent permanent,
final MagicLifeChangeTriggerData lifeChange) {
final MagicPlayer player = permanent.getController();
final int amount = lifeChange.amount;
return (player.getOpponent() == lifeChange.player) ?
return permanent.isOpponent(lifeChange.player) ?
new MagicEvent(
permanent,
player,
new Object[]{amount},
this,
player + " gains " + amount + " life."):
"PN gains " + amount + " life."):
MagicEvent.NONE;
}
@Override

View File

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

View File

@ -15,20 +15,18 @@ import magic.model.trigger.MagicWhenOtherSpellIsCastTrigger;
public class Mesa_Enchantress {
public static final MagicWhenOtherSpellIsCastTrigger T = new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack data) {
final MagicPlayer player = permanent.getController();
final MagicCard card = data.getCard();
return (card.getOwner() == player && card.getCardDefinition().isEnchantment()) ?
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack spell) {
return (permanent.isFriend(spell) &&
spell.getCardDefinition().isEnchantment()) ?
new MagicEvent(
permanent,
player,
new MagicSimpleMayChoice(
player + " may draw a card.",
MagicSimpleMayChoice.DRAW_CARDS,
1,
MagicSimpleMayChoice.DEFAULT_NONE),
this,
player + " may$ draw a card."):
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
1,
MagicSimpleMayChoice.DEFAULT_NONE),
this,
"PN may$ draw a card."
):
MagicEvent.NONE;
}

View File

@ -28,12 +28,11 @@ public class Rejuvenation_Chamber {
public MagicEvent getPermanentEvent(
final MagicPermanent source,
final MagicPayedCost payedCost) {
final MagicPlayer player = source.getController();
return new MagicEvent(
source,
player,
this,
player + " gains 2 life");
source,
this,
"PN gains 2 life"
);
}
@Override

View File

@ -29,20 +29,19 @@ public class Scroll_of_Griselbrand {
final MagicPermanent permanent = (MagicPermanent)source;
return new MagicEvent[]{
new MagicPayManaCostEvent(source,source.getController(),MagicManaCost.ONE),
new MagicSacrificeEvent(permanent)};
new MagicSacrificeEvent(permanent)
};
}
@Override
public MagicEvent getPermanentEvent(
final MagicPermanent source,
final MagicPayedCost payedCost) {
final MagicPlayer player = source.getController();
return new MagicEvent(
source,
player,
this,
"Opponent discards a card. If " + player +
" controls a Demon, opponent loses 3 life.");
"Opponent discards a card. If PN controls a Demon, opponent loses 3 life."
);
}
@Override

View File

@ -19,15 +19,13 @@ public class Sphinx_of_Lost_Truths {
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
final boolean kicked=permanent.isKicked();
return new MagicEvent(
permanent,
player,
new Object[]{kicked},
this,
kicked ?
player + " draws three cards." :
player + " draws three cards. Then discards three cards.");
permanent,
this,
permanent.isKicked() ?
"PN draws three cards." :
"PN draws three cards. Then discards three cards."
);
}
@Override
public void executeEvent(
@ -37,8 +35,7 @@ public class Sphinx_of_Lost_Truths {
final Object[] choiceResults) {
final MagicPlayer player=event.getPlayer();
game.doAction(new MagicDrawAction(player,3));
final boolean kicked=(Boolean)data[0];
if (!kicked) {
if (event.getPermanent().isKicked()) {
game.addEvent(new MagicDiscardEvent(event.getPermanent(),player,3,false));
}
}