;-----------------
;Stripper message
;-----------------
modify:
{
	match:
	{
		"classname" "logic_auto"
		"origin" "-8970 12164 6239"
	}
	insert:
	{
		"OnMapSpawn" "cmd,Command,say *** MAP MODIFIED (4-14-2024) ***,3,-1"
	}
}

;-------------
;Disable bhop
;-------------
modify:
{
	match:
	{
		"classname" "logic_auto"
		"origin" "-8970 12164 6239"
	}
	insert:
	{
		"OnMapSpawn" "cmd,Command,sv_enablebunnyhopping 0,0,-1"
	}
}

;----------------------------
;Edict cleanup/optimizations
;----------------------------
modify:
{
	match:
	{
		"origin" "-8937.82 -95.6208 1205"
		"targetname" "boss_start_r_main"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "y_d1,Kill,,0,-1"
		"OnTrigger" "y_d2,Kill,,0,-1"
		"OnTrigger" "y_d3,Kill,,0,-1"
		"OnTrigger" "g_d1,Kill,,0,-1"
		"OnTrigger" "g_d2,Kill,,0,-1"
		"OnTrigger" "g_m1,Kill,,0,-1"
		"OnTrigger" "g_d4,Kill,,0,-1"
		"OnTrigger" "g_d5,Kill,,0,-1"
		"OnTrigger" "g_d6,Kill,,0,-1"
		"OnTrigger" "g_d7,Kill,,0,-1"
		"OnTrigger" "g_m_2,Kill,,0,-1"
		"OnTrigger" "b_d1,Kill,,0,-1"
		"OnTrigger" "b_d2,Kill,,0,-1"
		"OnTrigger" "b_d3,Kill,,0,-1"
		"OnTrigger" "b_d4,Kill,,0,-1"
		"OnTrigger" "b_d5,Kill,,0,-1"
		"OnTrigger" "p_d1,Kill,,0,-1"
		"OnTrigger" "p_d2,Kill,,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-8388 -248 2490"
		"targetname" "skill_kill_relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-3078.89 9221.38 5640.86"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnSpawn" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-3088 9145 5711"
		"targetname" "z_grav_maker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-6840 12897 5664"
		"targetname" "z_heal_maker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-1592 7649 5713"
		"targetname" "rejection_item_maker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "4106 10163 1584"
		"targetname" "fact_item_maker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-2764 10973 -11093"
		"targetname" "escapism_item_maker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "448 4880 1823"
		"targetname" "z_ice_item_maker"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "4352 10409 1744"
		"targetname" "g_npc_1"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-2136 8194 5680"
		"targetname" "y_npc_1"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "9170 9544 -4727"
		"targetname" "b_npc_1"
		"classname" "env_entity_maker"
	}
	insert:
	{
		"OnEntitySpawned" "!self,Kill,,0.1,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-7927.3 265 2436.43"
		"targetname" "ende_relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "p_bgm,Kill,,5.02,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "b_once_3"
		"origin" "7000 10985 -5525"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnTrigger" "b_bgm,Kill,0,115.02,1"
	}
}
modify:
{
	match:
	{
		"targetname" "y_once_4"
		"origin" "0 6057 5607"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "y_bgm,Kill,,15.02,1"
	}
}
modify:
{
	match:
	{
		"targetname" "g_once_5"
		"origin" "8676 13737 -265"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "g_bgm,Kill,,65.02,1"
	}
}

