﻿# Guardian events

# guardian_familyromance.0001 Your ward lost a favorite toy.
# guardian_familyromance.0002 Your ward wants new clothes.
# guardian_familyromance.0003 Your ward picked in a fight and got beaten
# guardian_familyromance.0004 Your ward is interested in love




namespace = guardian_familyromance


# Your ward lost a favorite toy.
# You could try to help or ignore.
guardian_familyromance.0001 = {
	type = character_event
	
	title = fr_guardian_familyromance.1001.t
	desc = fr_guardian_familyromance.1001.desc
	theme = family
	
    override_background = { reference = market }

    left_portrait = {
		character = root
		animation = idle
	}

    right_portrait = {
		character = scope:ward_for_romance
		animation = sadness
	}

	cooldown = { days = 30 }

    trigger = {
		is_ai = no
        familyromance_warden_player_for_interaction = yes
                
        any_relation = {
            type = ward                        
            age >= 6
		    is_available_ai_child = yes
            OR = {
                is_child_of = root
                is_sibling_of = root                
                is_nibling_of = root
            }
			NOT = { has_character_flag = familyromance_ward_event_0001_done }
        }
		
	}

    immediate = {
		random_relation = {
            type = ward
            limit = {
                is_available_ai_child = yes
				age >= 6
                OR = {
                    is_child_of = root
                    is_sibling_of = root
                    is_nibling_of = root
                }
                NOT = { has_character_flag = familyromance_ward_event_0001_done }
            }
            save_scope_as = ward_for_romance
		}

        if = {
			limit = {
				NOT = { exists = scope:ward_for_romance.var:fr_your_wards_guardian }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }			
            }
		}
		else = {
			limit = {
				NOT = { scope:ward_for_romance.var:fr_your_wards_guardian = root }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }
			
            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }
            }
		}
		
		scope:ward_for_romance = {
			set_favorite_toy_effect = yes
		}
	}


    # Try to find a toy
	option = {
		name = fr_guardian_familyromance.1001.a

		random_list = {
			40 = { # The toy found
				desc = fr_guardian_familyromance.1001.a.toy_found
				
				send_interface_toast = {
					title = fr_guardian_familyromance.1001.a.toy_found
					left_icon = root
					right_icon = scope:ward_for_romance					
				}
                
                reverse_add_opinion = {
                    target = scope:ward_for_romance
                    modifier = pleased_opinion
                    opinion = 10
                }

                scope:ward_for_romance = {
                        change_variable = {
                            name = fr_ward_affection_to_you
                            add = 1
                    }
                }

			}
			
			30 = { # You didn't find the toy, but find some jewellry				
				desc = fr_guardian_familyromance.1001.a.found_jewelry
				
				send_interface_toast = {
                    title = fr_guardian_familyromance.1001.a.found_jewelry
                    left_icon = root
                    right_icon = scope:ward_for_romance						
				}
                
                reverse_add_opinion = {
                    target = scope:ward_for_romance
                    modifier = pleased_opinion
                    opinion = 10
                }

                add_gold = tiny_gold_value

                scope:ward_for_romance = {
                        change_variable = {
                            name = fr_ward_affection_to_you
                            add = 1
                    }
                }

			}

			30 = {	# You found nothing
				desc = fr_guardian_familyromance.1001.a.toy_not_found
				
				send_interface_toast = {
						title = fr_guardian_familyromance.1001.a.toy_not_found
						left_icon = root
						right_icon = scope:ward_for_romance						
				}

                reverse_add_opinion = {
                    target = scope:ward_for_romance
                    modifier = disappointed_opinion
                    opinion = -5
                }

			}
			
		}

        add_stress = minor_stress_gain
		
	}

    # I'll buy you a new toy.
	option = {
		name = fr_guardian_familyromance.1001.b
        trigger = {
			short_term_gold >= minor_gold_value_check
        }
		show_as_unavailable = {
			short_term_gold < minor_gold_value_check
		}
        
        remove_short_term_gold = minor_gold_value
		
		stress_impact = {			
			greedy = medium_stress_impact_gain
		}
        	    
		reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }

        scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
				
	}


    # It's your fault!
	option = {
		name = fr_guardian_familyromance.1001.c
        	    
		reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = disappointed_opinion
            opinion = -5
        }			
	}
	
	
	# High stewardship; You could buy a new toy with a discount
	option = {
		trigger = {
			stewardship >= high_skill_rating
			short_term_gold >= tiny_gold_value_check
		}
		
        remove_short_term_gold = tiny_gold_value
		
		name = fr_guardian_familyromance.1001.d
		        	    
		reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }
		
		scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
	}
	
	
	# Diligent; Tell your ward to make a new toy
	option = {		
		trigger = {
			has_trait = diligent
		}
		trait = diligent
				
		name = fr_guardian_familyromance.1001.e
		
		scope:ward_for_romance = {
			add_stress = minor_stress_gain
		}
		        	    
		reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }
		
		scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
	}

    after = {
        scope:ward_for_romance = {
            add_character_flag = {
                flag = familyromance_ward_event_0001_done
                years = 20
            }	
        }
    }

}



