﻿namespace = cagm_stars

cagm_stars.0001 = {
	type = activity_event
	title = cagm_stars.0001.t
	desc = cagm_stars.0001.desc
	theme = learning
	override_background = { reference = corridor_night }
	left_portrait = { character = root animation = thinking }
	right_portrait = { trigger = { exists = scope:lead_observer } character = scope:lead_observer animation = personality_rational }
	immediate = {
		involved_activity = {
			random_attending_character = {
				limit = { this != root is_adult = yes learning >= 10 }
				save_scope_as = lead_observer
			}
		}
		if = {
			limit = { NOT = { exists = scope:lead_observer } }
			create_character = {
				template = cagm_local_observer_character
				culture = root.location.culture
				faith = root.location.faith
				location = root.location
				save_scope_as = lead_observer
			}
		}
		if = {
			limit = { exists = scope:lead_observer }
			involved_activity = { set_variable = { name = cagm_stars_lead_observer value = scope:lead_observer } }
		}
	}
	option = {
		name = cagm_stars.0001.a
		add_stress = -10
		custom_tooltip = cagm_stars_progress_good_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 5 }
				set_variable = { name = cagm_stars_story_route_quiet value = yes }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0001_a character = root score = 10 show_in_conclusion = no }
			}
			trigger_event = { id = cagm_stars.0100 days = 3 }
		}
		ai_chance = { base = 40 modifier = { add = 30 stress >= 50 } }
	}
	option = {
		name = cagm_stars.0001.b
		add_prestige = 25
		custom_tooltip = cagm_stars_progress_strong_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 8 }
				set_variable = { name = cagm_stars_story_route_formal value = yes }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0001_b character = root score = 10 show_in_conclusion = no }
			}
			trigger_event = { id = cagm_stars.0100 days = 3 }
		}
		ai_chance = { base = 35 modifier = { add = 20 learning >= 12 } }
	}
	option = {
		name = cagm_stars.0001.c
		custom_tooltip = cagm_stars_progress_good_opinion_tt
		involved_activity = { every_attending_character = { limit = { this != scope:host } add_opinion = { target = root modifier = cagm_stars_shared_vigil_opinion years = 2 } } }
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 6 }
				set_variable = { name = cagm_stars_story_route_shared value = yes }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0001_c character = root score = 10 show_in_conclusion = no }
			}
			trigger_event = { id = cagm_stars.0100 days = 3 }
		}
		ai_chance = { base = 25 modifier = { add = 20 has_trait = gregarious } }
	}
}

cagm_stars.0010 = {
	type = activity_event
	title = cagm_stars.0010.t
	desc = cagm_stars.0010.desc
	theme = learning
	override_background = { reference = corridor_night }
	left_portrait = { character = root animation = personality_rational }
	option = {
		name = cagm_stars.0010.a
		add_learning_lifestyle_xp = 25
		custom_tooltip = cagm_stars_progress_strong_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 9 }
				set_variable = { name = cagm_stars_story_method_tables value = yes }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0010_a character = root score = 10 show_in_conclusion = no }
			}
			trigger_event = { id = cagm_stars.0200 days = 3 }
		}
		ai_chance = { base = 40 modifier = { add = 25 learning >= 12 } }
	}
	option = {
		name = cagm_stars.0010.b
		custom_tooltip = cagm_stars_progress_good_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 6 }
				set_variable = { name = cagm_stars_story_method_memory value = yes }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0010_b character = root score = 10 show_in_conclusion = no }
			}
			trigger_event = { id = cagm_stars.0200 days = 3 }
		}
		ai_chance = { base = 35 modifier = { add = 20 has_trait = humble } }
	}
	option = {
		name = cagm_stars.0010.c
		add_stress = 10
		custom_tooltip = cagm_stars_progress_great_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 12 }
				set_variable = { name = cagm_stars_story_method_alignment value = yes }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0010_c character = root score = 10 show_in_conclusion = no }
			}
			trigger_event = { id = cagm_stars.0200 days = 3 }
		}
		ai_chance = { base = 25 modifier = { add = 25 has_trait = diligent } }
	}
}

