More visitors for keywords and merge duplicate keyword amount methods.

This commit is contained in:
Myrd
2014-12-31 03:57:16 +00:00
parent 35a1daf116
commit c2904fa2aa
6 changed files with 26 additions and 41 deletions

View File

@@ -857,7 +857,7 @@ public class AiAttackController {
public final static int countExaltedBonus(final Player player) {
int bonus = 0;
for (Card c : player.getCardsIn(ZoneType.Battlefield)) {
bonus += c.getKeywordAmount("Exalted");
bonus += c.getAmountOfKeyword("Exalted");
}
return bonus;

View File

@@ -1140,7 +1140,7 @@ public class ComputerUtilCombat {
//check Exalted only for the first attacker
if (combat != null && combat.getAttackers().isEmpty()) {
for (Card card : attacker.getController().getCardsIn(ZoneType.Battlefield)) {
power += card.getKeywordAmount("Exalted");
power += card.getAmountOfKeyword("Exalted");
}
}
@@ -1323,7 +1323,7 @@ public class ComputerUtilCombat {
//check Exalted only for the first attacker
if (combat != null && combat.getAttackers().isEmpty()) {
for (Card card : attacker.getController().getCardsIn(ZoneType.Battlefield)) {
toughness += card.getKeywordAmount("Exalted");
toughness += card.getAmountOfKeyword("Exalted");
}
}

View File

@@ -362,8 +362,8 @@ public abstract class PumpAiBase extends SpellAbilityAi {
|| !ph.getPhase().equals(PhaseType.COMBAT_DECLARE_ATTACKERS)) {
return false;
}
int canBlockNum = 1 + card.getKeywordAmount("CARDNAME can block an additional creature.") +
card.getKeywordAmount("CARDNAME can block an additional ninety-nine creatures.") * 99;
int canBlockNum = 1 + card.getAmountOfKeyword("CARDNAME can block an additional creature.") +
card.getAmountOfKeyword("CARDNAME can block an additional ninety-nine creatures.") * 99;
int possibleBlockNum = 0;
for (Card attacker : game.getCombat().getAttackers()) {
if (CombatUtil.canBlock(attacker, card)) {