﻿namespace = dev
dev.1 = {
	#Point
	type = country_event
	event_image = {
		video = "gfx/event_pictures/unspecific_military_parade.bk2"
	}
	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/military_parade"
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	title = dev.1.t
	desc = dev.1.desc
	duration = 1
	option = {
		name = dev.1.a
		default_option = yes
		if = {
			limit = {
				NOT = {
					has_variable = idea_point_pool
				}
			}
			set_variable = {
				name = idea_point_pool
				value = 0
			}
		}
		if = {
			limit = {
				ve_national_insight_value < 1000
			}
			change_variable = {
				name = idea_point_pool
				add = 300
			}
			ve_clamp_national_insight = yes
		}
	}
	option = {
		name = dev.1.b
		if = {
			limit = {
				NOT = {
					has_variable = idea_point_pool
				}
			}
			set_variable = {
				name = idea_point_pool
				value = 0
			}
		}
		if = {
			limit = {
				ve_national_insight_value > 0
			}
			change_variable = {
				name = idea_point_pool
				subtract = 300
			}
			ve_clamp_national_insight = yes
		}
	}
	option = {
		name = dev.1.c
		if = {
			limit = {
				NOT = {
					has_variable = piety_bar_point
				}
			}
			set_variable = {
				name = piety_bar_point
				value = 0
			}
		}
		if = {
			limit = {
				ve_religious_state_value < 100
			}
			change_variable = {
				name = piety_bar_point
				add = 25
			}
			ve_clamp_religious_state = yes
		}
	}
	option = {
		name = dev.1.d
		if = {
			limit = {
				NOT = {
					has_variable = piety_bar_point
				}
			}
			set_variable = {
				name = piety_bar_point
				value = 0
			}
		}
		if = {
			limit = {
				ve_religious_state_value > 0
			}
			change_variable = {
				name = piety_bar_point
				subtract = 25
			}
			ve_clamp_religious_state = yes
		}
	}
	option = {
		name = dev.1.e
		if = {
			limit = {
				NOT = {
					has_variable = culture_reform_point
				}
			}
			set_variable = {
				name = culture_reform_point
				value = 0
			}
		}
		if = {
			limit = {
				ve_national_identity_value < 500
			}
			change_variable = {
				name = culture_reform_point
				add = 200
			}
			ve_clamp_cultural_mandate = yes
		}
	}
	option = {
		name = dev.1.f
		if = {
			limit = {
				NOT = {
					has_variable = culture_reform_point
				}
			}
			set_variable = {
				name = culture_reform_point
				value = 0
			}
		}
		if = {
			limit = {
				ve_national_identity_value > 0
			}
			change_variable = {
				name = culture_reform_point
				subtract = 200
			}
			ve_clamp_cultural_mandate = yes
		}
	}
	option = {
		name = dev.1.g
		if = {
			limit = {
				NOT = {
					has_variable = ve_splender_points
				}
			}
			set_variable = {
				name = ve_splender_points
				value = 0
			}
		}
		if = {
			limit = {
				splender_points_value < 1000
			}
			change_variable = {
				name = ve_splender_points
				add = 800
			}
		}
	}
	option = {
		name = dev.1.h
		if = {
			limit = {
				NOT = {
					has_variable = ve_splender_points
				}
			}
			set_variable = {
				name = ve_splender_points
				value = 0
			}
		}
		if = {
			limit = {
				splender_points_value > 0
			}
			change_variable = {
				name = ve_splender_points
				subtract = 800
			}
		}
	}
	option = {
		name = dev.1.i
		if = {
			limit = {
				NOT = {
					has_variable = piety_reform_point
				}
			}
			set_variable = {
				name = piety_reform_point
				value = 0
			}
		}
		change_variable = {
			name = piety_reform_point
			add = 200
		}
		ve_clamp_piety_reform = yes
	}
	option = {
		name = dev.1.j
		if = {
			limit = {
				NOT = {
					has_variable = piety_reform_point
				}
			}
			set_variable = {
				name = piety_reform_point
				value = 0
			}
		}
		change_variable = {
			name = piety_reform_point
			subtract = 200
		}
		ve_clamp_piety_reform = yes
	}
	option = {
		name = dev.1.k
		set_variable = {
			name = idea_point_pool
			value = 950
		}
		set_variable = {
			name = piety_reform_point
			value = 450
		}
		set_variable = {
			name = piety_bar_point
			value = 75
		}
		set_variable = {
			name = culture_reform_point
			value = 450
		}
		set_variable = {
			name = ve_national_cohesion
			value = 75
		}
		set_variable = {
			name = ve_splender_points
			value = 950
		}
	}
	option = {
		name = dev.1.l
		# Fixes a save whose idea_group_unlocked counter got inflated by the
		# now-fixed double-increment bug in embrace_idea_group (see
		# common/scripted_guis/ve_idea.txt). Recalculates the true count from
		# the can_go_X flags instead of just zeroing it, so groups you have
		# actually embraced still count against the cap.
		ve_recalculate_idea_group_unlocked = yes
	}
}

