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:
parent
f005c75d7c
commit
dcacb90ba9
1 changed files with 13 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue