﻿#On actions related to health events


yearly_health_pulse = { #Fired from the birthday pulse
	on_actions = {
		#disease_outbreak_pulse # moved to a 5-year pulse in yearly_on_actions.txt
		# Provides 4 opportunities per year for you to recover from being wounded
		delay = { days = { 1 89 } }
		wounded_recovery_pulse
		delay = { days = { 90 179 } }
		wounded_recovery_pulse
		delay = { days = { 180 269 } }
		wounded_recovery_pulse
		delay = { days = { 270 365 } }
		wounded_recovery_pulse
	}
	random_events = {
		# Balanced to keep the events:
		## Present but not constant on default values.
		## Rare but not never-seen on reduced values.
		## Increased without being ludicrous on high values.
		1000 = 0
		2000 = harm.9501	# Nothingness event.
		
		#Infirm 
		100 = health.7000	# Become infirm
		150 = health.7100	# Become depressed while infirm
		200 = harm.0001		# Becoming incapable due to age: culmination.
		200 = harm.0002		# Becoming incapable due to age: mental problems.
		200 = harm.0003		# Becoming incapable due to age: physical problems.

		# Random incapability.
		10 = harm.0501		# Best in Breed - Inbreeding has left you increasingly vapid and feeble-minded.
		10 = harm.0502		# Best in Breed - foreboding event.
		10 = harm.0511		# A Little Tumble - You fall from your horse/camel/elephant/donkey.
		10 = harm.0512		# A Little Tumble - foreboding event.
		10 = harm.0521		# Gurgling & Grasping - Whilst at sea, you fall overboard and drown long enough to endanger your brain.
		10 = harm.0522		# Gurgling & Grasping - foreboding event.
		10 = harm.0531		# The World Slipping - Struck down by a stroke.
		10 = harm.0532		# The World Slipping - foreboding event.
		10 = harm.0541		# Chilled to the Bones - Crippling arthritis, chiefly in colder regions, can hurt the elderly.
		10 = harm.0542		# Chilled to the Bones - foreboding event.
		10 = harm.0551		# A Thud & A Snap - A child falls from a tree.
		10 = harm.0552		# A Thud & A Snap - foreboding event.
		10 = harm.0561		# The Descent - An old person falls down some stairs.
		10 = harm.0562		# The Descent - foreboding event.
		10 = harm.0571		# A Trip During Training - A fighting ruler is whacked on the bonce whilst training.
		10 = harm.0572		# A Trip During Training - foreboding event.
		10 = harm.0581		# Slippery when Wet - Slipping getting out of the tub.
		10 = harm.0582		# Slippery when Wet - foreboding event.
		10 = harm.0591		# Death from Above - A peasant's falling pot leaves you incapable.
		10 = harm.0592		# Death from Above - foreboding event.
		10 = harm.0601		# What's the Harm? - Children playing goes horribly wrong.
		10 = harm.0602		# What's the Harm? - foreboding event.
		10 = harm.0611		# Dizzying Heights - As a cripplingly feeble character, stand up way, way too fast.
		10 = harm.0612		# Dizzying Heights - foreboding event.
		10 = harm.0621		# A Jolly Good Time - Drunken shenanigans.
		10 = harm.0622		# A Jolly Good Time - foreboding event.
		10 = harm.0631		# A Rollicking Good Time - Heart attack whilst vigorously bonking.
		10 = harm.0632		# A Rollicking Good Time - foreboding event.
		10 = harm.0641		# Some Slight Swelling - Dropsy renders you bed-ridden.
		10 = harm.0642		# Some Slight Swelling - foreboding event.

		# Random deaths.
		10 = harm.1001		# Choke On It - Choking at a feast.
		10 = harm.1002		# Choke On It - foreboding event.
		10 = harm.1011		# Ride or Die - Something spooks your horse and it goes flying out of control.
		10 = harm.1012		# Ride or Die - foreboding event.
		10 = harm.1021		# Finger-Licking Good - Eating too much exotic food.
		10 = harm.1022		# Finger-Licking Good - foreboding event.
		10 = harm.1031		# A Clogged Throat - Quinsy-induced choking.
		10 = harm.1032		# A Clogged Throat - foreboding event.
		10 = harm.1041		# Probably Safe - Fall into a body of water.
		10 = harm.1042		# Probably Safe - foreboding event.
		10 = harm.1051		# Flickering Flames - A small fire gets out of hand.
		10 = harm.1052		# Flickering Flames - foreboding event.
		10 = harm.1061		# A Moderate Tumble - Falling out of a window whilst admiring the view.
		10 = harm.1062		# A Moderate Tumble - foreboding event.on the door/eavesdropping on a conversation below.
		10 = harm.1071		# Crimes of Passion - A scuffle between two rivals sees you accidentally stabbed.
		10 = harm.1072		# Crimes of Passion - foreboding event.
		10 = harm.1081		# Storm's Wrath - Death in a storm, due to a lightning hit/being crushed by a falling tree/twatted by a falling rock/catching a terminal chill.
		10 = harm.1082		# Storm's Wrath - foreboding event.chill.
		10 = harm.1091		# Aching Minds - Struck down by an aneurysm.
		10 = harm.1092		# Aching Minds - foreboding event.
		3 = harm.1101		# Street Safety - Run over by a rider/run-away cart.
		3 = harm.1102		# Street Safety - foreboding event.
		10 = harm.1111		# People's Justice - Stabbed by a servant in your capital that hates you.
		10 = harm.1112		# People's Justice - foreboding event.
	}
}