dev.2 = {
	#Developer Work Event - Not for users
	type = country_event
	event_image = {
		video = "gfx/event_pictures/middleeast_oil_derricks.bk2"
	}
	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/world_fair"
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	title = dev.2.t
	desc = dev.2.d
	flavor = dev.1.f
	duration = 0
	trigger = {
		literacy_rate <= 0.25
	}
	immediate = {
		# random_country = {
		# 	limit = {
		# 		is_ai = no
		# 	}
		# 	religion = {
		# 		save_scope_as = my_religion
		# 	}
		# }
		# every_scope_state = {
		# 	random_scope_pop = {
		# 		limit = {
		# 			pop_has_primary_culture = yes
		# 		}
		# 		culture = {
		# 			save_scope_as = my_culture
		# 		}
		# 	}
		# }
	}
	option = {
		name = dev.2.a
		default_option = yes
		# set_global_variable = ve_age_2_started
		# remove_global_variable = ve_age_1_started
		# remove_global_variable = ve_age_3_started
		# set_global_variable = age_2_started_trigger
		# create_diplomatic_pact = {
		# 	country = c:BRZ
		# 	type = puppet
		# }
		# create_diplomatic_pact = {
		# 	country = c:AGJ
		# 	type = puppet
		# }
		# create_diplomatic_pact = {
		# 	country = c:PRG
		# 	type = puppet
		# }
		# create_diplomatic_pact = {
		# 	country = c:URU
		# 	type = puppet
		# }
		# annex = c:BRZ
		# annex = c:AGJ
		# annex = c:PRG
		# annex = c:URU
		# annex = c:ARJ
		# annex = c:CHL
		# annex = c:CLM
		# annex = c:VNZ
		set_global_variable = ve_age_3_started
		remove_global_variable = ve_age_1_started
		remove_global_variable = ve_age_2_started
		# set_state_religion = rel:atheist
	}
	option = {
		name = dev.2.b
		default_option = yes
		add_technology_researched = railways
		# every_scope_state = {
		# 	limit = {
		# 		owner = ROOT
		# 	}
		# 	create_building = {
		# 		building = building_railway
		# 		level = 1
		# 	}
		# }
	}
	option = {
		name = dev.2.d
		# every_scope_state = {
		# 	limit = {
		# 		has_variable = selected_state_religion
		# 	}
		# 	convert_population = {
		# 		target = scope:my_religion
		# 		value = 0.1
		# 	}
		# 	every_scope_pop = {
		# 		limit = {
		# 			pop_has_primary_culture = no
		# 		}
		# 		change_pop_culture = {
		# 			value = 0.005
		# 			target = scope:my_culture
		# 		}
		# 	}
		# }
		capital = {
			convert_population = {
				target = rel:orthodox
				value = 0.5
			}
		}
		c:TUR = {
			trigger_event = {
				id = dev.7
			}
		}
		c:EGY = {
			trigger_event = {
				id = dev.7
			}
		}
	}
}

