mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 18:28:42 +07:00
Unhappiness battle modifier properly capped now
This commit is contained in:
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 28
|
||||
versionCode 178
|
||||
versionName "2.10.14"
|
||||
versionCode 179
|
||||
versionName "2.10.15"
|
||||
}
|
||||
|
||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||
|
@ -2,7 +2,7 @@ package com.unciv.logic.battle
|
||||
|
||||
import com.unciv.logic.map.MapUnit
|
||||
import com.unciv.models.gamebasics.unit.UnitType
|
||||
import kotlin.math.min
|
||||
import kotlin.math.max
|
||||
|
||||
class BattleDamageModifier(val vs:String,val modificationAmount:Float){
|
||||
fun getText(): String = "vs $vs"
|
||||
@ -47,7 +47,7 @@ class BattleDamage{
|
||||
|
||||
//https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
|
||||
if (combatant.getCivilization().happiness < 0)
|
||||
modifiers["Unhappiness"] = min(0.02f * combatant.getCivilization().happiness,0.9f) // otherwise it could exceed 100% and start healing enemy units...
|
||||
modifiers["Unhappiness"] = max(0.02f * combatant.getCivilization().happiness,-0.9f) // otherwise it could exceed -100% and start healing enemy units...
|
||||
|
||||
if(combatant.getCivilization().policies.isAdopted("Populism"))
|
||||
modifiers["Populism"] = 0.25f
|
||||
|
Reference in New Issue
Block a user