removed card name from constructor

master
melvin 2011-08-13 12:08:28 +08:00
parent 1c21b0b764
commit 7bfd3db2d7
25 changed files with 300 additions and 239 deletions

View File

@ -12,20 +12,24 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Absorb {
public static final MagicSpellCardEvent V3322 =new MagicSpellCardEvent("Absorb") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,MagicTargetChoice.NEG_TARGET_SPELL,new Object[]{cardOnStack,player},this,
"Counter target spell$. You gain 3 life.");
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_SPELL,
new Object[]{cardOnStack,player},
this,
"Counter target spell$. You gain 3 life.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
final MagicCardOnStack targetSpell=event.getTarget(game,choiceResults,0);
if (targetSpell!=null) {
@ -34,5 +38,4 @@ public class Absorb {
game.doAction(new MagicChangeLifeAction((MagicPlayer)data[1],3));
}
};
}

View File

@ -14,28 +14,33 @@ import magic.model.trigger.MagicTrigger;
import magic.model.trigger.MagicTriggerType;
public class Armadillo_Cloak {
public static final MagicSpellCardEvent S = new MagicPlayAuraEvent(
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.getInstance());
public static final MagicSpellCardEvent V6480 =new MagicPlayAuraEvent("Armadillo Cloak",
MagicTargetChoice.POS_TARGET_CREATURE,MagicPumpTargetPicker.getInstance());
public static final MagicTrigger V10453 =new MagicTrigger(MagicTriggerType.WhenDamageIsDealt,"Armadillo Cloak") {
public static final MagicTrigger T = new MagicTrigger(MagicTriggerType.WhenDamageIsDealt) {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object data) {
final MagicDamage damage=(MagicDamage)data;
if (permanent.getEnchantedCreature()==damage.getSource()) {
final MagicPlayer player=permanent.getController();
final int amount=damage.getDealtAmount();
return new MagicEvent(permanent,player,new Object[]{player,amount},this,"You gain "+amount+" life.");
return new MagicEvent(
permanent,
player,
new Object[]{player,amount},
this,
"You gain "+amount+" life.");
}
return null;
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object data[],final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
game.doAction(new MagicChangeLifeAction((MagicPlayer)data[0],(Integer)data[1]));
}
};
}

View File

@ -14,20 +14,23 @@ import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicTapTargetPicker;
public class Backlash {
public static final MagicSpellCardEvent V3365 =new MagicSpellCardEvent("Backlash") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(cardOnStack.getCard(),cardOnStack.getController(),
MagicTargetChoice.NEG_TARGET_UNTAPPED_CREATURE,new MagicTapTargetPicker(true,false),new Object[]{cardOnStack},this,
"Tap target untapped creature$. That creature deals damage equal to its power to its controller.");
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
MagicTargetChoice.NEG_TARGET_UNTAPPED_CREATURE,
new MagicTapTargetPicker(true,false),new Object[]{cardOnStack},
this,
"Tap target untapped creature$. That creature deals damage equal to its power to its controller.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
final MagicPermanent creature=event.getTarget(game,choiceResults,0);
if (creature!=null) {
@ -37,5 +40,4 @@ public class Backlash {
}
}
};
}

View File

