CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect

hunt_wound_apply_effect

hunt_wound_apply_effect = { SEVERE = … }

game/common/scripted_effects/00_hunt_effects.txt, line 2785 (89 lines). Parameters: $SEVERE$.

hunt_wound_apply_effect is a scripted effect in Crusader Kings III, written at line 2785 of its file. A call passes 1 parameter: SEVERE. The game's script calls it in 12 places, among them A Spear for … (event hunt.1006), A Spear for … (event hunt.1007) and Cornering the … (event hunt.1202). Patch 1.20.1.2, from game/common/scripted_effects/00_hunt_effects.txt.

What it does

  • If

    • scope:severe = yes

    Then

    • Depending on wound:
      • When wound is Incapable:
        • add_trait_force_tooltip = incapable
      • When wound is maimed:
      • When wound is one eyed:
        • add_trait_force_tooltip = one_eyed
      • When wound is one legged:
        • add_trait_force_tooltip = one_legged
      • When wound is disfigured:
        • add_trait_force_tooltip = disfigured
  • If

    Then

    • add_trait_force_tooltip = wounded_3

    Else if

    • One of these

      • Has the Trait: Wounded
      • or

        All of these

        • scope:severe = yes
        • exists = scope:wound
        • scope:wound = flag:wound

    Then

    • add_trait_force_tooltip = wounded_2

    Otherwise

    • add_trait_force_tooltip = wounded_1

• 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 (89 lines of game script)
hunt_wound_apply_effect = {
	if = {
		limit = { has_character_flag = hunt_wound_ignored }
		remove_character_flag = hunt_wound_ignored
	}
	save_scope_value_as = {
		name = severe
		value = $SEVERE$
	}
	if = {
		limit = { scope:severe = yes }
		if = {
			limit = {
				NOT = { scope:wound = flag:wound }
			}
			hidden_effect = {
				change_trait_rank = {
					trait = wounded
					rank = 1
					max = 3
				}
			}
		}
		switch = {
			trigger = scope:wound
			flag:wound = {
				hidden_effect = {
					change_trait_rank = {
						trait = wounded
						rank = 2
						max = 3
					}
				}
			}
			flag:incapable = { add_trait_force_tooltip = incapable }
			flag:maimed = { apply_maimed_trait_and_modifier_effect = yes }
			flag:one_eyed = { add_trait_force_tooltip = one_eyed }
			flag:one_legged = { add_trait_force_tooltip = one_legged }
			flag:disfigured = { add_trait_force_tooltip = disfigured }
			flag:none = {}
		}
	}
	else = {
		hidden_effect = {
			change_trait_rank = {
				trait = wounded
				rank = 1
				max = 3
			}
		}
	}
	# Tooltips see the pre-change rank
	# Unwrapped add_trait_force_tooltip would apply the new rank a second time
	show_as_tooltip = {
		if = {
			limit = {
				OR = {
					has_trait = wounded_2
					has_trait = wounded_3
					AND = {
						has_trait = wounded_1
						scope:severe = yes
						exists = scope:wound
						scope:wound = flag:wound
					}
				}
			}
			add_trait_force_tooltip = wounded_3
		}
		else_if = {
			limit = {
				OR = {
					has_trait = wounded_1
					AND = {
						scope:severe = yes
						exists = scope:wound
						scope:wound = flag:wound
					}
				}
			}
			add_trait_force_tooltip = wounded_2
		}
		else = { add_trait_force_tooltip = wounded_1 }
	}
	add_character_flag = {
		flag = recent_hunt_wound
		weeks = 1
	}
}

As written in game/common/scripted_effects/00_hunt_effects.txt.

Where it is used

Every place in common/, events/ and history/ that calls hunt_wound_apply_effect.

Source: game/common/scripted_effects/00_hunt_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.

Spotted a mistake on this page?