;---------------------------------------------------
; Filters out a troll button in adminroom
;---------------------------------------------------
filter:
{
    "targetname" "cao_ni_ma"
    "origin" "332.35 8760.5 -2554.9"
    "classname" "func_button"
}

;---------------------------------------------------
; Adds maploadout for the stripperable items
;---------------------------------------------------
add:
{
    "origin" "-6544 -14240 3336"
    "weapon_p90" "1"
    "weapon_hegrenade" "1"
    "weapon_elite" "1"
    "item_assaultsuit" "1"
    "targetname" "map_loadout_items"
    "spawnflags" "1"
    "classname" "game_player_equip"
}

;---------------------------------
; Gives red guy guns and shit
;---------------------------------
modify:
{
    match:
    {
        "origin" "-2694.68 8953.28 -3662.21"
        "targetname" "red_knife"
        "classname" "weapon_knife"
    }
    insert:
    {
        "OnPlayerPickup" "map_loadout_items,USE,,0,1"
    }
}

;---------------------------------
; Gives blue guy guns and shit
;---------------------------------
modify:
{
    match:
    {
        "origin" "-2693.52 8828.1 -3662.21"
        "targetname" "blue_knife"
        "classname" "weapon_knife"
    }
    insert:
    {
        "OnPlayerPickup" "map_loadout_items,USE,,0,1"
    }
}

;---------------------------------
; Gives fang guy guns and shit
;---------------------------------
modify:
{
    match:
    {
        "origin" "-2370.03 8903.27 -3638.21"
        "targetname" "fang_knife"
        "classname" "weapon_knife"
    }
    insert:
    {
        "OnPlayerPickup" "map_loadout_items,USE,,0,1"
    }
}

;---------------------------------
; Removes HP Add for final trigs
;---------------------------------
modify:
{
	match:
	{
        "targetname" "finale_zm_hurt"
        "origin" "4004 -8053.5 13684.5"
        "classname" "trigger_hurt"
	}
	Delete:
	{
        "OnStartTouch" "gaza_counter,Add,50,0,-1"
	}
}
modify:
{
	match:
	{
        "targetname" "finale_ct_hurt"
        "origin" "4004 -10175.5 13684.5"
        "classname" "trigger_hurt"
	}
	Delete:
	{
        "OnStartTouch" "gaza_counter,Add,50,0,-1"
	}
}


;-----------------------------------------------------------------------------------------
; Removes trigger hurt for red guy and fixes him getting killed and restting dmg filter
;-----------------------------------------------------------------------------------------
modify:
{
    match:
    {
        "targetname" "red_reset_damagefilter"
        "origin" "-2688.65 8954.01 -3683.77"
        "classname" "trigger_once"
    }
    replace:
    {
        "filtername" "filter_red_item"
    }
}
modify:
{
    match:
    {
        "targetname" "red_item_hurt_user"
        "origin" "-2689.15 8954.01 -3673.43"
        "classname" "trigger_hurt"
    }
    replace:
    {
        "filtername" "filter_red_item"
    }
}
modify:
{
	match:
	{
        "origin" "-2694.68 8953.28 -3662.21"
        "targetname" "red_knife"
        "classname" "weapon_knife"
	}
    delete:
	{
        "OnPlayerPickup" "filter_red_item,TestActivator,,0,-1"
	}
    insert:
	{
        "OnPlayerPickup" "!activator,addoutput,targetname red_item_filter_guy,0,-1"
	}
}
modify:
{
	match:
	{
        "targetname" "red_item_hitbox"
        "origin" "-2691.65 8954.01 -3627.6"
        "classname" "func_physbox_multiplayer"
	}
    delete:
	{
        "OnBreak" "red_item_hurt_user,Enable,,0.2,1"
	}
    insert:
	{
        "OnBreak" "red_item_hurt_user,Enable,,0.1,1"
        "OnBreak" "red_item_hurt_user,Kill,,0.2,1"
	}
}

;-------------------------------------------------------------------------------------------
; Removes trigger hurt for blue guy and fixes him getting killed and restting dmg filter
;-------------------------------------------------------------------------------------------
modify:
{
    match:
    {
        "targetname" "blue_reset_damagefilter"
        "origin" "-2687.65 8829.01 -3683.77"
        "classname" "trigger_once"
    }
    replace:
    {
        "filtername" "filter_blue_item"
    }
}
modify:
{
    match:
    {
        "targetname" "blue_item_hurt_user"
        "origin" "-2688.15 8828.01 -3646.8"
        "classname" "trigger_hurt"
    }
    replace:
    {
        "filtername" "filter_blue_item"
    }
}
modify:
{
	match:
	{
        "origin" "-2693.52 8828.1 -3662.21"
        "targetname" "blue_knife"
        "classname" "weapon_knife"
	}
    delete:
	{
        "OnPlayerPickup" "filter_blue_item,TestActivator,,0,-1"
	}
    insert:
	{
        "OnPlayerPickup" "!activator,addoutput,targetname blue_item_filter_guy,0,-1"
	}
}
modify:
{
	match:
	{
        "targetname" "blue_item_hitbox"
        "origin" "-2691.65 8828 -3628.61"
        "classname" "func_physbox_multiplayer"
	}
    delete:
	{
        "OnBreak" "blue_item_hurt_user,Enable,,0.2,1"
	}
    insert:
	{
        "OnBreak" "blue_item_hurt_user,Enable,,0.1,1"
        "OnBreak" "blue_item_hurt_user,Kill,,0.2,1"
	}
}

