﻿qs_go_into_hiding = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
	
	#sort_order = 81

	desc = qs_go_into_hiding_desc
	selection_tooltip = qs_go_into_hiding_tooltip

	ai_check_interval = 24
	
	decision_group_type = major

	is_shown = {
		is_landed_or_landless_administrative = yes
		has_game_rule = qs_decision_go_into_hiding_enabled
		NOT = { has_trait = qs_in_hiding }
	}
	
	is_valid = {
		OR = {
			custom_tooltip = {
				text = qs_go_into_hiding_scheme_valid
				any_targeting_scheme = {
					is_hostile = yes
					is_scheme_exposed = yes
				}
			}
			has_character_modifier = watchful_modifier
			has_trait = paranoid
		}
	}
	
	is_valid_showing_failures_only = {
		is_available_adult = yes
		is_physically_able = yes
	}
	
	effect = {
		send_interface_toast = {
			type = event_toast_effect_good
			title = qs.go.into.hiding.title
			left_icon = root
			add_prestige = major_prestige_loss
			add_trait = qs_in_hiding
			if = {
				limit = {
					has_trait = paranoid
				}
				stress_impact = {
					paranoid = medium_stress_impact_loss
				}
			}
			else = {
				stress_impact = {
					base = medium_stress_impact_gain
				}
			}
		}
		hidden_effect = {
			add_character_flag = { # 3 years in hiding
				flag = qs_character_is_in_hiding
				days = 1095
			}			
		}
	}
	ai_potential = {
		always = yes
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 25
			has_trait = paranoid
		}
		modifier = {
			add = 100
			has_character_modifier = watchful_modifier
		}
		modifier = {
			add = 100
			any_targeting_scheme = {
				is_hostile = yes
				is_scheme_exposed = yes
			}
		}
	}
}
qs_leave_hiding = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
	
	decision_group_type = major
	sort_order = 81

	desc = qs_leave_hiding_desc
	selection_tooltip = qs_leave_hiding_tooltip

	ai_check_interval = 24

	is_shown = {
		has_game_rule = qs_decision_go_into_hiding_enabled
		has_trait = qs_in_hiding
	}
	effect = {
		send_interface_toast = {
			type = event_toast_effect_good
			title = qs.go.out.of.hiding.title
			left_icon = root
			remove_trait = qs_in_hiding
		}
		if = {
			limit = {
				has_character_flag = qs_character_is_in_hiding
			}
			remove_character_flag = qs_character_is_in_hiding
		}
		if = {
			limit = {
				has_character_flag = qs_character_sent_into_hiding
			}
			remove_character_flag = qs_character_sent_into_hiding
		}
		if = {
			limit = {
				has_character_flag = qs_character_sent_into_hiding_timer
			}
			remove_character_flag = qs_character_sent_into_hiding_timer
		}
	}
	ai_potential = {
		has_trait = qs_in_hiding
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 100
			NAND = {
				has_character_modifier = watchful_modifier
				has_trait = paranoid
			}
		}
		modifier = {
			add = 100
			NOT = { has_character_flag = qs_character_is_in_hiding }
		}
	}
}
qs_invite_holy_man = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_personal_religious.dds"
	}

	decision_group_type = courtier
	
	ai_check_interval = 0

	cooldown = { years = 10 }
	
	is_shown = {
		has_game_rule = qs_decision_invite_holy_man_enabled
		is_landless_adventurer = no
	}
	
	desc = qs_invite_holy_man_desc
	effect = {
		trigger_event = {
			id = qs_decisions.0001
			days = { 10 20 }
		}
		custom_tooltip = qs_invite_holy_man_effect_tooltip
	}
	
	cost = { piety = minor_piety_value } 	

	ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}
qs_invite_debutante = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds"
	}

	ai_check_interval = 0
	
	decision_group_type = courtier

	cooldown = { years = 10 }
	
	is_shown = {
		has_game_rule = qs_decision_invite_debutante_enabled
		is_landless_adventurer = no
	}
	
	desc = qs_invite_debutante_desc
	effect = {
		trigger_event = {
			id = qs_decisions.0002
			days = { 10 20 }
		}
		custom_tooltip = qs_invite_debutante_effect_1_tooltip
	}
	
	cost = { prestige = medium_prestige_value } 		

	ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}
qs_invite_noble = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds"
	}

	ai_check_interval = 0
	
	decision_group_type = courtier

	cooldown = { years = 10 }
	
	is_shown = {
		has_game_rule = qs_decision_invite_noble_enabled
		is_landless_adventurer = no
	}
	
	desc = qs_invite_noble_desc
	effect = {
		trigger_event = {
			id = qs_decisions.0003
			days = { 10 20 }
		}
		custom_tooltip = qs_invite_noble_effect_1_tooltip
	}
	
	cost = { prestige = minor_prestige_value } 	

	ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}
qs_invite_poet = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_recruitment.dds"
	}
	
	decision_group_type = courtier

	ai_check_interval = 0

	cooldown = { years = 20 }
	
	is_shown = {
		has_game_rule = qs_decision_invite_poet_enabled
		is_landless_adventurer = no
		has_royal_court = yes
	}
	
	desc = qs_invite_poet_desc
	effect = {
		trigger_event = {
			id = qs_decisions.0005
			days = { 10 20 }
		}
		custom_tooltip = qs_invite_poet_effect_tooltip
	}
	
	cost = { prestige = major_prestige_value }  	

	ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}
