Modified bidding evaluation for AI (Mages' Contest)

This commit is contained in:
L_J 2018-08-30 18:52:51 +00:00 committed by GitHub
parent a018f6fb5c
commit a0776d7b66
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(Math.max(currentPlayer.getLife(), 0)) + RandomUtil.nextInt(spell.getConvertedManaCost()), currentPlayer.getLife());
int maxBid = Math.min(RandomUtil.nextInt(Math.max(currentPlayer.getLife(), 1)) + RandomUtil.nextInt(Math.max(spell.getConvertedManaCost(), 1)), currentPlayer.getLife());
if (highBid + 1 < maxBid) {
newBid = highBid + 1;
}