1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-09 01:01:06 -09:00

Optimized the AI-ScoringSystem for enchantments.

This commit is contained in:
LevelX2 2013-03-15 16:00:44 +01:00
parent f005c75d7c
commit dcacb90ba9

View file

@ -9,6 +9,9 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
import mage.Constants.Outcome;
import mage.abilities.effects.Effect;
import mage.abilities.keyword.EnchantAbility;
/**
* @author ubeefx, nantuko
@ -85,13 +88,21 @@ public class ArtificialScoringSystem {
Card card = game.getCard(uuid);
if (card != null) {
if (card.getCardType().contains(Constants.CardType.ENCHANTMENT)) {
enchantments++;
Effect effect = card.getSpellAbility().getEffects().get(0);
if (effect != null) {
Outcome outcome = effect.getOutcome();
if (outcome.isGood()) {
enchantments++;
} else if (!outcome.equals(Outcome.Detriment)) {
enchantments--;
}
}
} else {
equipments++;
}
}
}
score += equipments*50 /*+ enchantments*100*/;
score += equipments*50 + enchantments*100;
if (!permanent.canAttack(game)) {
score -= 100;