From e3e1d0fb49da271fe908ac142385c29ffaee319b Mon Sep 17 00:00:00 2001 From: EmperorPinguin <99119424+EmperorPinguin@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:09:14 +0100 Subject: [PATCH] Move Spy tech steal modifiers to mod constants (#12964) * Update ModConstants.kt * Update Spy.kt * Update ModConstants.kt --- core/src/com/unciv/models/ModConstants.kt | 6 +++++- core/src/com/unciv/models/Spy.kt | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/models/ModConstants.kt b/core/src/com/unciv/models/ModConstants.kt index 6a106eeedd..06806b6fe6 100644 --- a/core/src/com/unciv/models/ModConstants.kt +++ b/core/src/com/unciv/models/ModConstants.kt @@ -108,9 +108,13 @@ class ModConstants { // Espionage var maxSpyRank = 3 // How much of a skill bonus each rank gives. - // Rank 0 is 100%, rank 1 is 130%, and so on for stealing technology. + // Rank 0 is 100, rank 1 is 130, and so on. // Half as much for a coup. var spyRankSkillPercentBonus = 30 + // Rank 2 is +25% tech steal rate, rank 3 is +50%, and so on + var spyRankStealPercentBonus = 25 + // Steal cost equal to 125% of the most expensive stealable tech + var spyTechStealCostModifier = 1.25f // UI: If set >= 0, ImprovementPicker will silently skip improvements whose tech requirement is more advanced than your current Era + this var maxImprovementTechErasForward = -1 diff --git a/core/src/com/unciv/models/Spy.kt b/core/src/com/unciv/models/Spy.kt index b6f180b3ba..b3208ae907 100644 --- a/core/src/com/unciv/models/Spy.kt +++ b/core/src/com/unciv/models/Spy.kt @@ -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()