;---------------------------------------
;Replace boss targetname + buff boss hp
;---------------------------------------
modify:
{
	match:
	{
		"origin" "-8702 -700 1205"
		"targetname" "#954C93"
		"classname" "math_counter"
	}
	replace:
	{
		"targetname" "boss_counter"
	}
	delete:
	{
		"OnHitMin" "segments,Subtract,1,0,-1"
	}
	insert:
	{
		"OnHitMin" "boss_segments,Subtract,1,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "boss_addhp"
		"origin" "-8171.5 0.5 1074.99"
		"classname" "trigger_multiple"
	}
	delete:
	{
		"OnStartTouch" "#954C93,Add,60,0,-1"
	}
	insert:
	{
		"OnStartTouch" "boss_counter,Add,90,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "boss_hitbox"
		"origin" "-8172 0 2225"
		"classname" "func_breakable"
	}
	delete:
	{
		"OnHealthChanged" "#954C93,Subtract,1,0,-1"
	}
	insert:
	{
		"OnHealthChanged" "boss_counter,Subtract,1,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-8702 -716 1205"
		"targetname" "segments"
		"classname" "math_counter"
	}
	replace:
	{
		"targetname" "boss_segments"
	}
}

;-----------------------------------
;Fix random teleport after elevator
;-----------------------------------
filter:
{
	"targetname" "/afk_d_4_(a|b)/"
	"classname" "info_teleport_destination"
}
add:
{
	"origin" "3728 11257 2776"
	"targetname" "afk_d_4_a"
	"angles" "0 0 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "5200 9785 2776"
	"targetname" "afk_d_4_b"
	"angles" "0 90 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "5200 9785 2776"
	"targetname" "afk4_tele_random"
	"classname" "logic_case"
	"OnCase01" "afk_d_4_a,Teleport,,0,-1"
	"OnCase02" "afk_d_4_b,Teleport,,0,-1"
}
modify:
{
	match:
	{
		"targetname" "afk_4"
		"classname" "trigger_teleport"
	}
	replace:
	{
		"classname" "trigger_multiple"
	}
	delete:
	{
		"target" "afk_d_4_*"
	}
	insert:
	{
		"OnStartTouch" "afk4_tele_random,PickRandomShuffle,,0,-1"
	}
}

;----------------------------------
;Fix random teleport before stairs
;----------------------------------
filter:
{
	"targetname" "/afk_d_5_(a|b)/"
	"classname" "info_teleport_destination"
}
add:
{
	"origin" "5952 12969 2872"
	"targetname" "afk_d_5_a"
	"angles" "0 0 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "6896 12009 2872"
	"targetname" "afk_d_5_b"
	"angles" "0 90 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "5200 9785 2776"
	"targetname" "afk5_tele_random"
	"classname" "logic_case"
	"OnCase01" "afk_d_5_a,Teleport,,0,-1"
	"OnCase02" "afk_d_5_b,Teleport,,0,-1"
}
modify:
{
	match:
	{
		"targetname" "afk_5"
		"classname" "trigger_teleport"
	}
	replace:
	{
		"classname" "trigger_multiple"
	}
	delete:
	{
		"target" "afk_d_5_*"
	}
	insert:
	{
		"OnStartTouch" "afk5_tele_random,PickRandomShuffle,,0,-1"
	}
}

;---------------------------------
;Fix random teleport in boss room
;---------------------------------
filter:
{
	"classname" "info_teleport_destination"
	"targetname" "/boss_fall_d_(a|b|c|e)/"
}
add:
{
	"origin" "-7404 768 1197"
	"targetname" "boss_fall_d_a"
	"angles" "0 225 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "-8940 768 1197"
	"targetname" "boss_fall_d_b"
	"angles" "0 315 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "-8940 -768 1197"
	"targetname" "boss_fall_d_c"
	"angles" "0 45 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "-7404 -768 1197"
	"targetname" "boss_fall_d_e"
	"angles" "0 135 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "-7436 800 1216"
	"targetname" "boss_fall_d_random"
	"classname" "logic_case"
	"OnCase01" "boss_fall_d_a,Teleport,,0,-1"
	"OnCase02" "boss_fall_d_b,Teleport,,0,-1"
	"OnCase03" "boss_fall_d_c,Teleport,,0,-1"
	"OnCase04" "boss_fall_d_e,Teleport,,0,-1"
}
modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"targetname" "boss_fall_human"
		"origin" "-8172 0 442.5"
	}
	replace:
	{
		"classname" "trigger_multiple"
	}
	delete:
	{
		"target" "boss_fall_d_*"
	}
	insert:
	{
		"OnStartTouch" "boss_fall_d_random,PickRandomShuffle,,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-3352 10981 -13652"
		"classname" "trigger_teleport"
	}
	replace:
	{
		"classname" "trigger_multiple"
	}
	delete:
	{
		"target" "boss_fall_d_a"
	}
	insert:
	{
		"OnStartTouch" "boss_fall_d_random,PickRandomShuffle,,0,-1"
	}
}