;-------------------------------------------------------------------------------------------
; Removes trigger hurt for fang guy and fixes him getting killed and restting dmg filter
;-------------------------------------------------------------------------------------------
modify:
{
    match:
    {
        "targetname" "fang_item_melee_flame_trigger"
        "origin" "-2245.97 8906 -3594.12"
        "classname" "trigger_hurt"
    }
    insert:
    {
        "OnHurtPlayer" "!activator,ignitelifetime,1,0,-1"
    }
}
modify:
{
    match:
    {
        "targetname" "fang_item_flame_hurt"
        "origin" "-2237.98 8903 -3578.11"
        "classname" "trigger_hurt"
    }
    insert:
    {
        "OnHurtPlayer" "!activator,ignitelifetime,1,0,-1"
    }
}
modify:
{
    match:
    {
        "targetname" "fang_item_strip"
        "origin" "-2364.45 8903.97 -3635.79"
        "classname" "trigger_once"
    }
    insert:
    {
        "filtername" "MapFilterCT"
    }
}
modify:
{
    match:
    {
        "targetname" "fang_push_forward"
        "origin" "-2363.99 8904.02 -3623.79"
        "classname" "trigger_push"
    }
    replace:
    {
        "filtername" "filter_fang_item"
    }
}
modify:
{
    match:
    {
        "targetname" "fang_reset_damagefilter"
        "origin" "-2364 8904 -3659.77"
        "classname" "trigger_once"
    }
    replace:
    {
        "filtername" "filter_fang_item"
    }
}
modify:
{
    match:
    {
        "targetname" "fang_item_hurt_user"
        "origin" "-2372.5 8904 -3637.43"
        "classname" "trigger_hurt"
    }
    replace:
    {
        "filtername" "filter_fang_item"
    }
}
modify:
{
	match:
	{
        "origin" "-2370.03 8903.27 -3638.21"
        "targetname" "fang_knife"
        "classname" "weapon_knife"
	}
    delete:
	{
        "OnPlayerPickup" "filter_fang_item,TestActivator,,0,-1"
	}
    insert:
	{
        "OnPlayerPickup" "!activator,addoutput,targetname fang_item_filter_guy,0,-1"
	}
}
modify:
{
	match:
	{
        "targetname" "fang_item_hitbox"
        "origin" "-2367 8904 -3603.6"
        "classname" "func_physbox_multiplayer"
	}
    delete:
	{
        "OnBreak" "fang_item_hurt_user,Enable,,0.2,1"
	}
    insert:
	{
        "OnBreak" "fang_item_hurt_user,Enable,,0.1,1"
        "OnBreak" "fang_item_hurt_user,Kill,,0.2,1"
	}
}



;----------------
; Wallboss fixes
;----------------
modify:
{
	match:
	{
        "targetname" "s1_facility_bridge"
        "origin" "3240 520 4307"
        "classname" "func_movelinear"
	}
    insert:
	{
        "OnFullyOpen" "wallboss_addhealth,Enable,,0.2,1"
	}
}
  
modify:
{
	match:
	{
        "targetname" "wallboss_weakspot2_breakable"
        "origin" "3048 2672 4520"
        "classname" "func_breakable"
	}
    insert:
	{
        "damagefilter" "Filter_Nada"
	}
}

modify:
{
	match:
	{
        "targetname" "wallboss_weakspot3_breakable"
        "origin" "3240 2672 4520"
        "classname" "func_breakable"
	}
    insert:
	{
        "damagefilter" "Filter_Nada"
	}
}

modify:
{
	match:
	{
        "targetname" "wallboss_weakspot4_breakable"
        "origin" "3432 2672 4520"
        "classname" "func_breakable"
	}
    insert:
	{
        "damagefilter" "Filter_Nada"
	}
}

modify:
{
	match:
	{
        "targetname" "wallboss_weakspot1_breakable"
        "origin" "3240 2672 4712"
        "classname" "func_breakable"
	}
    insert:
	{
        "damagefilter" "Filter_Nada"
	}
}


modify:
{
	match:
	{
        "targetname" "wallboss_mainbody"
        "origin" "3240 2816 4680"
        "classname" "func_door"
	}
    insert:
	{
        "OnUser1" "wallboss_weakspot1_breakable,SetDamageFilter,,2,-1"
        "OnUser1" "wallboss_weakspot2_breakable,SetDamageFilter,,2,-1"
        "OnUser1" "wallboss_weakspot3_breakable,SetDamageFilter,,2,-1"
        "OnUser1" "wallboss_weakspot4_breakable,SetDamageFilter,,2,-1"
	}
}



;----------------
; Lowers first miniboss hp
;----------------
modify:
{
	match:
	{
        "targetname" "miniboss1_hp_add_trigger"
        "origin" "-4864 -6624 2022.5"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "Boss_HealthBackup,Add,80,0,-1"
        "OnStartTouch" "Boss_Health,Add,80,0,-1"
        "OnStartTouch" "miniboss1_math,Add,80,0,-1"
	}
    insert:
	{
        "OnStartTouch" "Boss_HealthBackup,Add,45,0,-1"
        "OnStartTouch" "Boss_Health,Add,45,0,-1"
        "OnStartTouch" "miniboss1_math,Add,45,0,-1"
	}
}

;----------------
; Lowers last boss hp
;----------------
modify:
{
	match:
	{
        "targetname" "final_boss_hp_add_trigger"
        "origin" "-12594.5 -156 -6063"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "finalboss_HealthBackup,Add,100,0,-1"
        "OnStartTouch" "final_Health,Add,100,0,-1"
        "OnStartTouch" "minifinal1_math,Add,100,0,-1"
	}
    insert:
	{
        "OnStartTouch" "finalboss_HealthBackup,Add,60,0,-1"
        "OnStartTouch" "final_Health,Add,60,0,-1"
        "OnStartTouch" "minifinal1_math,Add,60,0,-1"
	}
}


