From 3ed8b68d2906e86d6d13b22f8d87c1d07d99eb78 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 06:04:12 +0000 Subject: [PATCH] - Added Ravenous Baloth. --- res/cards.txt | 6 +++ src/forge/CardFactory_Creatures.java | 60 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/res/cards.txt b/res/cards.txt index 30d690263f5..4d234f161e5 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,9 @@ +Ravenous Baloth +2 G G +Creature Beast +no text +4/4 + Elven Cache 2 G G Sorcery diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index e8ccfd414d7..cb0aec30e07 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -20986,6 +20986,66 @@ public class CardFactory_Creatures { //card.addSpellAbility(CardFactoryUtil.ability_Devour(card, magnitude)); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Ravenous Baloth")) { + final SpellAbility ability = new Ability_Activated(card,"0") { + + private static final long serialVersionUID = 4242089395799673253L; + public boolean canPlayAI() { + CardList creats = AllZoneUtil.getCreaturesInPlay(Constant.Player.Computer); + creats = creats.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.getType().contains("Beast") || c.getKeyword().contains("Changeling") + && CardFactoryUtil.canTarget(card, c); + } + }); + if( creats.size() > 0) { + if (AllZone.GameAction.getPlayerLife(Constant.Player.Computer).getLife() < 5 ) { + CardListUtil.sortAttackLowFirst(creats); + setTargetCard(creats.get(0)); + return true; + } + else { + return false; + } + } + else return false; + } + + public void resolve() { + AllZone.GameAction.getPlayerLife(card.getController()).addLife(4); + AllZone.GameAction.sacrifice(getTargetCard()); + } + };//SpellAbility + + Input runtime = new Input() { + + private static final long serialVersionUID = 6566691243159414430L; + + public void showMessage() { + //ability.setStackDescription(card +" - Sacrifice a land to gain 2 life."); + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + CardList choice = new CardList(play.getCards()); + choice = choice.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.getType().contains("Beast") || c.getKeyword().contains("Changeling") + && CardFactoryUtil.canTarget(card, c); + } + }); + stopSetNext(CardFactoryUtil.input_sacrifice(ability,choice,"Select a Beast to sacrifice.")); + } + }; + ability.setDescription("Sacrifice a Beast: You gain 4 life."); + ability.setStackDescription(card + " - You gain 4 life."); + card.addSpellAbility(ability); + ability.setBeforePayMana(runtime); + }//*************** END ************ END ************************** + + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(shouldCycle(card) != -1) {