From 382f346166d1339b95aee92a479483bda92b0e5e Mon Sep 17 00:00:00 2001 From: beholder Date: Fri, 2 Sep 2011 12:16:17 +0200 Subject: [PATCH] added Serra Ascendant --- resources/magic/data/cards.txt | 14 +++++++++++ src/magic/card/Serra_Ascendant.java | 38 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/magic/card/Serra_Ascendant.java diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index 38bef02de0..925b57c0ee 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -998,6 +998,20 @@ power=1 toughness=3 timing=main +>Serra Ascendant +image=http://magiccards.info/scans/en/m11/28.jpg +value=2 +rarity=R +type=Creature +subtype=Human,Monk +color=w +converted=1 +cost={W} +power=1 +toughness=1 +ability=lifelink +timing=main + >Skinrender image=http://magiccards.info/scans/en/som/78.jpg value=4 diff --git a/src/magic/card/Serra_Ascendant.java b/src/magic/card/Serra_Ascendant.java new file mode 100644 index 0000000000..cc960e3383 --- /dev/null +++ b/src/magic/card/Serra_Ascendant.java @@ -0,0 +1,38 @@ +package magic.card; + +import magic.model.MagicAbility; +import magic.model.MagicCardDefinition; +import magic.model.MagicChangeCardDefinition; +import magic.model.MagicGame; +import magic.model.MagicPermanent; +import magic.model.MagicPowerToughness; +import magic.model.variable.MagicDummyLocalVariable; +import magic.model.variable.MagicLocalVariable; +import magic.model.variable.MagicStaticLocalVariable; + +public class Serra_Ascendant { + + private static final MagicLocalVariable LV = new MagicDummyLocalVariable() { + @Override + public void getPowerToughness(final MagicGame game,final MagicPermanent permanent,final MagicPowerToughness pt) { + if (permanent.getController().getLife() >= 30) { + pt.power += 5; + pt.toughness += 5; + } + } + @Override + public long getAbilityFlags(final MagicGame game,final MagicPermanent permanent,final long flags) { + return permanent.getController().getLife() >= 30 ? + flags|MagicAbility.Flying.getMask() : flags; + } + }; + + public static final MagicChangeCardDefinition SET = new MagicChangeCardDefinition() { + @Override + public void change(MagicCardDefinition cdef) { + cdef.addLocalVariable(MagicStaticLocalVariable.getInstance()); + cdef.addLocalVariable(LV); + } + }; + +}