﻿# Leo VI's Mass Vassal Directives - events

namespace = leo_mvd

##################################################
# leo_mvd.1 - self-rescheduling monthly pulse (hidden)
# ROOT: the player character
##################################################
leo_mvd.1 = {
	hidden = yes

	trigger = {
		is_ai = no
	}

	immediate = {
		# Heartbeat for the yearly watchdog: while this flag is alive the
		# pulse chain is known to be running.
		add_character_flag = {
			flag = leo_mvd_pulse_alive
			days = 45
		}
		# The panel reads the configuration variables straight from GUI, so they
		# have to exist before it is ever opened. This is idempotent, and makes
		# a save that predates a config change heal itself within the month even
		# if the panel is never touched.
		leo_mvd_init_defaults_effect = yes
		if = {
			limit = {
				has_variable = leo_mvd_auto
				is_ruler = yes
			}
			leo_mvd_run_waterfall_effect = yes
		}
		trigger_event = {
			id = leo_mvd.1
			days = 30
		}
	}
}