@ -14,23 +14,27 @@ import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicGraveyardTargetPicker;
public class Beacon_of_Unrest {
public static final MagicSpellCardEvent V5152 =new MagicSpellCardEvent("Beacon of Unrest") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
final MagicCard card=cardOnStack.getCard();
return new MagicEvent(card,player,MagicTargetChoice.TARGET_ARTIFACT_OR_CREATURE_CARD_FROM_ALL_GRAVEYARDS,
MagicGraveyardTargetPicker.getInstance(),new Object[]{card,player},this,
"Return target artifact or creature card$ from a graveyard onto the battlefield under your control. "+
"Shuffle Beacon of Unrest into its owner's library.");
return new MagicEvent(
card,
player,
MagicTargetChoice.TARGET_ARTIFACT_OR_CREATURE_CARD_FROM_ALL_GRAVEYARDS,
MagicGraveyardTargetPicker.getInstance(),
new Object[]{card,player},
this,
"Return target artifact or creature card$ from a graveyard onto the battlefield under your control. "+
"Shuffle Beacon of Unrest into its owner's library.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCard targetCard=event.getTarget(game,choiceResults,0);
if (targetCard!=null) {
game.doAction(new MagicReanimateAction((MagicPlayer)data[1],targetCard,MagicPlayCardAction.NONE));
@ -38,5 +42,4 @@ public class Beacon_of_Unrest {
game.doAction(new MagicShuffleIntoLibraryAction((MagicCard)data[0]));
}
};
}

View File

@ -11,20 +11,25 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Bestial_Menace {
public static final MagicSpellCardEvent V5176 =new MagicSpellCardEvent("Bestial Menace") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,new Object[]{cardOnStack,player},this,
"Put a 1/1 green Snake creature token, a 2/2 green Wolf creature token and a 3/3 green Elephant creature token onto the battlefield.");
return new MagicEvent(
cardOnStack.getCard(),
player,
new Object[]{cardOnStack,player},
this,
"Put a 1/1 green Snake creature token, " +
"a 2/2 green Wolf creature token and " +
"a 3/3 green Elephant creature token onto the battlefield.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
final MagicPlayer player=(MagicPlayer)data[1];
game.doAction(new MagicPlayTokenAction(player,TokenCardDefinitions.SNAKE_TOKEN_CARD));
@ -32,5 +37,4 @@ public class Bestial_Menace {
game.doAction(new MagicPlayTokenAction(player,TokenCardDefinitions.ELEPHANT_TOKEN_CARD));
}
};
}

View File

@ -13,20 +13,25 @@ import magic.model.target.MagicDamageTargetPicker;
import magic.model.target.MagicTarget;
public class Blaze {
public static final MagicSpellCardEvent V5197 =new MagicSpellCardEvent("Blaze") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final int amount=payedCost.getX();
return new MagicEvent(cardOnStack.getCard(),cardOnStack.getController(),MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(amount),new Object[]{cardOnStack,amount},this,"Blaze deals "+amount+" damage to target creature or player$.");
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(amount),
new Object[]{cardOnStack,amount},
this,
"Blaze deals "+amount+" damage to target creature or player$.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final MagicTarget target=event.getTarget(game,choiceResults,0);
@ -36,5 +41,4 @@ public class Blaze {
}
}
};
}

View File

@ -13,20 +13,24 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Blightning {
public static final MagicSpellCardEvent V5245 =new MagicSpellCardEvent("Blightning") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,MagicTargetChoice.NEG_TARGET_PLAYER,
new Object[]{cardOnStack},this,"Blightning deals 3 damage to target player$. That player discards two cards.");
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_PLAYER,
new Object[]{cardOnStack},
this,
"Blightning deals 3 damage to target player$. That player discards two cards.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final MagicPlayer player=event.getTarget(game,choiceResults,0);
@ -37,5 +41,4 @@ public class Blightning {
}
}
};
}

View File

@ -12,23 +12,26 @@ import magic.model.target.MagicDamageTargetPicker;
import magic.model.target.MagicTarget;
public class Burst_Lightning {
public static final MagicSpellCardEvent V3412 =new MagicSpellCardEvent("Burst Lightning") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,
new MagicKickerChoice(MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,MagicManaCost.FOUR,false),
new MagicDamageTargetPicker(2),new Object[]{cardOnStack},this,
"Burst Lightning deals 2 damage to target creature or player$. "+
"If Burst Lightning was kicked$, it deals 4 damage to that creature or player instead.");
return new MagicEvent(
cardOnStack.getCard(),
player,
new MagicKickerChoice(MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,MagicManaCost.FOUR,false),
new MagicDamageTargetPicker(2),
new Object[]{cardOnStack},
this,
"Burst Lightning deals 2 damage to target creature or player$. "+
"If Burst Lightning was kicked$, it deals 4 damage to that creature or player instead.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final MagicTarget target=event.getTarget(game,choiceResults,0);
@ -39,5 +42,4 @@ public class Burst_Lightning {
}
}
};
}

View File