;----------------
; Escape pod door now force closes
;----------------
modify:
{
	match:
	{
        "targetname" "s3_pod_door"
        "origin" "15370.9 -9024 -4144"
        "classname" "func_movelinear"
	}
    replace:
	{
        "blockdamage" "99999"
	}
}


;----------------
; Fixes duoboss not getting hp added properly
;----------------
modify:
{
	match:
	{
        "targetname" "s2_before_terminator_door"
        "origin" "-2496 14773 6860"
        "classname" "func_movelinear"
	}
    delete:
	{
        "OnFullyClosed" "duoboss_adder,Enable,,0,1"
	}
}

modify:
{
	match:
	{
        "targetname" "s2_duoboss_sprite_dormant_door"
        "origin" "-1152 14752 7376"
        "classname" "func_door"
	}
    insert:
	{
        "OnFullyClosed" "duoboss_adder,Enable,,0.02,1"
	}
}
  
;----------------
; Enables floor exploding trigger faster in stage 2 for better balancing
;----------------
modify:
{
	match:
	{
        
        "origin" "-9599.5 -7048 -1835"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "s2_explosion_particle,Start,,20,1"
        "OnStartTouch" "s2_explosion_particle,Stop,,22,1"
        "OnStartTouch" "s2_floor_break,Break,,20,1"
        "OnStartTouch" "sound_explosion3,PlaySound,,20,1"
        "OnStartTouch" "console,Command,say *** FALL BACK! ***,20,1"
	}
    insert:
	{
        "OnStartTouch" "s2_explosion_particle,Start,,5,1"
        "OnStartTouch" "s2_explosion_particle,Stop,,7,1"
        "OnStartTouch" "s2_floor_break,Break,,5,1"
        "OnStartTouch" "sound_explosion3,PlaySound,,5,1"
        "OnStartTouch" "console,Command,say *** FALL BACK! ***,5,1"
        "OnStartTouch" "zmsewerpush,Enable,,5,1"
        "OnStartTouch" "zmsewerpush,Disable,,20,1"
	}
}

;----------------------
; Increases Spidal fire
;----------------------

modify:
{
	match:
	{
        "targetname" "Guard_Boss_Particle_Fire_Hurt"
        "origin" "332 7243.5 -2580.49"
        "classname" "trigger_hurt"
	}
    replace:
	{
        "damage" "80"
	}
}
  

;----------------
; Nerf Heal Item
;----------------

modify:
{
	match:
	{
        "targetname" "Item_heart_crystal_trigger"
        "origin" "-2265.94 11015.1 13247.5"
        "classname" "trigger_hurt"
	}
    delete:
	{
        "OnStartTouch" "!activator,AddOutput,max_health 250,0,-1"
	}
    insert:
	{
        "OnStartTouch" "!activator,AddOutput,max_health 180,0,-1"
	}
}


;---------------------------
; Reduce door timer to spidal
;---------------------------

modify:
{
	match:
	{
        "origin" "-694 2514 6698.57"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "console,Command,say *** DOOR OPENS IN 20 SECONDS ***,0,1"
        "OnStartTouch" "s1_facilitydoor12,Open,,20,1"
	}
    insert:
	{
        "OnStartTouch" "console,Command,say *** DOOR OPENS IN 5 SECONDS ***,0,1"
        "OnStartTouch" "s1_facilitydoor12,Open,,5,1"
	}
}

;--------------------------------
; Increase Duoboss health scaling
;--------------------------------

modify:
{
	match:
	{
        "targetname" "duoboss_adder"
        "origin" "-794.5 14768.5 6724"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "duoboss_red_health,Add,50,0,-1"
	}
    insert:
	{
        "OnStartTouch" "duoboss_red_health,Add,85,0,-1"
	}
}

modify:
{
	match:
	{
        "targetname" "duoboss_adder"
        "origin" "-794.5 14768.5 6724"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "duoboss_blue_health,Add,50,0,-1"
	}
    insert:
	{
        "OnStartTouch" "duoboss_blue_health,Add,85,0,-1"
	}
}

;-----------------------------------
; Increase Terminator health scaling
;-----------------------------------

modify:
{
	match:
	{
        "targetname" "s2_termiboss_hp_adder"
        "origin" "-810 14704 7217"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "minitermiboss1_math,Add,140,0,-1"
        "OnStartTouch" "termiboss_Health,Add,140,0,-1"
        "OnStartTouch" "termiboss_HealthBackup,Add,140,0,-1"
	}
    insert:
	{
        "OnStartTouch" "minitermiboss1_math,Add,165,0,-1"
        "OnStartTouch" "termiboss_Health,Add,165,0,-1"
        "OnStartTouch" "termiboss_HealthBackup,Add,165,0,-1"
	}
}

;---------------------
; Buff Terminator boss
;---------------------

modify:
{
	match:
	{
        "targetname" "terminatorboss_boss_firebreath_hurt"
        "origin" "-1276.54 14775.7 7522"
        "classname" "trigger_hurt"
	}
    replace:
	{
        "damage" "75"
	}
}

modify:
{
	match:
	{
        "targetname" "termiboss_homingbeam1_hurt"
        "origin" "714 14972.6 7776.04"
        "classname" "trigger_hurt"
	}
    replace:
	{
        "damage" "50"
	}
}

