- Two improvements for the AI of AF Pump Curse:

- The AI will recognize duplicate HIDDEN keywords.
 - The AI will no longer give "HIDDEN CARDNAME attacks each turn if able." during his own turn.
This commit is contained in:
Sloth
2011-11-05 09:09:40 +00:00
parent fb0daf391c
commit 8981073cd3
3 changed files with 8 additions and 2 deletions

View File

@@ -6,7 +6,6 @@ PT:5/3
K:Defender
K:Flying
A:AB$ Pump | Cost$ 1 R | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ HIDDEN CARDNAME attacks each turn if able. | IsCurse$ True | SpellDescription$ Target creature attacks this turn if able.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rage_nimbus.jpg
SetInfo:ROE|Rare|http://magiccards.info/scans/en/roe/160.jpg

View File

@@ -6070,7 +6070,11 @@ public class Card extends GameEntity implements Comparable<Card> {
* @return a boolean.
*/
public final boolean hasKeyword(final String keyword) {
return getKeyword().contains(keyword);
String kw = new String(keyword);
if (kw.startsWith("HIDDEN")) {
kw = kw.substring(7);
}
return getKeyword().contains(kw);
}
/**

View File

@@ -360,6 +360,9 @@ public class AbilityFactoryPump {
if (!this.containsCombatRelevantKeyword(this.keywords)
&& AllZone.getPhase().isBefore(Constant.Phase.MAIN2)) {
list.clear(); // this keyword is not combat relevenat
} else if (this.keywords.get(0).equals("HIDDEN CARDNAME attacks each turn if able.")
&& AllZone.getPhase().isPlayerTurn(AllZone.getComputerPlayer())) {
list.clear();
}
list = list.filter(new CardListFilter() {