﻿# Childhood events

# childhood_familyromance.0001 Your guardian wants to take a treat from you
# childhood_familyromance.0002 Your guardian is too doting and she/he is try to give your some more sweets
# childhood_familyromance.0003 You want to stay with your guardian, but there are other duties.
# childhood_familyromance.0004 Your guardian persuades you to study harder.

namespace = childhood_familyromance

# ------------------------------

# Your guardian wants to take a treat from you
# You can obey or not.
childhood_familyromance.0001 = {
	type = character_event
	
	title = fr_childhood_child_familyromance.1001.t
	desc = fr_childhood_child_familyromance.1001.desc
	theme = family
	
    override_background = { reference = feast }

    left_portrait = {
		character = root
		animation = beg
	}

    right_portrait = {
		character = scope:guardian_for_romance
		animation = personality_callous
	}

	cooldown = {
		years = 6
	}

    trigger = {
		is_ai = no
		age >= 7
		is_available_child = yes
		
        any_relation = {
            type = guardian
            is_alive = yes
            is_imprisoned = no
            OR = {
                is_parent_of = root
                is_sibling_of = root
                is_uncle_or_aunt_of = root
            }
			OR = {
				familyromance_has_cruelty_traits = yes
				familyromance_has_content_traits = yes
			}
        }
		
	}


    immediate = {
		random_relation = {
            type = guardian
            limit = {
                is_alive = yes
                is_imprisoned = no
                OR = {
                    is_parent_of = root
                    is_sibling_of = root
                    is_uncle_or_aunt_of = root
                }
				OR = {
					familyromance_has_cruelty_traits = yes
					familyromance_has_content_traits = yes
				}
            }
            save_scope_as = guardian_for_romance
		}
		
		
		if = {
			limit = {
				NOT = { exists = var:fr_your_current_relative_guardian }
			}
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
		else = {
			limit = {
				NOT = { var:fr_your_current_relative_guardian = scope:guardian_for_romance }
			}
						
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
		
	}


    # I will try to get away with treat
	option = {
		name = fr_childhood_child_familyromance.1001.a

		duel = {
			skill = prowess
			target = scope:guardian_for_romance
			50 = { #You get away
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -29
				}
				desc = fr_childhood_child_familyromance.1001.b.welldone
				send_interface_toast = {
					title = fr_childhood_child_familyromance.1001.b.welldone
					left_icon = root
					right_icon = scope:guardian_for_romance

					add_prowess_skill = 1

					add_character_modifier = {
						modifier = travel_well_fed_modifier						 
						years = 5
					}
				}
			}
			50 = { #You fail to run away
				compare_modifier = {
					value = scope:duel_value
					multiplier = -2.5
					min = -49
				}
				desc = fr_childhood_child_familyromance.1001.b.fail
				send_interface_toast = {
					title = fr_childhood_child_familyromance.1001.t
					left_icon = root
					right_icon = scope:guardian_for_romance

					add_stress = minor_stress_gain

					add_intrigue_skill = 1
				}
			}
		}

		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = angry_opinion
			opinion = -20
		}
		
	}

    # I will obey
	option = {
		name = fr_childhood_child_familyromance.1001.b

        add_stress = minor_stress_gain
				
		if = {
				limit = { NOT = { exists = var:fr_your_relative_guardian_affection } }
				set_variable = {
					name = fr_your_relative_guardian_affection
					value = 1
				}
		}
		else = {
			change_variable = {
				name = fr_your_relative_guardian_affection
				add = 1
			}
		}
        
		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = pleased_opinion
			opinion = 10
		}
				
	}

}


