From 6f07de81a6ca430c522527958e05440d67b04937 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sun, 7 Jan 2024 23:47:39 +0100 Subject: feat: condition loading and parsing Co-authored-by: Hop311 --- src/openvic-simulation/military/Wargoal.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/military') diff --git a/src/openvic-simulation/military/Wargoal.cpp b/src/openvic-simulation/military/Wargoal.cpp index 28cbc51..174cd09 100644 --- a/src/openvic-simulation/military/Wargoal.cpp +++ b/src/openvic-simulation/military/Wargoal.cpp @@ -84,9 +84,13 @@ bool WargoalTypeManager::load_wargoal_file(ast::NodeCPtr root) { mutual = false, all_allowed_states = false, always = false; peace_options_t peace_options = NO_PEACE_OPTIONS; WargoalType::peace_modifiers_t modifiers; - ConditionScript can_use, is_valid, allowed_states, allowed_substate_regions, allowed_states_in_crisis, - allowed_countries; - EffectScript on_add, on_po_accepted; + ConditionScript can_use { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::COUNTRY }; + ConditionScript is_valid { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::COUNTRY }; + ConditionScript allowed_states { scope_t::STATE, scope_t::COUNTRY, scope_t::COUNTRY }; + ConditionScript allowed_substate_regions { scope_t::STATE, scope_t::COUNTRY, scope_t::COUNTRY }; + ConditionScript allowed_states_in_crisis { scope_t::STATE, scope_t::COUNTRY, scope_t::COUNTRY }; + ConditionScript allowed_countries { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::COUNTRY }; + EffectScript on_add, on_po_accepted; //country as default scope for both const auto expect_peace_option = [&peace_options](peace_options_t peace_option) -> node_callback_t { return expect_bool([&peace_options, peace_option](bool val) -> bool { -- cgit v1.2.3-56-ga3b1