Scripted effect
commander_trait_leveling_leveling_effect
commander_trait_leveling_leveling_effect = { XP = … }game/common/scripted_effects/00_war_effects.txt, line 2736 (296 lines). Parameters: $XP$.
commander_trait_leveling_leveling_effect is a scripted effect in Crusader Kings III, written at line 2736 of its file. A call passes 1 parameter: XP. The game's script calls it in 2 places, among them on_combat_end_loser (on action) and on_combat_end_winner (on action). Patch 1.20.1.2, from game/common/scripted_effects/00_war_effects.txt.
The comment above it in the file
ROOT is a combat side in this scripted effect, but the THIS scope should be the commander
What it does
If
One of these
- Has the Trait: Desert Warrior
or
Has the Trait: Open Terrain Expertor
Has the Trait: Rough Terrain Expertor
Has the Trait: Forest Fighteror
Has the Trait: Jungle Stalker
Then
If
- Has the Trait: Desert Warrior
- Their location:
One of these
terrain = drylandsor
terrain = desertor
terrain = desert_mountainsor
terrain = oasis
Then
- Desert Warrior experience changes
Else if
- Has the Trait: Open Terrain Expert
- Their location:
One of these
terrain = farmlandsor
terrain = plainsor
terrain = steppe
Then
- Open Terrain Expert experience changes
Else if
- Has the Trait: Rough Terrain Expert
- Their location:
One of these
terrain = hillsor
terrain = mountainsor
terrain = wetlands
Then
- Rough Terrain Expert experience changes
Else if
- Has the Trait: Forest Fighter
- Their location:
One of these
terrain = forestor
terrain = taiga
Then
- Forest Fighter experience changes
Else if
- Has the Trait: Jungle Stalker
- Their location:
terrain = jungle
Then
- Jungle Stalker experience changes
If
One of these
- Has the Trait: Aggressive Attacker
or
Has the Trait: Defender
Then
If
- Has the Trait: Aggressive Attacker
- You:
is_combat_side_attacker = yes
Then
- Aggressive Attacker experience changes
- If has the Trait: Flexible Leader: Flexible Leader experience changes
If
- Has the Trait: Faithful Blade
root.enemy_side.side_commander.religion != root.side_commander.religion
Then
- Faithful Blade experience changes
If
One of these
- Has the Trait: Reckless
or
Has the Trait: Cautious Leader
- You: Troops ratio less than 0.95
Then
- If has the Trait: Reckless: Reckless experience changes
- If has the Trait: Cautious Leader: Cautious Leader experience changes
If
- Has the Trait: Peasant Leader
root.enemy_side.side_commander ?= { is_lowborn = no }
Then
- Peasant Leader experience changes
• 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)
commander_trait_leveling_leveling_effect = {
if = { # Terrain Based
limit = {
OR = {
has_trait = desert_warrior
has_trait = open_terrain_expert
has_trait = rough_terrain_expert
has_trait = forest_fighter
has_trait = jungle_stalker
}
}
if = {
limit = {
has_trait = desert_warrior
location = {
OR = {
terrain = drylands
terrain = desert
terrain = desert_mountains
terrain = oasis
}
}
}
add_trait_xp = {
trait = desert_warrior
value = {
value = $XP$
multiply = 2
add = {
value = martial
divide = 10
}
}
}
}
else_if = {
limit = {
has_trait = open_terrain_expert
location = {
OR = {
terrain = farmlands
terrain = plains
terrain = steppe
}
}
}
add_trait_xp = {
trait = open_terrain_expert
value = {
value = $XP$
multiply = 2
add = {
value = martial
divide = 10
}
}
}
}
else_if = {
limit = {
has_trait = rough_terrain_expert
location = {
OR = {
terrain = hills
terrain = mountains
terrain = wetlands
}
}
}
add_trait_xp = {
trait = rough_terrain_expert
value = {
value = $XP$
multiply = 2
add = {
value = martial
divide = 10
}
}
}
}
else_if = {
limit = {
has_trait = forest_fighter
location = {
OR = {
terrain = forest
terrain = taiga
}
}
}
add_trait_xp = {
trait = forest_fighter
value = {
value = $XP$
multiply = 2
add = {
value = martial
divide = 10
}
}
}
}
else_if = {
limit = {
has_trait = jungle_stalker
location = {
terrain = jungle
}
}
add_trait_xp = {
trait = jungle_stalker
value = {
value = $XP$
multiply = 2
add = {
value = martial
divide = 10
}
}As written in game/common/scripted_effects/00_war_effects.txt.
The first 120 of its 296 lines; the rest is in game/common/scripted_effects/00_war_effects.txt from line 2736.
Where it is used
Every place in common/, events/ and history/ that calls commander_trait_leveling_leveling_effect.
On actions (the game's own hooks) (2)
- on_combat_end_loser
- on_combat_end_winner
Source: game/common/scripted_effects/00_war_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.