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

modify:
{
	match:
	{
		"origin" "-11879 -10149 32"
		"classname" "logic_auto"
		"hammerid" "180448"
	}
	delete:
	{
		"OnMapSpawn" "!player,AddOutput,targetname noname,0,-1"
	}
	insert:
	{
		"OnMapSpawn" "player,AddOutput,targetname noname,0,-1"
	}
}

;-----------------------
;REPLACING LEVEL SYSTEM
;-----------------------

;*************************
; Deleting the Old System
;*************************

filter:
{
	"targetname" "physics_bug_trigger"
	"classname" "trigger_once"
}
filter:
{
	"targetname" "chapters_wheel"
	"classname" "func_physbox"
}
filter:
{
	"origin" "-11981 -10313 56"
	"model" "models/props/de_train/barrel.mdl"
	"classname" "prop_physics"
	"hammerid" "116"
}
filter:
{
	"targetname" "/chapters_brush.*/"
	"classname" "func_brush"
}
filter:
{
	"targetname" "physics_bug_trigger"
	"classname" "trigger_once"
	"hammerid" "208"
}
filter:
{
	"targetname" "chapter1_trigger"
	"classname" "trigger_once"
}
filter:
{
	"targetname" "chapter2_trigger"
	"classname" "trigger_once"
}
filter:
{
	"targetname" "chapter3_trigger"
	"classname" "trigger_once"
}

;************
; New System
;************

modify:
{
	match:
	{
		"origin" "-11879 -10149 32"
		"classname" "logic_auto"
		"hammerid" "180448"
	}
	insert:
	{
		"OnMapSpawn" "Map_InitPermEntities,FireUser1,,0,1"
		"OnMapSpawn" "Level_Counter,GetValue,,0.02,1"
	}
}

add:
{
	"targetname" "Map_InitPermEntities"
	"origin" "0 0 0"
	"classname" "info_target"
	"OnUser1" "Template_PermEntities,ForceSpawn,,0,1"
	"OnUser1" "Level_Counter,AddOutput,classname info_target,0.03,1"
	"OnUser1" "!self,Kill,,0.06,1"
}
add:
{
	"targetname" "Template_PermEntities"
	"origin" "0 0 0"
	"Template01" "Level_Counter"
	"spawnflags" "2"
	"classname" "point_template"
	"OnEntitySpawned" "!self,Kill,,0,-1"
}

add:
{
	"origin" "0 0 0"
	"targetname" "Level_Counter"
	"startvalue" "1"
	"min" "1"
	"max" "3"
	"classname" "math_counter"
	"OnGetValue" "Level_Case,InValue,,0,-1"
}

