;Fix stage 4 nuke
modify:
{
	match:
	{
		"classname"		"trigger_multiple"
		"targetname"	"stage_4_escape_elevator_trigger_win"
	}
	insert:
	{
		"parentname"	"stage_4_escape_elevator"
	}
}


;; _

;; stage 3 - players can't block elevator

modify:
{
	match:
	{
		"targetname" "stage_3_facility_mine_elevator"
		"classname" "func_movelinear"
	}
	replace:
	{
		"blockdamage" "1000"
	}
}

;; stage 3 - fix afk teleport origin

modify:
{
	match:
	{
		"targetname" "stage_3_afk_teleport_3"
		"classname" "trigger_teleport"
	}
	replace:
	{
		"origin" "-9888 7552 6815"
	}
}

;; stage 3 - block cave skip, playerclips for last elevator

add:
{
	"targetname" "stage3_clip"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-9460.5 8500.5 7356"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -537 -5.5 -60,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 537 5.5 60,0.1,1"
}
add:
{
	"targetname" "stage3_clip"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "240 8648 7679"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -16 -24 -128,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 16 24 128,0.1,1"
}
add:
{
	"targetname" "stage3_clip"
	"vrad_brush_cast_shadows" "0"
	"StartDisabled" "0"
	"spawnflags" "2"
	"Solidity" "0"
	"solidbsp" "0"
	"rendermode" "10"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-240 8648 7679"
	"invert_exclusion" "0"
	"InputFilter" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"classname" "func_brush"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -16 -24 -128,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 16 24 128,0.1,1"
}

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "4783"
	}
	insert:
	{
		"OnMapSpawn" "stage3_clip,FireUser1,,0,-1"
	}
}

;; stage 4 - fix crane collision model

modify:
{
	match:
	{
		"model" "models/cranes/crane_docks.mdl"
		"classname" "prop_dynamic_override"
		"hammerid" "18302"
	}
	replace:
	{
		"solid" "0"
	}
}

;; stage 5 - fix nuke

modify:
{
	match:
	{
		"targetname" "stage_5_zombie_detector"
		"classname" "trigger_multiple"
	}
	insert:
	{
		"parentname" "Helicopter"
	}
}

;; stage 5 - players can't block elevators

modify:
{
	match:
	{
		"targetname" "/illya_parking_lift_[A-B]/"
		"classname" "func_movelinear"
	}
	replace:
	{
		"blockdamage" "10000"
	}
}
modify:
{
	match:
	{
		"targetname" "/illya_parking_lift_[A-B]_door/"
		"classname" "func_door"
	}
	replace:
	{
		"ignoredebris" "0"
	}
}
modify:
{
	match:
	{
		"targetname" "/illya_parking_lift_[A-B]_door_bottom/"
		"classname" "func_door"
	}
	replace:
	{
		"ignoredebris" "0"
	}
}

;; stage 4 - split players on spawn

add:
{
	"model" "*47"
	"wait" "1"
	"targetname" "stage4_spawn_tele_ct"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "11768 14848 14448"
	"filtername" "filter_humans"
	"classname" "trigger_multiple"
	"OnStartTouch" "stage4_spawn_case_ct,PickRandomShuffle,,0,-1"
}
add:
{
	"origin" "11768 14868 14468"
	"targetname" "stage4_spawn_case_ct"
	"classname" "logic_case"
	"OnCase01" "!activator,AddOutput,origin -11840 13824 13320,0,-1"
	"OnCase02" "!activator,AddOutput,origin -12736 13824 13320,0,-1"
}
add:
{
	"model" "*47"
	"wait" "1"
	"targetname" "stage4_spawn_tele_t"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "11768 14848 14448"
	"filtername" "filter_zombies"
	"classname" "trigger_multiple"
	"OnStartTouch" "stage4_spawn_case_t,PickRandomShuffle,,0,-1"
}
add:
{
	"origin" "11768 14868 14478"
	"targetname" "stage4_spawn_case_t"
	"classname" "logic_case"
	"OnCase01" "!activator,AddOutput,origin -13568 13824 13256,0,-1"
	"OnCase02" "!activator,AddOutput,origin -11008 13824 13256,0,-1"
}

modify:
{
	match:
	{
		"targetname" "stage_case"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase05" "teleport_destination_afk,AddOutput,origin -11024 13824 13264,0,1"
		"OnCase05" "teleport_destination_afk,AddOutput,angles 0 180 0,0,1"
	}
	insert:
	{
		"OnCase05" "spawn_teleport,Kill,,0,1"
		"OnCase05" "stage4_spawn_tele_ct,Enable,,2,1"
		"OnCase05" "stage4_spawn_tele_t,Enable,,3,1"
	}
}

;; stage 5 - boss arena rework

add:
{
	"origin" "-5032 3952 7744"
	"spawnflags" "0"
	"solid" "6"
	"skin" "0"
	"SetBodyGroup" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"RandomAnimation" "0"
	"pressuredelay" "0"
	"PerformanceMode" "0"
	"modelscale" "1.0"
	"model" "models/props_wasteland/interior_fence001g.mdl"
	"MinAnimTime" "5"
	"MaxAnimTime" "10"
	"health" "0"
	"fadescale" "1"
	"fademindist" "-1"
	"ExplodeRadius" "0"
	"ExplodeDamage" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"DisableBoneFollowers" "0"
	"angles" "0 0 0"
	"classname" "prop_dynamic_override"
}
add:
{
	"origin" "-5032 4080 7728"
	"StartDisabled" "0"
	"spawnflags" "0"
	"solid" "6"
	"skin" "0"
	"SetBodyGroup" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"RandomAnimation" "0"
	"pressuredelay" "0"
	"PerformanceMode" "0"
	"model" "models/props/de_nuke/crate_extrasmall.mdl"
	"mindxlevel" "0"
	"MinAnimTime" "5"
	"maxdxlevel" "0"
	"MaxAnimTime" "10"
	"fadescale" "1"
	"fademindist" "-1"
	"fademaxdist" "0"
	"ExplodeRadius" "0"
	"ExplodeDamage" "0"
	"disableshadows" "1"
	"disablereceiveshadows" "1"
	"DisableBoneFollowers" "1"
	"angles" "0 0 0"
	"classname" "prop_dynamic"
}
add:
{
	"classname" "prop_dynamic"
	"origin" "-4980 4124 7680"
	"angles" "0 90 0"
	"model" "models/props_lab/blastdoor001c.mdl"
	"disablereceiveshadows" "1"
	"disableshadows" "1"
	"solid" "6"
	"rendermode" "10"
}
add:
{
	"model" "*179"
	"targetname" "stage_5_finale_zombie_blocker_tp"
	"target" "teleport_destination_afk"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "-4608 3584 8000"
	"filtername" "filter_zombies"
	"classname" "trigger_teleport"
}

modify:
{
	match:
	{
		"targetname" "depth_titan_End"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "stage_5_finale_zombie_blocker_tp,Enable,,0,1"
		"OnTrigger" "stage_5_finale_zombie_blocker_tp,Disable,,1,1"
	}
}

;; stage 1,2,3,5 - fix zombie checker

modify:
{
	match:
	{
		"targetname" "/stage_[1-5]_zombie_detector/"
		"classname" "trigger_multiple"
	}
	replace:
	{
		"wait" "1"
	}
}


