;----------------------------
; Unfucks Logic_auto targetname and wall_toggle on alpha arena
;----------------------------
modify:
{
    match:
    {
    	"classname" "logic_auto"
    }
    delete:
    {
        "OnMapSpawn" "player,AddOutput,targetname player,0,-1"
    }
    insert:
    {
        "OnMapSpawn" "player,AddOutput,targetname default,0,-1"
        "OnMapSpawn" "teleport_unfuckery,FireUser1,,1,1"
        "OnMapSpawn" "alpha_arena_wall_toggle,Enable,,10,-1"
        "OnMapSpawn" "teleport_last_afk_fix,FireUser1,,15,-1"
        "OnMapSpawn" "dont_skip_alpha,FireUser1,,0,-1"
    }
}
;----------------------------
; Unfucks ending skip
;----------------------------
modify:
{
    match:
    {
        "classname" "logic_relay"
        "targetname" "boss_phase_2_end"
    }
    insert:
    {
        "OnTrigger" "dest_falldown_waterhole_3,AddOutput,origin -5504 -3848 -872,0,-1"
        "OnTrigger" "tp_safeguard_1,AddOutput,target dest_deskip_ending,0,-1"
        "OnTrigger" "tp_safeguard_2,AddOutput,target dest_deskip_ending,0,-1"
    }
}
modify:
{
    match:
    {
        "classname" "info_teleport_destination"
        "targetname" "dest_deskip_ending"
        "hammerid" "465380"
    }
    replace:
    {
        "Origin" "-5504 -3716 -820"
    }
}
;----------------------------
; Unfucks Alpha HP adder hopefully
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_once"
        "hammerid" "201102"
        "targetname" "alpha_arena_trigger"
    }
    insert:
    {
        "OnStartTouch" "boss_health_alpha,Enable,,24,-1"
    }
}
modify:
{
    match:
    {
        "classname" "logic_relay"
        "hammerid" "208527"
        "targetname" "boss_health_alpha_take_damage"
    }
    replace:
    {
        "StartDisabled" "1"
    }
}
modify:
{
    match:
    {
        "classname" "logic_relay"
        "hammerid" "347215"
        "targetname" "alpha_intro_relay"
    }
    insert:
    {
        "OnTrigger" "boss_health_alpha_take_damage,Enable,,15,-1"
    }
}
;----------------------------
; Unfucks side_teleports
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "origin" "-2816 -6400 -2496"
        "hammerid" "309756"
    }
    insert:
    {
        "targetname" "tp_safeguard_1"
    }
}
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "origin" "-8192 -6272 -2496 "
        "hammerid" "309767"
    }
    insert:
    {
        "targetname" "tp_safeguard_2"
    }
}
;----------------------------
; Unfucks game_text 1
;----------------------------
modify:
{
    match:
    {
        "classname" "game_text"
        "targetname" "game_text_generic"
    }
    replace:
    {
        "spawnflags" "1"
    }
}
;----------------------------
; Unfucks game_text 2
;----------------------------
modify:
{
    match:
    {
        "classname" "game_text"
        "targetname" "game_text_header"
    }
    replace:
    {
        "spawnflags" "1"
    }
}
;----------------------------
; Unfucks zombie tp after alpha phase 1
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "targetname" "alpha_arena_zombie_tp"
    }
    replace:
    {
        "spawnflags" "1"
    }
}
;----------------------------
; Unfucks Alpha rendermode
;----------------------------
modify:
{
    match:
    {
        "classname" "prop_dynamic"
        "targetname" "boss_alpha_Model"
        "hammerid" "484094"
    }
    insert:
    {
        "rendermode" "1"
    }
}
;----------------------------
; Unfucks Heal filter
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_multiple"
        "targetname" "weapon_heal_nodmgfilter"
    }
    replace:
    {
        "filtername" "human"
    }
}
;----------------------------
; Unfucks Ammo filter
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_multiple"
        "targetname" "weapon_heal_give_ammo"
    }
    replace:
    {
        "filtername" "human"
    }
}
;----------------------------
; Unfucks permament white fade
;----------------------------
modify:
{
    match:
    {
        "classname" "env_fade"
        "targetname" "fade_to_white_constant"
        "hammerid" "407757"
    }
    replace:
    {
        "spawnflags" "0"
    }
}
;----------------------------
; Unfucks Interlude zm tp
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "hammerid" "249998"
    }
    insert:
    {
        "targetname" "tp_interlude_zm_1"
    }
    replace:
    {
        "origin" "10752 -4608 -9568"
        "StartDisabled" "1"
        "target" "dest_afk_tp_alpha_arena"
        "spawnflags" "1"
    }
}
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "hammerid" "250010"
    }
    insert:
    {
        "targetname" "tp_interlude_zm_2"
    }
    replace:
    {
        "origin" "10752 -4608 -11232"
        "StartDisabled" "1"
        "target" "dest_afk_tp_alpha_arena"
        "spawnflags" "1"
    }
}
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "hammerid" "209404"
    }
    insert:
    {
        "targetname" "tp_interlude_zm_3"
    }
    replace:
    {
        "origin" "13824 -7680 -9568"
        "StartDisabled" "1"
        "target" "dest_afk_tp_alpha_arena"
        "spawnflags" "1"
    }
}
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "hammerid" "250019"
    }
    insert:
    {
        "targetname" "tp_interlude_zm_4"
    }
    replace:
    {
        "origin" "10752 -7680 -9568"
        "StartDisabled" "1"
        "target" "dest_afk_tp_alpha_arena"
        "spawnflags" "1"
    }
}
modify:
{
    match:
    {
        "classname" "logic_relay"
        "targetname" "boss_phase_1_end"
        "hammerid" "208926"
    }
    insert:
    {
        "OnTrigger" "tp_interlude_zm_*,Enable,,62,-1"
    }
}
;----------------------------
; Unfucks AFK teleport
;----------------------------
add:
{
    "targetname" "teleport_unfuckery"
    "StartDisabled" "1"
    "spawnflags" "1"
    "origin" "-5248 2048 -4420"
    "classname" "trigger_teleport"
    "target" "dest_falldown_outside_1"
    "OnUser1" "!self,AddOutput,solid 2,0,1"
    "OnUser1" "!self,AddOutput,mins -1008 -1008 -256,0.1,1"
    "OnUser1" "!self,AddOutput,maxs 1008 1008 256,0.1,1"
}
modify:
{
    match:
    {
        "classname" "trigger_once"
        "hammerid" "286343"
    }
    insert:
    {
        "OnStartTouch" "teleport_unfuckery,Enable,,30,-1"
    }
}
;----------------------------
; Unfucks Boss maybe spawning more than once
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_once"
        "hammerid" "201102"
    }
    delete:
    {
        "OnStartTouch" "template_boss_alpha,ForceSpawn,,14,-1"
    }
    insert:
    {
        "OnStartTouch" "template_boss_alpha,ForceSpawn,,14,1"
    }
}
modify:
{
    match:
    {
        "classname" "trigger_once"
        "hammerid" "185618"
    }
    delete:
    {
        "OnStartTouch" "omega_template,ForceSpawn,,20,-1"
    }
    insert:
    {
        "OnStartTouch" "omega_template,ForceSpawn,,20,1"
    }
}
;----------------------------
; Unfucks Boss Alpha spamming attacks maybe and constant regen on phase 2
;----------------------------
modify:
{
    match:
    {
        "classname" "logic_relay"
        "hammerid" "208926"
        "targetname" "boss_phase_1_end"
    }
    delete:
    {
        "OnTrigger" "boss_alpha_physbox,Kill,,0.5,-1"
    }
    insert:
    {
        "OnTrigger" "boss_alpha_*,Kill,,0,-1"
        "OnTrigger" "alpha_phase_2_add_hp,Disable,,55,-1"
    }
}
modify:
{
    match:
    {
        "classname" "logic_relay"
        "hammerid" "208931"
        "targetname" "boss_phase_2_end"
    }
    delete:
    {
        "OnTrigger" "boss_alpha_physbox,Kill,,1,-1"
    }
    insert:
    {
        "OnTrigger" "boss_alpha_*,Kill,,1,-1"
    }
}
modify:
{
    match:
    {
        "classname" "prop_dynamic"
        "hammerid" "484094"
        "targetname" "boss_alpha_Model"
    }
    insert:
    {
        "OnUser1" "!self,SetAnimation,float_exit,0,-1"
        "OnUser1" "!self,SetAnimation,sprint_f,0.5,-1"
    }
}
modify:
{
    match:
    {
        "classname" "trigger_teleport"
        "hammerid" "209851"
        "targetname" "from_interlude_tp"
    }
    insert:
    {
        "OnStartTouch" "boss_health_alpha,Add,215,0,-1"
    }
}
;----------------------------
; Balances items more aggresively
;----------------------------
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "273458"
        "targetname" "weapon_heal_filter"
    }
    delete:
    {
        "OnPass" "weapon_heal_sprite,ToggleSprite,,60,-1"
        "OnPass" "weapon_heal_button,Unlock,,60,-1"
    }
    insert:
    {
        "OnPass" "weapon_heal_sprite,ToggleSprite,,80,-1"
        "OnPass" "weapon_heal_button,Unlock,,80,-1"
    }
}
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "273319"
        "targetname" "weapon_bfg_filter"
    }
    delete:
    {
        "OnPass" "weapon_bfg_sprite,ToggleSprite,,60,-1"
        "OnPass" "weapon_bfg_button,Unlock,,60,-1"
    }
    insert:
    {
        "OnPass" "weapon_bfg_sprite,ToggleSprite,,80,-1"
        "OnPass" "weapon_bfg_button,Unlock,,80,-1"
    }
}
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "273054"
        "targetname" "weapon_wall_filter"
    }
    delete:
    {
        "OnPass" "weapon_wall_sprite,ToggleSprite,,60,-1"
        "OnPass" "weapon_wall_button,Unlock,,60,-1"
    }
    insert:
    {
        "OnPass" "weapon_wall_sprite,ToggleSprite,,80,-1"
        "OnPass" "weapon_wall_button,Unlock,,80,-1"
    }
}
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "267242"
        "targetname" "weapon_poison_filter"
    }
    delete:
    {
        "OnPass" "weapon_poison_sprite,ToggleSprite,,60,-1"
        "OnPass" "weapon_poison_button,Unlock,,60,-1"
    }
    insert:
    {
        "OnPass" "weapon_poison_sprite,ToggleSprite,,80,-1"
        "OnPass" "weapon_poison_button,Unlock,,80,-1"
    }
}
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "267011"
        "targetname" "weapon_plasma_filter"
    }
    delete:
    {
        "OnPass" "weapon_plasma_sprite,ToggleSprite,,60,-1"
        "OnPass" "weapon_plasma_button,Unlock,,60,-1"
        "OnPass" "weapon_plasma_trigger,Enable,,0,-1"
        "OnPass" "weapon_plasma_trigger,Disable,,4,-1"
    }
    insert:
    {
        "OnPass" "weapon_plasma_sprite,ToggleSprite,,80,-1"
        "OnPass" "weapon_plasma_button,Unlock,,80,-1"
        "OnPass" "weapon_plasma_trigger,Enable,,1,-1"
        "OnPass" "weapon_plasma_trigger,Disable,,5,-1"
    }
}
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "266827"
        "targetname" "weapon_fire_filter"
    }
    delete:
    {
        "OnPass" "weapon_fire_sprite,ToggleSprite,,60,-1"
        "OnPass" "weapon_fire_button,Unlock,,60,-1"
    }
    insert:
    {
        "OnPass" "weapon_fire_sprite,ToggleSprite,,80,-1"
        "OnPass" "weapon_fire_button,Unlock,,80,-1"
    }
}
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "266451"
        "targetname" "weapon_frost_filter"
    }
    delete:
    {
        "OnPass" "weapon_frost_sprite,ToggleSprite,,60,-1"
        "OnPass" "weapon_frost_button,Unlock,,60,-1"
    }
    insert:
    {
        "OnPass" "weapon_frost_sprite,ToggleSprite,,80,-1"
        "OnPass" "weapon_frost_button,Unlock,,80,-1"
    }
}
modify:
{
    match:
    {
        "classname" "filter_activator_name"
        "hammerid" "173787"
        "targetname" "weapon_teleport_filter"
    }
    delete:
    {
        "OnPass" "weapon_teleport_sprite,ToggleSprite,,90,-1"
        "OnPass" "weapon_teleport_button,Unlock,,90,-1"
    }
    insert:
    {
        "OnPass" "weapon_teleport_sprite,ToggleSprite,,110,-1"
        "OnPass" "weapon_teleport_button,Unlock,,110,-1"
    }
}

