mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Ibrushed up on the rules and there are ways to have influence decrease in quantities less than 1, so you were right, it is a float
This commit is contained in:
parent
de9ae3da54
commit
0eb6b91957
@ -17,7 +17,7 @@ class UnCivGame(val version: String) : Game() {
|
||||
* This exists so that when debugging we can see the entire map.
|
||||
* Remember to turn this to false before commit and upload!
|
||||
*/
|
||||
val viewEntireMapForDebug = true
|
||||
val viewEntireMapForDebug = false
|
||||
|
||||
// For when you need to test something in an advanced game and don't have time to faff around
|
||||
val superchargedForDebug = false
|
||||
|
@ -147,7 +147,7 @@ class CivilizationInfo {
|
||||
for (otherCivName in diplomacy.keys) {
|
||||
val otherCiv = gameInfo.getCivilization(otherCivName)
|
||||
if (otherCiv.isCityState() && otherCiv.diplomacy[civName]!!.influence > 60) {
|
||||
var cultureBonus = Stats()
|
||||
val cultureBonus = Stats()
|
||||
cultureBonus.add(Stat.Culture, 5.0f * getEra().ordinal)
|
||||
if (statMap.containsKey("City States"))
|
||||
statMap["City States"] = statMap["City States"]!! + cultureBonus
|
||||
|
@ -28,7 +28,7 @@ class DiplomacyManager() {
|
||||
* The JSON serialize/deserialize REFUSES to deserialize hashmap keys as Enums, so I'm forced to use strings instead =(
|
||||
* This is so sad Alexa play Despacito */
|
||||
var flagsCountdown = HashMap<String,Int>()
|
||||
var influence: Int = 0 // For city states
|
||||
var influence = 0f // For city states
|
||||
|
||||
fun clone(): DiplomacyManager {
|
||||
val toReturn = DiplomacyManager()
|
||||
@ -145,11 +145,11 @@ class DiplomacyManager() {
|
||||
if(flagsCountdown[flag]==0) flagsCountdown.remove(flag)
|
||||
}
|
||||
|
||||
if (influence > 0) {
|
||||
if (influence > 1) {
|
||||
influence -= 1
|
||||
} else if (influence < 0) {
|
||||
} else if (influence < 1) {
|
||||
influence += 1
|
||||
}
|
||||
} else influence = 0f
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user