cagm_stars.0020 = {
	type = activity_event
	title = cagm_stars.0020.t
	desc = cagm_stars.0020.desc
	theme = learning
	override_background = { reference = corridor_night }
	left_portrait = { character = root animation = worry }
	option = {
		name = cagm_stars.0020.a
		add_stress = 5
		custom_tooltip = cagm_stars_progress_good_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 6 }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0020_a character = root score = 10 show_in_conclusion = no }
			}
		}
		ai_chance = { base = 35 modifier = { add = 25 has_trait = patient } }
	}
	option = {
		name = cagm_stars.0020.b
		add_learning_lifestyle_xp = 35
		custom_tooltip = cagm_stars_progress_strong_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 9 }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0020_b character = root score = 10 show_in_conclusion = no }
			}
		}
		ai_chance = { base = 45 modifier = { add = 20 has_trait = honest } }
	}
	option = {
		name = cagm_stars.0020.c
		add_prestige = 50
		add_stress = 10
		custom_tooltip = cagm_stars_progress_great_public_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 12 }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0020_c character = root score = 10 show_in_conclusion = no }
			}
		}
		ai_chance = { base = 20 modifier = { add = 25 has_trait = ambitious } }
	}
}

cagm_stars.0030 = {
	type = activity_event
	title = cagm_stars.0030.t
	desc = cagm_stars.0030.desc
	theme = learning
	override_background = { reference = corridor_night }
	left_portrait = { character = root animation = thinking }
	option = {
		name = cagm_stars.0030.a
		custom_tooltip = cagm_stars_progress_strong_record_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 9 }
				set_variable = { name = cagm_stars_final_record value = yes }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0030_a character = root score = 10 show_in_conclusion = no }
			}
		}
		ai_chance = { base = 45 modifier = { add = 20 learning >= 12 } }
	}
	option = {
		name = cagm_stars.0030.b
		add_prestige = 50
		custom_tooltip = cagm_stars_progress_great_interpretation_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 12 }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0030_b character = root score = 10 show_in_conclusion = no }
			}
		}
		ai_chance = { base = 25 modifier = { add = 20 has_trait = ambitious } }
	}
	option = {
		name = cagm_stars.0030.c
		add_stress = -10
		custom_tooltip = cagm_stars_progress_good_witness_tt
		hidden_effect = {
			involved_activity = {
				change_variable = { name = cagm_stars_event_adjustment add = 5 }
				set_variable = { name = cagm_stars_success value = cagm_stars_success_value }
				add_activity_log_entry = { key = cagm_stars_log_0030_c character = root score = 10 show_in_conclusion = no }
			}
		}
		ai_chance = { base = 30 modifier = { add = 25 has_trait = calm } }
	}
}

