diff --git a/res/cards.txt b/res/cards.txt index 42953368985..8935c5d1142 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,19 @@ +Reprisal +1 W +Instant +Destroy target creature with power 4 or greater. It can't be regenerated. + +Ali from Cairo +2 R R +Creature Human +Damage that would reduce your life total to less than 1 reduces it to 1 instead. +0/1 + +Ivory Tower +1 +Artifact +At the beginning of your upkeep, you gain X life, where X is the number of cards in your hand minus four. + Lavalanche X B R G Sorcery diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 0961952fb03..e1ebe814c63 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17565,6 +17565,42 @@ public class CardFactory implements NewConstants { } //*************** END ************ END ************************** + //*************** START *********** START ************************** + if(cardName.equals("Reprisal")) { + final SpellAbility spell = new Spell(card) { + private static final long serialVersionUID = 8653455310355884536L; + + public void resolve() { + if(AllZone.GameAction.isCardInPlay(getTargetCard())) { + AllZone.GameAction.destroy(getTargetCard()); + } + }//resolve + };//SpellAbility + + card.clearSpellAbility(); + card.addSpellAbility(spell); + + Input target = new Input() { + private static final long serialVersionUID = 4794354831721082791L; + public void showMessage() { + AllZone.Display.showMessage("Select target Creature to destroy"); + ButtonUtil.enableOnlyCancel(); + } + public void selectButtonCancel() { + stop(); + } + public void selectCard(Card c, PlayerZone zone) { + if(zone.is(Constant.Zone.Play) && c.isCreature() && (c.getNetAttack() > 3)) { + spell.setTargetCard(c); + stopSetNext(new Input_PayManaCost(spell)); + } + } + };//input + + spell.setBeforePayMana(target); + }//*************** END ************ END ************************** + + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) { diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 34af05485b1..dbbef2dcf1a 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -9148,7 +9148,7 @@ public class CardFactory_Creatures { } };//SpellAbility card.addSpellAbility(ability); - ability.setDescription("W, tap: Tap target creature."); + ability.setDescription("B, tap: Tap target creature."); ability.setBeforePayMana(CardFactoryUtil.input_targetCreature(ability)); }//*************** END ************ END ************************** diff --git a/src/forge/GameAction.java b/src/forge/GameAction.java index e4b729dc668..8394a82483e 100644 --- a/src/forge/GameAction.java +++ b/src/forge/GameAction.java @@ -356,6 +356,18 @@ public class GameAction { } } + + private boolean isAliFromCairoInPlay(PlayerZone zone) { + if( zone == null ) { + return false; + } + else { + CardList all = new CardList(); + all.addAll(zone.getCards()); + return all.containsName("Ali from Cairo"); + } + } + public void checkStateEffects() { // System.out.println("checking !!!"); // RuntimeException run = new RuntimeException(); @@ -366,6 +378,12 @@ public class GameAction { boolean stop = false; + if (isAliFromCairoInPlay(AllZone.Computer_Play) && AllZone.Computer_Life.getLife() < 1) + AllZone.Computer_Life.setLife(1); + + if (isAliFromCairoInPlay(AllZone.Human_Play) && AllZone.Human_Life.getLife() < 1) + AllZone.Human_Life.setLife(1); + if(AllZone.Computer_Life.getLife() <= 0 || AllZone.Computer_PoisonCounter.getPoisonCounters() >= 10) { Constant.Runtime.WinLose.addWin(); stop = true; diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index e7353c46035..3ea0697bb1e 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -85,6 +85,7 @@ public class GameActionUtil { upkeep_Blaze_Counters(); upkeep_Dark_Confidant(); // keep this one semi-last + upkeep_Ivory_Tower(); upkeep_BlackVice(); // keep this one last, since it happens at the end // of the upkeep. upkeep_Howling_Mine(); // keep this one even laster, since it would @@ -5680,6 +5681,32 @@ public class GameActionUtil { }// for }// upkeep_Convalescence() + public static void upkeep_Ivory_Tower() { + final String player = AllZone.Phase.getActivePlayer(); + PlayerZone playZone = AllZone.getZone(Constant.Zone.Play,player); + + CardList list = new CardList(playZone.getCards()); + list = list.getName("Ivory Tower"); + + Ability ability; + for(int i = 0; i < list.size(); i++) { + ability = new Ability(list.get(i), "0") { + public void resolve() { + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player); + int numCards = hand.getCards().length; + if( numCards > 4 ) { + AllZone.GameAction.getPlayerLife(player).addLife(numCards-4); + } + } + };//Ability + ability.setStackDescription("Ivory Tower - " +player+ " gains 1 life for each card > 4"); + + AllZone.Stack.add(ability); + }//for + }//upkeep_Ivory Tower() + + + // Currently we don't determine the difference between beginning and end of // upkeep in MTG forge. // So Black Vise's effects happen at the beginning of the upkeep instead of diff --git a/src/forge/Mana_PayCost.java b/src/forge/Mana_PayCost.java index 45b2a39b6a3..b1a0e5c086e 100644 --- a/src/forge/Mana_PayCost.java +++ b/src/forge/Mana_PayCost.java @@ -22,7 +22,7 @@ public class Mana_PayCost { //note that when the cost is displayed it is backward "2/G 2/R 2/B 2/U 2/W" //so you would have to tap W, then U, then B, then R, then G (order matters) public Mana_PayCost(String manaCost) { - manaPart = split(manaCost); + manaPart = split(manaCost); } public boolean isNeeded(String mana) {