# Your ward wants new clothes.
# Should you buy it?
guardian_familyromance.0002 = {
	type = character_event
	
	title = fr_guardian_familyromance.1002.t
	
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = fr_guardian_familyromance.1002.desc_unland_adv
			}
			desc = fr_guardian_familyromance.1002.desc
		}
	}
	
	theme = family
	
    override_background = { reference = throne_room }

    left_portrait = {
		character = root
		animation = idle
	}

    right_portrait = {
		character = scope:ward_for_romance
		animation = beg
	}

	cooldown = { days = 30 }

    trigger = {
		is_ai = no
        familyromance_warden_player_for_interaction = yes
                
        any_relation = {
            type = ward                        
            age >= 7
		    is_available_ai_child = yes
            OR = {
                is_child_of = root
                is_sibling_of = root                
                is_nibling_of = root
            }
			NOT = { has_character_flag = familyromance_ward_event_0002_done }
        }
		
	}


    immediate = {
		random_relation = {
            type = ward
            limit = {
                is_available_ai_child = yes
				age >= 7
                OR = {
                    is_child_of = root
                    is_sibling_of = root
                    is_nibling_of = root
                }
                NOT = { has_character_flag = familyromance_ward_event_0002_done }
            }
            save_scope_as = ward_for_romance
		}

        if = {
			limit = {
				NOT = { exists = scope:ward_for_romance.var:fr_your_wards_guardian }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }			
            }
		}
		else = {
			limit = {
				NOT = { scope:ward_for_romance.var:fr_your_wards_guardian = root }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }
			
            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }
            }
		}
	}


    # Buy a new lovely clothes
	option = {
		name = fr_guardian_familyromance.1002.a
        
        trigger = {
			short_term_gold >= minor_gold_value_check
        }
		show_as_unavailable = {
			short_term_gold < minor_gold_value_check
		}
        
        remove_short_term_gold = minor_gold_value
		
		stress_impact = {			
			greedy = medium_stress_impact_gain
		}
		        
		add_prestige = minor_prestige_gain

        scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
		
        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }
		
	}

    # Maybe, we could find something from old clothes...
	option = {
		name = fr_guardian_familyromance.1002.b

        scope:ward_for_romance = {
			add_prestige = minor_prestige_loss
		}
		
		add_prestige = medium_prestige_loss
		
		stress_impact = {
			ambitious = minor_stress_impact_gain
		}

        scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
				
	}

    # No, you already have enought clothes...
	option = {
		name = fr_guardian_familyromance.1002.c

        scope:ward_for_romance = {
			add_prestige = minor_prestige_loss
		}
		
		stress_impact = {
			greedy = major_stress_impact_loss
		}
        	    
		reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = disappointed_opinion
            opinion = -5
        }			
	}
	
	# High stewardship; Teach your ward how to get more money and buy new clothes
	option = {
		trigger = {
			stewardship >= high_skill_rating 
		}
		
		name = fr_guardian_familyromance.1002.d

        scope:ward_for_romance = {
			add_stewardship_skill = 1
		}		
		        	    
		reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }
		
		scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
	}
	
	
	# Content; It is possible to spend less money and get new clothes
	option = {
		trigger = {
			has_trait = content
			short_term_gold >= tiny_gold_value_check
		}
		trait = content
		
		show_as_unavailable = {
			short_term_gold < tiny_gold_value_check
		}
        
        remove_short_term_gold = tiny_gold_value_check
		add_prestige = miniscule_prestige_loss
		
		name = fr_guardian_familyromance.1002.e
        		        	    
		reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }
		
		scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
	}
	
	

    after = {
        scope:ward_for_romance = {
            add_character_flag = {
                flag = familyromance_ward_event_0002_done
                years = 20
            }	
        }
    }
}





