;modify:
;{
;	match:
;	{
;		"classname" "logic_auto"
;	}
;	insert:
;	{
;		"OnNewGame"	"server,Command,say *** Stripper 2 loaded ***,25,-1"
;	}
;}

;modify:
;{
;	match:
;	{
;		"damagetype" "8"
;	}
;	replace:
;	{
;		"damagetype" "16384"
;	}
;}

;modify:
;{
;	match:
;	{
;		"targetname" "item_zombie_devour_show_move"
;	}
;	replace:
;	{
;		"classname" "func_door"
;		"spawnflags" "4108"
;	}
;	delete:
;	{
;		"movedistance" "160"
;	}
;	insert:
;	{
;		"lip" "-160"
;		"wait" "-1"
;	}
;}

;modify:
;{
;	match:
;	{
;		"origin" "-1472 -3488 -3392"
;		"targetname" "lv4_final_end_laser_maker_top"
;	}
;	insert:
;	{
;		"OnEntitySpawned"	"lv3_final_d1_hurt3*,FireUser1,,0,-1"
;	}
;}
;modify:
;{
;	match:
;	{
;		"origin" "-1472 -3488 -3544"
;		"targetname" "lv4_final_end_laser_maker_bottom"
;	}
;	insert:
;	{
;		"OnEntitySpawned"	"lv3_final_d1_hurt3*,FireUser1,,0,-1"
;	}
;}

;modify:
;{
;	match:
;	{
;		"model" "*22"
;		"targetname" "lv3_final_d1_hurt3"
;	}
;	insert:
;	{
;		"OnUser1"	"!self,AddOutput,damage 160,0,1"
;	}
;}



;-----------------------
;Fix game_text holdtime
;-----------------------
filter:
{
	"classname" "logic_timer"
	"targetname" "text_stage_timer"
}
modify:
{
	match:
	{
		"classname" "game_text"
		"targetname" "text_stage"
	}
	replace:
	{
		"holdtime" "5"
	}
	insert:
	{
		"OnUser1" "!self,Display,,0,-1"
		"OnUser1" "!self,FireUser1,,5,-1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "lv4_final_relay"
	}
	delete:
	{
		"OnTrigger" "text_stage,Display,,147.7,-1"
	}
	insert:
	{
		"OnTrigger" "text_stage,FireUser1,,147.7,-1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "rtv_trigger"
	}
	delete:
	{
		"OnTrigger" "text_stage,Display,,1,1"
	}
	insert:
	{
		"OnTrigger" "text_stage,FireUser1,,1,1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "lv4_case_relay"
	}
	delete:
	{
		"OnTrigger" "text_stage,Display,,1,1"
	}
	insert:
	{
		"OnTrigger" "text_stage,FireUser1,,1,1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "lv3_case_relay"
	}
	delete:
	{
		"OnTrigger" "text_stage,Display,,1,1"
	}
	insert:
	{
		"OnTrigger" "text_stage,FireUser1,,1,1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "lv1_case_relay"
	}
	delete:
	{
		"OnTrigger" "text_stage,Display,,1,1"
	}
	insert:
	{
		"OnTrigger" "text_stage,FireUser1,,1,1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "lv2_case_relay"
	}
	delete:
	{
		"OnTrigger" "text_stage,Display,,1,1"
	}
	insert:
	{
		"OnTrigger" "text_stage,FireUser1,,1,1"
	}
}

;-------------------------------------
;Fix stage 4 boss music playing early
;-------------------------------------
modify:
{
	match:
	{
		"targetname" "lv4_light_trigger"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "lv4_music2,PlaySound,,0,1"
		"OnStartTouch" "lv4_music1,StopSound,,0,1"
		"OnStartTouch" "music_text,SetText,Bgm:Danger 8:02 - Danger,4.9,1"
		"OnStartTouch" "music_text,Display,,5,1"
	}
	insert:
	{
		"OnStartTouch" "lv4_music2,PlaySound,,60,1"
		"OnStartTouch" "lv4_music1,StopSound,,60,1"
		"OnStartTouch" "music_text,SetText,Bgm:Danger - 8:02,64.9,1"
		"OnStartTouch" "music_text,Display,,65,1"
	}
}

;-----------------------
;Fix broken damage type
;-----------------------
modify:
{
	match:
	{
		"damagetype" "8"
	}
	replace:
	{
		"damagetype" "16384"
	}
}

;-------------------------------------------------
;Fix zm devour not moving due to func_door change
;-------------------------------------------------
modify:
{
	match:
	{
		"targetname" "item_zombie_devour_show_move"
	}
	replace:
	{
		"classname" "func_door"
		"spawnflags" "4108"
	}
	delete:
	{
		"movedistance" "160"
	}
	insert:
	{
		"lip" "-160"
		"wait" "-1"
	}
}

