;--------------------------------------------------------------------
;STRIPPER CFG BY MOLTARD http://steamcommunity.com/id/0123456789ABC/
;--------------------------------------------------------------------
;FIX ELEVATOR ISSUES
;--------------------

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "1087185"
	}
	insert:
	{
		"OnMapSpawn" "IFixAStupidMistake,FireUser1,,1,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Cargoelevator_top_relay_4"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "IFixAStupidMistake,Enable,,0,-1"
		"OnTrigger" "IFixAStupidMistake,Kill,,26.95,-1"
	}
}

add:
{
	"targetname" "IFixAStupidMistake"
	"target" "mainroom_teleport_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-329 1136 256"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -13 -174 -256,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 13 174 256,0.1,1"
}
add:
{
	"targetname" "IFixAStupidMistake"
	"target" "mainroom_teleport_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-834 1136 256"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -13 -174 -256,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 13 174 256,0.1,1"
}
add:
{
	"targetname" "IFixAStupidMistake"
	"target" "mainroom_teleport_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-578 881 256"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -174 -13 -256,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 174 13 256,0.1,1"
}
add:
{
	"targetname" "IFixAStupidMistake"
	"target" "mainroom_teleport_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-578 1393 256"
	"classname" "trigger_teleport"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -174 -13 -256,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 174 13 256,0.1,1"
}

;--------------------------------------------------
;RESTART ROUND ON WARMUP INSTEAD OF SLAYING PLAYERS
;--------------------------------------------------

;Normal Warmup
modify:
{
	match:
	{
		"classname"		"logic_relay"
		"targetname"	"Stage_WARMUP_initate"
	}
	delete:
	{
		"OnTrigger"		"Trigger_nuke2,Enable,,59,-1"
		"OnTrigger"		"ending_explosion_sound2,PlaySound,,59,-1"
	}
	insert:
	{
		"OnTrigger"		"command,Command,mp_restartgame 1,59,1"
	}
}

;Extreme Warmup
modify:
{
	match:
	{
		"classname"		"logic_relay"
		"targetname"	"Stage_INTERLUDE_initate"
	}
	delete:
	{
		"OnTrigger"		"Trigger_nuke2,Enable,,59,-1"
		"OnTrigger"		"ending_explosion_sound2,PlaySound,,59,-1"
	}
	insert:
	{
		"OnTrigger"		"command,Command,mp_restartgame 1,59,1"
	}
}

;-------------------------------------
;FIX ZOMBIE GLITCH AFTER STAGE 4 BOSS
;-------------------------------------

add:
{
	"model"	"*202"
	"targetname" "zombie_prison_push_antiglitch_s4"
	"origin" "-3475 -1917 -702"
	"filtername" "Zombie_only"
	"StartDisabled" "1"
	"pushdir" "0 90 0"
	"spawnflags" "1"
	"speed"	"500"
	"classname"	"trigger_push"
}
modify:
{
	match:
	{
		"targetname" "boss_3_knockback_1_counter"
		"classname" "math_counter"
	}
	insert:
	{
		"OnHitMin" "zombie_prison_push_antiglitch_s4,Enable,,1,-1"
	}
}

modify:
{
	match:
	{
		"origin" "-3475 -1923 -702"
		"classname"	"trigger_once"
	}
	insert:
	{
		"OnStartTouch" "zombie_prison_push_antiglitch_s4,Disable,,8,-1"
	}
}

; Also better automatically kill the pushes in case the CT dont want to go out of the room
modify:
{
	match:
	{
		"targetname" "boss_3_knockback_1_counter"
		"classname" "math_counter"
	}
	insert:
	{
		"OnHitMin" "Zombie_Prison_push1,Kill,,20,-1"
		"OnHitMin" "Zombie_Prison_push2,Kill,,20,-1"
		"OnHitMin" "zombie_prison_push_antiglitch_s4,Kill,,20,-1"
	}
}

;Fix safe spot from stage 3 nuke
add:
{
    "model" "*431"
    "targetname" "stage3nukefix"
    "classname" "trigger_hurt"
    "origin" "-3128 2579 -492"
    "StartDisabled" "1"
    "spawnflags" "1"
    "damage" "50000"
}
modify:
{
    match:
    {
        "classname" "func_breakable"
        "targetname" "boss_3_container"
    }
    insert:
    {
        "OnBreak" "stage3nukefix,Enable,,173,-1"
    }
}

;--------------------------------------------------------------------
; FOLLOWING FIXES BY HOBBITTEN
;--------------------------------------------------------------------

