980 lines
21 KiB
Text
980 lines
21 KiB
Text
|
|
### Effects for handling Diplomacy Lifestyle Perks
|
|
|
|
# sound_foundations_skill_gain_effect: Randomly gain a skill point because of your child
|
|
# sound_foundations_random_removal_effect: Removes a random one of the modifiers added by Sound Foundations
|
|
|
|
sound_foundations_skill_gain_effect = {
|
|
if = {
|
|
limit = {
|
|
NOT = { has_variable = current_sound_foundations_value }
|
|
}
|
|
set_variable = {
|
|
name = current_sound_foundations_value # Number of applied modifiers
|
|
value = 0
|
|
}
|
|
}
|
|
every_child = {
|
|
add_to_temporary_list = current_amount_of_children
|
|
}
|
|
|
|
if = {
|
|
limit = {
|
|
exists = var:current_sound_foundations_value
|
|
save_temporary_scope_as = affected_parent
|
|
var:current_sound_foundations_value < sound_foundations_max
|
|
any_in_list = {
|
|
list = current_amount_of_children
|
|
count > scope:affected_parent.var:current_sound_foundations_value
|
|
}
|
|
}
|
|
if = {
|
|
limit = { government_has_flag = government_is_mandala }
|
|
random_list = {
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = mandala_sound_foundations_martial_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = mandala_sound_foundations_diplomacy_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = mandala_sound_foundations_intrigue_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = mandala_sound_foundations_stewardship_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = mandala_sound_foundations_learning_gain
|
|
}
|
|
}
|
|
}
|
|
change_variable = {
|
|
name = current_sound_foundations_value
|
|
add = 1
|
|
}
|
|
}
|
|
else = {
|
|
random_list = {
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = sound_foundations_martial_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = sound_foundations_diplomacy_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = sound_foundations_intrigue_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = sound_foundations_stewardship_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = sound_foundations_learning_gain
|
|
}
|
|
}
|
|
}
|
|
change_variable = {
|
|
name = current_sound_foundations_value
|
|
add = 1
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
sound_foundations_random_removal_effect = {
|
|
if = {
|
|
limit = {
|
|
has_perk = sound_foundations_perk
|
|
}
|
|
every_child = {
|
|
add_to_temporary_list = current_amount_of_children
|
|
}
|
|
|
|
if = {
|
|
limit = {
|
|
exists = var:current_sound_foundations_value
|
|
save_temporary_scope_as = affected_parent
|
|
var:current_sound_foundations_value <= sound_foundations_max
|
|
var:current_sound_foundations_value > 0
|
|
any_in_list = {
|
|
list = current_amount_of_children
|
|
count > scope:affected_parent.var:current_sound_foundations_value
|
|
NOT = { has_character_flag = about_to_die_but_not_dead_yet_flag } # Applied from on action death; called before imminent death
|
|
}
|
|
}
|
|
|
|
random_list = {
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = sound_foundations_martial_gain
|
|
}
|
|
remove_character_modifier = sound_foundations_martial_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = sound_foundations_diplomacy_gain
|
|
}
|
|
remove_character_modifier = sound_foundations_diplomacy_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = sound_foundations_intrigue_gain
|
|
}
|
|
remove_character_modifier = sound_foundations_intrigue_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = sound_foundations_stewardship_gain
|
|
}
|
|
remove_character_modifier = sound_foundations_stewardship_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = sound_foundations_learning_gain
|
|
}
|
|
remove_character_modifier = sound_foundations_learning_gain
|
|
}
|
|
}
|
|
|
|
change_variable = {
|
|
name = current_sound_foundations_value
|
|
subtract = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
groomed_to_rule_random_skills_effect = {
|
|
save_scope_as = child
|
|
if = {
|
|
limit = {
|
|
trigger_if = {
|
|
limit = { age <= childhood_education_start_age }
|
|
has_trait = rowdy # Default trait for martial ed
|
|
}
|
|
trigger_else_if = {
|
|
limit = { age < adulthood_start_age }
|
|
has_focus = education_martial
|
|
}
|
|
trigger_else = {
|
|
has_trait = education_martial
|
|
}
|
|
}
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:martial
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
trigger_if = {
|
|
limit = { age <= childhood_education_start_age }
|
|
has_trait = charming # Default trait for intrigue ed
|
|
}
|
|
trigger_else_if = {
|
|
limit = { age < adulthood_start_age }
|
|
has_focus = education_intrigue
|
|
}
|
|
trigger_else = {
|
|
has_trait = education_intrigue
|
|
}
|
|
}
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:intrigue
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
trigger_if = {
|
|
limit = { age <= childhood_education_start_age }
|
|
has_trait = curious # Default trait for diplomacy ed
|
|
}
|
|
trigger_else_if = {
|
|
limit = { age < adulthood_start_age }
|
|
has_focus = education_diplomacy
|
|
}
|
|
trigger_else = {
|
|
has_trait = education_diplomacy
|
|
}
|
|
}
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:diplomacy
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
trigger_if = {
|
|
limit = { age <= childhood_education_start_age }
|
|
has_trait = bossy # Default trait for stewardship ed
|
|
}
|
|
trigger_else_if = {
|
|
limit = { age < adulthood_start_age }
|
|
has_focus = education_stewardship
|
|
}
|
|
trigger_else = {
|
|
has_trait = education_stewardship
|
|
}
|
|
}
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:stewardship
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
trigger_if = {
|
|
limit = { age <= childhood_education_start_age }
|
|
has_trait = pensive # Default trait for learning ed
|
|
}
|
|
trigger_else_if = {
|
|
limit = { age < adulthood_start_age }
|
|
has_focus = education_learning
|
|
}
|
|
trigger_else = {
|
|
has_trait = education_learning
|
|
}
|
|
}
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:learning
|
|
}
|
|
}
|
|
else = { # Fallback in case something goes wrong
|
|
random_list = {
|
|
1 = {
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:martial
|
|
}
|
|
}
|
|
1 = {
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:diplomacy
|
|
}
|
|
}
|
|
1 = {
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:intrigue
|
|
}
|
|
}
|
|
1 = {
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:stewardship
|
|
}
|
|
}
|
|
1 = {
|
|
save_temporary_scope_value_as = {
|
|
name = skill_to_increase
|
|
value = flag:learning
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if = {
|
|
limit = {
|
|
scope:skill_to_increase = flag:martial
|
|
}
|
|
random_list = {
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_martial_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_martial_skill = 1
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_martial_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_martial_skill = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_martial_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_martial_skill = 2
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_martial_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_martial_skill = 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_martial_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_martial_skill = 3
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_martial_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_martial_skill = 3
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
scope:skill_to_increase = flag:intrigue
|
|
}
|
|
random_list = {
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_intrigue_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_intrigue_skill = 1
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_intrigue_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_intrigue_skill = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_intrigue_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_intrigue_skill = 2
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_intrigue_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_intrigue_skill = 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_intrigue_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_intrigue_skill = 3
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_intrigue_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_intrigue_skill = 3
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
scope:skill_to_increase = flag:diplomacy
|
|
}
|
|
random_list = {
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_diplomacy_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_diplomacy_skill = 1
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_diplomacy_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_diplomacy_skill = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_diplomacy_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_diplomacy_skill = 2
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_diplomacy_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_diplomacy_skill = 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_diplomacy_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_diplomacy_skill = 3
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_diplomacy_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_diplomacy_skill = 3
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
scope:skill_to_increase = flag:stewardship
|
|
}
|
|
random_list = {
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_stewardship_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_stewardship_skill = 1
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_stewardship_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_stewardship_skill = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_stewardship_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_stewardship_skill = 2
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_stewardship_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_stewardship_skill = 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_stewardship_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_stewardship_skill = 3
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_stewardship_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_stewardship_skill = 3
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else_if = {
|
|
limit = {
|
|
scope:skill_to_increase = flag:learning
|
|
}
|
|
random_list = {
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_learning_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_learning_skill = 1
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_learning_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_learning_skill = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_learning_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_learning_skill = 2
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_learning_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_learning_skill = 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
1 = {
|
|
send_interface_message = {
|
|
type = event_learning_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:parent
|
|
|
|
add_learning_skill = 3
|
|
}
|
|
scope:parent = {
|
|
send_interface_message = {
|
|
type = event_learning_good
|
|
title = groomed_to_rule_msg_title
|
|
left_icon = scope:child
|
|
|
|
show_as_tooltip = {
|
|
scope:child = {
|
|
add_learning_skill = 3
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
childhood_groomed_to_rule_skill_gain_effect = {
|
|
every_parent = {
|
|
limit = {
|
|
is_alive = yes
|
|
has_perk = groomed_to_rule_perk
|
|
}
|
|
save_scope_as = parent
|
|
root = {
|
|
groomed_to_rule_random_skills_effect = yes
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
save_commission_epic_loc_variables = {
|
|
story_owner = {
|
|
set_variable = {
|
|
name = composition_type
|
|
value = scope:story.var:composition_type
|
|
}
|
|
set_variable = {
|
|
name = composition_detail
|
|
value = scope:story.var:composition_detail
|
|
}
|
|
if = {
|
|
limit = {
|
|
exists = scope:story.var:composer
|
|
}
|
|
set_variable = {
|
|
name = composer_exists
|
|
value = yes
|
|
}
|
|
scope:story.var:composer = {
|
|
save_scope_as = composer
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
clear_commission_epic_loc_variables = {
|
|
remove_variable = composition_type
|
|
remove_variable = composition_detail
|
|
remove_variable = composer_exists
|
|
}
|
|
|
|
update_embassies_effect = {
|
|
if = {
|
|
limit = {
|
|
has_perk = embassies_perk
|
|
is_landless_adventurer = no
|
|
}
|
|
remove_all_character_modifier_instances = embassies_perk_modifier
|
|
|
|
set_variable = {
|
|
name = current_embassies_perk_value
|
|
value = 0
|
|
}
|
|
set_variable = {
|
|
name = previous_current_embassies_perk_value
|
|
value = 0
|
|
}
|
|
|
|
if = {
|
|
limit = {
|
|
exists = var:previous_current_embassies_perk_value
|
|
exists = var:current_embassies_perk_value
|
|
}
|
|
|
|
every_ally = {
|
|
prev = {
|
|
change_variable = {
|
|
name = previous_current_embassies_perk_value
|
|
add = 1
|
|
}
|
|
if = {
|
|
limit = {
|
|
exists = var:current_embassies_perk_value
|
|
var:current_embassies_perk_value < embassies_max
|
|
}
|
|
change_variable = {
|
|
name = current_embassies_perk_value
|
|
add = 1
|
|
}
|
|
add_character_modifier = {
|
|
modifier = embassies_perk_modifier
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
# For players that were over the cap before the change so that they don't feel like they've "lost progress"
|
|
save_temporary_scope_as = variable_check
|
|
if = {
|
|
limit = {
|
|
var:current_embassies_perk_value < scope:variable_check.var:previous_current_embassies_perk_value
|
|
}
|
|
set_variable = {
|
|
name = current_embassies_perk_value
|
|
value = var:previous_current_embassies_perk_value
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
try_remove_perk_alliance_opinion_effect = {
|
|
if = {
|
|
limit = {
|
|
has_opinion_modifier = {
|
|
modifier = perk_negotiated_alliance_opinion
|
|
target = $TARGET$
|
|
}
|
|
}
|
|
remove_opinion = {
|
|
modifier = perk_negotiated_alliance_opinion
|
|
target = $TARGET$
|
|
}
|
|
}
|
|
}
|
|
|
|
# friendly_counsel_skill_gain_effect: Randomly gain a skill point because of your friend
|
|
# friendly_counsel_random_removal_effect: Removes a random one of the modifiers added by Friendly Counsel
|
|
friendly_counsel_skill_gain_effect = {
|
|
if = {
|
|
limit = {
|
|
has_perk = friendly_counsel_perk
|
|
}
|
|
if = {
|
|
limit = {
|
|
NOT = { has_variable = current_friendly_counsel_perk_value }
|
|
}
|
|
set_variable = {
|
|
name = current_friendly_counsel_perk_value
|
|
value = 0
|
|
}
|
|
}
|
|
|
|
every_relation = {
|
|
type = friend
|
|
add_to_temporary_list = friendly_counsel_friends
|
|
}
|
|
every_relation = {
|
|
type = best_friend
|
|
add_to_temporary_list = friendly_counsel_friends
|
|
}
|
|
every_relation = {
|
|
type = blood_brother
|
|
add_to_temporary_list = friendly_counsel_friends
|
|
}
|
|
|
|
if = {
|
|
limit = {
|
|
exists = var:current_friendly_counsel_perk_value
|
|
save_temporary_scope_as = affected_friend
|
|
OR = {
|
|
var:current_friendly_counsel_perk_value < friendly_counsel_max
|
|
AND = { # If you have a Blood Brother you get one extra skill
|
|
government_has_flag = government_is_nomadic
|
|
var:current_friendly_counsel_perk_value < 6
|
|
any_in_list = {
|
|
list = friendly_counsel_friends
|
|
has_relation_blood_brother = root
|
|
}
|
|
}
|
|
}
|
|
any_in_list = {
|
|
list = friendly_counsel_friends
|
|
count > scope:affected_friend.var:current_friendly_counsel_perk_value
|
|
}
|
|
}
|
|
random_list = {
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = friendly_counsel_martial_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = friendly_counsel_diplomacy_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = friendly_counsel_intrigue_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = friendly_counsel_stewardship_gain
|
|
}
|
|
}
|
|
1 = {
|
|
add_character_modifier = {
|
|
modifier = friendly_counsel_learning_gain
|
|
}
|
|
}
|
|
}
|
|
change_variable = {
|
|
name = current_friendly_counsel_perk_value
|
|
add = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
friendly_counsel_random_removal_effect = {
|
|
if = {
|
|
limit = {
|
|
has_perk = friendly_counsel_perk
|
|
}
|
|
|
|
every_relation = {
|
|
type = friend
|
|
add_to_temporary_list = friendly_counsel_friends
|
|
}
|
|
every_relation = {
|
|
type = best_friend
|
|
add_to_temporary_list = friendly_counsel_friends
|
|
}
|
|
|
|
if = {
|
|
limit = {
|
|
exists = var:current_friendly_counsel_perk_value
|
|
save_temporary_scope_as = affected_friend
|
|
var:current_friendly_counsel_perk_value <= friendly_counsel_max
|
|
var:current_friendly_counsel_perk_value > 0
|
|
any_in_list = {
|
|
list = friendly_counsel_friends
|
|
count > scope:affected_friend.var:current_friendly_counsel_perk_value
|
|
NOT = { has_character_flag = about_to_die_but_not_dead_yet_flag }
|
|
}
|
|
}
|
|
random_list = {
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = friendly_counsel_martial_gain
|
|
}
|
|
remove_character_modifier = friendly_counsel_martial_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = friendly_counsel_diplomacy_gain
|
|
}
|
|
remove_character_modifier = friendly_counsel_diplomacy_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = friendly_counsel_intrigue_gain
|
|
}
|
|
remove_character_modifier = friendly_counsel_intrigue_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = friendly_counsel_stewardship_gain
|
|
}
|
|
remove_character_modifier = friendly_counsel_stewardship_gain
|
|
}
|
|
1 = {
|
|
trigger = {
|
|
has_character_modifier = friendly_counsel_learning_gain
|
|
}
|
|
remove_character_modifier = friendly_counsel_learning_gain
|
|
}
|
|
}
|
|
|
|
change_variable = {
|
|
name = current_friendly_counsel_perk_value
|
|
subtract = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
update_confidants_effect = {
|
|
if = {
|
|
limit = {
|
|
has_perk = confidants_perk
|
|
}
|
|
remove_all_character_modifier_instances = confidants_perk_modifier
|
|
save_temporary_scope_as = confidant_scope
|
|
|
|
set_variable = {
|
|
name = current_confidants_perk_value
|
|
value = 0
|
|
}
|
|
|
|
if = {
|
|
limit = {
|
|
exists = var:current_confidants_perk_value
|
|
}
|
|
every_relation = {
|
|
type = friend
|
|
add_to_temporary_list = confidant_friend_list
|
|
}
|
|
every_in_list = {
|
|
list = confidant_friend_list
|
|
scope:confidant_scope = {
|
|
if = {
|
|
limit = {
|
|
exists = var:current_confidants_perk_value
|
|
var:current_confidants_perk_value < confidants_max
|
|
}
|
|
change_variable = {
|
|
name = current_confidants_perk_value
|
|
add = 1
|
|
}
|
|
add_character_modifier = {
|
|
modifier = confidants_perk_modifier
|
|
}
|
|
}
|
|
}
|
|
}
|
|
remove_variable = current_confidants_perk_value
|
|
}
|
|
}
|
|
}
|