Scripted effect · Roads to Power files
war_task_contracts_completion_effect
war_task_contracts_completion_effect = yesgame/common/scripted_effects/07_dlc_ep3_scripted_effects.txt, line 11278 (93 lines). No parameters.
war_task_contracts_completion_effect is a scripted effect in Crusader Kings III, in the Roads to Power files, written at line 11278 of its file. It takes no parameters: war_task_contracts_completion_effect = yes. The game's script calls it in 4 places, among them on_war_invalidated (on action), on_war_white_peace (on action) and on_war_won_attacker (on action). Patch 1.20.1.2, from game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.
The comment above it in the file
Complete war group task contracts, used in war_on_actions
What it does
scope:war:If
- Any war participant › Any character active contract:
One of these
All of these
has_task_contract_type = laamp_join_war_contract- Task contract war is scope:war
or
All of these
has_task_contract_type = laamp_help_claimant_contracttask_contract_employer = scope:war.primary_attacker
Then
scope:relevant_contract:If
scope:war:war_contribution = { target = scope:relevant_contract.task_contract_taker value > 0 }
Then
complete_task_contract = success_standard
Otherwise
complete_task_contract = failure_standard
- Any war participant › Any character active contract:
If
using_civil_war_cb_trigger = yes- Any war participant › Any character active contract:
task_contract_type = laamp_join_faction_contracttask_contract_employer = { is_participant_in_war = scope:war }
Then
- Every war participant › Every character active contract:
- Where:
task_contract_employer = { is_participant_in_war = scope:war }
task_contract_type = laamp_join_faction_contractIf
task_contract_taker = scope:winner
Then
complete_task_contract = success_standard
Otherwise
complete_task_contract = failure_standard
- 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 (93 lines of game script)
war_task_contracts_completion_effect = {
#Join War Contract and Help Claimant Contract
scope:war = {
if = {
limit = {
any_war_participant = {
any_character_active_contract = {
OR = {
AND = {
has_task_contract_type = laamp_join_war_contract
var:task_contract_war ?= scope:war
}
AND = {
has_task_contract_type = laamp_help_claimant_contract
task_contract_employer = scope:war.primary_attacker
}
}
save_temporary_scope_as = relevant_contract
}
}
}
scope:relevant_contract = {
if = {
limit = {
scope:war = {
war_contribution = {
target = scope:relevant_contract.task_contract_taker
value > 0
}
}
}
complete_task_contract = success_standard
}
else = {
complete_task_contract = failure_standard
}
}
}
if = {
limit = {
primary_attacker = {
has_variable = valuable_prisoners
}
}
primary_attacker = {
remove_variable = valuable_prisoners
}
}
if = {
limit = {
primary_defender = {
has_variable = valuable_prisoners
}
}
primary_defender = {
remove_variable = valuable_prisoners
}
}
if = {
limit = {
using_civil_war_cb_trigger = yes
any_war_participant = {
any_character_active_contract = {
task_contract_type = laamp_join_faction_contract
task_contract_employer = {
is_participant_in_war = scope:war
}
}
}
}
every_war_participant = {
every_character_active_contract = {
task_contract_type = laamp_join_faction_contract
limit = {
task_contract_employer = {
is_participant_in_war = scope:war
}
}
if = {
limit = {
exists = scope:winner
task_contract_taker = scope:winner
}
complete_task_contract = success_standard
}
else = {
complete_task_contract = failure_standard
}
}
}
}
}
}As written in game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls war_task_contracts_completion_effect.
On actions (the game's own hooks) (4)
- on_war_invalidated
- on_war_white_peace
- on_war_won_attacker
- on_war_won_defender
Source: game/common/scripted_effects/07_dlc_ep3_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.