add:
{
	"origin" "0 0 0"
	"targetname" "Level_Case"
	"Case01" "1"
	"Case02" "2"
	"Case03" "3"
	"classname" "logic_case"
	"OnCase01" "Relay_Level_Normal,Trigger,,0,1"
	"OnCase02" "Relay_Level_Hard,Trigger,,0,1"
	"OnCase03" "Relay_Level_Extreme,Trigger,,0,1"
}
add:
{
	"origin" "0 0 0"
	"targetname" "Relay_Level_Normal"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnTrigger" "serv_command,Command,say >>> ZE PORTAL STORY - NORMAL DIFFICULTY <<<,0.01,-1"
	"OnTrigger" "lvl1_health_norm,SetValue,1,0.01,-1"
	"OnTrigger" "norm_snd,PlaySound,,0.01,-1"
	"OnTrigger" "lvl1_end_score_norm,Enable,,0.01,-1"
	"OnTrigger" "lvl1_portal_timer,Kill,,0.01,-1"
	"OnTrigger" "lvl1_glados_rocket1_platform,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_2_pipe3,Kill,,0.01,-1"
	"OnTrigger" "lvl1_door3_box2,Kill,,0.01,-1"
}
add:
{
	"origin" "0 0 0"
	"targetname" "Relay_Level_Hard"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnTrigger" "serv_command,Command,say >>> ZE PORTAL STORY - HARD DIFFICULTY <<<,0.01,-1"
	"OnTrigger" "lvl1_health_hrd,SetValue,1,0.01,-1"
	"OnTrigger" "lvl1_door1_box1,Break,,0.01,-1"
	"OnTrigger" "lvl1_door2_box1,Break,,0.01,-1"
	"OnTrigger" "lvl1_door3_box,Kill,,0.01,-1"
	"OnTrigger" "norm_snd,PlaySound,,0.01,-1"
	"OnTrigger" "lvl1_end_score_hard,Enable,,0.01,-1"
	"OnTrigger" "lvl1_glados_rocket1_platform,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path1_2_crate1,Kill,,0.01,-1"
	"OnTrigger" "lvl1_door4_box1,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_2_pipe1,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_2_pipe4,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_1_box,Kill,,0.01,-1"
}
add:
{
	"origin" "0 0 0"
	"targetname" "Relay_Level_Extreme"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnTrigger" "extr_snd,PlaySound,,0.01,-1"
	"OnTrigger" "lvl1_door3_box,Kill,,0.01,-1"
	"OnTrigger" "lvl1_door2_box1,Break,,0.01,-1"
	"OnTrigger" "lvl1_door1_box1,Break,,0.01,-1"
	"OnTrigger" "lvl1_health_extr,SetValue,1,0.01,-1"
	"OnTrigger" "serv_command,Command,say >>> ZE PORTAL STORY - EXTREME DIFFICULTY <<<,0.01,-1"
	"OnTrigger" "lvl1_door1_box2,Break,,0.01,-1"
	"OnTrigger" "lvl1_door2_box2,Break,,0.01,-1"
	"OnTrigger" "lvl1_end_score_extr,Enable,,0.01,-1"
	"OnTrigger" "lvl1_music_branch1,SetValue,1,0.01,-1"
	"OnTrigger" "lvl1_music_branch3,SetValue,1,0.01,-1"
	"OnTrigger" "lvl1_music_branch4,SetValue,1,0.01,-1"
	"OnTrigger" "lvl1_music_branch5,SetValue,1,0.01,-1"
	"OnTrigger" "global_Ts_heal,Enable,,0.01,-1"
	"OnTrigger" "lvl1_door3_box2,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path1_2_crate1,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path1_2_crate2,Kill,,0.01,-1"
	"OnTrigger" "lvl1_door4_box1,Kill,,0.01,-1"
	"OnTrigger" "lvl1_door4_box2,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_2_pipe1,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_2_pipe2,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_2_pipe4,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_2_wall,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_1_box,Kill,,0.01,-1"
	"OnTrigger" "lvl1_path2_1_wall,Kill,,0.01,-1"
	"OnTrigger" "lvl1_glados_hpfire,Start,,0.01,-1"
	"OnTrigger" "global_CTs_heal,Enable,,0.01,-1"
}

; Level Ending

modify:
{
	match:
	{
		"targetname" "lvl1_end_score_norm"
		"classname" "trigger_multiple"
	}
	delete:
	{
		"OnTrigger" "chapters_brush4,Disable,,0,1"
		"OnTrigger" "chapters_brush3,Enable,,0,1"
		"OnTrigger" "chapters_brush2,Enable,,0,1"
		"OnTrigger" "chapters_brush1,Disable,,0,1"
	}
	insert:
	{
		"OnTrigger" "Level_Counter,SetValue,2,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "lvl1_end_score_hard"
		"classname" "trigger_multiple"
	}
	delete:
	{
		"OnTrigger" "chapters_brush1,Disable,,0,1"
		"OnTrigger" "chapters_brush2,Disable,,0,1"
		"OnTrigger" "chapters_brush3,Enable,,0,1"
		"OnTrigger" "chapters_brush4,Enable,,0,1"
	}
	insert:
	{
		"OnTrigger" "Level_Counter,SetValue,3,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "lvl1_end_score_extr"
		"classname" "trigger_multiple"
	}
	delete:
	{
		"OnTrigger" "chapters_brush1,Enable,,0,1"
		"OnTrigger" "chapters_brush2,Enable,,0,1"
		"OnTrigger" "chapters_brush3,Disable,,0,1"
		"OnTrigger" "chapters_brush4,Disable,,0,1"
	}
	insert:
	{
		"OnTrigger" "Level_Counter,SetValue,1,0,1"
	}
}

