# =============================================================================
# Giga + Age of Wonder Compatibility Patch — Dyson Sphere stage cascade
# Loads AFTER zzzz_compat_dyson_variants.txt (zzzzz_ > zzzz_).
# sphere_0 and sphere_1 are zero-build-time passthrough stages in AOW's chain.
# Normally the player would see "Dyson Sphere Site" (sphere_0) and "Dyson Sphere
# Frame" (sphere_1) as separate clickable upgrades. This file adds on_build_complete
# auto-redirects so the chain cascades instantly:
#   _entry -> sphere_0 -> sphere_1 -> sphere_2
# The player lands on sphere_2 ("Dyson Sphere: Initial") and continues manually.
# =============================================================================

# ---- sphere_0 overrides (add on_build_complete cascade to sphere_1) ----

AOW_MEGA_dyson_sphere_0_hyper = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	inline_script = {
		script = megastructures/dismantle_megastructure
		time = 360
		tech = tech_dyson_sphere
		category = megastructures
		alloys = 5000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_hyper
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_super = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_super
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_O = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_O
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_B = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_B
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_giant = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_giant
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_A = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_A
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_F = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_F
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_G = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_G
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_K = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_K
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_0_M = {
	entity = "construction_platform_entity"
	construction_entity = "construction_platform_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	entity_offset = { x = -7 y = -7 }
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { energy = @AOW_var_DS_UPKP_energy }
	}
	upgrade_from = { AOW_MEGA_dyson_sphere_entry }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_1_M
			finish_upgrade = yes
		}
	}
}

# ---- sphere_1 overrides (passthrough: redirect to sphere_2) ----
# sphere_1 is only reached via the cascade from sphere_0 above.
# It exists for 0 days and auto-redirects to sphere_2 ("Initial").

AOW_MEGA_dyson_sphere_1_hyper = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_hyper }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_hyper
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_super = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_super }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_super
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_O = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_O }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_O
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_B = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_B }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_B
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_giant = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_giant }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_giant
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_A = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_A }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_A
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_F = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_F }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_F
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_G = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_G }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_G
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_K = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_K }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_K
			finish_upgrade = yes
		}
	}
}

AOW_MEGA_dyson_sphere_1_M = {
	entity = "AOW_new_dyson_sphere_phase_01_entity"
	construction_entity = "AOW_new_dyson_sphere_frame_entity"
	portrait = "GFX_megastructure_construction_background"
	scales_with_planet = yes
	use_planet_resource = yes
	build_time = 0
	resources = { category = megastructures }
	upgrade_from = { AOW_MEGA_dyson_sphere_0_M }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_sphere" }
	potential = { always = no }
	ai_weight = { factor = 0 }
	on_build_complete = {
		fromfrom = {
			upgrade_megastructure_to = AOW_MEGA_dyson_sphere_2_M
			finish_upgrade = yes
		}
	}
}
