From ee5aa38129df6343a398380699372b4ecbd8ab68 Mon Sep 17 00:00:00 2001 From: 9kgsofrice <65415105+9kgsofrice@users.noreply.github.com> Date: Sat, 12 Dec 2020 18:10:39 +0000 Subject: [PATCH] GG bonus generation now checks for civinfo uniques (#3412) * great general bonus isn't applied to national uniques check added to allow this * added uniques together :) * added vals in line with similar checks - more efficient(?) --- core/src/com/unciv/logic/battle/Battle.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 64da63a24d..04a7aa9cf5 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -283,8 +283,10 @@ object Battle { if(thisCombatant.getCivInfo().isMajorCiv()) { var greatGeneralPointsModifier = 1f - for (unique in thisCombatant.unit.getMatchingUniques("[] is earned []% faster")) - if (unique.params[0] == Constants.greatGeneral) + val unitUniques = thisCombatant.unit.getMatchingUniques("[] is earned []% faster") + val civUniques = thisCombatant.unit.civInfo.getMatchingUniques("[] is earned []% faster") + for (unique in unitUniques + civUniques) + if (unique.params[0] == Constants.greatGeneral) greatGeneralPointsModifier += unique.params[1].toFloat() / 100 if (thisCombatant.unit.hasUnique("Combat very likely to create Great Generals")) // As of 3.10.10 This is to be deprecated and converted to "[Great General] is earned []% faster" - keeping it here to that mods with this can still work for now