# =============================================================================
# Giga + Age of Wonder Compatibility Patch - AOW Dyson variant upgrade_from fix
# AUTO-GENERATED by _gen_dyson_fix.ps1 from AOW's AOW_3_dyson_sphere_*.txt.
# Re-points the 30 entry-tier variants' upgrade_from to the re-homed AOW entries
# (AOW_MEGA_dyson_sphere_entry / AOW_MEGA_dyson_swarm_entry) so:
#   * the AOW Dyson build button's redirect lands correctly (was: bare icon), and
#   * Giga's vanilla dyson_swarm/sphere no longer offer AOW star-class variants.
# Re-run the generator after any AOW update to these files.
# =============================================================================
AOW_MEGA_dyson_swarm_1_hyper = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_hyper = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_hyper }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -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 }
}

AOW_MEGA_dyson_swarm_1_super = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_super = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_super }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_o = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_o = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_o }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_b = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_b = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_b }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_giant = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_giant = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_giant }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_a = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_a = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_a }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_f = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_f = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_f }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_3_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_g = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_g = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_g }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_k = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_k = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_k }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}

AOW_MEGA_dyson_swarm_1_m = {
	entity = "dyson_swarm_phase_1_entity"
	construction_entity = "dyson_swarm_phase_1_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 0
	resources = {
		category = megastructures
		upkeep = { alloys = 5 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 500
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	prerequisites = { "tech_dyson_swarm" }
	upgrade_from = { AOW_MEGA_dyson_swarm_entry }
	upgrade_desc = hide
	country_modifier = { custom_tooltip = dyson_swarm_1_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_1_mod
				days = -1
			}
		}
	}
}

AOW_MEGA_dyson_swarm_2_m = {
	entity = "dyson_swarm_phase_2_entity"
	construction_entity = "dyson_swarm_phase_2_entity"
	portrait = "GFX_megastructure_dyson_swarm_background"
	entity_offset = { x = -0.1 y = -0.1 }
	rotate_to_center = no
	scale_offset = yes
	place_entity_on_planet_plane = yes
	use_planet_resource = yes
	build_time = 1080 # 3 years
	resources = {
		category = megastructures
		cost = {
			alloys = 1000
			unity = 2500
		}
		upkeep = { alloys = 10 }
	}
	construction_blocks_and_blocked_by = none
	inline_script = {
		script = megastructures/dismantle_megastructure_with_effects
		time = 360
		tech = tech_dyson_swarm
		category = megastructures
		key = dyson_swarm
		alloys = 1000
		minerals = 0 vm = 0 eg = 0 rc = 0 lm = 0 zo = 0 dm = 0
	}
	upgrade_from = { AOW_MEGA_dyson_swarm_1_m }
	upgrade_desc = hide
	prerequisites = { "tech_dyson_swarm" }
	country_modifier = { custom_tooltip = dyson_swarm_2_mod_tooltip }
	on_build_complete = {
		fromfrom = { set_megastructure_flag = AOW_flag_MEGA_dyson_swarm_@owner }
		fromfrom.planet = {
			remove_modifier = dyson_swarm_1_mod
			remove_modifier = dyson_swarm_2_mod
			remove_modifier = dyson_swarm_3_mod
			add_modifier = {
				modifier = dyson_swarm_2_mod
				days = -1
			}
		}
	}
}

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 }
}