;-------------------------------------------------------------------------------
; Adds another trigger_hurt for stage 3 at the staircase not being reached
;-------------------------------------------------------------------------------
add:
{
	"model" "*287"
	"targetname" "Trigger_nuke3_fix"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-3523.73 3086.4 -1660.5"
	"nodmgforce" "0"
	"damagetype" "64"
	"damagemodel" "0"
	"damagecap" "999999"
	"damage" "999999"
	"classname" "trigger_hurt"
}
modify:
{
	match:
	{
		"classname" "logic_auto"
		"origin" "1804 -1301 8"
	}
	insert:
	{
		"OnMapSpawn" "Trigger_nuke3_fix,AddOutput,angles 90 0,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "Trigger_nuke3"
		"classname" "trigger_hurt"
		"origin" "1988.5 2119.45 -244.5"
	}
	replace:
	{
		"damage" "999999"
		"damagecap" "999999"
	}
}
;------------------------------------------------------------------------------------
; Adds the Trigger_nuke3_fix into the other entities that activates Trigger_nuke3
;------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"targetname" "boss_3_container"
		"classname" "func_breakable"
	}
	insert:
	{
		"OnBreak" "Trigger_nuke3_fix,Enable,,173,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "bomb_track_2"
		"classname" "path_track"
	}
	insert:
	{
		"OnPass" "Trigger_nuke3_fix,Enable,,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "manta_track_6"
		"classname" "path_track"
	}
	insert:
	{
		"OnPass" "Trigger_nuke3_fix,Enable,,3,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "2_Ending"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "Trigger_nuke3_fix,Enable,,3,-1"
		"OnStartTouch" "fix_never_ending_round_relay,Kill,,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "stage_6_win_trigger"
		"classname" "trigger_multiple"
	}
	insert:
	{
		"OnStartTouch" "Trigger_nuke3_fix,Enable,,3,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "Stage_1_Win_Relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "Trigger_nuke3_fix,Enable,,3,-1"
	}
}
;----------------------------------------------------------------------------
; Fixes stage 1 teleporter near elevator not being connected to a location
;----------------------------------------------------------------------------
modify:
{
	match:
	{
		"targetname" "stage_1_teleport_temp_2"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"target" "Teleporter_tomb_Cargo"
	}
}
;-------------------------------------------------------------------------------------------------------------------------
; Adding extra teleporters at stage 3 for the props underneath bridge can be standed on and prevent being teleported
;-------------------------------------------------------------------------------------------------------------------------
add:
{
	"model" "*38"
	"targetname" "stage_3_teleport_perm_6"
	"target" "teleport_core_1_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-4456.59 2782.86 -1205.9"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*38"
	"targetname" "stage_3_teleport_perm_6"
	"target" "teleport_core_1_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-4624 2752 -1205.9"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*38"
	"targetname" "stage_3_teleport_perm_6"
	"target" "teleport_core_1_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-5024 2352 -1287.99"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*38"
	"targetname" "stage_3_teleport_perm_6"
	"target" "teleport_core_1_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-4928 -1328 -1303.99"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*38"
	"targetname" "stage_3_teleport_perm_6"
	"target" "teleport_core_1_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-4496 -2368 -1287.99"
	"classname" "trigger_teleport"
}
add:
{
	"model" "*38"
	"targetname" "stage_3_teleport_perm_6"
	"target" "teleport_core_1_destination"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-5120 -3936 -1223.99"
	"classname" "trigger_teleport"
}
;-------------------------------------------------------------------------
; Fixing stage 2 where the round can never end if no one reaches the end
;-------------------------------------------------------------------------
add:
{
	"origin" "-3480 -2712 -1016"
	"targetname" "fix_never_ending_round_relay"
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnTrigger" "command,Command,say *** HUMANS FAILED TO ESCAPE ***,0,-1"
	"OnTrigger" "ending_explosion_sound,PlaySound,,0,-1"
	"OnTrigger" "ending_screen_fade,Fade,,0,-1"
	"OnTrigger" "Trigger_nuke3_fix,Enable,,3,-1"
	"OnTrigger" "Trigger_nuke3,Enable,,3,-1"
	"OnTrigger" "ending_explosion_sound2,PlaySound,,3,-1"
}
modify:
{
	match:
	{
		"targetname" "Train_path4"
		"classname" "path_track"
	}
	insert:
	{
		"OnPass" "fix_never_ending_round_relay,Trigger,,8,-1"
	}
}