@ -12,31 +12,33 @@ import magic.model.target.MagicTargetFilter;
import java.util.Collection;
public class Chain_Reaction {
public static final MagicSpellCardEvent V5328 =new MagicSpellCardEvent("Chain Reaction") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,new Object[]{cardOnStack},this,
"Chain Reaction deals X damage to each creature, where X is the number of creatures on the battlefield.");
return new MagicEvent(
cardOnStack.getCard(),
player,
new Object[]{cardOnStack},
this,
"Chain Reaction deals X damage to each creature, where X is the number of creatures on the battlefield.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final int amount=game.getNrOfPermanents(MagicType.Creature);
final MagicSource source=cardOnStack.getCard();
final Collection<MagicTarget> targets=game.filterTargets(cardOnStack.getController(),MagicTargetFilter.TARGET_CREATURE);
final Collection<MagicTarget> targets=
game.filterTargets(cardOnStack.getController(),MagicTargetFilter.TARGET_CREATURE);
for (final MagicTarget target : targets) {
final MagicDamage damage=new MagicDamage(source,target,amount,false);
game.doAction(new MagicDealDamageAction(damage));
}
}
};
}

View File

@ -6,7 +6,7 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.target.MagicWeakenTargetPicker;
public class Clinging_Darkness {
public static final MagicSpellCardEvent V6484 =new MagicPlayAuraEvent("Clinging Darkness",
MagicTargetChoice.NEG_TARGET_CREATURE,new MagicWeakenTargetPicker(-4,-1));
public static final MagicSpellCardEvent S =new MagicPlayAuraEvent(
MagicTargetChoice.NEG_TARGET_CREATURE,
new MagicWeakenTargetPicker(-4,-1));
}

View File

@ -14,19 +14,24 @@ import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicPumpTargetPicker;
public class Colossal_Might {
public static final MagicSpellCardEvent V3489 =new MagicSpellCardEvent("Colossal Might") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(cardOnStack.getCard(),cardOnStack.getController(),MagicTargetChoice.POS_TARGET_CREATURE,MagicPumpTargetPicker.getInstance(),
new Object[]{cardOnStack},this,"Target creature$ gets +4/+2 and gains trample until end of turn.");
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.getInstance(),
new Object[]{cardOnStack},
this,
"Target creature$ gets +4/+2 and gains trample until end of turn.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final MagicPermanent creature=event.getTarget(game,choiceResults,0);
@ -36,5 +41,4 @@ public class Colossal_Might {
}
}
};
}

View File

@ -15,22 +15,27 @@ import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicDestroyTargetPicker;
public class Corpsehatch {
public static final MagicSpellCardEvent V5354 =new MagicSpellCardEvent("Corpsehatch") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,MagicTargetChoice.NEG_TARGET_NONBLACK_CREATURE,
new MagicDestroyTargetPicker(false),new Object[]{cardOnStack,player},this,
"Destroy target nonblack creature$. Put two 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. "+
"They have \"Sacrifice this creature: Add {1} to your mana pool.\"");
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_NONBLACK_CREATURE,
new MagicDestroyTargetPicker(false),
new Object[]{cardOnStack,player},
this,
"Destroy target nonblack creature$. " +
"Put two 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. " +
"They have \"Sacrifice this creature: Add {1} to your mana pool.\"");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
final MagicPermanent creature=event.getTarget(game,choiceResults,0);
if (creature!=null) {
@ -41,5 +46,4 @@ public class Corpsehatch {
game.doAction(new MagicPlayTokenAction(player,TokenCardDefinitions.ELDRAZI_SPAWN_TOKEN_CARD));
}
};
}

View File

@ -12,20 +12,24 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Countersquall {
public static final MagicSpellCardEvent V3551 =new MagicSpellCardEvent("Countersquall") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,MagicTargetChoice.NEG_TARGET_NONCREATURE_SPELL,
new Object[]{cardOnStack},this,"Counter target noncreature spell$. Its controller loses 2 life.");
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_NONCREATURE_SPELL,
new Object[]{cardOnStack},
this,
"Counter target noncreature spell$. Its controller loses 2 life.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
final MagicCardOnStack targetSpell=event.getTarget(game,choiceResults,0);
if (targetSpell!=null) {
@ -34,5 +38,4 @@ public class Countersquall {
}
}
};
}

View File

@ -14,26 +14,29 @@ import magic.model.target.MagicTargetFilter;
import java.util.Collection;
public class Day_of_Judgment {
public static final MagicSpellCardEvent V5402 =new MagicSpellCardEvent("Day of Judgment") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(cardOnStack.getCard(),cardOnStack.getController(),new Object[]{cardOnStack},this,"Destroy all creatures.");
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
new Object[]{cardOnStack},
this,
"Destroy all creatures.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final Collection<MagicTarget> targets=game.filterTargets(cardOnStack.getController(),MagicTargetFilter.TARGET_CREATURE);
final Collection<MagicTarget> targets=
game.filterTargets(cardOnStack.getController(),MagicTargetFilter.TARGET_CREATURE);
for (final MagicTarget target : targets) {
game.doAction(new MagicDestroyAction((MagicPermanent)target));
}
}
};
}

