small bug meant that there was a 67% chance NOT to capture defeated barbarian unit (#3450)

This commit is contained in:
9kgsofrice 2020-12-25 10:55:20 +00:00 committed by GitHub
parent 76e9f973c5
commit 099ee879cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,7 +190,7 @@ object Battle {
if (defender.isDefeated() && defender.getCivInfo().isBarbarian() if (defender.isDefeated() && defender.getCivInfo().isBarbarian()
&& attackedTile.improvement == Constants.barbarianEncampment && attackedTile.improvement == Constants.barbarianEncampment
&& attacker.getCivInfo().hasUnique("67% chance to earn 25 Gold and recruit a Barbarian unit from a conquered encampment") && attacker.getCivInfo().hasUnique("67% chance to earn 25 Gold and recruit a Barbarian unit from a conquered encampment")
&& Random().nextDouble() > 0.67) { && Random().nextDouble() < 0.67) {
attacker.getCivInfo().placeUnitNearTile(attackedTile.position, defender.getName()) attacker.getCivInfo().placeUnitNearTile(attackedTile.position, defender.getName())
attacker.getCivInfo().gold += 25 attacker.getCivInfo().gold += 25
attacker.getCivInfo().addNotification("A barbarian [${defender.getName()}] has joined us!", attackedTile.position, Color.RED) attacker.getCivInfo().addNotification("A barbarian [${defender.getName()}] has joined us!", attackedTile.position, Color.RED)