modify:
{
	match:
	{
        "targetname" "termiboss_homingbeam2_hurt"
        "origin" "714 14636.6 7776.04"
        "classname" "trigger_hurt"
	}
    replace:
	{
        "damage" "50"
	}
}

modify:
{
	match:
	{
        "targetname" "termiboss_bomb_hurt"
        "origin" "-342.5 14770 6666"
        "classname" "trigger_hurt"
	}
    replace:
	{
        "damage" "80"
	}
}

modify:
{
	match:
	{
        "targetname" "termiboss_fire_aimtarget"
        "origin" "227.46 14783.7 6722"
        "classname" "func_door"
	}
    replace:
	{
        "speed" "750"
	}
}

modify:
{
	match:
	{
        "targetname" "terminatorboss_boss_firebreath_counter"
        "origin" "179.462 14783.7 6738"
        "classname" "math_counter"
	}
    replace:
	{
        "max" "4"
	}
}

modify:
{
	match:
	{
        "targetname" "terminatorboss_boss_firebreath_compare"
        "origin" "179.462 14767.7 6738"
        "classname" "logic_compare"
	}
    replace:
	{
        "CompareValue" "4"
	}
}

;----------------------------------------------------------
; Increase delay to Terminator's intro after Duo bosses die
;----------------------------------------------------------

modify:
{
	match:
	{
        "origin" "-1152 14800 6746"
        "classname" "func_physbox_multiplayer"
	}
    delete:
	{
        "OnBreak" "s2_duoboss_dead_counter,Add,1,0.02,-1"
	}
    insert:
	{
        "OnBreak" "s2_duoboss_dead_counter,Add,1,3,-1"
	}
}

modify:
{
	match:
	{
        "origin" "-1152 14704 6746"
        "classname" "func_physbox_multiplayer"
	}
    delete:
	{
        "OnBreak" "s2_duoboss_dead_counter,Add,1,0.02,-1"
	}
    insert:
	{
        "OnBreak" "s2_duoboss_dead_counter,Add,1,3,-1"
	}
}

;---------------------------------------------
; Reduce door timer in stage 3's space segment
;---------------------------------------------

modify:
{
	match:
	{
        "origin" "1149 -11357 -11397"
        "classname" "func_movelinear"
	}
    delete:
	{
        "OnFullyOpen" "!self,Close,,20,1"
        "OnFullyOpen" "console,Command,say *** DOOR CLOSES IN 20 SECONDS ***,0,1"
	}
    insert:
	{
        "OnFullyOpen" "!self,Close,,15,1"
        "OnFullyOpen" "console,Command,say *** DOOR CLOSES IN 15 SECONDS ***,0,1"
	}
}

;----------------------------------------------------------------------------------
; Increase tp delay time for zombies into big space cave in stage 3's space segment
;----------------------------------------------------------------------------------

modify:
{
	match:
	{
        "origin" "1887 -11360 -11687"
        "classname" "func_movelinear"
	}
    delete:
	{
        "OnFullyOpen" "s3_zm_tp_to_lock,Enable,,4,1"
	}
    insert:
	{
        "OnFullyOpen" "s3_zm_tp_to_lock,Enable,,10,1"
	}
}

;--------------------------------------
; Fix some stuff that should hurt items
;--------------------------------------

modify:
{
	match:
	{
        "targetname" "terminatorboss_boss_firebreath_hurt"
		"origin" "-1276.54 14775.7 7522"
        "classname" "trigger_hurt"
	}
	replace:
    {
        "spawnflags" "1037"
    }
}

modify:
{
	match:
	{
        "targetname" "termiboss_homingbeam1_hurt"
		"origin" "714 14972.6 7776.04"
        "classname" "trigger_hurt"
	}
	replace:
    {
        "spawnflags" "1037"
    }
}

modify:
{
	match:
	{
        "targetname" "termiboss_homingbeam2_hurt"
		"origin" "714 14636.6 7776.04"
        "classname" "trigger_hurt"
	}
	replace:
    {
        "spawnflags" "1037"
    }
}

modify:
{
	match:
	{
        "targetname" "duoboss_blue_firehurt"
		"origin" "-1088 14704 6730"
        "classname" "trigger_hurt"
	}
	replace:
    {
        "spawnflags" "1037"
    }
}

modify:
{
	match:
	{
        "targetname" "heliboss_death_lastresort"
		"origin" "9032 9983 9713.96"
        "classname" "trigger_hurt"
	}
	replace:
    {
        "spawnflags" "1037"
    }
}

;----------------------------------------------------------------------------------
; Decrease attack delay in Terminator bomb attack
;----------------------------------------------------------------------------------

modify:
{
	match:
	{
        "targetname" "terminatorboss_boss_atk_case"
        "origin" "-576 15296 6642"
        "classname" "logic_case"
	}
    delete:
	{
        "OnCase02" "terminatorboss_gate_branch_openclose,ToggleTest,,6,-1"
        "OnCase02" "terminatorboss_gate_sound,PlaySound,,6,-1"
	}
    insert:
	{
        "OnCase02" "terminatorboss_gate_branch_openclose,ToggleTest,,4.5,-1"
        "OnCase02" "terminatorboss_gate_sound,PlaySound,,4.5,-1"
	}
}

;----------------------------------------------------------
; Clean terminator bomb leftover entities
;----------------------------------------------------------

modify:
{
	match:
	{
        "targetname" "termiboss_bomb_relay"
        "origin" "-342.501 14770.1 6714"
        "classname" "logic_relay"
	}
    insert:
	{
        "OnSpawn" "termiboss_bomb_kur,Kill,,5.5,-1"
	}
}

