- Updated evaluateCreature.

This commit is contained in:
Sloth
2012-01-07 22:04:57 +00:00
parent f6e63f9a5e
commit 120621e9d8

View File

@@ -421,14 +421,9 @@ public class CardFactoryUtil {
if (c.isToken()) { if (c.isToken()) {
value = 80; // tokens should be worth less than actual cards value = 80; // tokens should be worth less than actual cards
} }
int power = c.getNetAttack(); int power = c.getNetCombatDamage();
final int toughness = c.getNetDefense(); final int toughness = c.getNetDefense();
// Doran
if (AllZoneUtil.isCardInPlay("Doran, the Siege Tower")) {
power = toughness;
}
if (c.hasKeyword("Prevent all combat damage that would be dealt by CARDNAME.") if (c.hasKeyword("Prevent all combat damage that would be dealt by CARDNAME.")
|| c.hasKeyword("Prevent all damage that would be dealt by CARDNAME.") || c.hasKeyword("Prevent all damage that would be dealt by CARDNAME.")
|| c.hasKeyword("Prevent all combat damage that would be dealt to and dealt by CARDNAME.") || c.hasKeyword("Prevent all combat damage that would be dealt to and dealt by CARDNAME.")
@@ -538,11 +533,6 @@ public class CardFactoryUtil {
} }
value += c.getKeywordMagnitude("Absorb") * 11; value += c.getKeywordMagnitude("Absorb") * 11;
// Activated Abilities
if (c.hasStartOfKeyword("ab")) {
value += 10;
}
// Bad keywords // Bad keywords
if (c.hasKeyword("Defender") || c.hasKeyword("CARDNAME can't attack.")) { if (c.hasKeyword("Defender") || c.hasKeyword("CARDNAME can't attack.")) {
value -= (power * 9) + 40; value -= (power * 9) + 40;
@@ -598,6 +588,12 @@ public class CardFactoryUtil {
value -= 20; // not used atm value -= 20; // not used atm
} }
for (SpellAbility sa : c.getSpellAbilities()) {
if (sa.isAbility()) {
value += 10;
}
}
if (c.isUntapped()) { if (c.isUntapped()) {
value += 1; value += 1;
} }
@@ -609,14 +605,13 @@ public class CardFactoryUtil {
// returns null if list.size() == 0 // returns null if list.size() == 0
/** /**
* <p> * <p>
* getBestCreatureAI. * getBestAI.
* </p> * </p>
* *
* @param list * @param list
* a {@link forge.CardList} object. * a {@link forge.CardList} object.
* @return a {@link forge.Card} object. * @return a {@link forge.Card} object.
*/ */
public static Card getBestAI(final CardList list) { public static Card getBestAI(final CardList list) {
// Get Best will filter by appropriate getBest list if ALL of the list // Get Best will filter by appropriate getBest list if ALL of the list
// is of that type // is of that type