;-------------------------------------
;Fix random teleport after boss fight
;-------------------------------------
filter:
{
	"targetname" "/ende_des_(1|2)/"
	"classname" "info_teleport_destination"
}
add:
{
	"origin" "0 -4760 1416"
	"targetname" "ende_des_1"
	"angles" "0 90 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "0 4824 1416"
	"targetname" "ende_des_2"
	"angles" "0 270 0"
	"classname" "point_teleport"
	"target" "!activator"
}
add:
{
	"origin" "5200 9785 2776"
	"targetname" "ende_tele_random"
	"classname" "logic_case"
	"OnCase01" "ende_des_1,Teleport,,0,-1"
	"OnCase02" "ende_des_2,Teleport,,0,-1"
}
modify:
{
	match:
	{
		"origin" "-8171 0 -878.5"
		"classname" "trigger_teleport"
		"hammerid" "232301"
	}
	replace:
	{
		"classname" "trigger_multiple"
	}
	delete:
	{
		"target" "ende_des_*"
	}
	insert:
	{
		"OnStartTouch" "ende_tele_random,PickRandomShuffle,,0,-1"
	}
}

;-----------------
;Buff boss damage
;-----------------
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "12_hurt"
	}
	replace:
	{
		"damage" "80"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "3_h"
	}
	replace:
	{
		"damage" "60"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "5_hurt"
	}
	replace:
	{
		"damage" "60"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "6_h"
	}
	replace:
	{
		"damage" "60"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "4_hurt"
	}
	replace:
	{
		"damage" "80"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "4_hurt_2"
	}
	replace:
	{
		"damage" "80"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "8_h"
	}
	replace:
	{
		"damage" "40"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "10_hurt"
	}
	replace:
	{
		"damage" "40"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "2_hurt_1"
	}
	replace:
	{
		"damage" "60"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "2_hurt_2"
	}
	replace:
	{
		"damage" "60"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "9_hurt"
	}
	replace:
	{
		"damage" "60"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "11_hurt"
	}
	replace:
	{
		"damage" "20"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "1_h"
	}
	replace:
	{
		"damage" "60"
	}
}

;---------------------------
;Increase ending difficulty
;---------------------------
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "ende_ball_hurt1"
	}
	replace:
	{
		"damage" "200"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "ende_laser_hurt1"
	}
	replace:
	{
		"damage" "200"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "ende_ring_hurt"
	}
	replace:
	{
		"damage" "200"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "ball_h"
	}
	insert:
	{
		"filtername" "ct"
	}
}

;------------------------------
;Fix unadjustable music volume
;------------------------------
modify:
{
	match:
	{
		"origin" "-7934.66 265 2458.54"
		"targetname" "ende_bgm"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#lerm/ende_bgm.mp3"
	}
}
modify:
{
	match:
	{
		"origin" "-8932.19 -75.2637 1205"
		"targetname" "p_bgm"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#lerm/p_bgm.mp3"
	}
}
modify:
{
	match:
	{
		"origin" "-8970 12148 6239"
		"targetname" "y_bgm"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#lerm/y_bgm.mp3"
	}
}
modify:
{
	match:
	{
		"origin" "-8970 12132 6239"
		"targetname" "b_bgm"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#lerm/b_bgm.mp3"
	}
}
modify:
{
	match:
	{
		"origin" "-8970 12116 6239"
		"targetname" "g_bgm"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#lerm/g_bgm.mp3"
	}
}

