on_actions = {
	# Show the report once when a human country has access to the Iron Nest
	# project through the researched Railway Guns technology. This also supports
	# saves that already completed the technology before enabling the mod.
	on_daily = {
		effect = {
			# One-time save migration. Campaigns that completed the old all-in-one
			# project retain their Trio and super-heavy naval unlocks. New campaigns
			# receive the migration marker before the project can be completed.
			if = {
				limit = { NOT = { has_country_flag = iron_nest_v110_migration_checked } }
				if = {
					limit = {
						OR = {
							has_country_flag = iron_nest_overall_project_completed
							is_special_project_completed = sp:sp_land_iron_nest_overall_project
						}
					}
					set_technology = {
						iron_nest_trio_unlock_tech = 1
						iron_nest_super_heavy_naval_battery_unlock_tech = 1
						popup = no
					}
				}
				set_country_flag = iron_nest_v110_migration_checked
			}

			if = {
				limit = {
					is_ai = no
					has_tech = railway_gun
					NOT = { has_country_flag = iron_nest_tutorial_report_seen }
				}
				set_country_flag = iron_nest_tutorial_report_seen
				country_event = { id = iron_nest_tutorial.1 }
			}
		}
	}

	on_state_control_changed = {
		effect = {
			FROM.FROM = {
				if = {
					limit = { has_state_flag = iron_nest_emplaced }
					remove_dynamic_modifier = { modifier = iron_nest_state_support }
					clr_state_flag = iron_nest_emplaced
					clr_state_flag = iron_nest_emplaced_solo
					clr_state_flag = iron_nest_emplaced_duet
					clr_state_flag = iron_nest_emplaced_trio
				}
			}
		}
	}
}
