Scripted effect
fabricate_hook_assign_appropriate_type_effect
fabricate_hook_assign_appropriate_type_effect = { TYPE = … }game/common/scripted_effects/00_scheme_scripted_effects.txt, line 15277 (149 lines). Parameters: $TYPE$.
fabricate_hook_assign_appropriate_type_effect is a scripted effect in Crusader Kings III, written at line 15277 of its file. A call passes 1 parameter: TYPE. The game's script calls it in 1 place, among them fabricate_hook_success_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/00_scheme_scripted_effects.txt.
What it does
If
scope:hook_type = flag:loyalty_hook
Then
If
- scope:target: Is a ruler
Then
add_hook = { type = indebted_hook target = scope:target }
Otherwise
add_hook = { type = loyalty_hook target = scope:target }
Else if
scope:hook_type = flag:fabrication_hook
Then
If
- scope:target: Is a ruler
Then
add_hook = { type = manipulation_hook target = scope:target }
Otherwise
add_hook = { type = fabrication_hook target = scope:target }
Else if
scope:hook_type = flag:life_threat_hook
Then
If
- scope:target: Is a ruler
Then
add_hook = { type = threat_hook target = scope:target }- scope:target: Opinion: Threatened Me for 10 years
Otherwise
add_hook = { type = life_threat_hook target = scope:target }- scope:target: Opinion: Threatened Me for 10 years
• 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 (120 lines of game script)
fabricate_hook_assign_appropriate_type_effect = {
debug_log = "Running Fabricate Hook's Assign Appropriate Hook effect"
assert_if = {
limit = {
scope:owner = {
has_strong_hook = scope:target
}
}
text = "The Fabricate Hook Scheme Owner already has a Strong Hook on the Target! Why is this effect running?"
}
assert_if = {
limit = {
scope:target = { is_ruler = yes }
NOT = { exists = scope:strong_hook_against_ruler }
scope:owner = { has_hook = scope:target }
}
text = "The Owner has a hook against a ruler target, and the strong hook roll failed. Something has gone wrong to get here!"
}
save_scope_value_as = {
name = hook_type
value = flag:$TYPE$
}
# Go through the Hook types, and assign the appropriate one
if = {
limit = {
scope:hook_type = flag:loyalty_hook
}
# Check rulers first (to give weaker Hooks)
if = {
limit = {
scope:target = { is_ruler = yes }
NOT = { exists = scope:strong_hook_against_ruler } # Set by on_ready in the Scheme
}
send_interface_toast = {
title = fabricate_hook_gained_indebted_title
left_icon = scope:target
add_hook = {
type = indebted_hook
target = scope:target
}
}
}
else = {
send_interface_toast = {
title = fabricate_hook_gained_loyalty_title
left_icon = scope:target
add_hook = {
type = loyalty_hook
target = scope:target
}
}
}
}
else_if = {
limit = {
scope:hook_type = flag:fabrication_hook
}
# Check rulers first (to give weaker Hooks)
if = {
limit = {
scope:target = { is_ruler = yes }
NOT = { exists = scope:strong_hook_against_ruler } # Set by on_ready in the Scheme
}
send_interface_toast = {
title = fabricate_hook_gained_manipulation_title
left_icon = scope:target
add_hook = {
type = manipulation_hook
target = scope:target
}
}
}
else = {
send_interface_toast = {
title = fabricate_hook_gained_indebted_title
left_icon = scope:target
add_hook = {
type = fabrication_hook
target = scope:target
}
}
}
}
else_if = {
limit = {
scope:hook_type = flag:life_threat_hook
}
debug_log = "Attempting to set life threat hook"
# Check rulers first (to give weaker Hooks)
if = {
limit = {
scope:target = { is_ruler = yes }
NOT = { exists = scope:strong_hook_against_ruler } # Set by on_ready in the Scheme
}
debug_log = "Trying to set regular threat hook against ruler"
send_interface_toast = {
title = fabricate_hook_gained_threat_title
left_icon = scope:target
add_hook = {
type = threat_hook
target = scope:target
}
scope:target = {
add_opinion = {
target = scope:owner
modifier = fabricate_hook_threatened_me
years = 10
}
}
}
}
else = {
if = {
limit = { exists = scope:strong_hook_against_ruler }
debug_log = "Trying to set life_threat_hook against a ruler"
}
else = {
debug_log = "Setting life_threat_hook against non-ruler"
assert_if = {As written in game/common/scripted_effects/00_scheme_scripted_effects.txt.
The first 120 of its 149 lines; the rest is in game/common/scripted_effects/00_scheme_scripted_effects.txt from line 15277.
Where it is used
Every place in common/, events/ and history/ that calls fabricate_hook_assign_appropriate_type_effect.
Scripted effects (1)
Source: game/common/scripted_effects/00_scheme_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.