cagm_stars.0100 = {
	type = activity_event
	title = {
		first_valid = {
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_route_quiet } } desc = cagm_stars.0100.quiet.t }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_route_formal } } desc = cagm_stars.0100.formal.t }
			desc = cagm_stars.0100.shared.t
		}
	}
	desc = {
		first_valid = {
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_route_quiet } } desc = cagm_stars.0100.quiet.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_route_formal } } desc = cagm_stars.0100.formal.desc }
			desc = cagm_stars.0100.shared.desc
		}
	}
	theme = learning
	override_background = { reference = corridor_night }
	trigger = { exists = scope:activity involved_activity.activity_host ?= this }
	immediate = { involved_activity.var:cagm_stars_lead_observer = { save_scope_as = lead_observer } }
	left_portrait = { character = root animation = thinking }
	right_portrait = { trigger = { exists = scope:lead_observer } character = scope:lead_observer animation = personality_rational }

	option = {
		name = cagm_stars.0100.a
		trigger = { involved_activity = { has_variable = cagm_stars_story_route_quiet } }
		add_stress = -5
		custom_tooltip = cagm_branch_steady_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_route_steady character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 65 modifier = { add = 20 has_trait = calm } }
	}
	option = {
		name = cagm_stars.0100.b
		trigger = { involved_activity = { has_variable = cagm_stars_story_route_quiet } }
		add_learning_lifestyle_xp = 15
		custom_tooltip = cagm_branch_ambitious_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 2 } set_variable = { name = cagm_stars_story_route_ambition value = yes } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_route_ambitious character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 35 modifier = { add = 20 has_trait = shy } }
	}
	option = {
		name = cagm_stars.0100.c
		trigger = { involved_activity = { has_variable = cagm_stars_story_route_formal } }
		add_learning_lifestyle_xp = 20
		custom_tooltip = cagm_branch_steady_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_route_steady character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 65 modifier = { add = 20 learning >= 12 } }
	}
	option = {
		name = cagm_stars.0100.d
		trigger = { involved_activity = { has_variable = cagm_stars_story_route_formal } }
		add_prestige = 25
		custom_tooltip = cagm_branch_ambitious_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 2 } set_variable = { name = cagm_stars_story_route_ambition value = yes } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_route_ambitious character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 35 modifier = { add = 20 has_trait = ambitious } }
	}
	option = {
		name = cagm_stars.0100.e
		trigger = { involved_activity = { has_variable = cagm_stars_story_route_shared } }
		add_learning_lifestyle_xp = 15
		custom_tooltip = cagm_branch_steady_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_route_steady character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 65 modifier = { add = 20 has_trait = gregarious } }
	}
	option = {
		name = cagm_stars.0100.f
		trigger = { involved_activity = { has_variable = cagm_stars_story_route_shared } }
		add_prestige = 20
		custom_tooltip = cagm_branch_ambitious_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 2 } set_variable = { name = cagm_stars_story_route_ambition value = yes } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_route_ambitious character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 35 modifier = { add = 20 has_trait = arrogant } }
	}
}

cagm_stars.0200 = {
	type = activity_event
	title = {
		first_valid = {
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_tables } } desc = cagm_stars.0200.tables.t }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_memory } } desc = cagm_stars.0200.memory.t }
			desc = cagm_stars.0200.alignment.t
		}
	}
	desc = {
		first_valid = {
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_tables } } desc = cagm_stars.0200.tables.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_memory } } desc = cagm_stars.0200.memory.desc }
			desc = cagm_stars.0200.alignment.desc
		}
	}
	theme = learning
	override_background = { reference = corridor_night }
	trigger = { exists = scope:activity involved_activity.activity_host ?= this }
	immediate = { involved_activity.var:cagm_stars_lead_observer = { save_scope_as = lead_observer } }
	left_portrait = { character = root animation = personality_rational }
	right_portrait = { trigger = { exists = scope:lead_observer } character = scope:lead_observer animation = thinking }

	option = {
		name = cagm_stars.0200.a
		trigger = { involved_activity = { has_variable = cagm_stars_story_method_tables } }
		add_learning_lifestyle_xp = 20
		custom_tooltip = cagm_branch_steady_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_method_steady character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 65 modifier = { add = 20 has_trait = diligent } }
	}
	option = {
		name = cagm_stars.0200.b
		trigger = { involved_activity = { has_variable = cagm_stars_story_method_tables } }
		add_prestige = 25
		custom_tooltip = cagm_branch_ambitious_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 2 } set_variable = { name = cagm_stars_story_method_ambition value = yes } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_method_ambitious character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 35 modifier = { add = 20 has_trait = arrogant } }
	}
	option = {
		name = cagm_stars.0200.c
		trigger = { involved_activity = { has_variable = cagm_stars_story_method_memory } }
		add_learning_lifestyle_xp = 15
		custom_tooltip = cagm_branch_steady_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_method_steady character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 65 modifier = { add = 20 has_trait = humble } }
	}
	option = {
		name = cagm_stars.0200.d
		trigger = { involved_activity = { has_variable = cagm_stars_story_method_memory } }
		add_prestige = 20
		custom_tooltip = cagm_branch_ambitious_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 2 } set_variable = { name = cagm_stars_story_method_ambition value = yes } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_method_ambitious character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 35 modifier = { add = 20 has_trait = ambitious } }
	}
	option = {
		name = cagm_stars.0200.e
		trigger = { involved_activity = { has_variable = cagm_stars_story_method_alignment } }
		custom_tooltip = cagm_branch_steady_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_method_steady character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 65 modifier = { add = 20 has_trait = patient } }
	}
	option = {
		name = cagm_stars.0200.f
		trigger = { involved_activity = { has_variable = cagm_stars_story_method_alignment } }
		add_stress = 5
		custom_tooltip = cagm_branch_ambitious_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 2 } set_variable = { name = cagm_stars_story_method_ambition value = yes } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_method_ambitious character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 35 modifier = { add = 20 has_trait = diligent } }
	}
}

