﻿# On actions for when the player character changes, triggered automatically by the game

# For mods that want to intercept all cases where a player changes character from one to another
# Root is the new player character
# scope:previous_player_character is the old player character
on_player_character_change = {
	on_actions = {
		on_randomized_player_character
	}
}

on_randomized_player_character = {
	trigger = {
		#is_ai = no # What was I thinking? Of course it is a player!
		NOT = { has_game_rule = randomize_player_disabled }
		OR = {
			NOT = { has_variable = mr_qol_last_rand_player }
			exists = scope:previous_player_character.var:mr_qol_rand_player_off
		}
	}
	effect = {
		set_variable = mr_qol_rand_player_off
	}
}