View File

@ -15,21 +15,26 @@ import magic.model.target.MagicDamageTargetPicker;
import magic.model.target.MagicTarget;
public class Death_Grasp {
public static final MagicSpellCardEvent V5423 =new MagicSpellCardEvent("Death Grasp") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final int amount=payedCost.getX();
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,new MagicDamageTargetPicker(amount),
new Object[]{cardOnStack,player,amount},this,"Death Grasp deals "+amount+" damage to target creature or player$. You gain "+amount+" life.");
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(amount),
new Object[]{cardOnStack,player,amount},
this,
"Death Grasp deals "+amount+" damage to target creature or player$. You gain "+amount+" life.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final int amount=(Integer)data[2];
@ -41,5 +46,4 @@ public class Death_Grasp {
game.doAction(new MagicChangeLifeAction((MagicPlayer)data[1],amount));
}
};
}

View File

@ -12,20 +12,24 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Dismal_Failure {
public static final MagicSpellCardEvent V3644 =new MagicSpellCardEvent("Dismal Failure") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,MagicTargetChoice.NEG_TARGET_SPELL,
new Object[]{cardOnStack},this,"Counter target spell$. Its controller discards a card.");
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_SPELL,
new Object[]{cardOnStack},
this,
"Counter target spell$. Its controller discards a card.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final MagicCardOnStack counteredCard=event.getTarget(game,choiceResults,0);
@ -35,5 +39,4 @@ public class Dismal_Failure {
}
}
};
}

View File

@ -10,22 +10,25 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Divination {
public static final MagicSpellCardEvent V5449 =new MagicSpellCardEvent("Divination") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,new Object[]{cardOnStack,player},this,"Draw two cards.");
return new MagicEvent(
cardOnStack.getCard(),
player,
new Object[]{cardOnStack,player},
this,
"Draw two cards.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
game.doAction(new MagicDrawAction((MagicPlayer)data[1],2));
}
};
}

View File

@ -15,20 +15,25 @@ import magic.model.target.MagicDamageTargetPicker;
import magic.model.target.MagicTarget;
public class Douse_in_Gloom {
public static final MagicSpellCardEvent V3708 =new MagicSpellCardEvent("Douse in Gloom") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(cardOnStack.getCard(),player,MagicTargetChoice.NEG_TARGET_CREATURE,new MagicDamageTargetPicker(2),
new Object[]{cardOnStack,player},this,"Douse in Gloom deals 2 damage to target creature$ and you gain 2 life.");
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.NEG_TARGET_CREATURE,
new MagicDamageTargetPicker(2),
new Object[]{cardOnStack,player},
this,
"Douse in Gloom deals 2 damage to target creature$ and you gain 2 life.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final MagicTarget target=event.getTarget(game,choiceResults,0);
@ -39,5 +44,4 @@ public class Douse_in_Gloom {
game.doAction(new MagicChangeLifeAction((MagicPlayer)data[1],2));
}
};
}

View File

@ -6,7 +6,7 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.target.MagicPumpTargetPicker;
public class Dust_Corona {
public static final MagicSpellCardEvent V6488 =new MagicPlayAuraEvent("Dust Corona",
MagicTargetChoice.POS_TARGET_CREATURE,MagicPumpTargetPicker.getInstance());
public static final MagicSpellCardEvent S = new MagicPlayAuraEvent(
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.getInstance());
}

View File

@ -6,7 +6,7 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.target.MagicPumpTargetPicker;
public class Eel_Umbra {
public static final MagicSpellCardEvent V6490 =new MagicPlayAuraEvent("Eel Umbra",
MagicTargetChoice.POS_TARGET_CREATURE,MagicPumpTargetPicker.getInstance());
public static final MagicSpellCardEvent S = new MagicPlayAuraEvent(
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.getInstance());
}

View File

