###########################
# GALACTIC DOORSTEP ORIGIN
###########################

# Galactic Doorstep Origin - Arc Site - From Gateway Sent
site_from_gateway_sent = {
	desc = "site_from_gateway_sent_intro"
	picture = GFX_evt_atmospheric_entry
	stages = 4
	max_instances = 999
	weight = 0
	situation_log_category = empire_concerns

	allow = {
		exists = leader
		leader = { leader_class = scientist }
	}

	visible = {
		default_site_visible_trigger = yes
	}

	on_visible = {
		country_event = { id = story.5 days = 30 }
	}

	# Beyond Impact
	stage = {
		difficulty = -2
		icon = GFX_archaeology_runes_B5
		event = origin.1100
	}

	# Temporal Dissonance
	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_B1
		event = origin.1105
	}

	# Room Without A View
	stage = {
		difficulty = -1
		icon = GFX_archaeology_runes_B6
		event = origin.1110
	}

	# The Gatekeeper Memoirs
	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_B4
		event = origin.1115
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_from_gateway_sent_random_events }
		}
	}
}

####################################
# ON THE SHOULDERS OF GIANTS ORIGIN
####################################
# By Henrik Thyrwall & Douglas Furén

# On the Shoulders of Giants Origin - Arc Site 1 - Ex Gravitas
site_ex_gravitas = {
	desc = "site_ex_gravitas_intro"
	picture = GFX_evt_cold_barren
	stages = 4
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	on_visible = {
		country_event = { id = story.5 days = 30 }
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A6
		event = origin.1200
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A5
		event = origin.1205
	}

	stage = {
		difficulty = 2
		icon = GFX_archaeology_runes_A4
		event = origin.1210
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A3
		event = origin.1215
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_ex_gravitas_random_events }
		}
	}
 }

# On the Shoulders of Giants Origin - Arc Site 2 - Something Waiting
site_something_waiting = {
	desc = "site_something_waiting_intro"
	picture = GFX_evt_ship_in_orbit
	stages = 4
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A1
		event = origin.1220
	}

	stage = {
		difficulty = 2
		icon = GFX_archaeology_runes_A2
		event = origin.1225
	}

	stage = {
		difficulty = 2
		icon = GFX_archaeology_runes_A3
		event = origin.1230
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A4
		event = origin.1235
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_something_waiting_random_events }
		}
	}
}

# On the Shoulders of Giants Origin - Arc Site 3 - Buried Deep
site_buried_deep = {
	desc = "site_buried_deep_intro"
	picture = GFX_evt_ship_in_orbit
	stages = 2
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	stage = {
		difficulty = 3
		icon = GFX_archaeology_runes_A5
		event = origin.1240
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A2
		event = origin.1245
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_buried_deep_random_events }
		}
	}
}

# On the Shoulders of Giants Origin - Arc Site 4 - In Memoriam
site_in_memoriam = {
	desc = "site_in_memoriam_intro"
	picture = GFX_evt_ship_in_orbit
	stages = 4
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A3
		event = origin.1250
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A5
		event = origin.1255
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A2
		event = origin.1260
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A4
		event = origin.1265
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_in_memoriam_random_events }
		}
	}
}

# On the Shoulders of Giants Origin - Arc Site 5 - The Last Stand
site_the_last_stand = {
	desc = "site_the_last_stand_intro"
	picture = GFX_evt_ship_in_orbit
	stages = 4
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A1
		event = origin.1270
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A2
		event = origin.1275
	}

	stage = {
		difficulty = -2
		icon = GFX_archaeology_runes_A4
		event = origin.1280
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A3
		event = origin.1285
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_the_last_stand_random_events }
		}
	}
}

# On the Shoulders of Giants Origin - Arc Site 6 - Dark Secret
site_dark_secret = {
	desc = "site_dark_secret_intro"
	picture = GFX_evt_cold_barren
	stages = 4
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A5
		event = origin.1290
	}

	stage = {
		difficulty = -1
		icon = GFX_archaeology_runes_A1
		event = origin.1295
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A6
		event = origin.1296
	}

	stage = {
		difficulty = -1
		icon = GFX_archaeology_runes_A2
		event = origin.1297
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_dark_secret_random_events }
		}
	}
}

# On the Shoulders of Giants Origin - Arc Site 7 - Benign Cover-Up
site_benign_cover_up = {
	desc = "site_benign_cover_up_intro"
	picture = GFX_evt_cold_barren
	stages = 2
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	stage = {
		difficulty = -1
		icon = GFX_archaeology_runes_A2
		event = origin.1365
	}

	stage = {
		difficulty = 2
		icon = GFX_archaeology_runes_A4
		event = origin.1370
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_dark_secret_random_events }
		}
	}
}

# On the Shoulders of Giants Origin - Arc Site 7 - Bury The Hatchet
site_bury_the_hatchet = {
	desc = "site_bury_the_hatchet_intro"
	picture = GFX_evt_cold_barren
	stages = 2
	max_instances = 999
	situation_log_category = empire_concerns
	weight = {
		base = 0
	}

	allow = {
		exists = leader
		leader = { leader_class = scientist }
		hidden_trigger = {
			owner = {
				has_country_flag = shoulders_origin_@from.planet
			}
		}
	}

	visible = {
		has_country_flag = shoulders_origin_@from.planet
		default_site_visible_trigger = yes
	}

	stage = {
		difficulty = -1
		icon = GFX_archaeology_runes_A2
		event = origin.1410
	}

	stage = {
		difficulty = 1
		icon = GFX_archaeology_runes_A4
		event = origin.1415
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = { RANDOM_EVENTS = site_dark_secret_random_events }
		}
	}
}

##################
# OTHER ARC SITES
##################

# Genius Caeli (Joint Operation) by Gemma Thomson
leylines_digsite = {
	desc = leylines_digsite_desc
	picture = GFX_evt_clocks
	stages = 4
	max_instances = 200
	weight = 0 # Generated from an event ("Federations" DLC)

	allow = {
		is_ship_class = shipclass_science_ship
		exists = leader
	}
	visible = {
		default_site_visible_trigger = yes
	}
	stage = {
		difficulty = 2
		event = federations3.2105
		icon = GFX_archaeology_runes_A1
	}
	stage = {
		difficulty = 3
		event = federations3.2110 #Split path
		icon = GFX_archaeology_runes_A2
	}
	stage = {
		difficulty = 3
		event = federations3.2115 #Split path
		icon = GFX_archaeology_runes_A3
	}
	stage = {
		difficulty = 4
		event = federations3.2120
		icon = GFX_archaeology_runes_A4
	}

	on_roll_failed = {
		from = {
			standard_archaeological_site_on_roll_failed = {
				RANDOM_EVENTS = site_genius_caeli_random_events
			}
		}
	}
}