;----------------------------------------------------------
; Clean terminator flame after boss dies
;----------------------------------------------------------
modify:
{
	match:
	{
        "targetname" "s2_after_terminator_relay"
         "origin" "-1933.5 15336.5 6635"
        "classname" "logic_relay"
	}
    insert:
	{
        "OnTrigger" "terminatorboss_boss_firebreath_hurt,Kill,,0,-1"
	}
}

;----------------------------------------------------------
; Makes fire trigger on stage 2 faster
;----------------------------------------------------------

modify:
{
	match:
	{
        "targetname" "s2_fire_hold_wheel"
        "origin" "-9848.3 -10176 -1991"
        "classname" "momentary_rot_button"
	}
    delete:
	{
        "OnPressed" "console,Command,say *** VALVE IS CLOSED... HOLD FOR 15 SECONDS ***,5,1"
        "OnPressed" "s2_fire_hold_hurt,Kill,,20,1"
        "OnPressed" "s2_fire_hold_clip,Break,,20,1"
        "OnPressed" "s2_fire_hold_particle,Kill,,20,1"
	}
    insert:
	{
        "OnPressed" "console,Command,say *** VALVE IS CLOSED... HOLD FOR 5 SECONDS ***,5,1"
        "OnPressed" "s2_fire_hold_hurt,Kill,,10,1"
        "OnPressed" "s2_fire_hold_clip,Break,,10,1"
        "OnPressed" "s2_fire_hold_particle,Kill,,10,1"
	}
}



;----------------------------------------------------------
; Stage 1 balance changes
;----------------------------------------------------------

modify:
{
	match:
	{
        "origin" "-4960 1168 2117.67"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "console,Command,say *** HOLD THE BOULDERS FOR 30 SECONDS! ***,0,1"
        "OnStartTouch" "s1_boulders1,Kill,,30,1"
        "OnStartTouch" "s1_bridge_break_particle,AddOutput,origin -4476 920 2110,29.99,1"
        "OnStartTouch" "s1_bridge_break_particle,Start,,30,1"
        "OnStartTouch" "s1_bridge_break_particle,AddOutput,origin -5042.49 1045.67 1822,30.2,1"
        "OnStartTouch" "s1_bridge_break_particle,AddOutput,origin -5706.04 1025.19 1822,30.4,1"
        "OnStartTouch" "s1_bridge_break_particle,Stop,,32,1"
        "OnStartTouch" "sound_explosion3,PlaySound,,30,1"
        "OnStartTouch" "console,Command,say *** FALL BACK! ***,30,1"
        "OnStartTouch" "s1_boulder_break,Break,,30,1"
        "OnStartTouch" "s1_break_rocks_spawner1,Trigger,,30,1"
        "OnStartTouch" "s1_shooter_npc_relay_spawner2,Trigger,,30,1"
	}
    insert:
	{
        "OnStartTouch" "console,Command,say *** HOLD THE BOULDERS FOR 25 SECONDS! ***,0,1"
        "OnStartTouch" "s1_boulders1,Kill,,25,1"
        "OnStartTouch" "s1_bridge_break_particle,AddOutput,origin -4476 920 2110,24.99,1"
        "OnStartTouch" "s1_bridge_break_particle,Start,,25,1"
        "OnStartTouch" "s1_bridge_break_particle,AddOutput,origin -5042.49 1045.67 1822,25.2,1"
        "OnStartTouch" "s1_bridge_break_particle,AddOutput,origin -5706.04 1025.19 1822,25.4,1"
        "OnStartTouch" "s1_bridge_break_particle,Stop,,27,1"
        "OnStartTouch" "sound_explosion3,PlaySound,,25,1"
        "OnStartTouch" "console,Command,say *** FALL BACK! ***,25,1"
        "OnStartTouch" "s1_boulder_break,Break,,25,1"
        "OnStartTouch" "s1_break_rocks_spawner1,Trigger,,25,1"
        "OnStartTouch" "s1_shooter_npc_relay_spawner2,Trigger,,25,1"
	}
}




modify:
{
	match:
	{
        "targetname" "s1_static_breakable"
        "origin" "-4864 -9884 2552"
        "classname" "func_breakable"
	}
    replace:
	{
        "health" "2800"
	}
}


modify:
{
    match:
    {
        "origin" "-4760 -14568 3188"
        "classname" "trigger_push"
        "hammerid" "69895"
    }
    insert:
    {
        "targetname" "facilityfloorpush1"
    }
}

modify:
{
    match:
    {
        "targetname" "s1_facility_button"
        "origin" "-5491.88 -15712.1 3214.45"
        "classname" "func_button"
    }
    insert:
    {
        "OnPressed" "facilityfloorpush1,Kill,,0,1"
    }
}


modify:
{
	match:
	{

        "origin" "-696 5764 6698.57"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "console,Command,say *** DOOR OPENS IN 10 SECONDS ***,0,1"
        "OnStartTouch" "s1_facilitydoor11,Open,,10,1"
        "OnStartTouch" "contra_sky_spider,Enable,,0,1"
        "OnStartTouch" "skybox_rain,AddOutput,origin 8722 11245 -9471,0,1"
        "OnStartTouch" "skybox_rain,Alpha,255,9.5,1"
	}
    insert:
	{
        "OnStartTouch" "console,Command,say *** DOOR OPENS IN 5 SECONDS ***,0,1"
        "OnStartTouch" "s1_facilitydoor11,Open,,5,1"
        "OnStartTouch" "contra_sky_spider,Enable,,0,1"
        "OnStartTouch" "skybox_rain,AddOutput,origin 8491.28 5582.6 -5354.38,0,1"
        "OnStartTouch" "skybox_rain,Alpha,255,9.5,1"
	}
}

