mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-20 19:56:51 +01:00
Modification of the random part of Prize Ship to avoid save scumming (#8448)
* Modification of the random part of Prize Ship to avoid save scumming * Update core/src/com/unciv/logic/battle/Battle.kt Code modification for readability Co-authored-by: Yair Morgenstern <yairm210@hotmail.com> * Added conversion to Long Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
This commit is contained in:
parent
04cb4bd2a9
commit
dcdcc3bc8c
|
|
@ -242,7 +242,9 @@ object Battle {
|
|||
0.1f + attacker.getAttackingStrength().toFloat() / defender.getDefendingStrength()
|
||||
.toFloat() * 0.4f
|
||||
)
|
||||
return Random().nextFloat() <= captureChance
|
||||
/** Between 0 and 1. Defaults to turn and location-based random to avoid save scumming */
|
||||
val random = Random((attacker.getCivInfo().gameInfo.turns * defender.getTile().position.hashCode()).toLong())
|
||||
return random.nextFloat() <= captureChance
|
||||
}
|
||||
|
||||
fun unitGainFromEncampment(): Boolean {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user