;------------------------------------------------
;Make RTV stage end lasers instakill as intended
;------------------------------------------------
modify:
{
	match:
	{
		"origin" "-1472 -3488 -3392"
		"targetname" "lv4_final_end_laser_maker_top"
	}
	insert:
	{
		"OnEntitySpawned" "lv3_final_d1_hurt3*,FireUser1,,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-1472 -3488 -3544"
		"targetname" "lv4_final_end_laser_maker_bottom"
	}
	insert:
	{
		"OnEntitySpawned" "lv3_final_d1_hurt3*,FireUser1,,0,-1"
	}
}
modify:
{
	match:
	{
		"model" "*22"
		"targetname" "lv3_final_d1_hurt3"
	}
	insert:
	{
		"OnUser1" "!self,AddOutput,damage 160,0,1"
	}
}

;--------------------------------------
;Fix music volume not being adjustable
;--------------------------------------
modify:
{
	match:
	{
		"message" "celestials.mp3"
	}
	replace:
	{
		"message" "#celestials.mp3"
	}
}
modify:
{
	match:
	{
		"message" "danger753.mp3"
	}
	replace:
	{
		"message" "#danger753.mp3"
	}
}
modify:
{
	match:
	{
		"message" "danger802.mp3"
	}
	replace:
	{
		"message" "#danger802.mp3"
	}
}
modify:
{
	match:
	{
		"message" "forgiveness.mp3"
	}
	replace:
	{
		"message" "#forgiveness.mp3"
	}
}
modify:
{
	match:
	{
		"message" "forgiveness0.mp3"
	}
	replace:
	{
		"message" "#forgiveness0.mp3"
	}
}
modify:
{
	match:
	{
		"message" "innercity1.mp3"
	}
	replace:
	{
		"message" "#innercity1.mp3"
	}
}
modify:
{
	match:
	{
		"message" "innercity2.mp3"
	}
	replace:
	{
		"message" "#innercity2.mp3"
	}
}
modify:
{
	match:
	{
		"message" "liberation.mp3"
	}
	replace:
	{
		"message" "#liberation.mp3"
	}
}
modify:
{
	match:
	{
		"message" "light and shadow.mp3"
	}
	replace:
	{
		"message" "#light and shadow.mp3"
	}
}
modify:
{
	match:
	{
		"message" "xi.mp3"
	}
	replace:
	{
		"message" "#xi.mp3"
	}
}
modify:
{
	match:
	{
		"message" "nova.wav"
	}
	replace:
	{
		"message" "#nova.wav"
	}
}
modify:
{
	match:
	{
		"message" "song trooper.wav"
	}
	replace:
	{
		"message" "song trooper.wav"
	}
}

;------------------------------------------------------------
;Move core stage boss attack lower to account for css height
;------------------------------------------------------------
modify:
{
	match:
	{
		"targetname" "lv2_boss_d1_maker2"
		"classname" "env_entity_maker"
		"hammerid" "144270"
	}
	replace:
	{
		"origin" "-11683 -1512 -5850"
	}
}
modify:
{
	match:
	{
		"targetname" "lv2_boss_d1_maker"
		"classname" "env_entity_maker"
		"hammerid" "142039"
	}
	replace:
	{
		"origin" "-11683 -1508 -5850"
	}
}

;-----------------------------------------------
; Prevent players getting stuck in the elevator
;-----------------------------------------------
filter:
{
	"targetname" "lv2_move1_1"
	"classname" "func_movelinear"
	"hammerid" "13966"
}
add:
{
	"model" "*777"
	"hammerid" "13966"
	"classname" "func_door"
	"disablereceiveshadows" "1"
	"disableshadows" "1"
	"dmg" "10000"
	"forceclosed" "1"
	"health" "0"
	"ignoredebris" "0"
	"lip" "-192"
	"locked_sentence" "0"
	"loopmovesound" "0"
	"movedir" "-90 0 0"
	"origin" "-11683 -1508 -7279"
	"renderamt" "255"
	"rendercolor" "255 255 255"
	"renderfx" "0"
	"rendermode" "0"
	"spawnflags" "4096"
	"spawnpos" "0"
	"speed" "52"
	"targetname" "lv2_move1_1"
	"unlocked_sentence" "0"
	"wait" "-1"
}

; Add a safe teleport destination for the elevator
; In case anyone get stuck
; Should never happen but just in case..
add:
{
	"origin" "-11680 -1536 -7170"
	"targetname" "elevator_stuck_dest"
	"angles" "0 90 0"
	"parentname" "lv2_move1_1"
	"classname" "info_teleport_destination"
}
add:
{
	"model" "*777"
	"UseLandmarkAngles" "0"
	"targetname" "lv4_end_tele_all"
	"target" "elevator_stuck_dest"
	"filtername" "filter_ct"
	"StartDisabled" "0"
	"spawnflags" "4097"
	"origin" "-11683 -1508 -7283"
	"CheckDestIfClearForPlayer" "0"
	"classname" "trigger_teleport"
	"hammerid" "610712"
	"OnStartTouch" "!self,Kill,,5,-1"
}
