Small refactor to the fix for #6844.

This commit is contained in:
Jeff Wadsworth 2023-11-05 19:59:54 -06:00
parent 5a356e1388
commit 4f0ff05069

View file

@ -13,6 +13,7 @@ import org.apache.log4j.Logger;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.constants.Outcome;
/** /**
* @author nantuko * @author nantuko
@ -114,7 +115,7 @@ public final class GameStateEvaluator2 {
Permanent attachment = game.getPermanent(attachmentId); Permanent attachment = game.getPermanent(attachmentId);
for (Ability a : attachment.getAbilities(game)) { for (Ability a : attachment.getAbilities(game)) {
for (Effect e : a.getEffects()) { for (Effect e : a.getEffects()) {
if (!e.getOutcome().isGood() if (e.getOutcome().equals(Outcome.Detriment)
&& attachment.getControllerId().equals(permanent.getControllerId())) { && attachment.getControllerId().equals(permanent.getControllerId())) {
value -= 1000; // seems to work well ; -300 is not effective enough value -= 1000; // seems to work well ; -300 is not effective enough
} }
@ -130,7 +131,6 @@ public final class GameStateEvaluator2 {
public static int evaluateCreature(Permanent creature, Game game) { public static int evaluateCreature(Permanent creature, Game game) {
int value = ArtificialScoringSystem.getFixedPermanentScore(game, creature) int value = ArtificialScoringSystem.getFixedPermanentScore(game, creature)
+ ArtificialScoringSystem.getVariablePermanentScore(game, creature); + ArtificialScoringSystem.getVariablePermanentScore(game, creature);
System.out.println("The VALUE is : " + value);
return value; return value;
} }