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
This commit is contained in:
brodee 2018-10-27 11:50:59 -07:00
parent 843702bd86
commit 04457558b3

View file

@ -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;
}
}
/**