modify:
{
	match:
	{

        "origin" "-1368 -15104 2736"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "skybox_rain,AddOutput,origin 8922.68 10834 -9470.28,14,1"
	}
    insert:
	{
        "OnStartTouch" "skybox_rain,AddOutput,origin 8803.11 4369 -6596.1,14,1"
	}
}

modify:
{
	match:
	{
        "targetname" "s1_facilitydoor11"
        "origin" "-696 5696 6698.56"
        "classname" "func_movelinear"
	}
    delete:
	{
        "OnFullyOpen" "!self,Close,,15,1"
	}
    insert:
	{
        "OnFullyOpen" "!self,Close,,25,1"
	}
}


;----------------------------------------------------------
; Adds push for zm to give humans time to swim on stage 2
;----------------------------------------------------------

add:
{
    "model" "*128"
    "targetname" "zmsewerpush"
    "StartDisabled" "1"
    "speed" "1000"
    "spawnflags" "1"
    "pushdir" "0 270 0"
    "origin" "-9056 -5952 -1849.5"
    "filtername" "MapFilterT"
    "alternateticksfix" "0"
    "classname" "trigger_push"
}



;----------------------------------------------------------
; Lowers chopper HP
;----------------------------------------------------------
modify:
{
	match:
	{
        "targetname" "heliboss_boss_addhealth"
        "origin" "8712 8127 9535.96"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "heliboss_Boss_HealthBackup,Add,120,0,-1"
        "OnStartTouch" "heliboss_Boss_Health,Add,120,0,-1"
	}
    insert:
	{
        "OnStartTouch" "heliboss_Boss_HealthBackup,Add,80,0,-1"
        "OnStartTouch" "heliboss_Boss_Health,Add,80,0,-1"
	}
    replace:
	{
        "filtername" "MapFilterCT"
	}
}



;----------------------------------------------------------
; Makes holds easier on stage 2
;----------------------------------------------------------
modify:
{
	match:
	{
        
        "origin" "-8871 2361.5 -366.5"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "console,Command,say *** KEEP HOLDING ***,0,1"
        "OnStartTouch" "s2_building_fall_mover,Open,,15,1"
        "OnStartTouch" "sound_explosion3,PlaySound,,15,1"
        "OnStartTouch" "s2_building_fall_particle,Start,,15,1"
	}
    insert:
	{
        "OnStartTouch" "console,Command,say *** KEEP HOLDING ***,0,1"
        "OnStartTouch" "s2_building_fall_mover,Open,,5,1"
        "OnStartTouch" "sound_explosion3,PlaySound,,5,1"
        "OnStartTouch" "s2_building_fall_particle,Start,,5,1"
	}
}

modify:
{
	match:
	{
        
        "origin" "-6781.04 8687.1 7660"
        "classname" "func_button"
	}
    delete:
	{
        "OnPressed" "s2_button_sprite,Kill,,0,1"
        "OnPressed" "console,Command,say *** BARRIER BREAKS IN 15 SECONDS ***,0,1"
        "OnPressed" "s2_fence,Break,,15,1"
	}
    insert:
	{
        "OnPressed" "s2_button_sprite,Kill,,0,1"
        "OnPressed" "console,Command,say *** BARRIER BREAKS IN 10 SECONDS ***,0,1"
        "OnPressed" "s2_fence,Break,,10,1"
	}
}

modify:
{
	match:
	{
        
        "origin" "-6762.5 13536 8079.5"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "console,Command,say *** ZM TP IN 10 SECONDS ***,0,1"
        "OnStartTouch" "s2_facility_shortcut_break,Break,,3,1"
        "OnStartTouch" "s2_afktp8,Enable,,10,1"
	}
    insert:
	{
        "OnStartTouch" "console,Command,say *** ZM TP IN 10 SECONDS ***,10,1"
        "OnStartTouch" "s2_facility_shortcut_break,Break,,3,1"
        "OnStartTouch" "s2_afktp8,Enable,,20,1"
	}
}

modify:
{
	match:
	{
        "targetname" "s2_facilitydoor_counter"
        "origin" "-5419 13627.5 8906"
        "classname" "math_counter"
	}
    delete:
	{
        "OnHitMax" "s2_tower_door3,Open,,15,1"
        "OnHitMax" "s2_tower_door4,Open,,15,1"
        "OnHitMax" "console,Command,say *** BIG DOORS OPEN IN 15 SECONDS ***,0,1"
        "OnHitMax" "stage2_tankspawn4,Trigger,,15,1"
	}
    insert:
	{
        "OnHitMax" "s2_tower_door3,Open,,10,1"
        "OnHitMax" "s2_tower_door4,Open,,10,1"
        "OnHitMax" "console,Command,say *** BIG DOORS OPEN IN 10 SECONDS ***,0,1"
        "OnHitMax" "stage2_tankspawn4,Trigger,,10,1"
	}
}

;----------------------------------------------------------
; Attempt to fix weird bug of heliboss just deleting itself for some reason
;----------------------------------------------------------

modify:
{
	match:
	{
        "targetname" "heliboss_model"
        "origin" "8896 9991 9743.96"
        "classname" "prop_dynamic"
	}
    insert:
	{
        "damagefilter" "Filter_Nada"
	}
}


modify:
{
	match:
	{
        "targetname" "heliboss_backdoor_model"
        "origin" "8464 9983 9543.96"
        "classname" "prop_dynamic"
	}
    insert:
	{
        "damagefilter" "Filter_Nada"
	}
}

;----------------------------------------------------------
; Prevents heli from not dying if defeated too close to the tower (kills heli after set time)
;----------------------------------------------------------

