# Base tech, makes fusion suppressors give plasma, nearly all other techs require this one
tech_gigas_stellar_manip_1 = {
    cost = @tier5cost1
    area = physics
    tier = 5
    category = { particles }
    is_rare = yes
    weight = 0

    prereqfor_desc = {
        custom = {
            title = "basic_stellar_manip1"
            desc = "basic_stellar_manip1_desc"
        }
    }

    modifier = { megastructure_build_speed_mult = 0.05 }

    potential = {
        has_stellar_manip_ap = yes
    }
    # I should probably make this do something :clueless:
}

# Allows the construction of the stellar manipulator
tech_gigas_stellar_manip_2 = {
    cost = @giga_tier6cost1
    area = engineering
    tier = 5
    category = { materials }
    is_rare = yes
    weight = @giga_tier6weight1

    prerequisites = { "tech_gigas_stellar_manip_1" }
    potential = {
        has_technology = tech_gigas_stellar_manip_1
    }

    modifier = {
        megastructures_energy_produces_mult = 0.05
    }

    prereqfor_desc = {
        custom = {
            title = "advanced_stellar_manip1"
            desc = "advanced_stellar_manip1_desc"
        }
    }
    prereqfor_desc = {
        custom = {
            title = "advanced_stellar_manip2"
            desc = "advanced_stellar_manip2_desc"
        }
    }
}

# Allows the construction of the systemcraft assembler
tech_stellar_assembler = {
    cost = @giga_tier8cost2
    area = engineering
    tier = 5
    category = { voidcraft }
    is_rare = yes
    weight = @giga_tier7weight3

    potential = {
        has_stellar_manip_ap = yes
        NOT = { has_global_flag = stellar_manip_assembler_disabled }
    }

    prerequisites = {
        "tech_gigas_stellar_manip_2"
        "giga_tech_war_system_6"
        "giga_tech_planet_assembly"
    }

    modifier = {
        megastructure_build_speed_mult = 0.05
        country_resource_max_alloys_add = 500000
        country_resource_max_energy_add = 500000
    }

    prereqfor_desc = {
        custom = { title = "allow_star_assembly"	desc = "allow_star_assembly_desc" }
    }

    #copied the weights from systemcraft
    weight_modifier = {
        inline_script = technology/tech_weight_boni/militarist_tech_weight_bonus

        inline_script = {
            script = technologies/rare_technologies_weight_modifiers
            TECHNOLOGY = tech_stellar_assembler
        }
    }
}

# Allows the construction of the o class systemcraft
tech_o_class_war_system = {
    cost = @giga_tier8cost2
    area = physics
    tier = 5
    category = { field_manipulation }
    is_rare = yes
    weight = @giga_tier7weight3

    potential = {
        has_ascension_perk = ap_celestial_printing
        NOR = {
            has_global_flag = stellar_manip_o_systemcraft_disabled
            has_global_flag = systemcraft_disabled
        }
    }

    prerequisites = {
        giga_tech_war_system_6
        giga_tech_dyson_o_star
    }

    prereqfor_desc = {
        hide_prereq_for_desc = ship
        hide_prereq_for_desc = component
        hide_prereq_for_desc = feature
        hide_prereq_for_desc = resource
        custom = { title = "header_03_insane"	desc = "header_03_insane_desc" }
        custom = { title = "allow_o_class_war_system"	desc = "allow_o_class_war_system_desc" }
    }

    weight_modifier = {
        inline_script = technology/tech_weight_boni/shipbuilding_tech_weight_bonus

        inline_script = {
            script = technologies/rare_technologies_weight_modifiers
            TECHNOLOGY = tech_o_class_war_system
        }
    }
}
