﻿namespace = travel_danger_events

travel_danger_events.2000 = { #Something lurking in the jungle
	type = character_event
	title = travel_danger_events.2000.t
	desc = travel_danger_events.2000.desc
	theme = travel

	left_portrait = {
		character = root
		animation = paranoia
	}

	lower_right_portrait = {
		character = scope:jungle_owner
	}

	trigger = {
		is_location_valid_for_travel_event_on_land = yes
		location = {
			exists = province_owner
			province_owner != root
			travel_danger_type = {
				travel_plan = root.current_travel_plan
				terrain = jungle
			}
		}
	}

	cooldown = { years = 5 }

	weight_multiplier = {
		base = 1
	}

	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_medium }
		mp_delay_travel_plan = { DAYS = 90 }
		location.province_owner = {
			save_scope_as = jungle_owner
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 6
		}
	}


	option = { #Burn it
		name = travel_danger_events.2000.a
		location = {
			county = {
				change_development_progress = minor_development_progress_loss
			}	
		}

		scope:jungle_owner = {
			add_opinion = {
				modifier = burned_my_jungle_opinion
				opinion = -20
				target = root
			}
		}

		stress_impact = {
			paranoid = minor_stress_gain
			compassionate = minor_stress_gain
			lifestyle_gardener = minor_stress_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
			}
		}
		
	}

	option = { #Run!
		name = travel_danger_events.2000.b

		current_travel_plan = {
			add_destination_progress = {
				days = 10
			}
		}

		stress_impact = {
			brave = minor_stress_gain
			craven = minor_stress_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = brave
			}
		}
	}

	option = { #You're the danger
		name = travel_danger_events.2000.c
		trigger = {
			has_trait = jungle_stalker
		}
		add_prestige = medium_prestige_gain
	

		stress_impact = {
			brave = minor_stress_loss
			craven = minor_stress_gain
		}
	
		ai_chance = {
			base = 200
			modifier = {
				factor = 0
				has_trait = craven
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}


travel_danger_events.2001 = { #Flood event
	type = character_event
	title = travel_danger_events.2001.t
	desc = travel_danger_events.2001.desc
	theme = travel
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:flood_victim
		animation = fear
	}
	trigger = {
		is_location_valid_for_travel_event_on_land = yes
		current_travel_plan ?= { num_entourage_characters >= 1 }
		location ?= {
			travel_danger_type = {
				travel_plan = root.current_travel_plan
				terrain = floodplains
			}
		}

	}
	cooldown = { years = 5 }
	weight_multiplier = {
		base = 1
	}
	immediate = {
		wayfarer_storyteller_fame_effect = { VALUE = roaming_reward_fame_small }
		mp_delay_travel_plan = { DAYS = 90 }
		current_travel_plan = {
			random_entourage_character = {
				save_scope_as = flood_victim
			}
		}
		traveler_danger_xp_effect = {
			MIN = 3
			MAX = 6
		}
	}
	#Save the supplies
	option = { 
		name = travel_danger_events.2001.a
		scope:flood_victim = {
			death = {
				death_reason = death_drowned
			}
		}
		stress_impact = {
			compassionate = medium_stress_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = compassionate
			}
		}
	}
	#Save your companion
	option = { 
		name = travel_danger_events.2001.b
		if = {
			limit = {
				has_government = landless_adventurer_government
			}
			domicile = {
				change_provisions = major_provisions_loss
			}
		}
		else = {
			remove_short_term_gold = tiny_gold_value
		}
		current_travel_plan = {
			add_travel_plan_modifier = {
				modifier = travel_lost_supplies
	 			years = 5
			}
		}
		stress_impact = {
			greedy = minor_stress_gain
			avaricious = minor_stress_gain
			logistician = minor_stress_gain
			compassionate = minor_stress_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = brave
			}
		}
	}
	after = {
		mp_resume_travel_plan = yes
	}
}


