Ruins stat gifts modified by game speed

This commit is contained in:
yairm210
2025-01-08 11:10:53 +02:00
parent 413ace3985
commit 50979e8a0e
4 changed files with 8 additions and 7 deletions

View File

@ -2,7 +2,7 @@
{
"name": "discover cultural artifacts",
"notification": "We have discovered cultural artifacts in the ruins! (+20 culture)",
"uniques": ["Gain [20] [Culture]"],
"uniques": ["Gain [20] [Culture] <(modified by game speed)>"],
"color": "#cf8ff7"
},
{
@ -31,7 +31,7 @@
{
"name": "a stash of gold",
"notification": "", // trigger notification only
"uniques": ["Gain [50]-[100] [Gold]"],
"uniques": ["Gain [50]-[100] [Gold] <(modified by game speed)>"],
"color": "#ffeb7f"
},
{

View File

@ -2,7 +2,7 @@
{
"name": "discover cultural artifacts",
"notification": "We have discovered cultural artifacts in the ruins! (+20 culture)",
"uniques": ["Gain [20] [Culture]"],
"uniques": ["Gain [20] [Culture] <(modified by game speed)>"],
"color": "#cf8ff7"
},
{
@ -31,7 +31,7 @@
{
"name": "a stash of gold",
"notification": "", // trigger notification only
"uniques": ["Gain [50]-[100] [Gold]"],
"uniques": ["Gain [50]-[100] [Gold] <(modified by game speed)>"],
"color": "#ffeb7f"
},
{

View File

@ -672,8 +672,9 @@ object UniqueTriggerActivation {
) return null
val finalStatAmount = (tileBasedRandom.nextInt(unique.params[0].toInt(), unique.params[1].toInt()) *
civInfo.gameInfo.speed.statCostModifiers[stat]!!).roundToInt()
val randomValue = tileBasedRandom.nextInt(unique.params[0].toInt(), unique.params[1].toInt())
val finalStatAmount = if (unique.isModifiedByGameSpeed()) (randomValue * civInfo.gameInfo.speed.statCostModifiers[stat]!!).roundToInt()
else randomValue
return {
val stats = Stats().add(stat, finalStatAmount.toFloat())

View File

@ -810,7 +810,7 @@ enum class UniqueType(
OneTimeGainResource("Instantly gain [amount] [stockpile]", UniqueTarget.Triggerable, flags = setOf(UniqueFlag.AcceptsSpeedModifier)),
OneTimeGainStat("Gain [amount] [stat]", UniqueTarget.Triggerable, flags = setOf(UniqueFlag.AcceptsSpeedModifier)),
OneTimeGainStatRange("Gain [amount]-[amount] [stat]", UniqueTarget.Triggerable),
OneTimeGainStatRange("Gain [amount]-[amount] [stat]", UniqueTarget.Triggerable, flags = setOf(UniqueFlag.AcceptsSpeedModifier)),
OneTimeGainPantheon("Gain enough Faith for a Pantheon", UniqueTarget.Triggerable),
OneTimeGainProphet("Gain enough Faith for [amount]% of a Great Prophet", UniqueTarget.Triggerable),