dev.3 = {
	#Game Difficulty
	type = country_event
	event_image = {
		video = "gfx/event_pictures/unspecific_trains.bk2"
	}
	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/trains"
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	title = dev.3.t
	desc = dev.3.d
	flavor = dev.3.f
	duration = 1
	immediate = {
		set_global_variable = dev_3_triggered
	}
	trigger = {
		is_ai = no
		NOT = {
			has_global_variable = dev_3_triggered
		}
	}
	option = {
		name = dev.3.a
		if = {
			limit = {
				has_global_variable = ve_medium
			}
			remove_global_variable = ve_medium
		}
		if = {
			limit = {
				has_global_variable = ve_hard
			}
			remove_global_variable = ve_hard
		}
		set_global_variable = ve_easy
	}
	option = {
		name = dev.3.b
		default_option = yes
		if = {
			limit = {
				has_global_variable = ve_easy
			}
			remove_global_variable = ve_easy
		}
		if = {
			limit = {
				has_global_variable = ve_hard
			}
			remove_global_variable = ve_hard
		}
		set_global_variable = ve_medium
	}
	option = {
		name = dev.3.c
		if = {
			limit = {
				has_global_variable = ve_easy
			}
			remove_global_variable = ve_easy
		}
		if = {
			limit = {
				has_global_variable = ve_medium
			}
			remove_global_variable = ve_medium
		}
		set_global_variable = ve_hard
	}
}

dev.4 = {
	# Deprecated monthly compatibility wrapper.
	type = country_event
	hidden = yes
	immediate = {
		# Deprecated compatibility wrapper. Live monthly dispatch calls the
		# effect directly from on_monthly_pulse_country.
		ve_monthly_country_tick = yes
		if = {
			#For Released and Civil War Countries
			limit = {
				NOT = {
					has_variable = ve_1936_countries
				}
			}
			set_variable = ve_1936_countries
		}
	}
}

dev.5 = {
	#Imperial Age 
	type = country_event
	hidden = yes
	immediate = {
		set_global_variable = ve_age_2_started
		remove_global_variable = ve_age_1_started
		remove_global_variable = ve_age_3_started
		set_global_variable = age_2_started_trigger
		every_country = {
			limit = {
				is_ai = no
			}
			trigger_event = {
				id = ve_ages.1
			}
		}
		every_country = {
			ve_reset_era_momentum = yes
			ve_clear_age_1_objective_flags = yes
			if = {
				limit = {
					has_modifier = age_1_bonus_1
				}
				remove_modifier = age_1_bonus_1
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_2
				}
				remove_modifier = age_1_bonus_2
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_3
				}
				remove_modifier = age_1_bonus_3
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_4
				}
				remove_modifier = age_1_bonus_4
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_5
				}
				remove_modifier = age_1_bonus_5
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_6
				}
				remove_modifier = age_1_bonus_6
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_7
				}
				remove_modifier = age_1_bonus_7
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_8
				}
				remove_modifier = age_1_bonus_8
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_9
				}
				remove_modifier = age_1_bonus_9
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_10
				}
				remove_modifier = age_1_bonus_10
			}
			if = {
				limit = {
					has_modifier = age_1_bonus_11
				}
				remove_modifier = age_1_bonus_11
			}
			if = {
				limit = { has_modifier = age_1_bonus_12 }
				remove_modifier = age_1_bonus_12
			}
			if = {
				limit = { has_modifier = age_1_bonus_13 }
				remove_modifier = age_1_bonus_13
			}
		}
	}
	trigger = {
		is_ai = yes
		year >= 1871
		year < 1906
		NOT = {
			has_global_variable = age_2_started_trigger
		}
	}
}

