﻿# Use in events, not filled by default
idle = {
	effect = {
		if = {
			limit = {
				exists = global_var:add_character_throne_room
				exists = global_var:throne_room_view
			}
			global_var:throne_room_view = {
				add_to_list = characters
			}
		}
	}
	scripted_animation = {
		triggered_animation = {
			trigger = { always = yes }
			animation = idle
		}
	}
}


standing_ruler = {
	effect = {
		scope:ruler = {
			if = {
				limit = {
					trigger_if = {
						limit = {
							exists = global_var:add_character_throne_room
							exists = global_var:throne_room_view
						}
						NOT = {
							global_var:throne_room_view = scope:ruler
						}
					}
					OR = {
						has_character_flag = holding_court_character_flag
						is_available = yes
					}
					age >= 4
					is_incorrect_type_for_throne_trigger = { CHARACTER = scope:ruler }
				}
				add_to_list = characters
			}
		}
	}
	scripted_animation = {
		triggered_animation = {
			trigger = {
				scope:ruler = {
					has_title = title:e_byzantium
					religion = religion:christianity_religion
				}
			}
			animation = { scepter } # anim uses crucifix scepter
		}
		triggered_animation = {
			trigger = { always = yes }
			animation = { personality_honorable personality_content personality_rational }
		}
	}
}

# Role is used in code to place people on throne
ruler = {
	effect = {
		scope:ruler = {
			if = {
				limit = {
					trigger_if = {
						limit = {
							exists = global_var:add_character_throne_room
							exists = global_var:throne_room_view
						}
						NOT = {
							global_var:throne_room_view = scope:ruler
						}
					}
					OR = {
						has_character_flag = holding_court_character_flag
						is_available = yes
					}
					age >= 4
					NOT = {
						is_incorrect_type_for_throne_trigger = { CHARACTER = scope:ruler }
					}
				}
				add_to_list = characters
			}
		}
	}

	# ruler sits on the throne, so this animation parameter is ignored
	# instead we use animation specific to the throne entity
	# see game/gfx/court_scene/throne_animations/throne_animations.txt
	scripted_animation = {
		animation = throne_room_ruler
	}
}
