From 80233199b7cfee38b655a5123d0e65b1f849e345 Mon Sep 17 00:00:00 2001 From: wvpm <24685035+wvpm@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:50:05 +0100 Subject: Support attrition modifier from terrain --- src/openvic-simulation/modifier/ModifierEffectCache.cpp | 3 ++- src/openvic-simulation/modifier/ModifierEffectCache.hpp | 3 ++- src/openvic-simulation/modifier/ModifierManager.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openvic-simulation/modifier/ModifierEffectCache.cpp b/src/openvic-simulation/modifier/ModifierEffectCache.cpp index 0e7141f..d8fb208 100644 --- a/src/openvic-simulation/modifier/ModifierEffectCache.cpp +++ b/src/openvic-simulation/modifier/ModifierEffectCache.cpp @@ -197,6 +197,7 @@ ModifierEffectCache::ModifierEffectCache() local_rgo_throughput { nullptr }, local_ruling_party_support { nullptr }, local_ship_build { nullptr }, + attrition_local { nullptr }, max_attrition { nullptr }, mine_rgo_throughput_global { nullptr }, mine_rgo_output_global { nullptr }, @@ -215,7 +216,7 @@ ModifierEffectCache::ModifierEffectCache() /* Military Modifier Effects */ attack_leader { nullptr }, - attrition { nullptr }, + attrition_leader { nullptr }, defence_leader { nullptr }, experience { nullptr }, morale_global { nullptr }, diff --git a/src/openvic-simulation/modifier/ModifierEffectCache.hpp b/src/openvic-simulation/modifier/ModifierEffectCache.hpp index e88aaea..7634ff1 100644 --- a/src/openvic-simulation/modifier/ModifierEffectCache.hpp +++ b/src/openvic-simulation/modifier/ModifierEffectCache.hpp @@ -167,6 +167,7 @@ namespace OpenVic { ModifierEffect const* PROPERTY(local_rgo_throughput); ModifierEffect const* PROPERTY(local_ruling_party_support); ModifierEffect const* PROPERTY(local_ship_build); + ModifierEffect const* PROPERTY(attrition_local); ModifierEffect const* PROPERTY(max_attrition); ModifierEffect const* PROPERTY(mine_rgo_throughput_global); ModifierEffect const* PROPERTY(mine_rgo_output_global); @@ -186,7 +187,7 @@ namespace OpenVic { /* Military Modifier Effects */ ModifierEffect const* PROPERTY(attack_leader); - ModifierEffect const* PROPERTY(attrition); + ModifierEffect const* PROPERTY(attrition_leader); ModifierEffect const* PROPERTY(defence_leader); ModifierEffect const* PROPERTY(experience); ModifierEffect const* PROPERTY(morale_leader); diff --git a/src/openvic-simulation/modifier/ModifierManager.cpp b/src/openvic-simulation/modifier/ModifierManager.cpp index cd330fd..663e296 100644 --- a/src/openvic-simulation/modifier/ModifierManager.cpp +++ b/src/openvic-simulation/modifier/ModifierManager.cpp @@ -488,6 +488,7 @@ bool ModifierManager::setup_modifier_effects() { ret &= register_base_province_modifier_effect( modifier_effect_cache.local_ship_build, "local_ship_build", false, PROPORTION_DECIMAL ); + ret &= register_terrain_modifier_effect(modifier_effect_cache.attrition_local, "attrition", false, PROPORTION_DECIMAL, "UA_ATTRITION"); ret &= register_base_province_modifier_effect(modifier_effect_cache.max_attrition, "max_attrition", false, RAW_DECIMAL); ret &= register_technology_modifier_effect( modifier_effect_cache.mine_rgo_throughput_global, "mine_rgo_eff", true, PROPORTION_DECIMAL, "TECH_MINE_OUTPUT" @@ -530,7 +531,7 @@ bool ModifierManager::setup_modifier_effects() { /* Military Modifier Effects */ ret &= register_leader_modifier_effect(modifier_effect_cache.attack_leader, "attack", true, INT, "TRAIT_ATTACK"); - ret &= register_leader_modifier_effect(modifier_effect_cache.attrition, "attrition", false, RAW_DECIMAL, "ATTRITION"); + ret &= register_leader_modifier_effect(modifier_effect_cache.attrition_leader, "attrition", false, RAW_DECIMAL, "ATTRITION"); ret &= register_leader_modifier_effect(modifier_effect_cache.defence_leader, "defence", true, INT, "TRAIT_DEFEND"); ret &= register_leader_modifier_effect( modifier_effect_cache.experience, "experience", true, PROPORTION_DECIMAL, "TRAIT_EXPERIENCE" -- cgit v1.2.3-56-ga3b1