added Moldgraf Monstrosity and Moment of Heroism

master
beholder 2011-09-29 15:35:11 +02:00
parent 1c79a6dcce
commit b822089858
3 changed files with 125 additions and 0 deletions

View File

@ -4654,6 +4654,29 @@ pt=1/1
ability=flying ability=flying
timing=main timing=main
>Moldgraf Monstrosity
image=http://magiccards.info/scans/en/isd/194.jpg
value=5
rarity=R
type=Creature
subtype=Insect
color=g
converted=7
cost={4}{G}{G}{G}
pt=8/8
ability=trample
timing=main
>Moment of Heroism
image=http://magiccards.info/scans/en/isd/24.jpg
value=3
rarity=C
type=Instant
color=w
converted=2
cost={1}{W}
timing=pump
>Morkrut Banshee >Morkrut Banshee
image=http://magiccards.info/scans/en/isd/110.jpg image=http://magiccards.info/scans/en/isd/110.jpg
value=4 value=4

View File

@ -0,0 +1,57 @@
package magic.card;
import java.util.List;
import magic.model.MagicCard;
import magic.model.MagicGame;
import magic.model.MagicLocationType;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicMoveCardAction;
import magic.model.action.MagicPlayCardAction;
import magic.model.action.MagicReanimateAction;
import magic.model.action.MagicRemoveCardAction;
import magic.model.event.MagicEvent;
import magic.model.target.MagicTarget;
import magic.model.target.MagicTargetFilter;
import magic.model.trigger.MagicGraveyardTriggerData;
import magic.model.trigger.MagicWhenPutIntoGraveyardTrigger;
public class Moldgraf_Monstrosity {
public static final MagicWhenPutIntoGraveyardTrigger T = 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,
new Object[]{permanent,player},
this,
"Exile " + permanent + ", then return two creature " +
"cards at random from your graveyard to the battlefield."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
final MagicPermanent permanent = (MagicPermanent)data[0];
game.doAction(new MagicRemoveCardAction(permanent.getCard(),MagicLocationType.Graveyard));
game.doAction(new MagicMoveCardAction(permanent.getCard(),MagicLocationType.Graveyard,MagicLocationType.Exile));
final MagicPlayer player = (MagicPlayer)data[1];
final List<MagicTarget> targets =
game.filterTargets(player,MagicTargetFilter.TARGET_CREATURE_CARD_FROM_GRAVEYARD);
final magic.MersenneTwisterFast rng =
new magic.MersenneTwisterFast(permanent.getId() + player.getId());
int actualAmount = Math.min(targets.size(),2);
for (;actualAmount>0;actualAmount--) {
final int index = rng.nextInt(targets.size());
final MagicCard card = (MagicCard)targets.get(index);
game.doAction(new MagicReanimateAction(player,card,MagicPlayCardAction.NONE));
}
}
};
}

View File

@ -0,0 +1,45 @@
package magic.card;
import magic.model.MagicAbility;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.action.MagicChangeTurnPTAction;
import magic.model.action.MagicMoveCardAction;
import magic.model.action.MagicPermanentAction;
import magic.model.action.MagicSetAbilityAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicLifelinkTargetPicker;
public class Moment_of_Heroism {
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,
MagicLifelinkTargetPicker.getInstance(),
new Object[]{cardOnStack},
this,
"Target creature$ gets +2/+2 and gains lifelink until end of turn.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
game.doAction(new MagicMoveCardAction((MagicCardOnStack)data[0]));
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeTurnPTAction(creature,2,2));
game.doAction(new MagicSetAbilityAction(creature,MagicAbility.LifeLink));
}
});
}
};
}