mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 18:28:42 +07:00
Resolved #8489 - modded notifications for ruins providing stats
This commit is contained in:
@ -21,6 +21,7 @@ import com.unciv.models.translations.fillPlaceholders
|
|||||||
import com.unciv.models.translations.hasPlaceholderParameters
|
import com.unciv.models.translations.hasPlaceholderParameters
|
||||||
import com.unciv.ui.utils.MayaCalendar
|
import com.unciv.ui.utils.MayaCalendar
|
||||||
import com.unciv.ui.worldscreen.unit.actions.UnitActionsUpgrade
|
import com.unciv.ui.worldscreen.unit.actions.UnitActionsUpgrade
|
||||||
|
import kotlin.math.roundToInt
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
// Buildings, techs, policies, ancient ruins and promotions can have 'triggered' effects
|
// Buildings, techs, policies, ancient ruins and promotions can have 'triggered' effects
|
||||||
@ -382,10 +383,10 @@ object UniqueTriggerActivation {
|
|||||||
|| unique.params[1].toIntOrNull() == null
|
|| unique.params[1].toIntOrNull() == null
|
||||||
) return false
|
) return false
|
||||||
|
|
||||||
val finalStatAmount = tileBasedRandom.nextInt(unique.params[0].toInt(), unique.params[1].toInt()) *
|
val finalStatAmount = (tileBasedRandom.nextInt(unique.params[0].toInt(), unique.params[1].toInt()) *
|
||||||
civInfo.gameInfo.speed.statCostModifiers[stat]!!
|
civInfo.gameInfo.speed.statCostModifiers[stat]!!).roundToInt()
|
||||||
|
|
||||||
val stats = Stats().add(stat, finalStatAmount)
|
val stats = Stats().add(stat, finalStatAmount.toFloat())
|
||||||
civInfo.addStats(stats)
|
civInfo.addStats(stats)
|
||||||
|
|
||||||
val filledNotification = if (notification!=null && notification.hasPlaceholderParameters())
|
val filledNotification = if (notification!=null && notification.hasPlaceholderParameters())
|
||||||
|
Reference in New Issue
Block a user