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