From 04457558b39f957a95444a187d10fe31b1fa491c Mon Sep 17 00:00:00 2001 From: brodee Date: Sat, 27 Oct 2018 11:50:59 -0700 Subject: [PATCH] ai tweaks: improve rating for multicolor cards and reduce effect of rarity multicolor cards are the payoffs for playing those colors so they should be better reduced the effect of rarity increasing the rating --- .../java/mage/player/ai/utils/RateCard.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java index e737122a958..877bb466314 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java @@ -169,11 +169,13 @@ public final class RateCard { } private static final int SINGLE_PENALTY[] = {0, 1, 1, 3, 6, 9}; + private static final int MULTICOLOR_BONUS = 15; /** * Get manacost score. * Depends on chosen colors. Returns negative score for those cards that doesn't fit allowed colors. * If allowed colors are not chosen, then score based on converted cost is returned with penalty for heavy colored cards. + * gives bonus to multicolor cards that fit within allowed colors and if allowed colors is <5 * * * @param card @@ -216,7 +218,12 @@ public final class RateCard { } if (maxSingleCount > 5) maxSingleCount = 5; - return 2 * converted + 3 * (10 - SINGLE_PENALTY[maxSingleCount]/*-DOUBLE_PENALTY[doubleCount]*/); + + int rate = 2 * converted + 3 * (10 - SINGLE_PENALTY[maxSingleCount]); + if( singleCount.size() > 1 && singleCount.size() < 5){ + rate += MULTICOLOR_BONUS; + } + return rate; } /** @@ -230,13 +237,13 @@ public final class RateCard { private static int getRarityScore(Card card) { Rarity r = card.getRarity(); if (Rarity.MYTHIC == r){ - return 80; + return 60; }else if (Rarity.RARE == r){ - return 50; + return 40; }else if (Rarity.UNCOMMON == r){ - return 25; + return 20; }else{ - return 1; + return 0; } } /**