-- Newgame postprocessor script for 1.50 improved.

for pi,p in pairs(get_players()) do

 -- STRATEGIC: Remove Hard Shields from the tech tree.
    t = get_player_techs(pi)
    if t.extended_fuel_tanks == 0 then
    t.hard_shields = 0
    end
    set_player_techs(pi, t)

 -- LITHOVORE: Remove Weather Controller from the tech tree.
    if p.lithovore == 1 then
        t = get_player_techs(pi)
        if t.weather_control_system == 1 then
        t.weather_control_system = 0
        end
        set_player_techs(pi, t)
    end

 -- UNCREATIVE: Remove shield specials from the tech tree if it does not contain at least 1 ship shield.
    if p.uncreative == 1 then
        t = get_player_techs(pi)
        if t.class_i_shield == 0 and t.class_iii_shield == 0 and t.class_v_shield == 0 and t.class_vii_shield == 0 and t.class_x_shield == 0 then
            if t.shield_capacitors == 1 then
            t.shield_capacitors = 0
            r = random(2)
                if r == 1 then
                    t.ion_drive = 1 t.ion_pulse_cannon = 0 else
                    t.ion_drive = 0 t.ion_pulse_cannon = 1
                end
            end
            if t.multi_phased_shields == 1 then
            t.multi_phased_shields = 0
            r = random(2)
                if r == 1 then
                    t.phasor = 1 t.phasor_rifle = 0 else
                    t.phasor = 0 t.phasor_rifle = 1
                end
            end
            if t.hard_shields == 1 then
            t.hard_shields = 0
            r = random(2)
                if r == 1 then
                    t.cloaking_device = 1 t.stasis_field = 0 else
                    t.cloaking_device = 0 t.stasis_field = 1
                end
            end
        end
        set_player_techs(pi, t)
    end

end
