Scripted effect
mystic_lifestyle_point_gain_effect
mystic_lifestyle_point_gain_effect = { VALUE = … }game/common/scripted_effects/00_lifestyle_focus_effects.txt, line 612 (134 lines). Parameters: $VALUE$.
mystic_lifestyle_point_gain_effect is a scripted effect in Crusader Kings III, written at line 612 of its file. A call passes 1 parameter: VALUE. No file of common/, events/ or history/ calls it. Patch 1.20.1.2, from game/common/scripted_effects/00_lifestyle_focus_effects.txt.
What it does
If
Then
If
Then
• 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)
mystic_lifestyle_point_gain_effect = {
# Expects VALUE
# Tooltip stuff first:
show_as_tooltip = {
if = {
limit = { # No further rank ups if you're already at max
NAND = {
has_trait = lifestyle_mystic
has_trait_xp = {
trait = lifestyle_mystic
value >= 100
}
}
exists = var:mystic_lifestyle_progress # This assumes you can never progress the lifestyle on the first point gain
}
# Show rank-up tooltip if relevant
if = {
limit = {
has_trait = lifestyle_mystic
has_trait_xp = {
trait = lifestyle_mystic
value >= 100
}
}
set_local_variable = {
name = mystic_check_tooltip_value
value = mystic_second_rank_up_threshold
}
}
else = {
set_local_variable = {
name = mystic_check_tooltip_value
value = mystic_first_rank_up_threshold
}
}
change_local_variable = {
name = mystic_check_tooltip_value
subtract = $VALUE$
}
if = {
limit = {
trigger_if = { # If Mystic 2, use the higher threshold
limit = {
AND = {
has_trait = lifestyle_mystic
has_trait_xp = {
trait = lifestyle_mystic
value >= 50
}
has_trait_xp = {
trait = lifestyle_mystic
value < 100
}
}
}
var:mystic_lifestyle_progress >= local_var:mystic_check_tooltip_value
}
trigger_else = {
var:mystic_lifestyle_progress >= mystic_first_rank_up_threshold
}
}
mystic_lifestyle_rank_up_effect = yes
}
}
}
# Actually run the lifestyle experience/rank-up gain effect:
hidden_effect = {
if = {
limit = { # No further rank ups if you're already at max
NAND = {
has_trait = lifestyle_mystic
has_trait_xp = {
trait = lifestyle_mystic
value >= 100
}
}
}
if = {
limit = {
NOT = { exists = var:mystic_lifestyle_progress }
}
set_variable = {
name = mystic_lifestyle_progress
value = $VALUE$
}
}
else = {
change_variable = {
name = mystic_lifestyle_progress
add = $VALUE$
}
}
# Rank up if relevant
if = {
limit = {
trigger_if = { # If Mystic 2, use the higher threshold
limit = {
has_trait = lifestyle_mystic
has_trait_xp = {
trait = lifestyle_mystic
value >= 50
}
}
var:mystic_lifestyle_progress >= mystic_second_rank_up_threshold
}
trigger_else = {
var:mystic_lifestyle_progress >= mystic_first_rank_up_threshold
}
}
mystic_lifestyle_rank_up_effect = yes
# Remove the variable if you reach max rank
if = {
limit = {
has_trait = lifestyle_mystic
has_trait_xp = {
trait = lifestyle_mystic
value >= 100
}As written in game/common/scripted_effects/00_lifestyle_focus_effects.txt.
The first 120 of its 134 lines; the rest is in game/common/scripted_effects/00_lifestyle_focus_effects.txt from line 612.
Where it is used
No file of common/, events/ or history/ calls it.
Source: game/common/scripted_effects/00_lifestyle_focus_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.