Scripted effect · Tours and Tournaments files
tournament_contest_versus_battle_effect
tournament_contest_versus_battle_effect = { CHOOSE_WINNER = … CONTEST = … INJURY_CHANCE = … }game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 2125 (377 lines). Parameters: $CHOOSE_WINNER$, $CONTEST$, $INJURY_CHANCE$.
tournament_contest_versus_battle_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 2125 of its file. A call passes 3 parameters: CHOOSE_WINNER, CONTEST and INJURY_CHANCE. The game's script calls it in 2 places, among them contest_events.0802 (event) and contest_events.0830 (event). Patch 1.20.1.2, from game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.
The comment above it in the file
Randomize versus bout outcome based on skill
What it does
If
scope:choose_winner = yes
Then
- 1 of 2 things will happen:
- 50% – You win the … round (base chance; changed in play):
versus_contest_round_outcome_tooltip_effect = { WINNER = root LOSER = scope:next_versus_match }
- 50% – … wins the … round (base chance; changed in play):
versus_contest_round_outcome_tooltip_effect = { WINNER = scope:next_versus_match LOSER = root }
- 50% – You win the … round (base chance; changed in play):
- scope:activity › Depending on activity.var:contest versus progress:
- When activity.var:contest versus progress is 0:
add_to_guest_subset = { name = semi_finalist target = scope:contest_winner phase = tournament_phase_$CONTEST$ }
- When activity.var:contest versus progress is 1:
add_to_guest_subset = { name = finalist target = scope:contest_winner phase = tournament_phase_$CONTEST$ }
- When activity.var:contest versus progress is 2:
add_to_guest_subset = { name = winner target = scope:contest_winner phase = tournament_phase_$CONTEST$ }add_to_guest_subset = { name = second_place target = scope:contest_loser phase = tournament_phase_$CONTEST$ }
- When activity.var:contest versus progress is 0:
If
scope:injury_chance ?= yes
Then
- scope:activity › Depending on has current phase:
- When has current phase is Joust:
tournament_contest_versus_battle_wound_effect = { WOUND_CHANCE = 30 DEATH_CHANCE = 5 CONTEST = joust }
- When has current phase is Wrestling:
tournament_contest_versus_battle_wound_effect = { WOUND_CHANCE = 10 DEATH_CHANCE = 1 CONTEST = wrestling }
- When has current phase is Duel:
tournament_contest_versus_battle_wound_effect = { WOUND_CHANCE = 20 DEATH_CHANCE = 3 CONTEST = duel }
- When has current phase is Board Game:
tournament_contest_versus_battle_wound_effect = { WOUND_CHANCE = 5 DEATH_CHANCE = 1 CONTEST = board_game }
- When has current phase is Joust:
If
One of these
exists = scope:sabotage_murder_woundor
exists = scope:sabotage_murder_death
Then
- Depending on exists:
- When exists is scope:sabotage murder wound:
attempted_murder_opinion_effect = { VICTIM = scope:contest_loser MURDERER = scope:contest_winner }
- When exists is scope:sabotage murder death:
murder_opinion_effect = { VICTIM = scope:contest_loser MURDERER = scope:contest_winner }
- When exists is scope:sabotage murder wound:
If
- scope:host: Is played by the AI
Then
- 50% chance of:
rightfully_imprison_character_effect = { TARGET = scope:contest_winner IMPRISONER = scope:host }
scope:contest_winner:trigger_event = { on_action = contest_bout_$CONTEST$_outcome_pulse }
scope:contest_loser:trigger_event = { on_action = contest_bout_$CONTEST$_outcome_pulse }
scope:activity:- If contest versus progress less than 2:
- Otherwise › Every attending character:
- Where: Is played by a person
tournament_pivotal_contestant_scope_effect = yestrigger_event = { on_action = contest_bout_$CONTEST$_outcome_pulse }
• 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)
tournament_contest_versus_battle_effect = {
save_temporary_scope_value_as = {
name = choose_winner
value = $CHOOSE_WINNER$
}
save_temporary_scope_value_as = {
name = injury_chance
value = $INJURY_CHANCE$
}
set_variable = {
name = progress_to_victory
value = progress_to_victory_active_contestant_value
}
var:next_versus_match = {
save_scope_as = next_versus_match
if = {
limit = { is_alive = yes }
set_variable = {
name = progress_to_victory
value = progress_to_victory_active_contestant_value
}
}
}
# Determine winner
if = {
limit = { scope:choose_winner = yes }
random_list = {
# ROOT WINS
10 = {
trigger = {
is_alive = yes
save_temporary_scope_as = versus_matchee_temp
}
desc = tournament_contest_versus_battle_win_tt
modifier = {
exists = var:progress_to_victory_score
add = var:progress_to_victory_score
}
modifier = {
exists = var:contest_aptitude
add = {
value = var:contest_aptitude
divide = 2
}
}
# Prefer unmatched rivals of players to not get knocked out
modifier = {
is_ai = yes
scope:next_versus_match = { is_ai = yes }
scope:activity = {
any_guest_subset = {
name = contestant
exists = var:progress_to_victory
this != scope:next_versus_match
is_ai = no
has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
}
}
factor = 2
}
modifier = {
has_variable = murder_sabotage_target
factor = 0.5
}
# If aptitude is higher, more likely to win
modifier = {
exists = var:contest_aptitude
exists = scope:next_versus_match.var:contest_aptitude
var:contest_aptitude > scope:next_versus_match.var:contest_aptitude
factor = 2
}
# If have at least double aptitude of other character, you win
modifier = {
exists = var:contest_aptitude
exists = scope:next_versus_match.var:contest_aptitude
contest_aptitude_fetch_half_value >= scope:next_versus_match.var:contest_aptitude
add = 1000
}
show_chance = no
versus_contest_round_outcome_tooltip_effect = {
WINNER = root
LOSER = scope:next_versus_match
}
save_scope_as = contest_winner
scope:next_versus_match = { save_scope_as = contest_loser }
}
# VERSUS CONTESTANT WINS
10 = {
desc = tournament_contest_versus_battle_lose_tt
trigger = {
scope:next_versus_match = { is_alive = yes }
}
modifier = {
exists = scope:next_versus_match.var:progress_to_victory_score
add = scope:next_versus_match.var:progress_to_victory_score
}
modifier = {
exists = scope:next_versus_match.var:contest_aptitude
add = {
value = scope:next_versus_match.var:contest_aptitude
divide = 2
}
}
# Prefer unmatched rivals of players to not get knocked out
modifier = {
is_ai = yes
scope:next_versus_match = { is_ai = yes }
scope:activity = {
any_guest_subset = {
name = contestant
exists = var:progress_to_victory
this != root
is_ai = no
has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:next_versus_match }
}
}
factor = 2
}
modifier = {
scope:next_versus_match = { has_variable = murder_sabotage_target }As written in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.
The first 120 of its 377 lines; the rest is in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt from line 2125.
Where it is used
Every place in common/, events/ and history/ that calls tournament_contest_versus_battle_effect.
Events (2)
Source: game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.