# Your guardian is too doting and she/he is try to give your some more sweets
# Is it good for you?
childhood_familyromance.0002 = {
	type = character_event
	
	title = fr_childhood_child_familyromance.1002.t
	desc = fr_childhood_child_familyromance.1002.desc
	theme = family
	
    override_background = { reference = bp1_kitchen_western }

    left_portrait = {
		character = root
		animation = happiness
	}

    right_portrait = {
		character = scope:guardian_for_romance
		animation = personality_compassionate
	}

	cooldown = {
		years = 6
	}

    trigger = {
		is_ai = no
		age >= 7
		is_available_child = yes
				
		#NOR = {
		#	has_trait = gluttonous
		#	has_trait = temperate
		#}

        any_relation = {
            type = guardian
            is_alive = yes
            is_imprisoned = no
            OR = {
                is_parent_of = root
                is_sibling_of = root
                is_uncle_or_aunt_of = root
            }
						
			NOR = {
				familyromance_has_content_traits = yes
				familyromance_has_egotism_traits = yes
			}

        }
		
	}


    immediate = {
		random_relation = {
            type = guardian
            limit = {
                is_alive = yes
                is_imprisoned = no
                OR = {
                    is_parent_of = root
                    is_sibling_of = root
                    is_uncle_or_aunt_of = root
                }
								
				NOR = {
					familyromance_has_content_traits = yes
					familyromance_has_egotism_traits = yes
				}
            }
            save_scope_as = guardian_for_romance
		}
		
		if = {
			limit = {
				NOT = { exists = var:fr_your_current_relative_guardian }
			}
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
		else = {
			limit = {
				NOT = { var:fr_your_current_relative_guardian = scope:guardian_for_romance }
			}
						
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
	}


    # Eat some more sweets
	option = {
		name = fr_childhood_child_familyromance.1002.a

		random_list = {
			60 = {
				desc = fr_childhood_child_familyromance.1002.a.ate_a_lot_of_desserts
				
				send_interface_toast = {
					title = fr_childhood_child_familyromance.1002.a.ate_a_lot_of_desserts
					left_icon = root
					right_icon = scope:guardian_for_romance
					
					add_character_modifier = {
						modifier = full_of_dessert_modifier
						years = 5
					}
				}
			}
			
			20 = { # You become a glutton
				trigger = {
					NOR = {
						has_trait = temperate
						has_trait = gluttonous
					}
				}
				desc = fr_childhood_child_familyromance.1002.a.glutton
				
				send_interface_toast = {
						title = fr_childhood_child_familyromance.1002.a.glutton
						left_icon = root
						right_icon = scope:guardian_for_romance
						
						add_trait = gluttonous
					}
				
				hidden_effect = {
					change_current_weight = 50
				}
			}

			20 = {	# You overeat
				desc = fr_childhood_child_familyromance.1002.a.overeat
				
				send_interface_toast = {
						title = fr_childhood_child_familyromance.1002.a.overeat
						left_icon = root
						right_icon = scope:guardian_for_romance

						add_stress = medium_stress_gain
				}
				
				add_character_modifier = {
					modifier = stomach_ache_modifier
					years = 5
				}
				
				hidden_effect = {
					change_current_weight = 50
				}
			}						
			
		}

		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = pleased_opinion
			opinion = 10
		}

		if = {
				limit = { NOT = { exists = var:fr_your_relative_guardian_affection } }
				set_variable = {
					name = fr_your_relative_guardian_affection
					value = 1
				}
		}
		else = {
			change_variable = {
				name = fr_your_relative_guardian_affection
				add = 1
			}
		}
		
	}

    # No, I don't wanna anymore...
	option = {
		name = fr_childhood_child_familyromance.1002.b

        add_stress = minor_stress_loss
	    
		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = disappointed_opinion
			opinion = -5
		}
				
	}

}


# You want to stay with your guardian, but there are other duties.
# "Jealosy to others"
childhood_familyromance.0003 = {
	type = character_event
	
	title = fr_childhood_child_familyromance.1003.t
	
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {	exists = scope:guardian_for_romance_spouse }
				desc = fr_childhood_child_familyromance.1003.desc_with_spouse
			}
			desc = fr_childhood_child_familyromance.1003.desc_no_spouse
		}		
	}

	theme = family
	
	override_background = {
		trigger = {
			root.location = { graphical_wilderness_jungle_trigger = yes }
		}
		reference = wilderness_jungle
	}
	override_background = {
		trigger = {
			root.location = { graphical_wilderness_steppe_trigger = yes }
		}
		reference = wilderness_steppe
	}
	override_background = {
		trigger = {
			root.location = { 
				OR = {
					graphical_drylands_trigger = yes
					graphical_wilderness_desert_trigger = yes
				}
			}
		}
		reference = drylands
	}
	#Fallback
	override_background = { reference = wilderness_forest_pine }

    left_portrait = {
		character = root
		animation = sadness
	}

    right_portrait = {
		character = scope:guardian_for_romance
		animation = boredom
	}

	cooldown = {
		years = 6
	}

    trigger = {
		is_ai = no
		age >= 7
		is_available_child = yes
		
        any_relation = {
            type = guardian
            is_alive = yes
            is_imprisoned = no
            OR = {
                is_parent_of = root
                is_sibling_of = root
                is_uncle_or_aunt_of = root
            }			
        }		
	}
	
	immediate = {
		random_relation = {
            type = guardian
            limit = {
                is_alive = yes
                is_imprisoned = no
                OR = {
                    is_parent_of = root
                    is_sibling_of = root
                    is_uncle_or_aunt_of = root
                }
            }
            save_scope_as = guardian_for_romance
		}
		
		scope:guardian_for_romance = {
			random_spouse ?= {
				limit = {
					is_available_ai_adult = yes
				}
				save_scope_as = guardian_for_romance_spouse
			}
		}
		
		if = {
			limit = {
				NOT = { exists = var:fr_your_current_relative_guardian }
			}
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
		else = {
			limit = {
				NOT = { var:fr_your_current_relative_guardian = scope:guardian_for_romance }
			}
						
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
		
	}

	# Demand to take you for a walk
	option = {
		name = fr_childhood_child_familyromance.1003.a
		custom_tooltip = fr_childhood_child_familyromance.1003.a.tt
        #add_stress = minor_stress_loss
	    
		#add_prowess_skill = 1

		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = disappointed_opinion
			opinion = -10
		}
				
	}

	# Let your guargdian to have some free time
	option = {
		name = fr_childhood_child_familyromance.1003.b

		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = pleased_opinion
			opinion = 10
		}

		add_stress = minor_stress_gain
		
		if = {
				limit = { NOT = { exists = var:fr_your_relative_guardian_affection } }
				set_variable = {
					name = fr_your_relative_guardian_affection
					value = 1
				}
		}
		else = {
			change_variable = {
				name = fr_your_relative_guardian_affection
				add = 1
			}
		}

	}
	
}