modify:
{
    match:
    {
        "targetname" "hboss_ondeath_tp_maker"
        "origin" "8712 7047 9645.49"
        "classname" "env_entity_maker"
    }
    insert:
    {
        "OnEntitySpawned" "hboss_ondeath_reachend_relay,Trigger,,10,1"
    }
}

;----------------------------------------------------------
; Buff turret's health :)
;----------------------------------------------------------

modify:
{
    match:
    {
        "targetname" "turret_head_break"
        "origin" "1008.52 8311 -2568"
        "classname" "func_breakable"
    }
    replace:
	{
		"health" "800"
	}
}

modify:
{
    match:
    {
        "targetname" "turret_base"
        "origin" "1008.52 8311 -2568"
        "classname" "func_breakable"
    }
    replace:
	{
		"health" "1500"
	}
}

;----------------------------------------------------------
; Fix turrets facing the wrong direction if many are spawned at once on different locations
;----------------------------------------------------------

modify:
{
    match:
    {
        "targetname" "turret_aimer"
        "origin" "1008.52 8311 -2568"
        "classname" "light_dynamic"
    }
    replace:
	{
		"target" "nothingyet"
	}
}

modify:
{
	match:
	{
        "targetname" "turret_head_doorrot"
        "origin" "1008.52 8311 -2568"
        "classname" "func_door_rotating"
	}
    insert:
	{
        "OnFullyClosed" "turret_aimer,addoutput,target siderail_aimtarget,0,-1"
	}
}

;----------------------------------------------------------
; Fix turrets facing the wrong direction because of mistake relay angles
;----------------------------------------------------------

modify:
{
    match:
    {
        "targetname" "s1_turret_spawn1"
        "origin" "-4744.4 4261.32 2122.9"
        "classname" "logic_relay"
    }
    replace:
	{
		"angles" "0 90 0"
	}
}

modify:
{
    match:
    {
        "targetname" "s1_turret_spawn1"
        "origin" "-4864.87 -5037.15 1864.67"
        "classname" "logic_relay"
    }
    replace:
	{
		"angles" "0 90 0"
	}
}

;----------------------------------------------------------
; Add turrets / STAGE 1
;----------------------------------------------------------

add:
{
    "origin" "3421.6 -1944 2824"
    "targetname" "s1_turret_spawn2"
    "StartDisabled" "0"
    "spawnflags" "1"
    "angles" "0 90 270"
    "classname" "logic_relay"
    "OnTrigger" "npc_turret_maker,ForceSpawnAtEntityOrigin,!caller,0,-1"
}

add:
{
    "origin" "3057.6 -1944 2824"
    "targetname" "s1_turret_spawn2"
    "StartDisabled" "0"
    "spawnflags" "1"
    "angles" "0 270 270"
    "classname" "logic_relay"
    "OnTrigger" "npc_turret_maker,ForceSpawnAtEntityOrigin,!caller,0,-1"
}

modify:
{
    match:
    {
        "targetname" "s1_facilitydoor4"
        "origin" "2976 -7233 1896.45"
        "classname" "func_movelinear"
    }
    insert:
    {
        "OnFullyOpen" "s1_turret_spawn2,Trigger,,5,1"
    }
}

;----------------------------------------------------------
; Add turrets / STAGE 2
;----------------------------------------------------------


add:
{
    "origin" "9048 208 9504"
    "targetname" "s2_turret_spawn2"
    "StartDisabled" "0"
    "spawnflags" "1"
    "angles" "0 90 270"
    "classname" "logic_relay"
    "OnTrigger" "npc_turret_maker,ForceSpawnAtEntityOrigin,!caller,0,-1"
}

add:
{
    "origin" "8360 208 9504"
    "targetname" "s2_turret_spawn2"
    "StartDisabled" "0"
    "spawnflags" "1"
    "angles" "0 270 270"
    "classname" "logic_relay"
    "OnTrigger" "npc_turret_maker,ForceSpawnAtEntityOrigin,!caller,0,-1"
}

modify:
{
	match:
	{
        
        "origin" "8704 -1088 9824"
        "classname" "trigger_once"
	}
    insert:
	{
        "OnStartTouch" "s2_turret_spawn2,Trigger,,20,1"
	}
}

add:
{
    "origin" "-4128 14966 6912"
    "targetname" "s2_turret_spawn3"
    "StartDisabled" "0"
    "spawnflags" "1"
    "angles" "0 180 -90"
    "classname" "logic_relay"
    "OnTrigger" "npc_turret_maker,ForceSpawnAtEntityOrigin,!caller,0,-1"
}

add:
{
    "origin" "-4128 14966 6752"
    "targetname" "s2_turret_spawn3"
    "StartDisabled" "0"
    "spawnflags" "1"
    "angles" "0 180 -90"
    "classname" "logic_relay"
    "OnTrigger" "npc_turret_maker,ForceSpawnAtEntityOrigin,!caller,0,-1"
}

modify:
{
	match:
	{
        "targetname" "s2_facilitydoor_counter"
        "origin" "-5419 13627.5 8906"
        "classname" "math_counter"
	}
    insert:
	{
        "OnHitMax" "s2_turret_spawn3,Trigger,,15,1"
	}
}

;----------------------------------------------------------
; Try fix the issue where Spidal boss gets stuck
;----------------------------------------------------------
modify:
{
	match:
	{
        "targetname" "s1_dummyboss_doorrise"
        "origin" "-696 1480 5584"
        "classname" "func_door"
	}
    replace:
	{
        "lip" "-232"
	}
}

