// IW6 GSC SOURCE
// Generated by https://github.com/xensik/gsc-tool

main()
{
    level._effect["vfx_blood_impact_spacebreach"] = loadfx( "vfx/moments/loki/vfx_blood_impact_spacebreach" );
    level._effect["space_headshot_fxnow_02"] = loadfx( "vfx/moments/odin/vfx_blood_impact_head_space_fxnow" );
    level._effect["loki_breach_sparks_02"] = loadfx( "vfx/moments/loki/loki_breach_sparks_02" );
    level._effect["vfx_sparks_blown_slow_02"] = loadfx( "vfx/ambient/sparks/vfx_sparks_blown_slow_02" );
    level._effect["vfx_sparks_blown_slow"] = loadfx( "vfx/ambient/sparks/vfx_sparks_blown_slow" );
    level._effect["loki_rog_trail_close_2_nosound"] = loadfx( "vfx/moments/loki/loki_rog_trail_close_2_nosound" );
    level._effect["loki_breach_sparks"] = loadfx( "vfx/moments/loki/loki_breach_sparks" );
    level._effect["loki_breach_steam_01_flare"] = loadfx( "vfx/moments/loki/loki_breach_steam_01_flare" );
    level._effect["space_death_steam_loop"] = loadfx( "vfx/gameplay/space/space_death_steam_loop" );
    level._effect["spc_explosion_240_nosmk"] = loadfx( "vfx/gameplay/space/spc_explosion_240_nosmk" );
    level._effect["red_light_20_nolight"] = loadfx( "vfx/ambient/lights/red_light_20_nolight" );
    level._effect["interior_shuttle_light"] = loadfx( "vfx/moments/loki/interior_shuttle_light" );
    level._effect["red_light_30_nolight"] = loadfx( "vfx/ambient/lights/red_light_30_nolight" );
    level._effect["interior_shuttle_flare_lights"] = loadfx( "vfx/moments/loki/interior_shuttle_flare_lights" );
    level._effect["vfx_loki_rog_trail"] = loadfx( "vfx/moments/loki/vfx_loki_rog_trail" );
    level._effect["small_building_post_exp"] = loadfx( "vfx/moments/loki/small_building_post_exp" );
    level._effect["vfx_space_gas_leak"] = loadfx( "vfx/moments/loki/vfx_space_gas_leak" );
    level._effect["loki_space_flare_02"] = loadfx( "vfx/moments/loki/loki_space_flare_02" );
    level._effect["vfx_blood_impact_head_space"] = loadfx( "vfx/moments/odin/vfx_blood_impact_head_space" );
    level._effect["vfx_godray_loki_lrg"] = loadfx( "vfx/ambient/lights/vfx_godray_loki_lrg" );
    level._effect["vfx_godray_loki_sm"] = loadfx( "vfx/ambient/lights/vfx_godray_loki_sm" );
    level._effect["vfx_perif_smk_plume_huge_slow_b4_loki"] = loadfx( "vfx/moments/loki/vfx_perif_smk_plume_huge_slow_b4_loki" );
    level._effect["vfx_perif_smk_loki_vista_b4m"] = loadfx( "vfx/moments/loki/vfx_perif_smk_loki_vista_b4m" );
    level._effect["vfx_sparks_sign_ch_02_space_runner"] = loadfx( "vfx/moments/loki/vfx_sparks_sign_ch_02_space_runner" );
    level._effect["spc_shell_casings_moving"] = loadfx( "vfx/ambient/space/spc_shell_casings_moving" );
    level._effect["loki_breach_floating_objects"] = loadfx( "vfx/moments/loki/loki_breach_floating_objects" );
    level._effect["loki_breach_cabin_steam"] = loadfx( "vfx/moments/loki/loki_breach_cabin_steam" );
    level._effect["loki_breach_steam_02"] = loadfx( "vfx/moments/loki/loki_breach_steam_02" );
    level._effect["loki_breach_steam_01"] = loadfx( "vfx/moments/loki/loki_breach_steam_01" );
    level._effect["steam_large_vent_rooftop"] = loadfx( "fx/smoke/steam_large_vent_rooftop" );
    level._effect["loki_breach_explosion"] = loadfx( "vfx/moments/loki/loki_breach_explosion" );
    level._effect["vfx_silo_fuel_explosion"] = loadfx( "vfx/moments/loki/vfx_silo_fuel_explosion" );
    level._effect["vfx_silo_fuel_fire"] = loadfx( "vfx/moments/loki/vfx_silo_fuel_fire" );
    level._effect["vfx_exp_heli_sml_cg_cheap"] = loadfx( "vfx/moments/loki/vfx_exp_heli_sml_cg_cheap" );
    level._effect["loki_jet_destroy_trail"] = loadfx( "vfx/moments/loki/loki_jet_destroy_trail" );
    level._effect["vfx_loki_rog_maintrail"] = loadfx( "vfx/moments/loki/vfx_loki_rog_maintrail" );
    level._effect["vfx_mc_impact_smoke"] = loadfx( "vfx/moments/loki/vfx_mc_impact_smoke" );
    level._effect["vfx_prop_hit_smk_sparks"] = loadfx( "vfx/moments/loki/vfx_prop_hit_smk_sparks" );
    level._effect["vfx_space_debris_directional_short"] = loadfx( "vfx/moments/loki/vfx_space_debris_directional_short" );
    level._effect["vfx_space_impact_debris_med02"] = loadfx( "vfx/moments/loki/vfx_space_impact_debris_med02" );
    level._effect["vfx_sparks_burst_space"] = loadfx( "vfx/ambient/sparks/vfx_sparks_burst_space" );
    level._effect["vfx_fiery_glow_sparks_lrg"] = loadfx( "vfx/moments/loki/vfx_fiery_glow_sparks_lrg" );
    level._effect["loki_dust_mc_end_small"] = loadfx( "vfx/moments/loki/loki_dust_mc_end_small" );
    level._effect["vfx_space_impact_debris_sm"] = loadfx( "vfx/moments/loki/vfx_space_impact_debris_sm" );
    level._effect["vfx_space_dust_poof_med"] = loadfx( "vfx/moments/loki/vfx_space_dust_poof_med" );
    level._effect["vfx_dust_motes_mc_end"] = loadfx( "vfx/moments/loki/vfx_dust_motes_mc_end" );
    level._effect["glow_smoke_highlight"] = loadfx( "vfx/ambient/lights/glow_smoke_highlight" );
    level._effect["loki_dust_mc_end"] = loadfx( "vfx/moments/loki/loki_dust_mc_end" );
    level._effect["vfx_space_impact_debris_hg"] = loadfx( "vfx/moments/loki/vfx_space_impact_debris_hg" );
    level._effect["vfx_impact_sparks_space_runner"] = loadfx( "vfx/moments/loki/vfx_impact_sparks_space_runner" );
    level._effect["vfx_impact_sparks_space"] = loadfx( "vfx/moments/loki/vfx_impact_sparks_space" );
    level._effect["vfx_blood_impact_space_efxnow02"] = loadfx( "vfx/moments/odin/vfx_blood_impact_space_efxnow02" );
    level._effect["vfx_blood_impact_space_efxnow"] = loadfx( "vfx/moments/odin/vfx_blood_impact_space_efxnow" );
    level._effect["vfx_space_impact_debris_lrg_runner"] = loadfx( "vfx/moments/loki/vfx_space_impact_debris_lrg_runner" );
    level._effect["vfx_blood_impact_space_runner"] = loadfx( "vfx/moments/loki/vfx_blood_impact_space_runner" );
    level._effect["vfx_space_impact_debris_close"] = loadfx( "vfx/moments/loki/vfx_space_impact_debris_close" );
    level._effect["spc_fire_puff_big_single_runner"] = loadfx( "vfx/ambient/space/spc_fire_puff_big_single_runner" );
    level._effect["spc_fire_puff_big_single"] = loadfx( "vfx/ambient/space/spc_fire_puff_big_single" );
    level._effect["loki_fuel_ignite_fast_runner"] = loadfx( "vfx/moments/loki/loki_fuel_ignite_fast_runner" );
    level._effect["loki_fuel_ignite_fast"] = loadfx( "vfx/moments/loki/loki_fuel_ignite_fast" );
    level._effect["vfx_space_impact_debris_lrg"] = loadfx( "vfx/moments/loki/vfx_space_impact_debris_lrg" );
    level._effect["vfx_space_debris_directional"] = loadfx( "vfx/moments/loki/vfx_space_debris_directional" );
    level._effect["vfx_space_impact_debris_med"] = loadfx( "vfx/moments/loki/vfx_space_impact_debris_med" );
    level._effect["vfx_sparks_directional"] = loadfx( "vfx/moments/loki/vfx_sparks_directional" );
    level._effect["loki_dust_amb"] = loadfx( "vfx/moments/loki/loki_dust_amb" );
    level._effect["zg_electrical_sparks_big_single_runner_02"] = loadfx( "vfx/ambient/space/zg_electrical_sparks_big_single_runner_02" );
    level._effect["station_piece_collision"] = loadfx( "vfx/moments/odin/station_piece_collision" );
    level._effect["spc_sparks_jet_single_runner"] = loadfx( "vfx/ambient/space/spc_sparks_jet_single_runner" );
    level._effect["spc_shell_casings"] = loadfx( "vfx/ambient/space/spc_shell_casings_moving" );
    level._effect["spc_fire_puff_light"] = loadfx( "vfx/ambient/space/spc_fire_puff_light" );
    level._effect["spc_fire_puff_big_light"] = loadfx( "vfx/ambient/space/spc_fire_puff_big_light" );
    level._effect["spc_explosion_240"] = loadfx( "vfx/gameplay/space/spc_explosion_240" );
    level._effect["spc_explosion_1200"] = loadfx( "vfx/gameplay/space/spc_explosion_1200" );
    level._effect["odin_sat_thrusters_runner"] = loadfx( "vfx/moments/odin/odin_sat_thrusters_runner" );
    level._effect["odin_sat_thrusters_ignite_sporadic"] = loadfx( "vfx/moments/odin/odin_sat_thrusters_ignite_sporadic" );
    level._effect["odin_sat_rcs_fuel_fire"] = loadfx( "vfx/moments/odin/odin_sat_rcs_fuel_fire" );
    level._effect["odin_debris_field_med_runner"] = loadfx( "vfx/moments/odin/odin_debris_field_med_runner" );
    level._effect["odin_debris_field_max_runner"] = loadfx( "vfx/moments/odin/odin_debris_field_max_runner" );
    level._effect["odin_debris_field_low_runner"] = loadfx( "vfx/moments/odin/odin_debris_field_low_runner" );
    level._effect["odin_debris_field_high_runner"] = loadfx( "vfx/moments/odin/odin_debris_field_high_runner" );
    level._effect["odin_airlock_steam"] = loadfx( "vfx/moments/odin/odin_airlock_steam" );
    level._effect["vfx_blood_impact_space"] = loadfx( "vfx/moments/odin/vfx_blood_impact_space" );
    level._effect["circuit_breaker"] = loadfx( "fx/explosions/circuit_breaker" );
    level._effect["vfx_glow_red_light_400_strobe"] = loadfx( "vfx/ambient/lights/vfx_glow_red_light_400_strobe" );
    level._effect["vfx_shuttle_light_left"] = loadfx( "vfx/moments/odin/vfx_shuttle_light_left" );
    level._effect["vfx_shuttle_light_right"] = loadfx( "vfx/moments/odin/vfx_shuttle_light_right" );
    level._effect["vfx_shuttle_manuvr_thrust"] = loadfx( "vfx/moments/odin/vfx_shuttle_manuvr_thrust" );
    level._effect["loki_m880_missile_impact"] = loadfx( "vfx/moments/loki/loki_m880_missile_impact" );
    level._effect["loki_venting_gas_large"] = loadfx( "vfx/moments/loki/loki_venting_gas_large" );
    level._effect["loki_debris_field"] = loadfx( "vfx/moments/loki/loki_debris_field" );
    level._effect["vfx_pre_impact_smk"] = loadfx( "vfx/moments/loki/vfx_pre_impact_smk" );
    level._effect["vfx_fuel_fire_zerog_cglight"] = loadfx( "vfx/moments/loki/vfx_fuel_fire_zerog_cglight" );
    level._effect["vfx_fuel_leak_zerog"] = loadfx( "vfx/moments/loki/vfx_fuel_leak_zerog" );
    level._effect["loki_infil_rog_trail_emit_runner"] = loadfx( "vfx/moments/loki/loki_infil_rog_trail_emit_runner" );
    level._effect["loki_rog_highres_missile"] = loadfx( "vfx/moments/loki/loki_rog_highres_missile" );
    level._effect["vfx_rog_impact_test"] = loadfx( "vfx/moments/loki/vfx_rog_impact_test" );
    level._effect["vfx_scrnfx_space_dust"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_space_dust" );
    level._effect["vfx_scrnfx_fiery_bokeh_flash_01"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_fiery_bokeh_flash_01" );
    level._effect["loki_space_flare_01"] = loadfx( "vfx/moments/loki/loki_space_flare_01" );
    level._effect["fuel_explosion_zerog"] = loadfx( "vfx/moments/loki/fuel_explosion_zerog" );
    level._effect["loki_rog_trail_close_3_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_close_3_emit" );
    level._effect["loki_rog_trail_close_2_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_close_2_emit" );
    level._effect["loki_rog_close_1_missile"] = loadfx( "vfx/moments/loki/loki_rog_close_1_missile" );
    level._effect["loki_rog_trail_close_1_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_close_1_emit" );
    level._effect["loki_rog_trail_infil_1_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_infil_1_emit" );
    level._effect["fuel_sparkfire_zerog_runner"] = loadfx( "vfx/moments/loki/fuel_sparkfire_zerog_runner" );
    level._effect["vfx_fire_burning_zerog"] = loadfx( "vfx/moments/odin/vfx_fire_burning_zerog" );
    level._effect["loki_particulate_player_mov"] = loadfx( "vfx/moments/loki/loki_particulate_player_mov" );
    level._effect["loki_particulate_player_view"] = loadfx( "vfx/moments/loki/loki_particulate_player_view" );
    level._effect["loki_particulate_player"] = loadfx( "vfx/moments/loki/loki_particulate_player" );
    level._effect["loki_sun_flare_01"] = loadfx( "vfx/moments/loki/loki_sun_flare_01" );
    level._effect["loki_decompression_exp1"] = loadfx( "vfx/moments/loki/loki_decompression_exp1" );
    level._effect["electrical_sparks_zerog_runner"] = loadfx( "vfx/moments/odin/electrical_sparks_zerog_runner" );
    level._effect["loki_decompress_fastwind"] = loadfx( "vfx/moments/loki/loki_decompress_fastwind" );
    level._effect["loki_rog_trail_space_8_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_8_emit" );
    level._effect["loki_rog_trail_space_7_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_7_emit" );
    level._effect["loki_rog_trail_space_6_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_6_emit" );
    level._effect["loki_rog_trail_space_5_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_5_emit" );
    level._effect["loki_rog_trail_space_4_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_4_emit" );
    level._effect["loki_rog_trail_space_3_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_3_emit" );
    level._effect["loki_rog_trail_space_2_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_2_emit" );
    level._effect["loki_rog_trail_space_1_emit"] = loadfx( "vfx/moments/loki/loki_rog_trail_space_1_emit" );
    level._effect["thick_black_smoke_lx4"] = loadfx( "fx/smoke/thick_black_smoke_lx4" );
    level._effect["rog_impact_02"] = loadfx( "vfx/moments/loki/rog_impact_02" );
    level._effect["rog_impact_03"] = loadfx( "vfx/moments/loki/rog_impact_03" );
    level._effect["rog_impact_04"] = loadfx( "vfx/moments/loki/rog_impact_04" );
    level._effect["thick_dark_smoke_giant_loki"] = loadfx( "vfx/moments/loki/thick_dark_smoke_giant_loki" );
    level._effect["pistol_muzzleflash"] = loadfx( "vfx/gameplay/muzzle_flashes/ar/vfx_muz_ar_v" );
    level._effect["odin_helmet_glass_shatter"] = loadfx( "vfx/moments/odin/odin_helmet_glass_shatter" );
    level._effect["explosion"] = loadfx( "fx/explosions/space_explosion" );
    level._effect["explosion_small"] = loadfx( "fx/explosions/space_explosion_small" );
    level._effect["sniper_glint"] = loadfx( "fx/misc/scope_glint" );
    level._effect["space_clip_reload_arx"] = loadfx( "vfx/gameplay/space/space_clip_reload_arx" );
    level._effect["steam_small"] = loadfx( "fx/impacts/pipe_steam_small" );
    level._effect["antiair_runner_flak_day_mp"] = loadfx( "fx/misc/antiair_runner_flak_day_mp" );
    level._effect["antiair_single_tracer01_cloudy_loop"] = loadfx( "vfx/moments/satfarm/antiair_single_tracer01_cloudy_loop" );
    level._effect["vfx_perif_smk_war_vista_b4m"] = loadfx( "vfx/ambient/skybox/vfx_perif_smk_war_vista_b4m" );
    level._effect["vfx_perif_smk_plume_huge_slow_b4_02"] = loadfx( "vfx/vfx_perif_smk_plume_huge_slow_b4_02" );
    level._effect["loki_periph_plumes"] = loadfx( "vfx/moments/loki/loki_periph_plumes" );
    level._effect["vfx_sparks_ground_battle_runner"] = loadfx( "vfx/moments/loki/vfx_sparks_ground_battle_runner" );
    level._effect["vfx_smk_sat_ground_battle"] = loadfx( "vfx/moments/loki/vfx_smk_sat_ground_battle" );
    level._effect["vfx_fire_ground_battle_l"] = loadfx( "vfx/moments/loki/vfx_fire_ground_battle_l" );
    level._effect["vfx_fire_ground_battle"] = loadfx( "vfx/moments/loki/vfx_fire_ground_battle" );
    level._effect["vfx_dust_ground_battle"] = loadfx( "vfx/moments/loki/vfx_dust_ground_battle" );
    level._effect["vfx_exp_ground_battle"] = loadfx( "vfx/moments/loki/vfx_exp_ground_battle" );
    level._effect["vfx_vista_ground_battle"] = loadfx( "vfx/moments/loki/vfx_vista_ground_battle" );
    level._effect["vfx_mantis_exp_lrg"] = loadfx( "vfx/gameplay/explosions/vfx_mantis_exp_lrg" );
    level._effect["loki_rog_trail_side_01"] = loadfx( "vfx/moments/loki/loki_rog_trail_side_01" );
    level._effect["ROG_single_geotrail"] = loadfx( "vfx/moments/loki/vfx_loki_rog_trail" );
    level._effect["ROG_single_geotrail_light"] = loadfx( "fx/smoke/smoke_geotrail_hellfire_cheap" );
    level._effect["ROG_single_explosion"] = loadfx( "fx/explosions/bomb_explosion_large_ac130" );
    level._effect["ROG_cam_static"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_snakecam_static" );
    level._effect["thick_dark_smoke_giant_paris"] = loadfx( "fx/smoke/thick_dark_smoke_giant_paris" );
    level._effect["field_fire_smolder_500x500"] = loadfx( "fx/fire/field_fire_smolder_500x500" );
    level._effect["thick_black_smoke_l"] = loadfx( "fx/smoke/thick_black_smoke_lx4" );
    level._effect["shockwave"] = loadfx( "vfx/moments/black_ice/vfx_exfil_xplosion_shockwave" );
    level._effect["explosion_01"] = loadfx( "vfx/moments/loki/vfx_large_bomb_hit" );
    level._effect["smoke_01"] = loadfx( "vfx/moments/odin/rog_smoke_odin" );
    level._effect["shockwave_02"] = loadfx( "vfx/moments/loki/vfx_rog_shockwave_loki" );
    level._effect["vfx_rog_ground_shock_loc"] = loadfx( "vfx/moments/loki/vfx_rog_ground_shock_loc" );
    level._effect["vfx_rog_thrownpiece_smoke"] = loadfx( "vfx/moments/loki/vfx_rog_thrownpiece_smoke" );
    level._effect["smoke_geotrail_missile_large"] = loadfx( "vfx/moments/loki/battle_smoke_geotrail_missile_cheap" );
    level._effect["smoke_geotrail_missile_large_reverse"] = loadfx( "fx/temp/smoke_geotrail_missile_large_reverse" );
    level._effect["tank_blast_sand"] = loadfx( "fx/explosions/tank_impact_sand_cheap" );
    level._effect["building_collapse_01"] = loadfx( "fx/explosions/cave_mouth_wall_blast_rescue" );
    level._effect["building_collapse_02"] = loadfx( "fx/explosions/cave_mouth_wall_blast_rescue" );
    level._effect["building_collapse_01"] = loadfx( "fx/dust/building_collapse_nyharbor" );
    level._effect["building_collapse_blast_01"] = loadfx( "fx/maps/ny_harbor/ny_harbor_buildingchunkfall" );
    level._effect["building_nuke_flash"] = loadfx( "fx/dust/building_collapse_nuke" );
    level._effect["building_blast"] = loadfx( "vfx/moments/loki/loki_medium_explosion" );
    level._effect["space_jet_small"] = loadfx( "vfx/gameplay/space/space_jet_small" );
    level._effect["antiair_runner_flak"] = loadfx( "fx/misc/antiair_runner_flak" );
    level._effect["battle_contrail"] = loadfx( "vfx/moments/loki/battle_contrail" );
    level._effect["target_explosion_tank"] = loadfx( "fx/explosions/vehicle_tank_explosion" );
    level._effect["abrams_flash_wv_no_tracer"] = loadfx( "fx/muzzleflashes/abrams_flash_wv_no_tracer" );
    level._effect["tank_fire_ground_dust"] = loadfx( "vfx/moments/flood/tank_fire_ground_dust" );
    level._effect["missile_trail"] = loadfx( "fx/smoke/smoke_geotrail_javelin" );
    level._effect["loki_rog_jet_explosion_death"] = loadfx( "vfx/moments/loki/loki_rog_jet_explosion_death" );
    level._effect["loki_rog_spaceport_center_explosion"] = loadfx( "vfx/moments/loki/loki_rog_spaceport_center_explosion" );
    level._effect["loki_rog_rocket_scaffolding_explosion"] = loadfx( "vfx/moments/loki/loki_rog_rocket_scaffolding_explosion" );
    level._effect["building_crumble_directional"] = loadfx( "vfx/moments/loki/building_crumble_directional" );
    level._effect["loki_rog_satellite_dish_explosion"] = loadfx( "fx/explosions/loki_rog_satellite_dish_explosion" );
    level._effect["loki_rog_satellite_dish_perimeter_hit"] = loadfx( "fx/explosions/loki_rog_satellite_dish_perimeter_hit" );
    level._effect["loki_rog_spaceport_center_perimeter_hit"] = loadfx( "vfx/moments/loki/loki_rog_spaceport_center_perimeter_hit" );
    level._effect["loki_rog_rocket_scaffolding_perimeter_hit"] = loadfx( "vfx/moments/loki/loki_rog_rocket_scaffolding_perimeter_hit" );
    level._effect["vfx_scrnfx_loki_helmet"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_loki_helmet" );
    level._effect["vfx_scrnfx_space_helmet_dmg_lts"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_space_helmet_dmg_lts" );

    if ( !getdvarint( "r_reflectionProbeGenerate" ) )
    {
        maps\createfx\loki_fx::main();
        maps\createfx\loki_sound::main();
    }

    thread blue_flare();
    maps\_utility::setsaveddvar_cg_ng( "fx_alphathreshold", 9, 2 );
    thread loki_default_lighting_setup();
    level.player.helmet_show_damage = 0;
    thread fx_setup_mask();
    thread helmet_damage();

    if ( maps\_utility::is_gen4() )
        setsaveddvar( "r_mbEnable", 0 );

    setsaveddvar( "actor_spaceLightingOffset", -6 );
}

fx_setup_mask()
{
    for (;;)
    {
        if ( isdefined( level.player ) )
        {
            fx_helmet_mask_on();
            break;
        }
    }
}

fx_helmet_mask_on()
{
    if ( isdefined( level.helmet_mask_fx ) )
        level.helmet_mask_fx delete();

    level.helmet_mask_fx = spawnfx( level._effect["vfx_scrnfx_loki_helmet"], level.player.origin );
    triggerfx( level.helmet_mask_fx );
}

fx_helmet_mask_off()
{
    if ( isdefined( level.helmet_mask_fx ) )
        level.helmet_mask_fx delete();
}

helmet_damage()
{
    for (;;)
    {
        if ( level.player.helmet_show_damage )
        {
            playfx( level._effect["vfx_scrnfx_space_helmet_dmg_lts"], level.player.origin );
            wait 0.75;
        }

        common_scripts\utility::waitframe();
    }
}

helmet_damage_test()
{
    for (;;)
    {
        wait( randomfloatrange( 0.5, 4.0 ) );
        level.player.helmet_show_damage = 1;
    }
}

rog_cam_fx()
{
    create_view_particle_source();
    playfxontag( level._effect["ROG_cam_static"], level.view_particle_source, "tag_origin" );
}

spacedust_cam_fx()
{
    create_view_particle_source();
    playfxontag( level._effect["vfx_scrnfx_space_dust"], level.view_particle_source, "tag_origin" );
}

create_view_particle_source()
{
    if ( !isdefined( level.view_particle_source ) )
    {
        level.view_particle_source = spawn( "script_model", ( 0, 0, 0 ) );
        level.view_particle_source setmodel( "tag_origin" );
        level.view_particle_source.origin = level.player.origin;
        level.view_particle_source linktoplayerview( level.player, "tag_origin", ( 0, 0, 0 ), ( 0, 0, 0 ), 1 );
    }
}

fx_rog_satelittes_firing_c1()
{
    while ( !common_scripts\utility::flag( "explosion" ) )
    {
        wait 5;
        common_scripts\utility::exploder( "01" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "06" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "08" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "04" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "02" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "07" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "05" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "03" );
        wait( randomintrange( 1, 4 ) );
    }

    maps\_utility::delete_exploder( "01" );
    maps\_utility::delete_exploder( "06" );
    maps\_utility::delete_exploder( "08" );
    maps\_utility::delete_exploder( "04" );
    maps\_utility::delete_exploder( "02" );
    maps\_utility::delete_exploder( "07" );
    maps\_utility::delete_exploder( "05" );
    maps\_utility::delete_exploder( "03" );
}

fx_rog_satelittes_firing_c2()
{
    while ( !common_scripts\utility::flag( "turn_off_rogs" ) )
    {
        wait 1;
        common_scripts\utility::exploder( "c2_01" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "c2_06" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "c2_08" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "c2_04" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "c2_02" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "c2_07" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "c2_05" );
        wait( randomintrange( 1, 4 ) );
        common_scripts\utility::exploder( "c2_03" );
        wait( randomintrange( 1, 4 ) );
    }

    maps\_utility::delete_exploder( "c2_01" );
    maps\_utility::delete_exploder( "c2_06" );
    maps\_utility::delete_exploder( "c2_08" );
    maps\_utility::delete_exploder( "c2_04" );
    maps\_utility::delete_exploder( "c2_02" );
    maps\_utility::delete_exploder( "c2_07" );
    maps\_utility::delete_exploder( "c2_05" );
    maps\_utility::delete_exploder( "c2_03" );
}

loki_space_particulates()
{
    level endon( "space_breach_vo_done" );
    wait 15;
    thread loki_space_particulates_while_moving();

    for (;;)
    {
        var_0 = anglestoforward( level.player.angles ) * 96;
        playfx( common_scripts\utility::getfx( "loki_particulate_player" ), level.player.origin + var_0 );
        playfx( common_scripts\utility::getfx( "loki_particulate_player_view" ), level.player.origin + var_0 );
        wait 0.6;
    }
}

blue_flare()
{
    wait 18;
    common_scripts\utility::exploder( "blue_flare" );
}

loki_space_particulates_while_moving()
{
    level endon( "stop_particulates" );

    for (;;)
    {
        var_0 = level.player.origin;
        wait 0.1;

        if ( distance( var_0, level.player.origin ) > 1 )
        {
            var_1 = vectortoangles( level.player.origin - var_0 );
            var_2 = anglestoforward( var_1 ) * 256;
            playfx( common_scripts\utility::getfx( "loki_particulate_player_mov" ), level.player.origin + var_2 );
        }
    }
}

fx_infil_rog()
{
    wait 2.3;
    var_0 = common_scripts\utility::getstruct( "sat_missle_01", "targetname" );
    var_1 = common_scripts\utility::getstruct( "sat_missle_02", "targetname" );
    var_2 = common_scripts\utility::getstruct( "sat_missle_03", "targetname" );
    var_3 = common_scripts\utility::getstruct( "sat_missle_04", "targetname" );
    var_4 = common_scripts\utility::getstruct( "sat_missle_06", "targetname" );
    var_5 = common_scripts\utility::getstruct( "sat_missle_05", "targetname" );
    playfx( common_scripts\utility::getfx( "loki_rog_highres_missile" ), var_0.origin, ( -1, 0, 0 ) );
    playfx( common_scripts\utility::getfx( "loki_rog_highres_missile" ), var_1.origin, ( -1, 0, 0 ) );
    playfx( common_scripts\utility::getfx( "loki_rog_highres_missile" ), var_2.origin, ( -1, 0, 0 ) );
    playfx( common_scripts\utility::getfx( "loki_rog_highres_missile" ), var_3.origin, ( -1, 0, 0 ) );
    playfx( common_scripts\utility::getfx( "loki_rog_highres_missile" ), var_4.origin, ( -1, 0, 0 ) );
    playfx( common_scripts\utility::getfx( "loki_infil_rog_trail_emit_runner" ), var_5.origin, ( -1, 0, 0 ) );
}

fx_rog_satelittes_close_01()
{
    wait 22;
    var_0 = getentarray( "rog_sats_close_01", "targetname" );
    common_scripts\utility::array_thread( var_0, ::fx_rog_satelittes_fire_fx_close, 19, 10, 25, "loki_rog_close_1_missile", "loki_rog_trail_close_1_emit", "explosion" );
}

fx_rog_satelittes_close_02()
{
    var_0 = getentarray( "rog_sats_close_02", "targetname" );
    common_scripts\utility::array_thread( var_0, ::fx_rog_satelittes_fire_fx_close, 3, 8, 20, "loki_rog_close_1_missile", "loki_rog_trail_close_2_emit", "explosion" );
}

fx_rog_satelittes_close_03()
{
    var_0 = getentarray( "rog_sats_close_03", "targetname" );
    common_scripts\utility::array_thread( var_0, ::fx_rog_satelittes_fire_fx_close, 3, 8, 25, "loki_rog_close_1_missile", "loki_rog_trail_close_3_emit", "explosion" );
}

fx_c2_rog_satelittes_close_01()
{
    var_0 = getentarray( "rog_c2_sats_close_01", "targetname" );
    common_scripts\utility::array_thread( var_0, ::fx_rog_satelittes_fire_fx_close, 3, 10, 25, "loki_rog_close_1_missile", "loki_rog_trail_close_3_emit", "stop_close_rogs" );
}

fx_rog_satelittes_fire_fx_close( var_0, var_1, var_2, var_3, var_4, var_5 )
{
    level endon( var_5 );
    var_6 = [ 0, 1, 2, 3, 4, 5 ];
    var_7 = common_scripts\utility::array_randomize( var_6 );
    wait 0.1;

    for (;;)
    {
        for ( var_8 = 0; var_8 < 6; var_8++ )
        {
            var_9 = "tag_rogfx_0" + var_7[var_8];
            playfxontag( common_scripts\utility::getfx( "loki_rog_close_1_missile" ), self, var_9 );
            common_scripts\utility::waitframe();
        }

        wait( var_0 );

        for ( var_8 = 0; var_8 < 6; var_8++ )
        {
            var_9 = "tag_rogfx_0" + var_7[var_8];
            killfxontag( common_scripts\utility::getfx( "loki_rog_close_1_missile" ), self, var_9 );
            playfxontag( common_scripts\utility::getfx( "loki_rog_trail_close_2_emit" ), self, var_9 );
            wait( randomintrange( var_1, var_2 ) );
        }

        while ( maps\_utility::player_looking_at( self.origin, 0.5, 1 ) )
        {
            thread maps\loki_util::jkupoint( self.origin, 360, undefined, 1 );
            common_scripts\utility::waitframe();
        }
    }
}

fx_rog_amb_exp()
{
    wait 11;
    common_scripts\utility::exploder( "rog_amb_exp" );
}

set_motionblur()
{
    if ( maps\_utility::is_gen4() )
    {
        setsaveddvar( "r_mbEnable", 2 );
        setsaveddvar( "r_mbFastEnable", 1 );
        setsaveddvar( "r_mbFastPreset", 2 );
        setsaveddvar( "r_mbCameraRotationInfluence", 1.0 );
        setsaveddvar( "r_mbCameraTranslationInfluence", 5.0 );
        setsaveddvar( "r_mbModelVelocityScalar", 1.0 );
        setsaveddvar( "r_mbStaticVelocityScalar", 0.5 );
        setsaveddvar( "r_mbViewModelEnable", 1 );
        setsaveddvar( "r_mbViewModelVelocityScalar", 0.004 );
    }

    setsaveddvar( "actor_spaceLightingOffset", -6 );
}

light_rog_threads()
{
    thread rog_vision_set();
}

rog_vision_set()
{
    maps\_utility::vision_set_fog_changes( "loki_rog", 0 );
    setsaveddvar( "sm_sunSampleSizeNear", 2.5 );
    wait 4;
    setsaveddvar( "sm_sunSampleSizeNear", 25.0 );
}

loki_infil_lighting()
{
    maps\_utility::vision_set_fog_changes( "loki_infil", 1 );
}

platform_specific_shadow_settings()
{
    if ( level.ps3 )
    {
        setsaveddvar( "sm_sunShadowScale", 0.6 );
        setsaveddvar( "sm_sunSampleSizeNear", 0.311106 );
    }
    else if ( level.xenon )
    {
        setsaveddvar( "sm_sunShadowScale", 0.7071 );
        setsaveddvar( "sm_sunSampleSizeNear", 0.5 );
    }
}

loki_default_lighting_lerp_setup()
{
    maps\_utility::vision_set_fog_changes( "loki", 3.5 );
    setsaveddvar( "sm_sunSampleSizeNear", 0.75 );
    platform_specific_shadow_settings();
}

loki_default_lighting_setup()
{
    maps\_utility::vision_set_fog_changes( "loki", 0 );
    setsaveddvar( "sm_sunSampleSizeNear", 0.75 );
    platform_specific_shadow_settings();
}

loki_breach_lighting()
{
    maps\_utility::vision_set_fog_changes( "loki_breach", 0.7 );
}

loki_ending_lighting()
{
    maps\_utility::vision_set_fog_changes( "loki_ending", 0 );
}

light_combat2_threads()
{
    maps\_utility::vision_set_fog_changes( "loki_combat2", 0 );
    var_0 = spawn( "script_model", ( 34826, -1806.5, 2741.8 ) );
    var_1 = spawn( "script_model", ( -31726.6, -9076, 21972 ) );
    common_scripts\utility::waitframe();
    var_2 = getentarray( "controlroomdome", "targetname" );
    var_2[0] retargetscriptmodellighting( var_0 );
    var_2[1] retargetscriptmodellighting( var_1 );
}

fx_debri_combat_one()
{
    level endon( "end_of_combat_two" );

    for (;;)
    {
        var_0 = level.player.origin;
        wait 0.1;

        if ( distance( var_0, level.player.origin ) > 1 )
        {
            var_1 = vectortoangles( level.player.origin - var_0 );
            var_2 = anglestoforward( var_1 ) * 256;
            playfx( common_scripts\utility::getfx( "loki_debris_field" ), level.player.origin + var_2 );
        }
    }
}

ending_white_fade( var_0, var_1, var_2 )
{
    var_3 = maps\_hud_util::create_client_overlay( "white", 0, level.player );

    if ( var_0 > 0 )
        var_3 fadeovertime( var_0 );

    var_3.alpha = 0.75;
    wait( var_0 );
    wait( var_1 );

    if ( var_2 > 0 )
        var_3 fadeovertime( var_2 );

    var_3.alpha = 0;
    wait( var_2 );
    var_3 destroy();
}

fx_space_breach()
{
    common_scripts\utility::exploder( "be_exp" );
    wait 0.2;
    common_scripts\utility::exploder( "be_stm_01" );
    wait 0.8;
    common_scripts\utility::exploder( "be_stm_02" );
    wait 0.6;
    common_scripts\utility::exploder( "be_inside" );
    wait 5;
    common_scripts\utility::exploder( "sb_floaters" );
}

fx_fuel_explosion_pre_fx()
{
    common_scripts\utility::exploder( "fuel_exp_jet_01" );
    common_scripts\utility::exploder( "fuel_exp_01" );
    wait 0.3;
    common_scripts\utility::exploder( "fuel_exp_jet_02" );
    wait 0.1;
    maps\_utility::stop_exploder( "fuel_exp_jet_01" );
    wait 0.2;
    maps\_utility::stop_exploder( "fuel_exp_jet_02" );
}

ai_space_headshot_death_fxnow()
{
    if ( self.damagelocation == "head" || self.damagelocation == "neck" )
    {
        iprintlnbold( "headshot death" );

        if ( self.model == "us_space_assault_a_body" || self.model == "us_space_assault_b_body" || self.model == "body_fed_space_assault_a" || self.model == "body_fed_space_assault_b" )
        {
            playfxontag( common_scripts\utility::getfx( "space_headshot_fxnow_02" ), self, "J_Head" );
            self setmodel( self.model + "_cracked" );

            if ( gettimescale() < 0.5 )
                self playsound( "space_npc_helmet_shatter_slomo" );
            else
                self playsound( "space_npc_helmet_shatter" );
        }
    }
}
