Skip to content

Commit

Permalink
Ruins stat gifts modified by game speed
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Jan 8, 2025
1 parent 413ace3 commit 50979e8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions android/assets/jsons/Civ V - Gods & Kings/Ruins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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"
},
{
Expand Down
4 changes: 2 additions & 2 deletions android/assets/jsons/Civ V - Vanilla/Ruins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/unciv/models/ruleset/unique/UniqueType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Expand Down

0 comments on commit 50979e8

Please sign in to comment.