diff --git a/core/src/com/unciv/Constants.kt b/core/src/com/unciv/Constants.kt index 010e14c873..6b56a6fdf8 100644 --- a/core/src/com/unciv/Constants.kt +++ b/core/src/com/unciv/Constants.kt @@ -5,7 +5,6 @@ object Constants { const val workerUnique = "Can build improvements on tiles" const val settler = "Settler" const val settlerUnique = "Founds a new city" - const val greatGeneral = "Great General" const val impassable = "Impassable" const val ocean = "Ocean" diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index 397e6c94c1..3cc5c0e7f1 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -451,7 +451,7 @@ object NextTurnAutomation { when { unit.type.isRanged() -> rangedUnits.add(unit) unit.type.isMelee() -> meleeUnits.add(unit) - unit.name == Constants.greatGeneral || unit.baseUnit.replaces == Constants.greatGeneral + unit.hasUnique("Bonus for units in 2 tile radius 15%") -> generals.add(unit) //generals move after military units else -> civilianUnits.add(unit) } diff --git a/core/src/com/unciv/logic/automation/UnitAutomation.kt b/core/src/com/unciv/logic/automation/UnitAutomation.kt index 20b4c4ef13..744a652b5e 100644 --- a/core/src/com/unciv/logic/automation/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/UnitAutomation.kt @@ -97,7 +97,7 @@ object UnitAutomation { if (unit.name == "Work Boats") return SpecificUnitAutomation.automateWorkBoats(unit) - if (unit.name == Constants.greatGeneral || unit.baseUnit.replaces == Constants.greatGeneral) + if (unit.hasUnique("Bonus for units in 2 tile radius 15%")) return SpecificUnitAutomation.automateGreatGeneral(unit) if (unit.hasUnique("Can construct []")) diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index f94a7aaff0..bb6389ad8d 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -269,10 +269,13 @@ object Battle { if(thisCombatant.getCivInfo().isMajorCiv()) { var greatGeneralPointsModifier = 1f 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) + val civUniques = thisCombatant.getCivInfo().getMatchingUniques("[] is earned []% faster") + for (unique in unitUniques + civUniques) { + val unitName = unique.params[0] + val unit = thisCombatant.getCivInfo().gameInfo.ruleSet.units[unitName] + if (unit != null && unit.uniques.contains("Great Person - [War]")) greatGeneralPointsModifier += unique.params[1].toFloat() / 100 + } val greatGeneralPointsGained = (XPGained * greatGeneralPointsModifier).toInt() thisCombatant.getCivInfo().greatPeople.greatGeneralPoints += greatGeneralPointsGained