# Hunt-style contextual pulse: one night-watch incident is sampled and then
# returns to the fixed observation timeline.
cagm_stars.0050 = {
	type = activity_event
	hidden = yes
	trigger = { exists = scope:activity involved_activity.activity_host ?= this }
	immediate = {
		random_list = {
			34 = { trigger_event = cagm_stars.0300 }
			33 = { trigger_event = cagm_stars.0310 }
			33 = { trigger_event = cagm_stars.0320 }
		}
	}
}

cagm_stars.0300 = {
	type = activity_event
	title = cagm_stars.0300.t
	desc = cagm_stars.0300.desc
	theme = learning
	override_background = { reference = corridor_night }
	trigger = { exists = scope:activity involved_activity.activity_host ?= this }
	left_portrait = { character = root animation = thinking }
	option = {
		name = cagm_stars.0300.a
		add_learning_lifestyle_xp = 15
		custom_tooltip = cagm_stars_progress_good_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_lamp_shield character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 60 modifier = { add = 20 learning >= 12 } }
	}
	option = {
		name = cagm_stars.0300.b
		add_stress = 5
		custom_tooltip = cagm_stars_progress_strong_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 7 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_lamp_dark character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 40 modifier = { add = 20 has_trait = diligent } }
	}
}

cagm_stars.0310 = {
	type = activity_event
	title = cagm_stars.0310.t
	desc = cagm_stars.0310.desc
	theme = learning
	override_background = { reference = corridor_night }
	trigger = { exists = scope:activity involved_activity.activity_host ?= this }
	left_portrait = { character = root animation = personality_rational }
	option = {
		name = cagm_stars.0310.a
		add_piety = 20
		custom_tooltip = cagm_stars_progress_good_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_omen_record character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 60 modifier = { add = 20 has_trait = humble } }
	}
	option = {
		name = cagm_stars.0310.b
		add_prestige = 25
		add_stress = 5
		custom_tooltip = cagm_stars_progress_strong_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 7 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_omen_declare character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 40 modifier = { add = 20 has_trait = ambitious } }
	}
}

cagm_stars.0320 = {
	type = activity_event
	title = cagm_stars.0320.t
	desc = cagm_stars.0320.desc
	theme = learning
	override_background = { reference = corridor_night }
	trigger = { exists = scope:activity involved_activity.activity_host ?= this }
	left_portrait = { character = root animation = worry }
	option = {
		name = cagm_stars.0320.a
		add_learning_lifestyle_xp = 20
		custom_tooltip = cagm_stars_progress_good_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 4 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_clock_reconcile character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 60 modifier = { add = 20 has_trait = patient } }
	}
	option = {
		name = cagm_stars.0320.b
		add_stress = 5
		custom_tooltip = cagm_stars_progress_strong_tt
		hidden_effect = { involved_activity = { change_variable = { name = cagm_stars_event_adjustment add = 7 } set_variable = { name = cagm_stars_success value = cagm_stars_success_value } add_activity_log_entry = { key = cagm_stars_log_clock_choose character = root score = 10 show_in_conclusion = no } } }
		ai_chance = { base = 40 modifier = { add = 20 has_trait = arbitrary } }
	}
}

