﻿reform_byz_military_decision = {
	picture = {
        reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
	desc = reform_byz_military_decision_desc
	selection_tooltip = reform_byz_military_decision_tooltip
	decision_group_type = major

	ai_check_interval = 120

	is_shown = {
		is_ruler = yes
		is_landed = yes
		exists = dynasty # Everyone should have a dynasty, but in case they don't...
		OR = { # Must be Roman Emperor
			has_title = title:e_byzantium
			has_title = title:h_roman_empire
		}
		NOR = { # Government conditions.
			has_government = theocracy_government
			has_government = clan_government
			has_government = tribal_government
		}
		sub_realm_size <= 65 # The ERE must be struggling
		root.culture = { has_cultural_era_or_later = culture_era_early_medieval }
		NOT = {  #Can only do it once.
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_reformed_byz_military
			}
		}
	}

	is_valid = {
		trigger_if = {
			limit = { has_ep3_dlc_trigger = yes }
			influence_level >= 4
		}
		trigger_if = {
			limit = { has_ep3_dlc_trigger = no }
			prestige_level >= 3
		}
		NOT = { has_realm_law = crown_authority_0 }
		#Must have specific tradition:
		root.culture = {
			trigger_if = {
				limit = { has_ep3_dlc_trigger = yes }
				has_cultural_tradition = tradition_ep3_imperial_tagmata
			}
			trigger_if = {
				limit = { has_ep3_dlc_trigger = no }
				has_cultural_tradition = tradition_roman_legacy
			}
		}
		martial >= 15
		stewardship >= 10
		learning >= 10
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
	}

	cost = {
		influence = {
			value = 0
			if = {
				limit = { has_ep3_dlc_trigger = yes }
				add = 2000
			}
		}
		prestige = 1000
		gold = 250
	}

	effect = {
		show_as_tooltip = {
			reform_byz_military_decision_scripted_effect = yes
		}
		trigger_event = {
			id = DE_decision_event.0019
		}
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_reformed_byz_military
			}
		}
	}
	
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 1000
	}
}

recruit_military_engineer_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_invite_knights.dds"
	}
	sort_order = 75

	ai_check_interval = 120

	cooldown = { years = 5 }
	
	desc = recruit_military_engineer_decision_desc

	is_shown = {
		culture = {
			has_cultural_parameter = can_recruit_military_engineer
		}
	}

	effect = {
		custom_tooltip = recruit_military_engineer_decision.tt
		hidden_effect = {
			recruit_terrain_specialist_effect = {
				SPECIALIST_TRAIT = military_engineer
				SPECIALIST_TEMPLATE_CHARACTER = siege_commander_character
			}
		}
	}

	cost = {
		gold = {
			value = minor_gold_value
		}
		prestige = {
			value = medium_prestige_value
		}
	}

	ai_potential = {
		culture = {
			has_cultural_parameter = can_recruit_military_engineer
		}
	}

	ai_will_do = {
		base = 100

		modifier = {
			factor = 0
			any_courtier = {
				has_trait = military_engineer
			}
		}
	}
}