Modified bidding evaluation for AI (Mages' Contest)

This commit is contained in:
L_J 2018-08-28 15:08:05 +00:00 committed by GitHub
parent a45c7dd22f
commit dca2ec174b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@ class MagesContestEffect extends OneShotEffect {
int newBid = 0;
if (!currentPlayer.isHuman()) {
// make AI evaluate value of the spell to decide on bidding, should be reworked
int maxBid = Math.min(RandomUtil.nextInt(currentPlayer.getLife()) + RandomUtil.nextInt(spell.getConvertedManaCost()), currentPlayer.getLife());
int maxBid = Math.min(RandomUtil.nextInt(Math.max(currentPlayer.getLife(), 0)) + RandomUtil.nextInt(spell.getConvertedManaCost()), currentPlayer.getLife());
if (highBid + 1 < maxBid) {
newBid = highBid + 1;
}