﻿host_feast_decision = {
	picture = "gfx/interface/illustrations/decisions/decision_misc.dds"
	ai_check_interval = 60

	cost = { gold = standard_activity_cost }

	cooldown = { days = standard_feast_cooldown_time }

	desc = host_feast_decision_opening_desc
	selection_tooltip = host_feast_decision_tooltip

	is_shown = {
		OR = {
			is_landed = yes
			has_government = patrician_government
		}	
		highest_held_title_tier > tier_barony
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
	}

	effect = {
		if = {
			limit = { has_government = patrician_government }
			liege = {
				capital_province = {
					spawn_activity = {
						type = activity_feast
						owner = root
					}
				}
			}
		}	
		else = {
			capital_province = {
				spawn_activity = {
					type = activity_feast
					owner = root
				}
			}
		}	
		custom_tooltip = host_feast_decision_desc_vassals
		if = {
			limit = {
				is_independent_ruler = no
			}
			custom_tooltip = host_feast_decision_desc_liege_opinion
		}


		#Piety gain
		if = {
			limit = {
				faith = {
					OR = {
						has_doctrine_parameter = piety_from_feasts_active
						AND = {
							has_doctrine_parameter = summer_festivals_active
							# Only during 'summer' (May 1st through July 31st).
							current_month >= 5
							current_month <= 7
						}
					}
				}
			}
			add_piety = {
				value = 0

				faith = {
					if = {
						limit = {
							has_doctrine_parameter = summer_festivals_active
							# Only during 'summer' (May 1st through July 31st).
							current_month >= 5
							current_month <= 7
						}
						add = major_piety_value
					}
					if = {
						limit = {
							has_doctrine = tenet_ritual_celebrations
						}
						add = medium_piety_value
					}
					if = {
						limit = {
							has_doctrine = tenet_hedonistic
						}
						add = medium_piety_value
					}
				}

				min = medium_piety_value # Always give some piety, even if we don't have any of the specified tenets.
			}
		}

		#Stress loss
		if = {
			limit = {
				OR = {
					has_trait = shy
				}
			}
			custom_tooltip = host_feast_decision_desc_shy
		}
		else_if = {
			limit = {
				OR = {
					has_trait = gluttonous
					has_trait = gregarious
					has_trait = reveler_1
					has_trait = reveler_2
					has_trait = reveler_3
					has_trait = drunkard
					has_trait = comfort_eater
				}
			}
			stress_impact = {
				base = feast_stress_loss_value
				gluttonous = activity_stress_loss_impact
				gregarious = activity_stress_loss_impact
				reveler_1 = activity_stress_loss_impact
				reveler_2 = activity_stress_loss_impact
				reveler_3 = activity_stress_loss_impact
				drunkard = activity_stress_loss_impact
				comfort_eater = activity_stress_loss_impact
				greedy = activity_stress_loss_impact
			}
		}
		else = {
			stress_impact = {
				base = feast_stress_loss_value
			}
		}
	}
	
	ai_potential = {
		short_term_gold > standard_activity_cost
	}

	ai_will_do = {
		base = 35

		ai_value_modifier = {
			ai_sociability = 1
			ai_greed = -0.5
		}

		modifier = {
			add = 30 # Has Greed of 20, so this is only (-10 + 30 = +20)
			has_trait = gluttonous
		}
		modifier = {
			add = 12.5 # Has Greed of 5, so this is only (-2.5 + 12.5 = +10)
			has_trait = comfort_eater
		}
		modifier = {
			add = 47.5 # Has Greed of 75, so this is only (-37.5 + 45 = +10)
			has_trait = ambitious
		}

		modifier = {
			add = 35
			stress > low_stress
		}

		modifier = {
			add = 35
			faith = {
				has_doctrine = tenet_ritual_celebrations
			}
		}

		modifier = {
			add = 35
			faith = {
				has_doctrine = tenet_hedonistic
			}
		}
	}
}

start_hunt_decision = {
	picture = "gfx/interface/illustrations/decisions/decision_activity.dds"
	ai_check_interval = 60

	cost = {
		gold = {
			add = standard_activity_cost
			divide = 1.5
		}
	}

	cooldown = { days = standard_hunting_cooldown_time }

	is_shown = {
		OR = {
			is_landed = yes
			has_government = patrician_government
		}	
		highest_held_title_tier > tier_barony
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
	}

	effect = {
		custom_tooltip = line_break
		custom_tooltip = start_hunt_decision_go_on_hunt

		#Stress loss
		if = {
			limit = {
				has_trait = lazy
			}
			custom_tooltip = start_hunt_decision_stress_lazy
		}
		else = {
			stress_impact = {
				base = hunt_stress_loss_value
				compassionate = activity_stress_gain_impact
				craven = activity_stress_gain_impact
				diligent = activity_stress_loss_impact
				athletic = activity_stress_loss_impact
				sadistic = activity_stress_loss_impact
				brave = activity_stress_loss_impact
				hunter_1 = activity_stress_loss_impact
				hunter_2 = activity_stress_loss_impact
				hunter_3 = activity_stress_loss_impact
			}
		}

		#custom_tooltip = line_break
		#custom_tooltip = start_hunt_decision_tt_header
		custom_tooltip = start_hunt_decision_prestige
		#custom_tooltip = start_hunt_decision_stress
		#custom_tooltip = line_break
		
		hidden_effect = {
			if = {
				limit = { is_landed = no }
				liege = {
					random_sub_realm_barony = {
						title_province = {
							spawn_activity = {
								type = activity_hunt
								owner = root
							}
						}
					}
				}
			}	
			else = {
				random_sub_realm_barony = {
					title_province = {
						spawn_activity = {
							type = activity_hunt
							owner = root
						}
					}
				}
			}			
		}
	}
	
	ai_potential = {
		short_term_gold > standard_activity_cost
	}

	ai_will_do = {
		base = 35

		ai_value_modifier = {
			ai_energy = 1
			ai_greed = -0.5
			ai_compassion = -0.5
		}

		modifier = {
			add = 10
			has_trait_rank = {
				trait = education_martial
				rank > 0
			}
		}
		modifier = {
			add = 10
			has_trait_rank = {
				trait = education_martial
				rank > 2
			}
		}

		modifier = {
			add = 35
			stress > low_stress
		}
	}
}

host_witch_ritual_decision = {
	picture = "gfx/interface/illustrations/decisions/decision_major_religion.dds"
	ai_check_interval = 60

	cost = { gold = 50 }

	cooldown = { days = 3650 }

	desc = host_witch_ritual_decision_desc
	selection_tooltip = host_witch_ritual_decision_tooltip

	is_shown = {
		is_witch_trigger = yes
		exists = house
		house = { has_house_modifier = witch_coven }
		debug_only = yes
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
		is_landed = yes
	}

	effect = {
		capital_province = {
			spawn_activity = {
				type = activity_witch_ritual
				owner = root
			}
		}
	}
	
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 0

		modifier = {
			add = 50
			short_term_gold > 150
		}
	}
}
