From cb9b2dfaa1ee790aae69f6ce6fe6c5af63bfb4f5 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 10:22:55 +0000 Subject: [PATCH] *Added Stone Giant --- .gitattributes | 1 + res/cardsfolder/galvanic_blast.txt | 4 +- res/cardsfolder/pithing_needle.txt | 4 +- res/cardsfolder/stone_giant.txt | 9 ++++ src/forge/CardFactory_Creatures.java | 63 +++++++++++++++++++++++++++- 5 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 res/cardsfolder/stone_giant.txt diff --git a/.gitattributes b/.gitattributes index 4a9a1c12fa4..7ca52de4eb4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4196,6 +4196,7 @@ res/cardsfolder/stolen_grain.txt -text svneol=native#text/plain res/cardsfolder/stomper_cub.txt -text svneol=native#text/plain res/cardsfolder/stomping_ground.txt -text svneol=native#text/plain res/cardsfolder/stone_calendar.txt -text svneol=native#text/plain +res/cardsfolder/stone_giant.txt -text svneol=native#text/plain res/cardsfolder/stone_golem.txt -text svneol=native#text/plain res/cardsfolder/stone_kavu.txt -text svneol=native#text/plain res/cardsfolder/stone_rain.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/galvanic_blast.txt b/res/cardsfolder/galvanic_blast.txt index ae188173106..1c9047ec5f5 100644 --- a/res/cardsfolder/galvanic_blast.txt +++ b/res/cardsfolder/galvanic_blast.txt @@ -1,8 +1,8 @@ -#Uses Card-specific code! Name:Galvanic Blast ManaCost:R Types:Instant Text:Galvanic Blast deals 2 damage to target creature or player.\r\nMetalcraft - Galvanic Blast deals 4 damage to that creature or player instead if you control three or more artifacts. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/galvanic_blast.jpg -End \ No newline at end of file +End +#Uses Card-specific code! \ No newline at end of file diff --git a/res/cardsfolder/pithing_needle.txt b/res/cardsfolder/pithing_needle.txt index 37e8434f2c2..cbec7df95af 100644 --- a/res/cardsfolder/pithing_needle.txt +++ b/res/cardsfolder/pithing_needle.txt @@ -1,4 +1,3 @@ -#Uses card-specific code! Name:Pithing Needle ManaCost:1 Types:Artifact @@ -6,4 +5,5 @@ Text:As Pithing Needle enters the battlefield, name a card.\r\nActivated abiliti SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/pithing_needle.jpg SVar:RemAIDeck:True -End \ No newline at end of file +End +#Uses card-specific code! \ No newline at end of file diff --git a/res/cardsfolder/stone_giant.txt b/res/cardsfolder/stone_giant.txt new file mode 100644 index 00000000000..0f9a2259581 --- /dev/null +++ b/res/cardsfolder/stone_giant.txt @@ -0,0 +1,9 @@ +Name:Stone Giant +ManaCost:2 R R +Types:Creature Giant +Text:no text +PT:3/4 +SVar:Rarity:Uncommon +SVar:RemAIDeck:True +End +#Uses card-specific code! \ No newline at end of file diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 88bcd37ae4f..5bab26e684b 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -94,7 +94,68 @@ public class CardFactory_Creatures { return newCard; }//*************** END ************ END ************************** - + //*************** START *********** START ************************** + else if(cardName.equals("Stone Giant")) { + final ArrayList Tgt = new ArrayList(); + + final Command untilEOT = new Command() { + + private static final long serialVersionUID = -6829468812598100958L; + + //@Override + public void execute() { + for(Card c : Tgt) + { + AllZone.GameAction.destroy(c); + } + Tgt.clear(); + } + }; + + final SpellAbility ability = new Ability_Tap(card) { + + private static final long serialVersionUID = -807485081546883513L; + + public void resolve() { + getTargetCard().addOtherExtrinsicKeyword("Flying"); + Tgt.add(getTargetCard()); + AllZone.EndOfTurn.addAt(untilEOT); + } + + public boolean canPlay() { + CardList creats = new CardList(AllZone.getZone(Constant.Zone.Play,card.getController()).getCards()); + + creats = creats.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.getType().contains("Creature") && c.getNetDefense() < card.getNetAttack(); + } + }); + + return creats.size() > 0 && !card.isTapped() && !card.isSick(); + } + }; + + Input runtime = new Input() { + + private static final long serialVersionUID = 2101131021036402902L; + + @Override + public void showMessage() { + CardList valids = new CardList(AllZone.getZone(Constant.Zone.Play,card.getController()).getCards()); + valids = valids.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.getNetDefense() < card.getNetAttack(); + } + }); + + stopSetNext(CardFactoryUtil.input_targetSpecific(ability,valids,"Select target creature you control with toughness less than Stone Giant's power.",true,false)); + } + }; + ability.setBeforePayMana(runtime); + ability.setDescription("Tap: Target creature you control with toughness less than Stone Giant's power gains flying until end of turn. Destroy that creature at the beginning of the next end step."); + + card.addSpellAbility(ability); + }//*************** END ************ END ************************** //*************** START *********** START ************************** else if(cardName.equals("Belligerent Hatchling") || cardName.equals("Noxious Hatchling") || cardName.equals("Shrewd Hatchling") || cardName.equals("Sturdy Hatchling")