﻿on_game_start = {
	on_actions = {
		rtd_on_action_game_start
	}
}

rtd_on_action_game_start = {
	effect = {
		if = {
			limit = {
				NOT = { exists = global_var:rtd_is_loaded }
			}
			set_global_variable = {
				name = rtd_is_loaded
				value = yes
			}
		}
	}
}

# character just about to die in root scope
# if a killer is know, it's set as scope:killer
#Triggered by code

on_death = {
	on_actions = {
		rtd_on_action_refresh_coexistence
	}
}

rtd_on_action_refresh_coexistence = {
	trigger = {
		NOT = { has_game_rule = rtd_rule_coexistence_limit_free }
		has_trait = reincarnation
	}
	effect = {
		rtd_effect_remove_from_reincarnated_list = yes
	}
}