; Admin Room

modify:
{
	match:
	{
		"origin" "-11781 -10081 23.96"
		"classname" "func_button"
		"hammerid" "153124"
	}
	delete:
	{
		"OnPressed" "chapters_brush4,Disable,,0,-1"
		"OnPressed" "chapters_brush3,Disable,,0,-1"
		"OnPressed" "chapters_brush2,Enable,,0,-1"
		"OnPressed" "chapters_brush1,Enable,,0,-1"
	}
	insert:
	{
		"targetname" "AdminRoom_Normal"
		"OnPressed" "Level_Counter,SetValue,1,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-11781 -10145 23.96"
		"classname" "func_button"
		"hammerid" "153259"
	}
	delete:
	{
		"OnPressed" "chapters_brush4,Disable,,0,-1"
		"OnPressed" "chapters_brush3,Enable,,0,-1"
		"OnPressed" "chapters_brush2,Enable,,0,-1"
		"OnPressed" "chapters_brush1,Disable,,0,-1"
	}
	insert:
	{
		"targetname" "AdminRoom_Hard"
		"OnPressed" "Level_Counter,SetValue,2,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-11781 -10209 23.96"
		"classname" "func_button"
		"hammerid" "153266"
	}
	delete:
	{
		"OnPressed" "chapters_brush4,Enable,,0,-1"
		"OnPressed" "chapters_brush3,Enable,,0,-1"
		"OnPressed" "chapters_brush2,Disable,,0,-1"
		"OnPressed" "chapters_brush1,Disable,,0,-1"
	}
	insert:
	{
		"targetname" "AdminRoom_Extreme"
		"OnPressed" "Level_Counter,SetValue,3,0,-1"
	}
}

;-------------------
;ITEMS BUTTON MOVED
;-------------------

modify:
{
	match:
	{
		"origin" "-12098.4 -11001 65.43"
		"targetname" "RepulsiongellButton"
		"classname" "func_rot_button"
	}
	replace:
	{
		"origin" "-12091.4 -11001 58.43"
	}
}
modify:
{
	match:
	{
		"origin" "-12007.6 -11446 -8.61"
		"targetname" "propulsiongelbutton"
		"classname" "func_rot_button"
	}
	replace:
	{
		"origin" "-12000.6 -11446 -15.61"
	}
}

;--------------
;BOSS HP FIXES
;--------------

modify:
{
	match:
	{
		"targetname" "lvl1_cts_counter_trigger"
	}
	delete:
	{
		"OnTrigger" "lvl1_health_norm,Test,,0,-1"
		"OnTrigger" "lvl1_health_hrd,Test,,0,-1"
		"OnTrigger" "lvl1_health_extr,Test,,0,-1"
	}
	insert:
	{
		"OnStartTouch" "lvl1_health_norm,Test,,0,-1"
		"OnStartTouch" "lvl1_health_hrd,Test,,0,-1"
		"OnStartTouch" "lvl1_health_extr,Test,,0,-1"
	}
}




;; _

;; small helpers for humans during ending

add:
{
	"model" "*74"
	"targetname" "lvl1_end_push"
	"StartDisabled" "1"
	"speed" "500"
	"spawnflags" "1"
	"pushdir" "0 90 0"
	"origin" "-8324 -12350 1887"
	"filtername" "CTs_only"
	"alternateticksfix" "0"
	"classname" "trigger_push"
}
add:
{
	"model" "*77"
	"targetname" "lvl1_end_boost"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-8336 -12695 1786"
	"filtername" "CTs_only"
	"classname" "trigger_once"
	"OnStartTouch" "!activator,AddOutput,basevelocity 0 0 260,0,-1"
}

modify:
{
	match:
	{
		"targetname" "lvl1_safety_relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "lvl1_end_boost,Enable,,15.9,1"
	}
}