diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 4eee369073d..8b01104d8c6 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,8 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg +goblin_mutant.jpg http://www.wizards.com/global/images/magic/general/goblin_mutant.jpg +orgg.jpg http://www.wizards.com/global/images/magic/general/orgg.jpg brassclaw_orcs.jpg http://www.wizards.com/global/images/magic/general/brassclaw_orcs.jpg ironclaw_buzzardiers.jpg http://www.wizards.com/global/images/magic/general/ironclaw_buzzardiers.jpg ironclaw_curse.jpg http://www.wizards.com/global/images/magic/general/ironclaw_curse.jpg diff --git a/res/cards.txt b/res/cards.txt index da30f14b26e..a2342c53b40 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,21 @@ +Goblin Mutant +2 R R +Creature Goblin Mutant +no text +5/3 +Trample +CARDNAME can't attack if defending player controls an untapped creature with power 3 or greater. +CARDNAME can't block creatures with power 3 or greater. + +Orgg +3 R R +Creature Orgg +no text +6/6 +Trample +CARDNAME can't attack if defending player controls an untapped creature with power 3 or greater. +CARDNAME can't block creatures with power 3 or greater. + Brassclaw Orcs 2 R Creature Orc diff --git a/src/forge/CombatUtil.java b/src/forge/CombatUtil.java index 9c82e64a7ce..6a8f4ef7209 100644 --- a/src/forge/CombatUtil.java +++ b/src/forge/CombatUtil.java @@ -186,6 +186,46 @@ public class CombatUtil { if(!c.getKeyword().contains("Flying")) moatPrevented = true; } + // CARDNAME can't attack if defending player controls an untapped creature with power ... + + final int powerLimit[] = {0}; + int keywordPosition = 0; + boolean hasKeyword = false; + + ArrayList attackerKeywords = c.getKeyword(); + for (int i = 0; i < attackerKeywords.size(); i++) { + if (attackerKeywords.get(i).toString().startsWith("CARDNAME can't attack if defending player controls an untapped creature with power")) { + hasKeyword = true; + keywordPosition = i; + } + } + + if (hasKeyword) { // The keyword "CARDNAME can't attack if defending player controls an untapped creature with power" ... is present + String tmpString = c.getKeyword().get(keywordPosition).toString(); + String asSeparateWords[] = tmpString.trim().split(" "); + + if (asSeparateWords.length >= 13) { + if (asSeparateWords[12].matches("[0-9][0-9]?")) { + powerLimit[0] = Integer.parseInt((asSeparateWords[12]).trim()); + + CardList list = null; + if(c.getController().equals(Constant.Player.Human)) { + list = new CardList(AllZone.Computer_Play.getCards()); + } else { + list = new CardList(AllZone.Human_Play.getCards()); + } + + list = list.getType("Creature"); + list = list.filter(new CardListFilter() { + public boolean addCard(Card ct) { + return (ct.isUntapped() && ct.getNetAttack() >= powerLimit[0]); + } + }); + if (!list.isEmpty()) return false; + } + } + } // hasKeyword = CARDNAME can't attack if defending player controls an untapped creature with power ... + PlayerZone play = AllZone.getZone(Constant.Zone.Play, AllZone.GameAction.getOpponent(c.getController())); CardList list = new CardList(play.getCards()); CardList temp;