@ -14,26 +14,31 @@ import magic.model.trigger.MagicTrigger;
import magic.model.trigger.MagicTriggerType;
public class Elephant_Guide {
public static final MagicSpellCardEvent S = new MagicPlayAuraEvent(
MagicTargetChoice.POS_TARGET_CREATURE,
MagicPumpTargetPicker.getInstance());
public static final MagicSpellCardEvent V6492 =new MagicPlayAuraEvent("Elephant Guide",
MagicTargetChoice.POS_TARGET_CREATURE,MagicPumpTargetPicker.getInstance());
public static final MagicTrigger V10474 =new MagicTrigger(MagicTriggerType.WhenOtherPutIntoGraveyardFromPlay,"Elephant Guide") {
public static final MagicTrigger T = new MagicTrigger(MagicTriggerType.WhenOtherPutIntoGraveyardFromPlay) {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object data) {
if (permanent.getEnchantedCreature()==data) {
final MagicPlayer player=permanent.getController();
return new MagicEvent(permanent,player,new Object[]{player},this,"Put a 3/3 green Elephant creature token onto the battlefield.");
return new MagicEvent(
permanent,
player,
new Object[]{player},
this,
"Put a 3/3 green Elephant creature token onto the battlefield.");
}
return null;
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object data[],final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
game.doAction(new MagicPlayTokenAction((MagicPlayer)data[0],TokenCardDefinitions.ELEPHANT_TOKEN_CARD));
}
};
}

View File

@ -15,27 +15,29 @@ import magic.model.target.MagicTargetFilter;
import java.util.Collection;
public class Evacuation {
public static final MagicSpellCardEvent V3753 =new MagicSpellCardEvent("Evacuation") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(cardOnStack.getCard(),cardOnStack.getController(),new Object[]{cardOnStack},this,
"Return all creatures to their owner's hand.");
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
new Object[]{cardOnStack},
this,
"Return all creatures to their owner's hand.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
final Collection<MagicTarget> targets=game.filterTargets(cardOnStack.getController(),MagicTargetFilter.TARGET_CREATURE);
final Collection<MagicTarget> targets=
game.filterTargets(cardOnStack.getController(),MagicTargetFilter.TARGET_CREATURE);
for (final MagicTarget target : targets) {
game.doAction(new MagicRemoveFromPlayAction((MagicPermanent)target,MagicLocationType.OwnersHand));
}
}
};
}

View File

@ -12,19 +12,23 @@ import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Exhaustion {
public static final MagicSpellCardEvent V5518 =new MagicSpellCardEvent("Exhaustion") {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(cardOnStack.getCard(),cardOnStack.getController(),MagicTargetChoice.TARGET_OPPONENT,
new Object[]{cardOnStack},this,"Creatures and lands target opponent$ controls don't untap during that opponent's next untap step.");
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
MagicTargetChoice.TARGET_OPPONENT,
new Object[]{cardOnStack},
this,
"Creatures and lands target opponent$ controls don't untap during that opponent's next untap step.");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
final MagicPlayer player=event.getTarget(game,choiceResults,0);
if (player!=null) {
@ -32,5 +36,4 @@ public class Exhaustion {
}
}
};
}

View File

@ -21,25 +21,24 @@ public class MagicPlayAuraEvent extends MagicSpellCardEvent {
this.targetPicker=targetPicker;
}
public MagicPlayAuraEvent(
final String name,
final MagicTargetChoice targetChoice,
final MagicTargetPicker targetPicker) {
super(name);
this.targetChoice=targetChoice;
this.targetPicker=targetPicker;
}
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(cardOnStack.getCard(),cardOnStack.getController(),targetChoice,targetPicker,new Object[]{cardOnStack},this,
"Enchant "+targetChoice.getTargetDescription()+"$ with "+cardOnStack.getName()+".");
return new MagicEvent(
cardOnStack.getCard(),
cardOnStack.getController(),
targetChoice,
targetPicker,
new Object[]{cardOnStack},
this,
"Enchant "+targetChoice.getTargetDescription()+"$ with "+cardOnStack.getName()+".");
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choiceResults) {
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack=(MagicCardOnStack)data[0];
final MagicPermanent creature=event.getTarget(game,choiceResults,0);
if (creature!=null) {

View File

@ -9,10 +9,6 @@ public abstract class MagicSpellCardEvent implements MagicCardEvent,MagicEventAc
public MagicSpellCardEvent() {}
public MagicSpellCardEvent(final String name) {
cardIndex = CardDefinitions.getInstance().getCard(name).getIndex();
}
public void setCardIndex(final int cardIndex) {
this.cardIndex = cardIndex;
}