cagm_stars.0099 = {
	type = activity_event
	hidden = yes
	immediate = {
		random = {
			chance = { value = involved_activity.var:cagm_stars_success }
			involved_activity = { set_variable = { name = cagm_stars_success_roll value = yes } }
		}
		if = {
			limit = { involved_activity = { has_variable = cagm_stars_success_roll } }
			random_list = {
				75 = { trigger_event = cagm_stars.1100 }
				25 = {
					modifier = { add = 20 involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_wonder } } }
					modifier = { add = 10 involved_activity = { has_activity_option = { category = cagm_stars_instruments option = cagm_stars_instruments_finest } } }
					modifier = { add = 10 involved_activity = { has_variable = cagm_stars_final_record } }
					modifier = { add = 5 involved_activity = { has_variable = cagm_stars_story_route_ambition } }
					modifier = { add = 5 involved_activity = { has_variable = cagm_stars_story_method_ambition } }
					trigger_event = cagm_stars.1200
				}
			}
		}
		else = { trigger_event = cagm_stars.1000 }
	}
}

cagm_stars.1000 = {
	type = activity_event
	title = cagm_stars.1000.t
	desc = {
		first_valid = {
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_tables } } desc = cagm_stars.1000.tables.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_memory } } desc = cagm_stars.1000.memory.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_alignment } } desc = cagm_stars.1000.alignment.desc }
			desc = cagm_stars.1000.desc
		}
	}
	theme = learning
	override_background = { reference = corridor_night }
	left_portrait = { character = root animation = worry }
	immediate = {
		involved_activity = {
			add_activity_log_entry = {
				key = cagm_stars_log_failure
				character = root
				score = 25
				show_in_conclusion = yes
			}
		}
	}
	option = {
		name = cagm_stars.1000.a
		add_prestige = 25
		add_stress = -10
		add_learning_lifestyle_xp = 50
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 5 }
		involved_activity = { set_variable = { name = cagm_stars_result_failure value = yes } }
	}
}

cagm_stars.1100 = {
	type = activity_event
	title = cagm_stars.1100.t
	desc = {
		first_valid = {
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_tables } } desc = cagm_stars.1100.tables.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_memory } } desc = cagm_stars.1100.memory.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_alignment } } desc = cagm_stars.1100.alignment.desc }
			desc = cagm_stars.1100.desc
		}
	}
	theme = learning
	override_background = { reference = corridor_night }
	left_portrait = { character = root animation = war_over_win }
	immediate = {
		involved_activity = {
			if = {
				limit = { exists = var:cagm_stars_lead_observer }
				var:cagm_stars_lead_observer = { save_scope_as = lead_observer }
			}
		}
		if = { limit = { exists = scope:lead_observer } scope:lead_observer = { cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 10 } } }
		involved_activity = {
			add_activity_log_entry = {
				key = cagm_stars_log_success
				character = root
				score = 75
				show_in_conclusion = yes
			}
		}
	}
	option = {
		name = cagm_stars.1100.a
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_quiet } } }
		add_stress = -35
		add_prestige = 100
		involved_activity = { every_attending_character = { limit = { this != scope:host } add_opinion = { target = root modifier = cagm_stars_shared_vigil_opinion years = 4 } } set_variable = { name = cagm_stars_result_success value = yes } }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 20 }
	}
	option = {
		name = cagm_stars.1100.b
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_chart } } }
		add_prestige = 150
		add_learning_lifestyle_xp = 250
		remove_character_modifier = cagm_stars_scholarly_record
		add_character_modifier = { modifier = cagm_stars_scholarly_record years = 4 }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 20 }
		involved_activity = { set_variable = { name = cagm_stars_result_success value = yes } }
	}
	option = {
		name = cagm_stars.1100.c
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 125
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_war }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 20 }
		involved_activity = { set_variable = { name = cagm_stars_result_success value = yes } }
	}
	option = {
		name = cagm_stars.1100.d
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 125
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_realm }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 20 }
		involved_activity = { set_variable = { name = cagm_stars_result_success value = yes } }
	}
	option = {
		name = cagm_stars.1100.e
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 125
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_family }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 20 }
		involved_activity = { set_variable = { name = cagm_stars_result_success value = yes } }
	}
	option = {
		name = cagm_stars.1100.f
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 125
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_self }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 20 }
		involved_activity = { set_variable = { name = cagm_stars_result_success value = yes } }
	}
	option = {
		name = cagm_stars.1100.g
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_wonder } } }
		add_prestige = 200
		add_learning_lifestyle_xp = 250
		remove_character_modifier = cagm_stars_scholarly_record
		add_character_modifier = { modifier = cagm_stars_scholarly_record years = 5 }
		remove_character_flag = cagm_stars_wonder_rumor
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 20 }
		involved_activity = { set_variable = { name = cagm_stars_result_success value = yes } }
	}
}

