Scripted effect
sound_foundations_random_removal_effect
sound_foundations_random_removal_effect = yesgame/common/scripted_effects/00_diplomacy_perk_effects.txt, line 102 (62 lines). No parameters.
sound_foundations_random_removal_effect is a scripted effect in Crusader Kings III, written at line 102 of its file. It takes no parameters: sound_foundations_random_removal_effect = yes. The game's script calls it in 1 place, among them death_management.1002 (event). Patch 1.20.1.2, from game/common/scripted_effects/00_diplomacy_perk_effects.txt.
What it does
- If has the Sound Foundations Perk:
If
- Current sound foundations value at most sound foundations max
- Current sound foundations value more than 0
- Any in list:
Then
- 1 of 5 things will happen:
- 20%: Loses “Sound Foundations”
- 20%: Loses “Sound Foundations”
- 20%: Loses “Sound Foundations”
- 20%: Loses “Sound Foundations”
- 20%: Loses “Sound Foundations”
• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists
“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.
The script as written (62 lines of game script)
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
}
}
}
}As written in game/common/scripted_effects/00_diplomacy_perk_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls sound_foundations_random_removal_effect.
Events (1)
Source: game/common/scripted_effects/00_diplomacy_perk_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.