﻿bap_rename_pet_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/bap_decision_rename_pet.dds"
	}
	desc = bap_rename_pet_decision_desc
	selection_tooltip = bap_rename_pet_decision_tooltip

	ai_check_interval = 120

	is_shown = {
		has_character_flag = bap_pet_can_rename
		OR = {
			has_character_flag = bap_wolf_pet_alive
			has_character_flag = bap_bear_pet_alive
			has_character_flag = bap_lion_pet_alive
			has_character_flag = bap_tiger_pet_alive
		}
	}

	is_valid_showing_failures_only = {
		is_available = yes
	}

	effect = {
		custom_tooltip = bap_rename_pet_decision_effect_tt
		hidden_effect = {
			remove_localized_text = bap_pet_name
			remove_variable = bap_pet_name
			every_owned_story = {
				limit = {
					OR = {
						story_type = bap_story_cycle_wolf
						story_type = bap_story_cycle_bear
						story_type = bap_story_cycle_lion
						story_type = bap_story_cycle_tiger
					}
				}
				remove_variable = bap_pet_name
			}
			trigger_event = bap_buy_pet.1001
		}
	}

	ai_potential = {
		always = no
	}

	ai_will_do = {
		base = 0
	}
}

bap_wolf_pet_interaction_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/bap_decision_interact_wolf.dds"
	}
	desc = bap_wolf_pet_interaction_decision_desc
	selection_tooltip = bap_wolf_pet_interaction_decision_tooltip

	ai_check_interval = 120
	cooldown = { years = 5 }
	cost = { prestige = 50 }

	is_shown = {
		has_character_flag = bap_wolf_pet_alive
	}

	is_valid_showing_failures_only = {
		is_available = yes
	}

	effect = {
		custom_tooltip = bap_wolf_pet_interaction_decision_effect_tt
		add_dread = 50
		add_character_modifier = {
			modifier = bap_wolf_intimidation_modifier
			years = 1
		}
	}

	ai_potential = {
		always = no
	}

	ai_will_do = {
		base = 0
	}
}

bap_bear_pet_interaction_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/bap_decision_interact_bear.dds"
	}
	desc = bap_bear_pet_interaction_decision_desc
	selection_tooltip = bap_bear_pet_interaction_decision_tooltip

	ai_check_interval = 120
	cooldown = { years = 5 }
	cost = { prestige = 50 }

	is_shown = {
		has_character_flag = bap_bear_pet_alive
	}

	is_valid_showing_failures_only = {
		is_available = yes
		custom_tooltip = {
			text = bap_bear_warriors_already_active_tt
			NOT = { exists = var:bap_bear_warriors_army }
		}
	}

	effect = {
		custom_tooltip = bap_bear_pet_interaction_decision_effect_tt
		hidden_effect = {
			spawn_army = {
				name = bap_bear_warriors_event_troops
				men_at_arms = {
					type = bap_bear_warriors
					stacks = 1
				}
				location = capital_province
				uses_supply = yes
				inheritable = no
				save_scope_as = bap_bear_warriors_army
			}
			set_variable = {
				name = bap_bear_warriors_army
				value = scope:bap_bear_warriors_army
			}
		}
	}

	ai_potential = {
		always = no
	}

	ai_will_do = {
		base = 0
	}
}

bap_lion_pet_interaction_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/bap_decision_interact_lion.dds"
	}
	desc = bap_lion_pet_interaction_decision_desc
	selection_tooltip = bap_lion_pet_interaction_decision_tooltip

	ai_check_interval = 120
	cooldown = { years = 5 }
	cost = { prestige = 50 }

	is_shown = {
		has_character_flag = bap_lion_pet_alive
	}

	is_valid_showing_failures_only = {
		is_available = yes
	}

	effect = {
		custom_tooltip = bap_lion_pet_interaction_decision_effect_tt
		add_character_modifier = {
			modifier = bap_lion_procession_modifier
			years = 1
		}
	}

	ai_potential = {
		always = no
	}

	ai_will_do = {
		base = 0
	}
}

bap_tiger_pet_interaction_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/bap_decision_interact_tiger.dds"
	}
	desc = bap_tiger_pet_interaction_decision_desc
	selection_tooltip = bap_tiger_pet_interaction_decision_tooltip

	ai_check_interval = 120
	cooldown = { years = 5 }
	cost = { prestige = 50 }

	is_shown = {
		has_character_flag = bap_tiger_pet_alive
	}

	is_valid_showing_failures_only = {
		is_available = yes
	}

	effect = {
		custom_tooltip = bap_tiger_pet_interaction_decision_effect_tt
		add_character_flag = {
			flag = free_hunt
			years = 1
		}
		add_character_flag = {
			flag = bap_tiger_free_hunt_from_pet
			years = 1
		}
		add_character_modifier = {
			modifier = bap_tiger_hunt_preparation_modifier
			years = 1
		}
	}

	ai_potential = {
		always = no
	}

	ai_will_do = {
		base = 0
	}
}

bap_abandon_pet_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/bap_decision_abandon_pet.dds"
	}
	desc = bap_abandon_pet_decision_desc
	selection_tooltip = bap_abandon_pet_decision_tooltip

	ai_check_interval = 120

	is_shown = {
		bap_has_any_pet_trigger = yes
	}

	is_valid_showing_failures_only = {
		is_available = yes
	}

	effect = {
		custom_tooltip = bap_abandon_pet_decision_effect_tt

		# Stress depends on the pet's rarity (5 = common, 15 = exotic).
		if = {
			limit = { has_cat_trigger = yes }
			add_stress = 5
		}
		else_if = {
			limit = { has_dog_trigger = yes }
			add_stress = 6
		}
		else_if = {
			limit = { has_eagle_trigger = yes }
			add_stress = 8
		}
		else_if = {
			limit = { any_owned_story = { type = story_cycle_martial_lifestyle_warhorse } }
			add_stress = 9
		}
		else_if = {
			limit = { has_character_flag = bap_wolf_pet_alive }
			add_stress = 11
		}
		else_if = {
			limit = { has_character_flag = bap_bear_pet_alive }
			add_stress = 13
		}
		else = {
			add_stress = 15
		}

		hidden_effect = {
			bap_abandon_pet_effect = yes
		}
	}

	ai_potential = {
		always = no
	}

	ai_will_do = {
		base = 0
	}
}