#OUTBREAK
#Randomly getting a disease (not contagion, that is handled by effects applying disease)

disease_outbreak_pulse = {
	random_events = {
		chance_to_happen = 15

		chance_of_no_event = {
			# Perk reduces chance of sickness for yourself and for Courtiers/Guests
			if = {
				limit = {
					has_perk = wash_your_hands_perk
				}
				value = 25
			}
			else_if = {
				limit = {
					exists = host
					host = { has_perk = wash_your_hands_perk }
				}
				value = 12
			}
			if = { #Wet Nurse reduces chance of sickness for children
				limit = {
					OR = {
						liege ?= {
							any_court_position_holder ?= {
								type = wet_nurse_court_position
								has_relation_nursed_child = root
							}
						}
						root = {
							any_court_position_holder ?= {
								type = wet_nurse_court_position
								has_relation_nursed_child = root
							}
						}
					}
					root = { is_adult = no }
				}
				value = 12
			}			
			if = { # Difficulty
				limit = {
					is_ai = no
					has_game_rule = easy_difficulty
				}
				value = 12
			}
			else_if = {
				limit = {
					is_ai = no
					has_game_rule = very_easy_difficulty
				}
				value = 30
			}
			else_if = {
				limit = {
					is_ai = yes
					has_game_rule = easy_difficulty
					any_parent = {
						is_ai = no
					}
				}
				value = 5
			}
			else_if = {
				limit = {
					is_ai = no
					has_game_rule = very_easy_difficulty
					any_parent = {
						is_ai = no
					}
				}
				value = 25
			}
			if = { # Game Rule
				limit = {
					has_game_rule = fewer_minor_disease_frequency
				}
				value = 15
			}
		}

		11625 = health.1001 	#Ill
		675 = health.1002  	#Pneumonic
		325 = health.1003 	#Gout-ridden
		75 = health.1004  	#Leprosy
		375 = health.1005 	#Typhus, 7x common when commander/combat character
		525 = health.1006 	#Consumption
		300 = health.1007 	#Cancer
		125 = health.1008 	#Lover's Pox
		75 = health.1009 	#Great pox
		15 = health.1010	#Smallpox
		10 = health.1011	#Bubonic plague, won't happen before 1346
	}
}

wounded_recovery_pulse = {
	trigger = {
		OR = {
			has_trait = wounded
			has_infected_or_gangrenous_wound_trigger = yes
		}
	}
	random_events = {
		450 = 0
		375 = health.0001 #Recover from Wounded
		275 = health.0002 #Recover from Severely Wounded
		175 = health.0003 #Recover from Near Death
		125 = health.0004 #Infected wound is no longer infected
	}
}

#(Disease recovery is handled by effect applying disease)

commander_death_events_pulse = {
	trigger = { is_commanding_army = yes }
	random_events = {
		1000 = 0
		20 = harm.2001	# Camp Fever - Terrible siege conditions cause you strife.
		20 = harm.2011	# Marching Malaise - Terrible marching conditions are problematic.
		20 = harm.2021	# So... Cold... - Frostbite claims you.
		20 = harm.2031	# So... Hot... - Heat-stroke claims you.
		20 = harm.2041	# For the Realm - Aggrieved soldiers at war too long assassinate you.
		20 = harm.2051	# Starvation - Complications due to starvation from lack of supply.
		20 = harm.2061	# Harried Each Step - Retreating from battle and caught by enemy soldiers.
		20 = harm.2071	# A Disastrous Victory - Pursuing too far ahead in battle and caught by enemy soldiers.
	}
}

#Triggered from the decision
commit_suicide = {
	events = { #How will you do it?
		health.6001 #Other
		health.6200 #Incapable
	}
}