Scripted effect · Legacy of Persia files
fp3_struggle_apply_supporter_detractor_war_won_catalysts_effect
fp3_struggle_apply_supporter_detractor_war_won_catalysts_effect = yesgame/common/scripted_effects/05_dlc_fp3_scripted_effects.txt, line 487 (194 lines). No parameters.
fp3_struggle_apply_supporter_detractor_war_won_catalysts_effect is a scripted effect in Crusader Kings III, in the Legacy of Persia files, written at line 487 of its file. It takes no parameters: fp3_struggle_apply_supporter_detractor_war_won_catalysts_effect = yes. The game's script calls it in 2 places, among them on_war_won_attacker (on action) and on_war_won_defender (on action). Patch 1.20.1.2, from game/common/scripted_effects/05_dlc_fp3_scripted_effects.txt.
What it does
If
- Has the Trait: Supporter of Caliphal Authority
- Any character struggle:
involvement = involvedactivate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_supporter_win_unfair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
Then
- Every character struggle:
- Where:
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_supporter_win_unfair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
involvement = involvedactivate_struggle_catalyst = { catalyst = catalyst_supporter_win_unfair_war_within_the_region character = scope:winner }log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_supporter_win_unfair_war_within_the_region }
- Where:
Else if
- Has the Trait: Supporter of Caliphal Authority
- scope:war: Does not have “used for struggle catalyst on war ended” (a variable the game's script sets)
- Any character struggle:
involvement = involvedactivate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_supporter_win_fair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
Then
- Every character struggle:
- Where:
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_supporter_win_fair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
involvement = involvedactivate_struggle_catalyst = { catalyst = catalyst_supporter_win_fair_war_within_the_region character = scope:winner }log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_supporter_win_fair_war_within_the_region }
- Where:
Else if
- Has the Trait: Detractor of the Caliphate
- scope:war: Does not have “used for struggle catalyst on war ended” (a variable the game's script sets)
- Any character struggle:
involvement = involvedactivate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_detractor_win_unfair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
Then
- Every character struggle:
- Where:
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_detractor_win_unfair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
involvement = involvedactivate_struggle_catalyst = { catalyst = catalyst_detractor_win_unfair_war_within_the_region character = scope:winner }log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_detractor_win_unfair_war_within_the_region }
- Where:
Else if
- Has the Trait: Detractor of the Caliphate
- Any character struggle:
involvement = involvedactivate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_detractor_win_fair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
Then
- Every character struggle:
- Where:
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = { CATALYST = catalyst_detractor_win_fair_war_within_the_region VAR_SCOPE = scope:war INVOLVEMENT = involved }
involvement = involvedactivate_struggle_catalyst = { catalyst = catalyst_detractor_win_fair_war_within_the_region character = scope:winner }log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_detractor_win_fair_war_within_the_region }
- Where:
• 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)
fp3_struggle_apply_supporter_detractor_war_won_catalysts_effect = {
# During the Persian Struggle, a supporter wins any war in the region.
## Unfair wars.
if = {
limit = {
has_trait = fp3_struggle_supporter
# Scope:attacker won?
trigger_if = {
limit = {
scope:winner = scope:attacker
exists = scope:war.var:struggle_defender_tier
}
highest_held_title_tier > scope:war.var:struggle_defender_tier
}
# Else, scope:defender won.
trigger_if = {
limit = {
scope:winner = scope:defender
exists = scope:war.var:struggle_attacker_tier
}
highest_held_title_tier > scope:war.var:struggle_attacker_tier
}
any_character_struggle = {
involvement = involved
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = {
CATALYST = catalyst_supporter_win_unfair_war_within_the_region
VAR_SCOPE = scope:war
INVOLVEMENT = involved
}
}
}
every_character_struggle = {
involvement = involved
limit = {
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = {
CATALYST = catalyst_supporter_win_unfair_war_within_the_region
VAR_SCOPE = scope:war
INVOLVEMENT = involved
}
}
activate_struggle_catalyst = {
catalyst = catalyst_supporter_win_unfair_war_within_the_region
character = scope:winner
}
scope:war = { set_variable = used_for_struggle_catalyst_on_war_ended }
log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_supporter_win_unfair_war_within_the_region }
}
}
## Fair wars.
else_if = {
limit = {
has_trait = fp3_struggle_supporter
# Scope:attacker won?
trigger_if = {
limit = {
scope:winner = scope:attacker
exists = scope:war.var:struggle_defender_tier
}
highest_held_title_tier <= scope:war.var:struggle_defender_tier
}
# Else, scope:defender won.
trigger_if = {
limit = {
scope:winner = scope:defender
exists = scope:war.var:struggle_attacker_tier
}
highest_held_title_tier <= scope:war.var:struggle_attacker_tier
}
scope:war = {
NOT = { has_variable = used_for_struggle_catalyst_on_war_ended }
}
any_character_struggle = {
involvement = involved
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = {
CATALYST = catalyst_supporter_win_fair_war_within_the_region
VAR_SCOPE = scope:war
INVOLVEMENT = involved
}
}
}
every_character_struggle = {
involvement = involved
limit = {
activate_struggle_catalyst_warfare_check_attacker_involvement_trigger = {
CATALYST = catalyst_supporter_win_fair_war_within_the_region
VAR_SCOPE = scope:war
INVOLVEMENT = involved
}
}
activate_struggle_catalyst = {
catalyst = catalyst_supporter_win_fair_war_within_the_region
character = scope:winner
}
scope:war = { set_variable = used_for_struggle_catalyst_on_war_ended }
log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_supporter_win_fair_war_within_the_region }
}
}
# During the Persian Struggle, a detractor wins any war in the region.
## Unfair wars.
else_if = {
limit = {
has_trait = fp3_struggle_detractor
# Scope:attacker won?
trigger_if = {
limit = {
scope:winner = scope:attacker
exists = scope:war.var:struggle_defender_tier
}
highest_held_title_tier > scope:war.var:struggle_defender_tier
}
# Else, scope:defender won.
trigger_if = {
limit = {
scope:winner = scope:defender
exists = scope:war.var:struggle_attacker_tier
}
highest_held_title_tier > scope:war.var:struggle_attacker_tier
}
scope:war = {
NOT = { has_variable = used_for_struggle_catalyst_on_war_ended }As written in game/common/scripted_effects/05_dlc_fp3_scripted_effects.txt.
The first 120 of its 194 lines; the rest is in game/common/scripted_effects/05_dlc_fp3_scripted_effects.txt from line 487.
Where it is used
Every place in common/, events/ and history/ that calls fp3_struggle_apply_supporter_detractor_war_won_catalysts_effect.
On actions (the game's own hooks) (2)
- on_war_won_attacker
- on_war_won_defender
Source: game/common/scripted_effects/05_dlc_fp3_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.