Unhappiness battle modifier properly capped now

This commit is contained in:
Yair Morgenstern
2018-12-12 22:57:03 +02:00
parent 9187465699
commit 406fa60f61
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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