;----------------------------
; Unfucks Zombie Cage 
;----------------------------
add:
{
    "targetname" "teleport_zombiecage_fix_1"
    "StartDisabled" "0"
    "spawnflags" "1"
    "origin" "-7104 -128 -384"
    "classname" "trigger_teleport"
    "target" "dest_afk_tp_alpha_arena"
    "OnUser1" "!self,AddOutput,solid 2,0,1"
    "OnUser1" "!self,AddOutput,mins -64 -1472 -192,0.1,1"
    "OnUser1" "!self,AddOutput,maxs 64 1472 192,0.1,1"
}
add:
{
    "targetname" "teleport_zombiecage_fix_2"
    "StartDisabled" "0"
    "spawnflags" "1"
    "origin" "-3904 -128 -384"
    "classname" "trigger_teleport"
    "target" "dest_afk_tp_alpha_arena"
    "OnUser1" "!self,AddOutput,solid 2,0,1"
    "OnUser1" "!self,AddOutput,mins -64 -1472 -192,0.1,1"
    "OnUser1" "!self,AddOutput,maxs 64 1472 192,0.1,1"
}
add:
{
    "targetname" "teleport_zombiecage_fix_3"
    "StartDisabled" "0"
    "spawnflags" "1"
    "origin" "-5504 1344 -384"
    "classname" "trigger_teleport"
    "target" "dest_afk_tp_alpha_arena"
    "OnUser1" "!self,AddOutput,solid 2,0,1"
    "OnUser1" "!self,AddOutput,mins -1472 -64 -192,0.1,1"
    "OnUser1" "!self,AddOutput,maxs 1472 64 192,0.1,1"
}
add:
{
    "targetname" "teleport_zombiecage_fix_4"
    "StartDisabled" "0"
    "spawnflags" "1"
    "origin" "-5504 -1600 -384"
    "classname" "trigger_teleport"
    "target" "dest_afk_tp_alpha_arena"
    "OnUser1" "!self,AddOutput,solid 2,0,1"
    "OnUser1" "!self,AddOutput,mins -1664 -64 -192,0.1,1"
    "OnUser1" "!self,AddOutput,maxs 1664 64 192,0.1,1"
}
modify:
{
    match:
    {
        "classname" "logic_auto"
    }
    insert:
    {
        "OnMapSpawn" "teleport_zombiecage_fix_1,FireUser1,,1,1"
        "OnMapSpawn" "teleport_zombiecage_fix_2,FireUser1,,1,1"
        "OnMapSpawn" "teleport_zombiecage_fix_3,FireUser1,,1,1"
        "OnMapSpawn" "teleport_zombiecage_fix_4,FireUser1,,1,1"
    }
}
;----------------------------
; Unfucks AFK Teleport
;----------------------------
add:
{
    "targetname" "teleport_last_afk_fix"
    "StartDisabled" "1"
    "spawnflags" "1"
    "origin" "-5504 -8064 -4352"
    "classname" "trigger_teleport"
    "target" "dest_afk_tp_alpha_arena"
    "OnUser1" "!self,AddOutput,solid 2,0,1"
    "OnUser1" "!self,AddOutput,mins -384 -384 -384,0.1,1"
    "OnUser1" "!self,AddOutput,maxs 384 384 384,0.1,1"
}
modify:
{
    match:
    {
        "hammerid" "210001"
        "targetname" "alpha_arena_spawn_alpha"
    }
    insert:
    {
        "OnTrigger" "teleport_last_afk_fix,Enable,,0,-1"
    }
}
;----------------------------
; Makes Alpha Harder
;----------------------------
modify:
{
    match:
    {
        "classname" "logic_timer"
        "hammerid" "285497"
        "targetname" "boss_alpha_attack_timer"
    }
    replace:
    {
        "UpperRandomBound" "16"
        "LowerRandomBound" "12"
    }
}
;----------------------------
; Make ending harder
;----------------------------
modify:
{
    match:
    {
        "classname" "trigger_hurt"
        "hammerid" "324995"
        "targetname" "projectile_alpha_trigger"
    }
    replace:
    {
        "damage" "30"
    }
}
modify:
{
    match:
    {
        "classname" "trigger_multiple"
        "hammerid" "265961"
        "targetname" "orbital_vine_detection_finale"
    }
    replace:
    {
        "wait" "4"
    }
}
;----------------------------
; Unfucks Last Alpha Skip
;----------------------------
add:
{
    "targetname" "dont_skip_alpha"
    "StartDisabled" "1"
    "spawnflags" "1"
    "origin" "-5504 -13632 -1856"
    "classname" "trigger_hurt"
    "nodmgforce" "0"
    "damagetype" "0"
    "damagecap" "20"
    "damagemodel" "0"
    "damage" "99999"
    "OnUser1" "!self,AddOutput,solid 2,0,1"
    "OnUser1" "!self,AddOutput,mins -512 -512 -512,0.1,1"
    "OnUser1" "!self,AddOutput,maxs 512 512 512,0.1,1"
}
modify:
{
    match:
    {
        "hammerid" "325238"
        "targetname" "finale_projectile_triggers"
    }
    insert:
    {
        "OnTrigger" "dont_skip_alpha,Enable,,1,-1"
    }
}
modify:
{
    match:
    {
        "classname" "math_counter"
        "hammerid" "325324"
        "targetname" "alpha_finale_counter"
    }
    insert:
    {
        "OnHitMin" "dont_skip_alpha,Disable,,1,-1"
    }
}