dev.6 = {
	#The Last Age
	type = country_event
	hidden = yes
	immediate = {
		set_global_variable = ve_age_3_started
		remove_global_variable = ve_age_1_started
		remove_global_variable = ve_age_2_started
		set_global_variable = age_3_started_trigger
		every_country = {
			limit = {
				is_ai = no
			}
			trigger_event = {
				id = ve_ages.2
			}
		}
		every_country = {
			ve_reset_era_momentum = yes
			ve_clear_age_2_objective_flags = yes
			if = {
				limit = {
					has_modifier = age_2_bonus_1
				}
				remove_modifier = age_2_bonus_1
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_2
				}
				remove_modifier = age_2_bonus_2
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_3
				}
				remove_modifier = age_2_bonus_3
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_4
				}
				remove_modifier = age_2_bonus_4
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_5
				}
				remove_modifier = age_2_bonus_5
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_6
				}
				remove_modifier = age_2_bonus_6
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_7
				}
				remove_modifier = age_2_bonus_7
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_8
				}
				remove_modifier = age_2_bonus_8
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_9
				}
				remove_modifier = age_2_bonus_9
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_10
				}
				remove_modifier = age_2_bonus_10
			}
			if = {
				limit = {
					has_modifier = age_2_bonus_11
				}
				remove_modifier = age_2_bonus_11
			}
			if = {
				limit = { has_modifier = age_2_bonus_12 }
				remove_modifier = age_2_bonus_12
			}
			if = {
				limit = { has_modifier = age_2_bonus_13 }
				remove_modifier = age_2_bonus_13
			}
		}
	}
	trigger = {
		is_ai = yes
		year >= 1906
		NOT = {
			has_global_variable = age_3_started_trigger
		}
	}
}

dev.7 = {
	# Retired: the missionary system (ve_process_active_missionaries,
	# ve_reconcile_missionary_pool) was replaced by the Targeted Religious
	# Project - see common/scripted_effects/ve_religious_state_effects.txt.
	type = country_event
	hidden = yes
	immediate = {
	}
}

dev.8 = {
	#VE Testing - Force Religious Model
	type = country_event
	event_image = {
		video = "gfx/event_pictures/unspecific_politicians_arguing.bk2"
	}
	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/trains"
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	title = dev.8.t
	desc = dev.8.desc
	duration = 1
	option = {
		name = dev.8.a
		default_option = yes
		activate_law = law_type:law_state_religion
	}
	option = {
		name = dev.8.b
		activate_law = law_type:law_freedom_of_conscience
	}
	option = {
		name = dev.8.c
		activate_law = law_type:law_total_separation
	}
	option = {
		name = dev.8.d
		activate_law = law_type:law_state_atheism
	}
}

dev.9 = {
	#VE Testing - Force Identity/Citizenship Law
	type = country_event
	event_image = {
		video = "gfx/event_pictures/unspecific_ruler_speaking_to_people.bk2"
	}
	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/trains"
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	title = dev.9.t
	desc = dev.9.desc
	duration = 1
	option = {
		name = dev.9.a
		default_option = yes
		activate_law = law_type:law_ethnostate
	}
	option = {
		name = dev.9.b
		activate_law = law_type:law_national_supremacy
	}
	option = {
		name = dev.9.c
		activate_law = law_type:law_multicultural
	}
	option = {
		name = dev.9.d
		activate_law = law_type:law_racial_segregation
	}
	option = {
		name = dev.9.e
		activate_law = law_type:law_cultural_exclusion
	}
}

dev.10 = {
	#VE Testing - Force Age / Instant-Finish Active Projects
	type = country_event
	event_image = {
		video = "gfx/event_pictures/unspecific_signed_contract.bk2"
	}
	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/trains"
	icon = "gfx/interface/icons/event_icons/event_portrait.dds"
	title = dev.10.t
	desc = dev.10.desc
	duration = 1
	option = {
		name = dev.10.a
		default_option = yes
		trigger_event = { id = dev.5 }
	}
	option = {
		name = dev.10.b
		trigger_event = { id = dev.6 }
	}
	option = {
		name = dev.10.c
		if = {
			limit = { ve_has_active_cultural_project = yes }
			set_variable = {
				name = ve_cultural_project_progress
				value = 100
			}
			ve_update_cultural_project = yes
		}
	}
	option = {
		name = dev.10.d
		if = {
			limit = { ve_has_active_religious_project = yes }
			set_variable = {
				name = ve_religious_project_progress
				value = 100
			}
			ve_update_religious_project = yes
		}
	}
}
