diff --git a/common/national_focus/Kingdom_Akorn.txt b/common/national_focus/Kingdom_Akorn.txt index 809363c4..8b1dc8ca 100644 --- a/common/national_focus/Kingdom_Akorn.txt +++ b/common/national_focus/Kingdom_Akorn.txt @@ -2995,12 +2995,11 @@ focus_tree = { focus = KOA_Contradictions_of_the_South } completion_reward = { - KOA_increase_populist_influence = yes hidden_effect = { - KOA_Remove_Populist_Idea = yes - add_ideas = KOA_Southern_Pressure_2 - set_variable = { KOA_current_populist_idea_level = 2 } + set_variable = { KOA_new_populist_idea_level = 2 } + KOA_Switch_Populist_Idea = yes } + KOA_increase_populist_influence = yes custom_effect_tooltip = KOA_Populist_influence_increase_tooltip custom_effect_tooltip = KOA_Southern_oppression_idea_up } @@ -3042,11 +3041,11 @@ focus_tree = { focus = KOA_Land_and_Progress } completion_reward = { - KOA_increase_populist_influence = yes hidden_effect = { set_variable = { KOA_new_populist_idea_level = 4 } KOA_Switch_Populist_Idea = yes } + KOA_increase_populist_influence = yes KOA = { country_event = { id = koa.138 @@ -3265,7 +3264,8 @@ focus_tree = { } completion_reward = { hidden_effect = { - KOA_Remove_Populist_Idea = yes + set_variable = { KOA_new_populist_idea_level = 0 } + KOA_Switch_Populist_Idea = yes add_ideas = KOA_Southern_Glory } add_political_power = 125 @@ -3558,7 +3558,8 @@ focus_tree = { } completion_reward = { hidden_effect = { - KOA_Remove_Nobles_Idea = yes + set_variable = { KOA_new_nobles_idea_level = 0 } + KOA_Switch_Nobles_Idea = yes add_ideas = KOA_Northern_Dawn } add_political_power = 150 diff --git a/common/scripted_effects/KoA_Scripted_Effects.txt b/common/scripted_effects/KoA_Scripted_Effects.txt index 77cf8e75..24d8101e 100644 --- a/common/scripted_effects/KoA_Scripted_Effects.txt +++ b/common/scripted_effects/KoA_Scripted_Effects.txt @@ -10,418 +10,110 @@ KOA_enable_populist_domination = { } } -KOA_Remove_Populist_Idea = { - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 1 - } - } - remove_ideas = KOA_Southern_Pressure_1 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 2 - } - } - remove_ideas = KOA_Southern_Pressure_2 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 3 - } - } - remove_ideas = KOA_Southern_Pressure_3 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 4 - } - } - remove_ideas = KOA_Southern_Pressure_4 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 5 - } - } - remove_ideas = KOA_Southern_Pressure_5 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 6 - } - } - remove_ideas = KOA_Southern_Pressure_6 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 7 - } - } - remove_ideas = KOA_Southern_Pressure_7 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 8 - } - } - remove_ideas = KOA_Southern_Pressure_8 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 9 - } - } - remove_ideas = KOA_Southern_Pressure_9 - } - if = { - limit = { - check_variable = { - KOA_current_populist_idea_level = 10 +KOA_Switch_Populist_Meta = { + meta_effect = { + text = { + KOA = { + if = { + limit = { + check_variable = { + KOA_current_populist_idea_level > 0 + } + } + if = { + limit = { + has_idea = [IDEA_NAME]_[OLD_LEVEL] + } + remove_ideas = [IDEA_NAME]_[OLD_LEVEL] + } + } + if = { + limit = { + AND = { + check_variable = { + KOA_new_populist_idea_level > 0 + } + check_variable = { + KOA_new_populist_idea_level < 11 + } + } + } + add_ideas = [IDEA_NAME]_[NEW_LEVEL] + set_variable = { + KOA_current_populist_idea_level = [NEW_LEVEL] + } + if = { + limit = { + has_global_flag = KOA_helped_nobles + } + add_stability = -0.05 + clr_global_flag = KOA_helped_nobles + } + clear_variable = KOA_new_populist_idea_level + } } } - remove_ideas = KOA_Southern_Pressure_10 + IDEA_NAME = "KOA_Southern_Pressure" + OLD_LEVEL = "[?KOA_current_populist_idea_level|.0]" + NEW_LEVEL = "[?KOA_new_populist_idea_level|.0]" } } -KOA_Switch_Populist_Idea = { - KOA = { - KOA_Remove_Populist_Idea = yes - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 1 - } - } - add_ideas = KOA_Southern_Pressure_1 - set_variable = { - KOA_current_populist_idea_level = 1 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 2 - } - } - add_ideas = KOA_Southern_Pressure_2 - set_variable = { - KOA_current_populist_idea_level = 2 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 3 - } - } - add_ideas = KOA_Southern_Pressure_3 - set_variable = { - KOA_current_populist_idea_level = 3 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 4 - } - } - add_ideas = KOA_Southern_Pressure_4 - set_variable = { - KOA_current_populist_idea_level = 4 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 5 - } - } - add_ideas = KOA_Southern_Pressure_5 - set_variable = { - KOA_current_populist_idea_level = 5 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 6 - } - } - add_ideas = KOA_Southern_Pressure_6 - set_variable = { - KOA_current_populist_idea_level = 6 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 7 - } - } - add_ideas = KOA_Southern_Pressure_7 - set_variable = { - KOA_current_populist_idea_level = 7 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 8 - } - } - add_ideas = KOA_Southern_Pressure_8 - set_variable = { - KOA_current_populist_idea_level = 8 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 9 +KOA_Switch_Nobles_Meta = { + meta_effect = { + text = { + KOA = { + if = { + limit = { + check_variable = { + KOA_current_nobles_idea_level > 0 + } + } + if = { + limit = { + has_idea = [IDEA_NAME]_[OLD_LEVEL] + } + remove_ideas = [IDEA_NAME]_[OLD_LEVEL] + } } - } - add_ideas = KOA_Southern_Pressure_9 - set_variable = { - KOA_current_populist_idea_level = 9 - } - } - if = { - limit = { - check_variable = { - KOA_new_populist_idea_level = 10 + if = { + limit = { + AND = { + check_variable = { + KOA_new_nobles_idea_level > 0 + } + check_variable = { + KOA_new_nobles_idea_level < 11 + } + } + } + add_ideas = [IDEA_NAME]_[NEW_LEVEL] + set_variable = { + KOA_current_nobles_idea_level = [NEW_LEVEL] + } + if = { + limit = { + has_global_flag = KOA_helped_populist + } + add_stability = -0.05 + clr_global_flag = KOA_helped_populist + } + clear_variable = KOA_new_nobles_idea_level } } - add_ideas = KOA_Southern_Pressure_10 - set_variable = { - KOA_current_populist_idea_level = 10 - } - } - if = { - limit = { - has_global_flag = KOA_helped_nobles - } - add_stability = -0.05 - clr_global_flag = KOA_helped_nobles } + IDEA_NAME = "KOA_Northern_Winds" + OLD_LEVEL = "[?KOA_current_nobles_idea_level|.0]" + NEW_LEVEL = "[?KOA_new_nobles_idea_level|.0]" } - clear_variable = KOA_new_populist_idea_level } -KOA_Remove_Nobles_Idea = { - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 1 - } - } - remove_ideas = KOA_Northern_Winds_1 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 2 - } - } - remove_ideas = KOA_Northern_Winds_2 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 3 - } - } - remove_ideas = KOA_Northern_Winds_3 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 4 - } - } - remove_ideas = KOA_Northern_Winds_4 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 5 - } - } - remove_ideas = KOA_Northern_Winds_5 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 6 - } - } - remove_ideas = KOA_Northern_Winds_6 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 7 - } - } - remove_ideas = KOA_Northern_Winds_7 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 8 - } - } - remove_ideas = KOA_Northern_Winds_8 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 9 - } - } - remove_ideas = KOA_Northern_Winds_9 - } - if = { - limit = { - check_variable = { - KOA_current_nobles_idea_level = 10 - } - } - remove_ideas = KOA_Northern_Winds_10 - } +KOA_Switch_Populist_Idea = { + KOA_Switch_Populist_Meta = yes } KOA_Switch_Nobles_Idea = { - KOA = { - KOA_Remove_Nobles_Idea = yes - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 1 - } - } - add_ideas = KOA_Northern_Winds_1 - set_variable = { - KOA_current_nobles_idea_level = 1 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 2 - } - } - add_ideas = KOA_Northern_Winds_2 - set_variable = { - KOA_current_nobles_idea_level = 2 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 3 - } - } - add_ideas = KOA_Northern_Winds_3 - set_variable = { - KOA_current_nobles_idea_level = 3 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 4 - } - } - add_ideas = KOA_Northern_Winds_4 - set_variable = { - KOA_current_nobles_idea_level = 4 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 5 - } - } - add_ideas = KOA_Northern_Winds_5 - set_variable = { - KOA_current_nobles_idea_level = 5 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 6 - } - } - add_ideas = KOA_Northern_Winds_6 - set_variable = { - KOA_current_nobles_idea_level = 6 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 7 - } - } - add_ideas = KOA_Northern_Winds_7 - set_variable = { - KOA_current_nobles_idea_level = 7 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 8 - } - } - add_ideas = KOA_Northern_Winds_8 - set_variable = { - KOA_current_nobles_idea_level = 8 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 9 - } - } - add_ideas = KOA_Northern_Winds_9 - set_variable = { - KOA_current_nobles_idea_level = 9 - } - } - if = { - limit = { - check_variable = { - KOA_new_nobles_idea_level = 10 - } - } - add_ideas = KOA_Northern_Winds_10 - set_variable = { - KOA_current_nobles_idea_level = 10 - } - } - if = { - limit = { - has_global_flag = KOA_helped_populist - } - add_stability = -0.05 - clr_global_flag = KOA_helped_populist - } - } - clear_variable = KOA_new_nobles_idea_level + KOA_Switch_Nobles_Meta = yes } KOA_enable_nobles_domination = { @@ -484,6 +176,30 @@ KOA_compare_opposition = { } } +KOA_check_populist_levity = { + if = { + limit = { + has_global_flag = KOA_populist_levity_penalty + } + KOA = { + add_stability = -0.1 + } + clr_global_flag = KOA_populist_levity_penalty + } +} + +KOA_check_nobles_levity = { + if = { + limit = { + has_global_flag = KOA_nobles_levity_penalty + } + KOA = { + add_stability = -0.1 + } + clr_global_flag = KOA_nobles_levity_penalty + } +} + KOA_increase_populist_influence = { if = { limit = { @@ -506,7 +222,10 @@ KOA_increase_populist_influence = { set_variable = { populist_influence = 100 } set_variable = { nobles_influence = 0 } } - KOA_compare_opposition = yes + hidden_effect = { + KOA_compare_opposition = yes + } + KOA_check_nobles_levity = yes } KOA_greatly_increase_populist_influence = { @@ -531,7 +250,10 @@ KOA_greatly_increase_populist_influence = { set_variable = { populist_influence = 100 } set_variable = { nobles_influence = 0 } } - KOA_compare_opposition = yes + hidden_effect = { + KOA_compare_opposition = yes + } + KOA_check_nobles_levity = yes } KOA_increase_nobles_influence = { @@ -556,7 +278,10 @@ KOA_increase_nobles_influence = { set_variable = { nobles_influence = 100 } set_variable = { populist_influence = 0 } } - KOA_compare_opposition = yes + hidden_effect = { + KOA_compare_opposition = yes + } + KOA_check_populist_levity = yes } KOA_greatly_increase_nobles_influence = { @@ -581,7 +306,10 @@ KOA_greatly_increase_nobles_influence = { set_variable = { nobles_influence = 100 } set_variable = { populist_influence = 0 } } - KOA_compare_opposition = yes + hidden_effect = { + KOA_compare_opposition = yes + } + KOA_check_populist_levity = yes } KOA_release_SOT = {