# Your guardian persuades you to study harder.
childhood_familyromance.0004 = {
	type = character_event
	
	title = childhood_familyromance.0004.t
	desc = childhood_familyromance.0004.desc
	theme = family
	
    override_background = { reference = study }

    left_portrait = {
		character = root
		animation = boredom
	}

    right_portrait = {
		character = scope:guardian_for_romance
		animation = chancellor
	}

	cooldown = {
		years = 6
	}

    trigger = {
		is_ai = no
		age >= 8
		is_available_child = yes
		
        any_relation = {
            type = guardian
            is_alive = yes
            is_imprisoned = no
            OR = {
                is_parent_of = root
                is_sibling_of = root
                is_uncle_or_aunt_of = root
            }
        }
		
	}

    immediate = {
		random_relation = {
            type = guardian
            limit = {
                is_alive = yes
                is_imprisoned = no
                OR = {
                    is_parent_of = root
                    is_sibling_of = root
                    is_uncle_or_aunt_of = root
                }				
            }
            save_scope_as = guardian_for_romance
		}
		
		if = {
			limit = {
				NOT = { exists = var:fr_your_current_relative_guardian }
			}
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
		else = {
			limit = {
				NOT = { var:fr_your_current_relative_guardian = scope:guardian_for_romance }
			}
						
			set_variable = {
				name = fr_your_current_relative_guardian
				value = scope:guardian_for_romance
			}
			
			set_variable = {
				name = fr_your_relative_guardian_affection
				value = 1
			}
		}
	}


    # Ok, I will try to study harder
	option = {
		name = fr_childhood_child_familyromance.1004.a
		
		add_learning_skill = 1

		stress_impact = {
			rowdy = medium_stress_impact_gain			
			diligent = minor_stress_impact_loss
		}

		random_list = {
			70 = {
				desc = fr_childhood_child_familyromance.1004.a.good_studing
				
				send_interface_toast = {
					title = fr_childhood_child_familyromance.1004.a.good_studing
					left_icon = root
					right_icon = scope:guardian_for_romance					
				}
			}			

			30 = {	# 
				desc = fr_childhood_child_familyromance.1004.a.headache
				
				send_interface_toast = {
						title = fr_childhood_child_familyromance.1004.a.headache
						left_icon = root
						right_icon = scope:guardian_for_romance

						add_stress = minor_stress_gain
				}
								
			}						
			
		}

		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = pleased_opinion
			opinion = 20
		}

		if = {
				limit = { NOT = { exists = var:fr_your_relative_guardian_affection } }
				set_variable = {
					name = fr_your_relative_guardian_affection
					value = 1
				}
		}
		else = {
			change_variable = {
				name = fr_your_relative_guardian_affection
				add = 1
			}
		}
		
	}

    # I don't want to study!
	option = {
		name = fr_childhood_child_familyromance.1004.b

        add_stress = minor_stress_loss

		stress_impact = {
			rowdy = minor_stress_impact_loss			
		}
	    
		reverse_add_opinion = {
			target = scope:guardian_for_romance
			modifier = disappointed_opinion
			opinion = -5
		}
				
	}

}