﻿namespace = ppr_flavor_events

######################################################################
# 0001: The Mendicant Friar (travel)
######################################################################
ppr_flavor_events.0001 = {
	type = character_event
	title = ppr_flavor_events.0001.t
	desc = ppr_flavor_events.0001.desc
	theme = travel
	left_portrait = {
		character = root
		animation = interested
	}
	override_background = { reference = terrain }

	trigger = {
		is_available_travelling_adult = yes
		NOT = { has_character_flag = ppr_met_mendicant_friar }
	}

	immediate = {
		add_character_flag = {
			flag = ppr_met_mendicant_friar
			years = 5
		}
	}

	# Give alms
	option = {
		name = ppr_flavor_events.0001.a
		trigger = { gold >= tiny_gold_value }
		remove_short_term_gold = tiny_gold_value
		add_piety = minor_piety_gain
		if = { limit = { has_pam_dlc_trigger = yes } change_spiritual_fulfillment = minor_spiritual_fulfillment_value }
		stress_impact = {
			greedy = minor_stress_impact_gain
			generous = minor_stress_impact_loss
		}
		ai_chance = { base = 50 }
	}

	# Ask him to preach to the camp tonight
	option = {
		name = ppr_flavor_events.0001.b
		add_learning_lifestyle_xp = minor_lifestyle_xp
		add_piety = miniscule_piety_gain
		stress_impact = {
			base = minor_stress_impact_loss
			cynical = minor_stress_impact_gain
		}
		ai_chance = { base = 50 }
	}

	# Send him on his way
	option = {
		name = ppr_flavor_events.0001.c
		stress_impact = {
			compassionate = minor_stress_impact_gain
			zealous = minor_stress_impact_gain
		}
		ai_chance = { base = 10 }
	}
}

######################################################################
# 0011: A Wayside Shrine (travel)
######################################################################
ppr_flavor_events.0011 = {
	type = character_event
	title = ppr_flavor_events.0011.t
	desc = ppr_flavor_events.0011.desc
	theme = faith
	left_portrait = {
		character = root
		animation = prayer_standing
	}
	override_background = { reference = wilderness }

	trigger = {
		is_available_travelling_adult = yes
		NOT = { has_character_flag = ppr_visited_wayside_shrine }
	}

	immediate = {
		add_character_flag = {
			flag = ppr_visited_wayside_shrine
			years = 5
		}
	}

	# Kneel and pray
	option = {
		name = ppr_flavor_events.0011.a
		add_piety = minor_piety_gain
		if = { limit = { has_pam_dlc_trigger = yes } change_spiritual_fulfillment = minor_spiritual_fulfillment_value }
		stress_impact = {
			base = minor_stress_impact_loss
			cynical = minor_stress_impact_gain
		}
		ai_chance = { base = 50 }
	}

	# Leave an offering
	option = {
		name = ppr_flavor_events.0011.b
		trigger = { gold >= tiny_gold_value }
		remove_short_term_gold = tiny_gold_value
		add_piety = medium_piety_gain
		stress_impact = {
			greedy = minor_stress_impact_gain
		}
		ai_chance = { base = 30 }
	}

	# Ride on
	option = {
		name = ppr_flavor_events.0011.c
		stress_impact = {
			zealous = minor_stress_impact_gain
		}
		ai_chance = { base = 10 }
	}
}

######################################################################
# 0021: Heretics at the Campfire (camp, yearly)
######################################################################
ppr_flavor_events.0021 = {
	type = character_event
	title = ppr_flavor_events.0021.t
	desc = ppr_flavor_events.0021.desc
	theme = faith
	left_portrait = {
		character = root
		animation = thinking
	}
	override_background = { reference = ep3_campfire }

	trigger = {
		is_adult = yes
		is_available_allow_travelling = yes
		NOT = { has_character_flag = ppr_heretics_at_campfire }
	}

	immediate = {
		add_character_flag = {
			flag = ppr_heretics_at_campfire
			years = 4
		}
	}

	# Debate them
	option = {
		name = ppr_flavor_events.0021.a
		skill = learning
		duel = {
			skill = learning
			value = 10
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				min = 5
				desc = ppr_flavor_events.0021.a.success
				send_interface_toast = {
					type = event_generic_good
					title = ppr_flavor_events.0021.a.success
					left_icon = root
					add_piety = medium_piety_gain
					faith = {
						change_fervor = {
							value = minor_fervor_value
							desc = ppr_fervor_campfire_debate
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				min = 15
				desc = ppr_flavor_events.0021.a.failure
				send_interface_toast = {
					type = event_generic_bad
					title = ppr_flavor_events.0021.a.failure
					left_icon = root
					if = { limit = { has_pam_dlc_trigger = yes } change_spiritual_fulfillment = minor_spiritual_fulfillment_loss }
					add_stress = minor_stress_gain
				}
			}
		}
		ai_chance = { base = 50 }
	}

	# Drive them from the camp
	option = {
		name = ppr_flavor_events.0021.b
		add_piety = minor_piety_gain
		stress_impact = {
			compassionate = minor_stress_impact_gain
			zealous = minor_stress_impact_loss
		}
		ai_chance = { base = 50 }
	}

	# Listen without a word
	option = {
		name = ppr_flavor_events.0021.c
		add_learning_lifestyle_xp = medium_lifestyle_xp
		stress_impact = {
			zealous = medium_stress_impact_gain
			cynical = minor_stress_impact_loss
		}
		ai_chance = { base = 20 }
	}
}
