Scripted effect
petition_head_of_faith_prepare_petition_effect
petition_head_of_faith_prepare_petition_effect = { HOOK = … PIETY_VALUE = … TYPE = … }game/common/scripted_effects/11_petition_head_of_faith_effects.txt, line 162 (53 lines). Parameters: $HOOK$, $PIETY_VALUE$, $TYPE$.
petition_head_of_faith_prepare_petition_effect is a scripted effect in Crusader Kings III, written at line 162 of its file. A call passes 3 parameters: HOOK, PIETY_VALUE and TYPE. The game's script calls it in 3 places, among them Request Excommunication (interaction), Request Excommunication (interaction) and Seek Absolution (interaction). Patch 1.20.1.2, from game/common/scripted_effects/11_petition_head_of_faith_effects.txt.
The comment above it in the file
Setup on_accept runs this and we need actor and recipient secondary_recipient is only set for excommunication $TYPE$ = petition flag, $HOOK$ = hook send-option, $PIETY_VALUE$ = tier
What it does
scope:puppet_or_actor:petition_head_of_faith_clear_all_effect = yes- Otherwise:
If
Not all of these
- Their rite: The rite has Primary Defenders pay no Piety to Excommunicate same-Faith Attackers
scope:puppet_or_actor:has_opinion_modifier = { modifier = declared_war target = scope:secondary_recipient }
Then
add_piety = { value = 0 subtract = $PIETY_VALUE$ }
petition_head_of_faith_block_recipient_effect = yespetition_head_of_faith_begin_travel_effect = yes
• 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 (53 lines of game script)
petition_head_of_faith_prepare_petition_effect = {
scope:puppet_or_actor = {
petition_head_of_faith_clear_all_effect = yes
set_variable = {
name = pending_petition_head_of_faith_type
value = flag:$TYPE$
}
set_variable = {
name = pending_petition_head_of_faith_recipient
value = scope:recipient
}
if = {
limit = { exists = scope:secondary_recipient }
set_variable = {
name = pending_petition_head_of_faith_target_character
value = scope:secondary_recipient
}
}
if = {
limit = { scope:$HOOK$ = yes }
add_character_flag = pending_petition_head_of_faith_use_hook
}
else = {
#peace of god makes excommunicating free against aggressors
if = {
limit = {
NAND = {
exists = scope:excom_request
rite = {
rite_has_parameter = tenet_peace_of_god_excommunication
}
scope:puppet_or_actor = {
has_opinion_modifier = {
modifier = declared_war
target = scope:secondary_recipient
}
}
}
}
set_variable = {
name = pending_petition_head_of_faith_reserved_piety_value
value = $PIETY_VALUE$
}
add_piety = {
value = 0
subtract = $PIETY_VALUE$
}
}
}
petition_head_of_faith_block_recipient_effect = yes
petition_head_of_faith_begin_travel_effect = yes
}
}As written in game/common/scripted_effects/11_petition_head_of_faith_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls petition_head_of_faith_prepare_petition_effect.
Character interactions (3)
Source: game/common/scripted_effects/11_petition_head_of_faith_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.