qs_invite_dwarf = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_recruitment.dds"
	}
	
	decision_group_type = courtier

	ai_check_interval = 0

	cooldown = { years = 20 }
	
	is_shown = {
		has_game_rule = qs_decision_invite_dwarf_enabled
		is_landless_adventurer = no
		has_royal_court = yes
	}
	
	desc = qs_invite_dwarf_desc
	effect = {
		trigger_event = {
			id = qs_decisions.0006
			days = { 10 20 }
		}
		custom_tooltip = qs_invite_dwarf_effect_tooltip
	}
	
	cost = { prestige = major_prestige_value } 	

	ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}
qs_invite_giant = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_recruitment.dds"
	}
	
	decision_group_type = courtier

	ai_check_interval = 0

	cooldown = { years = 20 }
	
	is_shown = {
		has_game_rule = qs_decision_invite_giant_enabled
		is_landless_adventurer = no
		has_royal_court = yes
	}
	
	desc = qs_invite_giant_desc
	effect = {
		trigger_event = {
			id = qs_decisions.0008
			days = { 10 20 }
		}
		custom_tooltip = qs_invite_giant_effect_tooltip
	}
	
	cost = { prestige = major_prestige_value } 	

	ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}
qs_borrow_money_from_moneylenders = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}

	ai_check_interval = 24
	
	desc = qs_borrow_money_from_moneylenders_desc
	effect = {
		send_interface_toast = {
			type = event_toast_effect_good
			title = qs.borrow.money.title
			left_icon = root
			add_gold = 300
			if = {
				limit = {
					has_trait = greedy
				}
				stress_impact = {
					greedy = medium_stress_impact_loss
				}
			}
			else = {
				stress_impact = {
					base = minor_stress_impact_gain
				}
			}
		}
		add_character_modifier = qs_debt_to_moneylenders
		custom_tooltip = qs_repay_debt_to_moneylenders_effect_1_tooltip
	}
	
	is_shown = {
		#is_landless_adventurer = no
		NOT = { has_character_modifier = qs_debt_to_moneylenders }
		has_game_rule = qs_decision_money_from_moneylenders_enabled
	}
	
	cost = { prestige = medium_prestige_value } 	

	ai_potential = {
		has_character_modifier = qs_debt_to_moneylenders
	}
	
	ai_will_do = {
		base = 0
		modifier = {
			add = 100
			gold < 6
		}
		modifier = {
			add = 25
			is_at_war = yes
		}
	}
}
qs_repay_debt_to_moneylenders = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}

	ai_check_interval = 24
	
	decision_group_type = major
	
	desc = qs_repay_debt_to_moneylenders_desc
	
	effect = {
		send_interface_toast = {
			type = event_toast_effect_good
			title = qs.repay.money.title
			left_icon = root
			remove_short_term_gold = 350
			if = {
				limit = {
					has_trait = greedy
				}
				stress_impact = {
					greedy = medium_stress_impact_gain
				}
			}
			else = {
				stress_impact = {
					base = medium_stress_impact_loss
				}
			}
		}
		remove_character_modifier = qs_debt_to_moneylenders
	}
	
	is_shown = {
		has_character_modifier = qs_debt_to_moneylenders
		has_game_rule = qs_decision_money_from_moneylenders_enabled
	}
	
	is_valid = {
		custom_description = {
			text = qs_repay_money_enough_money_available
			gold > 349
		}
	}
	ai_potential = {
		AND = {
			has_character_modifier = qs_debt_to_moneylenders
			gold > 349
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 100
			is_at_war = no
		}
	}
}
qs_raise_zealots = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp2_decision_struggle_hostility.dds"
	}

	ai_check_interval = 60
	
	desc = qs_raise_zealots_desc
	effect = {
		send_interface_toast = {
			type = event_toast_effect_good
			title = qs.raise.zealots.title
			left_icon = root
			add_trait = heresiarch
			spawn_army = {
				levies = 2000
				location = root.capital_province
				inheritable = no
				uses_supply = yes
				name = qs.religious.zealots.army
			}
		}
		add_character_flag = qs_has_raised_zealots
		custom_tooltip = qs_raise_zealots_effect_tooltip
	}
	
	decision_group_type = major
	
	is_shown = {
		is_landless_adventurer = no
		has_game_rule = qs_decision_raise_zealots_enabled
		AND = {
			has_trait = zealous
			NOT = { has_character_flag = qs_has_raised_zealots }
		}
		liege = { 
			NOT = { has_faith = root.faith }
		}
	}
	
	cost = { piety = major_piety_value } 	

	ai_potential = {
		has_trait = zealous
		liege = { NOT = { has_faith = root.faith } }
		NOT = { has_character_flag = qs_has_raised_zealots }
	}
	
	ai_will_do = {
		base = 100
	}
}
qs_invite_eunuch = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_recruitment.dds"
	}
	
	decision_group_type = courtier

	ai_check_interval = 0

	cooldown = { years = 20 }
	
	is_shown = {
		is_landless_adventurer = no
		has_game_rule = qs_decision_invite_eunuch_enabled
		has_royal_court = yes
	}
	
	desc = qs_invite_eunuch_desc
	effect = {
		trigger_event = {
			id = qs_decisions.0007
			days = { 10 20 }
		}
		custom_tooltip = qs_invite_eunuch_effect_tooltip
	}
	
	cost = { prestige = major_prestige_value } 	

	ai_potential = {
		always = no
	}
	ai_will_do = {
		base = 0
	}
}