mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Added two new cards: Goblin Mutant and Orgg to cards.txt, card-pictures.txt and CombatUtil.java. These two cards are implemented by anew keyword
CARDNAME can't attack if defending player controls an untapped creature with power {num} or greater.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<String> 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;
|
||||
|
||||
Reference in New Issue
Block a user