﻿namespace = feast_events_tova

feast_events_tova.0001 = { #Pleasure Dome Feast
	type = activity_event
	title = feast_events_tova.0001.t
	desc = feast_events_tova.0001.desc

	theme = feast_activity

	override_background = { reference = mpo_city_steppe }
	
	left_portrait = {
		character = root
		animation = schadenfreude
	}

	center_portrait = {
		character = scope:palace_admirer
		animation = admiration
	}

	right_portrait = {
		character = scope:honorary_guest
		animation = thinking
	}

	cooldown = { years = 20 }

	trigger = {
		always = no
		#has_mpo_dlc_trigger = yes
		#scope:activity.activity_location = {
		#	has_building_or_higher = pleasure_dome
		#}
		#this = scope:activity.activity_host
		#involved_activity = {
		#	any_attending_character = { highest_held_title_tier >= tier_county }
		#}
	}

	immediate = {
		if = {
			limit = {
				exists = scope:activity.special_guest:honorary_guest
			}
			scope:activity.special_guest:honorary_guest = { save_scope_as = honorary_guest }
		}
		else_if = {
			limit = { exists = scope:activity.special_guest:honorary_guest_regular }
			scope:activity.special_guest:honorary_guest_regular = { save_scope_as = honorary_guest }
		}
		else = {
			involved_activity = {
				random_attending_character = {
					limit = {
						highest_held_title_tier >= tier_county
					}
					save_scope_as = honorary_guest
				}
			}
		}
		involved_activity = {
			random_attending_character = {
				limit = {
					NOT = { this = root }
					NAND = {
						exists = scope:honorary_guest
						this = scope:honorary_guest
					}
				}
				save_scope_as = palace_admirer
			}
		}
	}

	weight_multiplier = {
        base = 1
        modifier = {
            factor = 1.5
            involved_activity = {
                has_activity_option = {
                    category = special_type
                    option = feast_type_tsagaan_sar
                }
            }
        }
    }

	option = { #A place worthy to host such mighty warriors as us!
		name = feast_events_tova.0001.a
		trigger = {
			involved_activity = {
				any_attending_character = {
						is_vassal_of = root
						has_vassal_stance = glory_hound
				}
			}
		}
		add_prestige = minor_prestige_loss
		involved_activity = {
			every_attending_character = {
				limit = {
					is_vassal_of = root
					has_vassal_stance = glory_hound
				}
				custom = every_glory_hound_vassal
				add_opinion = {
					target = root
					modifier = obedience_opinion
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = humble
				factor = 0
			}
			modifier = {
				has_trait = arrogant
				factor = 2
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_loss
			humble = major_stress_impact_gain
		}
	}

	option = { #Impress most important guest.
		name = feast_events_tova.0001.b

		duel = {
			target = scope:honorary_guest
			skill = diplomacy

			50 = { #They are impressed by your opulence
				desc = feast_events_tova.0001.b.success

				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				min = 5

				send_interface_toast = {
					type = event_toast_effect_good
					title = feast_events_tova.0001.b.success
					left_icon = root
					right_icon = scope:honorary_guest
					add_hook = {
						target = scope:honorary_guest
						type = loyalty_hook
					}
				}
			}

			50 = { #They are not impressed by your palace
				desc = feast_events_tova.0001.b.failure

				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				min = 5

				send_interface_toast = {
					type = event_toast_effect_bad
					title = feast_events_tova.0001.b.failure
					left_icon = root
					right_icon = scope:honorary_guest
					add_hook = {
						target = scope:honorary_guest
						type = favor_hook
					}
					stress_impact = {
						base = miniscule_stress_gain
						diligent = miniscule_stress_gain
						ambitious = miniscule_stress_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = { #Truly, this is a great testament to my rule.
		name = feast_events_tova.0001.c
		dynasty = {
			add_dynasty_prestige = medium_dynasty_prestige_value
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
}
