CARDNAME can't attack if defending player controls an untapp
CARDNAME can't attack if defending player controls an untapped creature with power {rest of text string}
This keyword is for the various cards that are based upon the Orgg and Goblin Mutant type of ability. The keyword currently has this format:
The only forms supported at this time will look like:
The cards.txt entries will look like this:
Near the top of CombatUtil.java in the canAttack() method:
This keyword is for the various cards that are based upon the Orgg and Goblin Mutant type of ability. The keyword currently has this format:
- Code: Select all
CARDNAME can't attack if defending player controls an untapped creature with power {rest of text string}
The only forms supported at this time will look like:
- Code: Select all
CARDNAME can't attack if defending player controls an untapped creature with power {num} or {"greater." or "less."}
The cards.txt entries will look like this:
- Code: Select all
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.
Mogg Jailer
1 R
Creature Goblin
no text
2/2
CARDNAME can't attack if defending player controls an untapped creature with power 2 or less.
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.
Near the top of CombatUtil.java in the canAttack() method:
- Code: Select all
// 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();
final String asSeparateWords[] = tmpString.trim().split(" ");
if (asSeparateWords.length >= 15) {
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] && asSeparateWords[14].contains("greater")) ||
(ct.isUntapped() && ct.getNetAttack() <= powerLimit[0] && asSeparateWords[14].contains("less")));
}
});
if (!list.isEmpty()) return false;
}
}
} // hasKeyword = CARDNAME can't attack if defending player controls an untapped creature with power ...