From 1f5fa74cea89fdf87841f1eed52e1962e7d73562 Mon Sep 17 00:00:00 2001 From: 9kgsofrice <65415105+9kgsofrice@users.noreply.github.com> Date: Wed, 2 Dec 2020 21:04:00 +0000 Subject: [PATCH] adds val to modoptions and check to battle.kt to adjust max xp from barbarians (#3389) --- core/src/com/unciv/logic/battle/Battle.kt | 2 +- core/src/com/unciv/models/ruleset/Ruleset.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 8bf6033b9d..87e28d556e 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -267,7 +267,7 @@ object Battle { // XP! private fun addXp(thisCombatant:ICombatant, amount:Int, otherCombatant:ICombatant){ if(thisCombatant !is MapUnitCombatant) return - if(thisCombatant.unit.promotions.totalXpProduced() >= 30 && otherCombatant.getCivInfo().isBarbarian()) + if(thisCombatant.unit.promotions.totalXpProduced() >= thisCombatant.unit.civInfo.gameInfo.ruleSet.modOptions.maxXPfromBarbarians && otherCombatant.getCivInfo().isBarbarian()) return var XPModifier = 1f diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index 134a6afd82..3d0882276f 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -32,6 +32,7 @@ class ModOptions { var unitsToRemove = HashSet() var nationsToRemove = HashSet() var uniques = HashSet() + val maxXPfromBarbarians = 30 } class Ruleset {