mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-20 19:56:51 +01:00
Update Spy.kt
This commit is contained in:
parent
9d551fd137
commit
40cc283784
|
|
@ -170,13 +170,15 @@ class Spy private constructor() : IsPartOfGameInfoSerialization {
|
|||
if (stealableTechs.isEmpty()) return -1
|
||||
|
||||
var techStealCost = stealableTechs.maxOfOrNull { civInfo.gameInfo.ruleset.technologies[it]!!.cost }!!.toFloat()
|
||||
val techStealCostModifier = civInfo.gameInfo.ruleset.modOptions.constants.spyTechStealCostModifier //1.25f in Civ5 GlobalDefines.XML
|
||||
val techSpeedModifier = civInfo.gameInfo.speed.scienceCostModifier //Modify steal cost according to game speed
|
||||
techStealCost *= techSpeedModifier * 1.25f //Multiply by 1.25f, according to Civ5 GlobalDefines.XML
|
||||
techStealCost *= techStealCostModifier * techSpeedModifier
|
||||
var progressThisTurn = getCity().cityStats.currentCityStats.science
|
||||
if (progressThisTurn <= 0f) return -2 // The city has no science
|
||||
|
||||
// 25% spy bonus for each level
|
||||
progressThisTurn *= (rank + 3f) / 4f
|
||||
val rankTechStealModifier = rank * civInfo.gameInfo.ruleset.modOptions.constants.spyRankStealPercentBonus
|
||||
progressThisTurn *= (rankTechStealModifier + 75f) / 100f
|
||||
progressThisTurn *= getEfficiencyModifier().toFloat()
|
||||
progressTowardsStealingTech += progressThisTurn.toInt()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user