# Your ward picked in a fight and got beaten
# How could you help?
guardian_familyromance.0003 = {
	type = character_event
	
	title = fr_guardian_familyromance.1003.t
	desc = fr_guardian_familyromance.1003.desc
	theme = family
	
    override_background = { reference = corridor_day }

    left_portrait = {
		character = root
		animation = idle
	}

    right_portrait = {
		character = scope:ward_for_romance
		animation = severelywounded # pain
	}

	cooldown = { days = 30 }

    trigger = {
		is_ai = no
        familyromance_warden_player_for_interaction = yes
                
        any_relation = {
            type = ward                        
            age >= 9
		    is_available_ai_child = yes

            OR = {
                is_child_of = root
                is_sibling_of = root                
                is_nibling_of = root
            }
			NOT = { has_character_flag = familyromance_ward_event_0003_done }
        }
		
	}

    immediate = {
		random_relation = {
            type = ward
            limit = {
                is_available_ai_child = yes
				age >= 9
                OR = {
                    is_child_of = root
                    is_sibling_of = root
                    is_nibling_of = root
                }
                NOT = { has_character_flag = familyromance_ward_event_0003_done }
            }
            save_scope_as = ward_for_romance
		}

        if = {
			limit = {
				NOT = { exists = scope:ward_for_romance.var:fr_your_wards_guardian }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }			
            }
		}
		else = {
			limit = {
				NOT = { scope:ward_for_romance.var:fr_your_wards_guardian = root }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }
			
            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }
            }
		}
	}


    # Comfort your ward
	option = {
		name = fr_guardian_familyromance.1003.a
        
        scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
		
		stress_impact = {
			compassionate = medium_stress_impact_loss
		}
		
        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }
		
	}

    # Cynical, callous, sadistic; Laugh at your ward if you are cynical, callous...
	option = {
        trigger = {
            OR = {
                has_trait = cynical                
                has_trait = callous                
				has_trait = sadistic
            }
        }
        trait = cynical
        trait = callous
		trait = sadistic

		name = fr_guardian_familyromance.1003.b
        add_stress = major_stress_loss

        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = disappointed_opinion
            opinion = -5
        }				
	}

    # Make your ward return and fight again
	option = {
		name = fr_guardian_familyromance.1003.c
		custom_tooltip = fr_guardian_familyromance.1003.c.tt
		
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
        
		random_list = { 				
				# Your ward managed to fight off bullies!
				65 = {
					
					desc = fr_guardian_familyromance.1003.c.won					
					
					scope:ward_for_romance = {
						add_prestige = minor_prestige_gain
						add_prowess_skill = 1
						add_martial_skill = 1
					}
					

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

					scope:ward_for_romance = {
						change_variable = {
							name = fr_ward_affection_to_you
							add = 1
						}
					}

					send_interface_toast = {
						type = event_toast_effect_good 
						title = fr_guardian_familyromance.1003.c.won
						left_icon = root
						right_icon = scope:ward_for_romance						
					}

				}
				# Your ward got beaten again.
				35 = {					
					desc = fr_guardian_familyromance.1003.c.beaten
					
					scope:ward_for_romance = {
						add_prestige = minor_prestige_loss
						add_stress = medium_stress_gain
					}

					reverse_add_opinion = {
						target = scope:ward_for_romance
						modifier = disappointed_opinion
						opinion = -5
					}

					send_interface_toast = {
						type = event_toast_effect_bad
						title = fr_guardian_familyromance.1003.c.beaten
						left_icon = root
						right_icon = scope:ward_for_romance						
					}

				}				
		}
	}
	
	
	# High diplomacy; It's possible to resolve the conflict peacefully
	option = {
        trigger = { diplomacy >= high_skill_rating }

		name = fr_guardian_familyromance.1003.d
		
		scope:ward_for_romance = {
			add_diplomacy_skill = 1			
		}
        
        reverse_add_opinion = {
			target = scope:ward_for_romance
			modifier = pleased_opinion
			opinion = 10
		}

		scope:ward_for_romance = {
			change_variable = {
				name = fr_ward_affection_to_you
				add = 1
			}
		}
	}
	
	
	# Vengeful; We will find these bullies and make them pay
	option = {
        trigger = {
			has_trait = vengeful
        }
        trait = vengeful

		name = fr_guardian_familyromance.1003.e
        
		scope:ward_for_romance = {
			add_intrigue_skill = 1			
		}
									
        reverse_add_opinion = {
			target = scope:ward_for_romance
			modifier = pleased_opinion
			opinion = 10
		}

		scope:ward_for_romance = {
			change_variable = {
				name = fr_ward_affection_to_you
				add = 1
			}
		}
	}
	
	
	# Brave, education_martial, lifestyle_blademaster; You should train to become stronger
	option = {
        trigger = {
			OR = {
				has_trait = education_martial_prowess
				has_trait = brave
				has_trait = lifestyle_blademaster
			}
        }        
		trait = brave
		trait = lifestyle_blademaster

		name = fr_guardian_familyromance.1003.f
	        
		scope:ward_for_romance = {			
			add_stress = minor_stress_gain
			add_prowess_skill = 1
		}
		
        reverse_add_opinion = {
			target = scope:ward_for_romance
			modifier = pleased_opinion
			opinion = 10
		}

		scope:ward_for_romance = {
			change_variable = {
				name = fr_ward_affection_to_you
				add = 1
			}
		}
	}
	

    after = {
        scope:ward_for_romance = {
            add_character_flag = {
                flag = familyromance_ward_event_0003_done
                years = 20
            }	
        }
    }
}




