Add script for Elvish Healer

master
Jericho Pumpkin 2013-10-07 19:24:25 +00:00
parent 5481e64c68
commit 0cbd8d64b0
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,34 @@
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Prevent"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [new MagicTapEvent(source)];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.POS_TARGET_CREATURE_OR_PLAYER,
MagicPreventTargetPicker.getInstance(),
this,
"Prevent the next 1 damage that would be dealt to target creature or player\$ this turn. " +
"If that creature is green, prevent 2 damage instead."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final int amount = (target.isCreature() && target.hasColor(MagicColor.Green))? 2 : 1;
game.doAction(new MagicPreventDamageAction(target,amount));
}
});
}
}
]

View File

@ -0,0 +1,11 @@
name=Elvish Healer
url=http://magiccards.info/ia/en/246.html
image=http://magiccards.info/scans/en/ia/246.jpg
value=2.406
rarity=C
cost={2}{W}
type=Creature
subtype=Elf,Cleric
timing=main
pt=1/2
requires_groovy_code