cagm_stars.1200 = {
	type = activity_event
	title = cagm_stars.1200.t
	desc = {
		first_valid = {
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_tables } } desc = cagm_stars.1200.tables.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_memory } } desc = cagm_stars.1200.memory.desc }
			triggered_desc = { trigger = { involved_activity = { has_variable = cagm_stars_story_method_alignment } } desc = cagm_stars.1200.alignment.desc }
			desc = cagm_stars.1200.desc
		}
	}
	theme = learning
	override_background = { reference = corridor_night }
	left_portrait = { character = root animation = war_over_win }
	immediate = {
		involved_activity = {
			if = {
				limit = { exists = var:cagm_stars_lead_observer }
				var:cagm_stars_lead_observer = { save_scope_as = lead_observer }
			}
		}
		if = { limit = { exists = scope:lead_observer } scope:lead_observer = { cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 15 } } }
		involved_activity = {
			add_activity_log_entry = {
				key = cagm_stars_log_exceptional
				character = root
				score = 100
				show_in_conclusion = yes
			}
		}
	}
	option = {
		name = cagm_stars.1200.a
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_quiet } } }
		add_stress = -55
		add_prestige = 200
		involved_activity = { every_attending_character = { limit = { this != scope:host } add_opinion = { target = root modifier = cagm_stars_shared_vigil_opinion years = 6 } } set_variable = { name = cagm_stars_result_exceptional value = yes } }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 35 }
	}
	option = {
		name = cagm_stars.1200.b
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_chart } } }
		add_prestige = 300
		add_learning_lifestyle_xp = 400
		remove_character_modifier = cagm_stars_scholarly_record
		add_character_modifier = { modifier = cagm_stars_scholarly_record years = 6 }
		cagm_create_star_chart_artifact_effect = yes
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 35 }
		involved_activity = { set_variable = { name = cagm_stars_result_exceptional value = yes } }
	}
	option = {
		name = cagm_stars.1200.c
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 250
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_war }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 35 }
		involved_activity = { set_variable = { name = cagm_stars_result_exceptional value = yes } }
	}
	option = {
		name = cagm_stars.1200.d
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 250
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_realm }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 35 }
		involved_activity = { set_variable = { name = cagm_stars_result_exceptional value = yes } }
	}
	option = {
		name = cagm_stars.1200.e
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 250
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_family }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 35 }
		involved_activity = { set_variable = { name = cagm_stars_result_exceptional value = yes } }
	}
	option = {
		name = cagm_stars.1200.f
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_omens } } }
		add_prestige = 250
		cagm_replace_stars_forecast_effect = { MODIFIER = cagm_stars_forecast_self }
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 35 }
		involved_activity = { set_variable = { name = cagm_stars_result_exceptional value = yes } }
	}
	option = {
		name = cagm_stars.1200.g
		trigger = { involved_activity = { has_activity_option = { category = cagm_stars_purpose option = cagm_stars_wonder } } }
		add_prestige = 450
		add_learning_lifestyle_xp = 500
		cagm_create_meteorite_artifact_effect = yes
		remove_character_flag = cagm_stars_wonder_rumor
		cagm_award_tracked_trait_xp_effect = { TRAIT = cagm_stargazer XP = 35 }
		involved_activity = { set_variable = { name = cagm_stars_result_exceptional value = yes } }
	}
}
