﻿
physician_study_1 = {
	category = interaction_category_vassal
	common_interaction = yes
	desc = physician_study_1_desc
	icon = become_physician
	
	auto_accept = yes
	ignores_pending_interaction_block = yes

	is_shown = {
	
		#don't show this option for ourselves (we've got no time for studying to become a physician, we've got a goddamn realm to rule!)
		NOT = {
			scope:recipient = scope:actor
		}
		
		#do not show this option if the person is already a physician
		
		scope:recipient = {
			NOT = {		
				has_trait = lifestyle_physician
			}
		}		
		
		OR = {
		
			# family members
			
			AND = {
			
				# they're part of your family
				scope:actor = {
					is_dynast = yes
					dynasty = scope:recipient.dynasty
				}
				
				# you are the head of the house
				scope:actor = {
					is_house_head = yes
				}
			}
			
			# they are a courtier
			scope:recipient = {
				is_courtier_of = scope:actor
			}
		}

	}

	is_valid_showing_failures_only = {
	
		# not availble for characters who are too far away
		scope:recipient = { 
			is_busy_in_events_localised = yes
			is_physically_able_adult = yes
			
			custom_description = {
				text = ucp_character_is_guardian
			
				NOT = {
					any_relation = {
						type = ward
					}
				}
			}

			custom_description = {
				text = ucp_character_is_ward
			
				NOT = {
					any_relation = {
						type = guardian
					}
				}
			}			

			custom_description = {
				text = ucp_physician_training_not_available
			
				NOT = {
					has_character_flag = physician_training_unavailable
				}
			}			
		}
		
	}
	
	on_send = {	
		scope:actor = {
			trigger_event = physician_training.0001
		}
	}
	
}

physician_study_2 = {
	category = interaction_category_vassal
	common_interaction = yes
	desc = physician_study_2_desc

	auto_accept = yes
	ignores_pending_interaction_block = yes

	is_shown = {
	
		#don't show this option for ourselves (we've got no time for studying to become a physician, we've got a goddamn realm to rule!)
		NOT = {
			scope:recipient = scope:actor
		}
		
		#only show this option if the person is a novice physician
		
		scope:recipient = {
			AND = {
				has_trait = lifestyle_physician
				has_trait_xp = {
					trait = lifestyle_physician
					value < trait_second_level
				}
			}
		}		
		
		OR = {
		
			# family members
			
			AND = {
			
				# they're part of your family
				scope:actor = {
					is_dynast = yes
					dynasty = scope:recipient.dynasty
				}
				
				# you are the head of the house
				scope:actor = {
					is_house_head = yes
				}
			}
			
			# they are a courtier
			scope:recipient = {
				is_courtier_of = scope:actor
			}
		}

	}

	is_valid_showing_failures_only = {
	
		# not availble for characters who are too far away
		scope:recipient = { 
			is_busy_in_events_localised = yes 
			is_physically_able_adult = yes
			
			custom_description = {
				text = ucp_character_is_guardian
			
				NOT = {
					any_relation = {
						type = ward
					}
				}
			}

			custom_description = {
				text = ucp_character_is_ward
			
				NOT = {
					any_relation = {
						type = guardian
					}
				}
			}
			
			custom_description = {
				text = ucp_physician_training_not_available
			
				NOT = {
					has_character_flag = physician_training_unavailable
				}
			}			
		}
		
	}
	
	on_send = {	
		scope:actor = {
			trigger_event = physician_training.0002
		}
	}
	
}

physician_study_3 = {
	category = interaction_category_vassal
	common_interaction = yes
	desc = physician_study_3_desc

	auto_accept = yes
	ignores_pending_interaction_block = yes

	is_shown = {
	
		#don't show this option for ourselves (we've got no time for studying to become a physician, we've got a goddamn realm to rule!)
		NOT = {
			scope:recipient = scope:actor
		}
		
		#only show this option if the person is a novice physician
		
		scope:recipient = {
			has_trait_xp = {
				trait = lifestyle_physician
				value >= trait_second_level
			}
			has_trait_xp = {
				trait = lifestyle_physician
				value < trait_third_level
			}
		}		
		
		OR = {
		
			# family members
			
			AND = {
			
				# they're part of your family
				scope:actor = {
					is_dynast = yes
					dynasty = scope:recipient.dynasty
				}
				
				# you are the head of the house
				scope:actor = {
					is_house_head = yes
				}
			}
			
			# they are a courtier
			scope:recipient = {
				is_courtier_of = scope:actor
			}
		}

	}

	is_valid_showing_failures_only = {
	
		# not availble for characters who are too far away
		scope:recipient = { 
			is_busy_in_events_localised = yes
			is_physically_able_adult = yes

			custom_description = {
				text = ucp_character_is_guardian
			
				NOT = {
					any_relation = {
						type = ward
					}
				}
			}

			custom_description = {
				text = ucp_character_is_ward
			
				NOT = {
					any_relation = {
						type = guardian
					}
				}
			}
			
			custom_description = {
				text = ucp_physician_training_not_available
			
				NOT = {
					has_character_flag = physician_training_unavailable
				}
			}			
		}
		
	}

	on_send = {	
		scope:actor = {
			trigger_event = physician_training.0003
		}		
	}
	
}