;------------------------------
;Fix undetected timer messages
;------------------------------
modify:
{
	match:
	{
		"targetname" "b_once_3"
		"origin" "7000 10985 -5525"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 20 >,0,1"
		"OnStartTouch" "cmd,Command,say < 30 >,25,1"
		"OnStartTouch" "cmd,Command,say < 50 >,63,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 20s >,0,1"
		"OnStartTouch" "cmd,Command,say < 30s >,25,1"
		"OnStartTouch" "cmd,Command,say < 50s >,63,1"
	}
}
modify:
{
	match:
	{
		"targetname" "b_once_2"
		"origin" "9280 10641 -5525"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 30 >,0,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 30s >,0,1"
	}
}
modify:
{
	match:
	{
		"origin" "-8112 12329 7431"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 15 >,0,-1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 15s >,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-6272 12329 7271"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 20 >,0,-1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 20s >,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "y_once_2"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 25 >,0,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 25s >,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "y_once_3"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 35 >,0,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 35s >,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "y_once_4"
		"origin" "0 6057 5607"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 15 >,0,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 15s >,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "g_once_1"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 15 >,0,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 15s >,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "g_once_2"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 25 >,0,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 25s >,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "g_once_3"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 25 >,0,1"
		"OnStartTouch" "cmd,Command,say < 15 >,27,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 25s >,0,1"
		"OnStartTouch" "cmd,Command,say < 15s >,27,1"
	}
}
modify:
{
	match:
	{
		"targetname" "g_once_4"
		"origin" "6312 12369 3111"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 20 >,0,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 20s >,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "g_once_5"
		"origin" "8676 13737 -265"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 30 >,0,1"
		"OnStartTouch" "cmd,Command,say < 20 >,40,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 30s >,0,1"
		"OnStartTouch" "cmd,Command,say < 20s >,40,1"
	}
}
modify:
{
	match:
	{
		"targetname" "b_once_1"
		"origin" "13280 12229 -4089"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "cmd,Command,say < 15 >,0,1"
		"OnStartTouch" "cmd,Command,say < 10 >,18,1"
	}
	insert:
	{
		"OnStartTouch" "cmd,Command,say < 15s >,0,1"
		"OnStartTouch" "cmd,Command,say < 10s >,18,1"
	}
}

;----------------------------------------
;Add additional timer message for ending
;----------------------------------------
modify:
{
	match:
	{
		"origin" "-7927.3 265 2436.43"
		"targetname" "ende_relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "cmd,Command,say < 60s >,12,1"
	}
}

;-----------------------------------------------
;Reset player targetnames when picking up items
;-----------------------------------------------
modify:
{
	match:
	{
		"origin" "-9506 4937 -422"
		"targetname" "escapism_elite"
		"classname" "weapon_elite"
	}
	delete:
	{
		"OnPlayerPickup" "player_escapism,AddOutput,targetname,0,-1"
	}
	insert:
	{
		"OnPlayerPickup" "player_escapism,AddOutput,targetname default,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-11411 7416 -352"
		"targetname" "fact_elite"
		"classname" "weapon_elite"
	}
	delete:
	{
		"OnPlayerPickup" "player_fact,AddOutput,targetname,0,-1"
	}
	insert:
	{
		"OnPlayerPickup" "player_fact,AddOutput,targetname default,0,-1"
	}
}
modify:
{
	match:
	{
		"origin" "-8833.96 6143.03 -352"
		"targetname" "rejection_elite"
		"classname" "weapon_elite"
	}
	delete:
	{
		"OnPlayerPickup" "player_rejection,AddOutput,targetname,0,-1"
	}
	insert:
	{
		"OnPlayerPickup" "player_rejection,AddOutput,targetname default,0,-1"
	}
}