;----------------------------------------------------------
; Make final hold in stage 1 harder
;----------------------------------------------------------
modify:
{
	match:
	{
        
        "origin" "-681 -2931 6648"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "console,Command,say *** EVAC ARRIVES IN 15 SECONDS ***,0,1"
        "OnStartTouch" "s1_ending_heli_push,Enable,,15,1"
        "OnStartTouch" "s1_ending_chopper,FireUser1,,15,1"
        "OnStartTouch" "s1_ending_chopper_mover,StartForward,,15,1"
	}
    insert:
	{
        "OnStartTouch" "console,Command,say *** EVAC ARRIVES IN 20 SECONDS ***,0,1"
        "OnStartTouch" "s1_ending_heli_push,Enable,,20,1"
        "OnStartTouch" "s1_ending_chopper,FireUser1,,20,1"
        "OnStartTouch" "s1_ending_chopper_mover,StartForward,,20,1"
	}
}

modify:
{
	match:
	{
        "targetname" "s1_ending_relay"
        "origin" "-620 528 6352"
        "classname" "logic_relay"
	}
    delete:
	{
        "OnTrigger" "s1_endingmove1,Open,,3,-1"
        "OnTrigger" "s1_endingmove5,Open,,15,-1"
        "OnTrigger" "s1_endingmove4,Open,,12.5,-1"
	}
    insert:
	{
        "OnTrigger" "s1_endingmove1,SetPosition,0.09,3,-1"
        "OnTrigger" "s1_endingmove5,SetPosition,0.09,15,-1"
        "OnTrigger" "s1_endingmove4,SetPosition,0.09,12.5,-1"
	}
}

;----------------------------------------------------------
; Add vphysics clip for GAVA NPCs
;----------------------------------------------------------

add:
{
	"model" "*15"
	"targetname" "finalboss_npc_vphysics"
	"classname" "func_clip_vphysics"
    "origin" "-12556 1225 -6745.88"
    "filtername" "rollingnpc_filter"
}

;----------------------------------------------------------
; Buff Final Boss
;----------------------------------------------------------

modify:
{
	match:
	{
        "targetname" "rollingnpc_phys"
        "origin" "-11994.3 2344.95 -6453"
        "classname" "func_physbox_multiplayer"
	}
    replace:
	{
        "health" "500"
	}
}

modify:
{
	match:
	{
        "targetname" "rollingnpc_hurt_small"
        "origin" "-11994.3 2344.95 -6453"
        "classname" "trigger_hurt"
	}
    replace:
	{
        "damage" "20"
	}
}

filter:
{
    "targetname" "final_boss_npcspawntimer"
    "classname" "logic_timer"
} 

add:
{
    "origin" "-13296 2840 -6541"
    "UseRandomTime" "0"
    "RefireTime" "8"
    "targetname" "final_boss_npcspawntimer"
    "StartDisabled" "1"
    "spawnflags" "0"
    "classname" "logic_timer"
    "OnTimer" "finalboss_npcmaker_left,ForceSpawn,,0,-1"
    "OnTimer" "finalboss_npcmaker_right,ForceSpawn,,0,-1"
}

modify:
{
	match:
	{
        "targetname" "final_HalfHealthCount"
        "origin" "-13264 2928 -6541"
        "classname" "math_counter"
	}
    delete:
	{
        "OnHitMax" "final_boss_npcspawntimer,LowerRandomBound,4,0,-1"
        "OnHitMax" "final_boss_npcspawntimer,UpperRandomBound,8,0,-1"
	}
    insert:
	{
        "OnHitMax" "final_boss_npcspawntimer,RefireTime,4,0,-1"
	}
}

modify:
{
	match:
	{
        "targetname" "minifinal1_math"
        "origin" "-13285.1 2880.79 -6540.98"
        "classname" "math_counter"
	}
    delete:
	{
        "OnGetValue" "final_HalfHealthCount,Add,1,0,-1"
	}
    insert:
	{
        "OnHitMin" "final_HalfHealthCount,Add,1,0,-1"
	}
}


;----------------------------------------------------------
; Change GAVA to func_breakable so item bullets work on it
;----------------------------------------------------------

modify:
{
	match:
	{
        "targetname" "gaza_hitbox"
        "origin" "4003.5 -4808.5 13546"
	}
    replace:
	{
        "classname" "func_breakable"
	}
}

modify:
{
	match:
	{
        "classname" "func_button"
        "origin" "4005.5 -3495.5 13270"
	}
    delete:
	{
        "OnPressed" "gaza_hitbox,SetDamageFilter,MapFilterCT,40,1"
	}
    insert:
	{
        "OnPressed" "Template_GAVA,ForceSpawn,,39.8,1"
        "OnPressed" "gaza_hitbox,SetDamageFilter,,40,1"
	}
}

;+++++++++++++++++++++++++++
; Template the func_breakable since it blocks players
;+++++++++++++++++++++++++++

add:
{
	"targetname" "Template_GAVA"
	"origin" "4003.5 -4812 13546"
	"Template01" "gaza_mover"
	"Template02" "gaza_hitbox"
	"Template03" "gaza_hurt"
	"spawnflags" "2"
	"classname" "point_template"
}

;----------------------------------------------------------
; Buff GAVA health
;----------------------------------------------------------

modify:
{
	match:
	{
        "targetname" "gaza_hp_add"
        "origin" "4003.5 -4120 13572.5"
        "classname" "trigger_once"
	}
    delete:
	{
        "OnStartTouch" "gaza_counter,Add,50,0,-1"
	}
    insert:
	{
        "OnStartTouch" "gaza_counter,Add,110,0,-1"
	}
}