# Your ward is interested in love
# What you could tell about it?
guardian_familyromance.0004 = {
	type = character_event
	
	title = fr_guardian_familyromance.1004.t
	desc = fr_guardian_familyromance.1004.desc
	theme = family
	
    override_background = { reference = bedchamber }

    left_portrait = {
		character = root
		animation = thinking
	}

    right_portrait = {
		character = scope:ward_for_romance
		animation = grief
	}

	cooldown = { days = 30 }

    trigger = {
		is_ai = no
        familyromance_warden_player_for_interaction = yes
                
        any_relation = {
            type = ward                        
            age >= 12
		    is_available_ai_child = yes
            OR = {
                is_child_of = root
                is_sibling_of = root                
                is_nibling_of = root
            }
			NOT = { has_character_flag = familyromance_ward_event_0004_done }
        }
		
	}


    immediate = {
		random_relation = {
            type = ward
            limit = {
                is_available_ai_child = yes
				age >= 12
                OR = {
                    is_child_of = root
                    is_sibling_of = root
                    is_nibling_of = root
                }
                NOT = { has_character_flag = familyromance_ward_event_0004_done }
            }
            save_scope_as = ward_for_romance
		}

        if = {
			limit = {
				NOT = { exists = scope:ward_for_romance.var:fr_your_wards_guardian }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }
            }
		}
		else = {
			limit = {
				NOT = { scope:ward_for_romance.var:fr_your_wards_guardian = root }
			}

            scope:ward_for_romance = {
                set_variable = {
                    name = fr_your_wards_guardian
                    value = root
                }
            }
			
            scope:ward_for_romance = {
                set_variable = {
                    name = fr_ward_affection_to_you
                    value = 1
                }
            }
		}
	}


    # Tell your ward more about it
	option = {
		name = fr_guardian_familyromance.1004.a
       
        scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
		
        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }
		
	}

    # Send your ward off to study hard, instead of talking about such nonsense
	option = {
		name = fr_guardian_familyromance.1004.b
        
        scope:ward_for_romance = {
			stress_impact = {
				rowdy = medium_stress_impact_gain
				bossy = medium_stress_impact_gain
				charming = medium_stress_impact_gain
			}
			
            add_learning_skill = 1
        }

        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = disappointed_opinion
            opinion = -5
        }
				
	}
	
	# Zealous; Think about the god's love for us
	option = {
		name = fr_guardian_familyromance.1004.c
		
		trigger = {
			has_trait = zealous
		}
		trait = zealous
		
        scope:ward_for_romance = {
			add_piety = minor_piety_gain
        }

        add_piety = minor_piety_gain
		
		add_character_modifier = {
			modifier = yearly_pious_liege_modifier
			years = 10
		}
		
		scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
		
        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }				
	}
	
	# Lustful; Seduction is a tricky art
	option = {
		name = fr_guardian_familyromance.1004.d
		
		trigger = {
			OR = {
				has_trait = lustful
				has_trait = seducer
			}
		}
		trait = lustful
		trait = seducer
		        
        scope:ward_for_romance = {
			add_intrigue_skill = 1
        }
		
		scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
		
        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }				
	}
	
	
	# Chaste; Keep your heart clean
	option = {
		name = fr_guardian_familyromance.1004.e
		
		trigger = {
			has_trait = chaste
		}
		trait = chaste
		
		if = {
			limit = {
				faith = {
					NOT = {
						trait_is_sin = chaste
					}
				}
			}
			add_piety = minor_piety_gain
		
			scope:ward_for_romance = {
				add_piety = minor_piety_gain
			}
		}
				
		scope:ward_for_romance = {
            change_variable = {
                name = fr_ward_affection_to_you
                add = 1
            }
        }
		
        reverse_add_opinion = {
            target = scope:ward_for_romance
            modifier = pleased_opinion
            opinion = 10
        }				
	}
	
	
	

    after = {
        scope:ward_for_romance = {
            add_character_flag = {
                flag = familyromance_ward_event_0004_done
                years = 20
            }	
        }
    }
    
}