; Stripper for ze_night_cinema_v1 (11/11/2024)
; Todo on next recompile: select all -> center origins

;-------------------------------------------------
; [Required Fix] Rock & Madness stage:
; Filter the CT teleports to the last arena and cinema to humans
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"targetname" "RM_TP7_to_book_CT"
	}
	insert:
	{
		"filtername" "filter_activator_CT"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_teleport"
		"targetname" "RM_TP8_to_cinema_CT"
	}
	insert:
	{
		"filtername" "filter_activator_CT"
	}
}

;-------------------------------------------------
; [Recommended Fix] Rock & Madness stage:
; Scale down the orb health and the hurt damage value (8 -> 4)
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_multiple"
		"targetname" "RM_book_gamezone"
	}
	delete:
	{
		"OnStartTouch" "RM_darkorb_physbox,AddHealth,1750,0,-1"
	}
	insert:
	{
		"OnStartTouch" "RM_darkorb_physbox,AddHealth,1250,0,-1"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_hurt"
		"targetname" "RM_darkorb_hurt"
	}
	replace:
	{
		"damage" "4"
	}
}

;-------------------------------------------------
; [Improvement] Allow admins to skip warmup by nocliping to the admin room
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "cinema_adminroom"
	}
	insert:
	{
		"OnStartTouch" "warmup_cG,Kill,,0,1"
	}
}

;-------------------------------------------------
; [Improvement] French Catacombs stage:
; Add clipping to the statue model. There is a spot where players can get stuck
;-------------------------------------------------
add:
{
	"model" "*709"
	"origin" "7238 -1536 -6028"
	"classname" "func_breakable"
	"rendermode" "10"
	"spawnflags" "1"
	"material" "8"
	"disablereceiveshadows" "1"
	"disableshadows" "1"
}

;-------------------------------------------------
; [Improvement] Cabin in Woods stage:
; Extend the cabin hurt trigger to include the surroundings to prevent skipping the segment
; With this, humans are required to defend the house
;-------------------------------------------------
filter:
{
	"targetname" "CW_cabin_hurt"
	"classname" "trigger_hurt"
	"hammerid" "2019770"
}
add:
{
	"model" "*258"
	"origin" "5248 10624 6368"
	"classname" "trigger_hurt"
	"damage" "36"
	"damagecap" "20"
	"damagemodel" "0"
	"damagetype" "0"
	"filtername" "filter_activator_CT"
	"nodmgforce" "0"
	"spawnflags" "1"
	"StartDisabled" "1"
	"targetname" "CW_cabin_hurt"
	"OnStartTouchAll" "CW_cabin_killone,Hurt,,0,-1"
}

;-------------------------------------------------
; [Improvement] Cabin in Woods stage:
; Delay the final raft by 5 sec to give defenders some extra time to get on
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "CP_lake_finale"
	}
	delete:
	{
		"OnStartTouch" "servercommand,Command,say Final raft leaving in 15 sec,0,1"
		"OnStartTouch" "CW_lake_raft,Open,,15,1"
		"OnStartTouch" "CW_balloon_template,ForceSpawn,,16,1"
	}
	insert:
	{
		"OnStartTouch" "servercommand,Command,say Final raft leaving in 20 sec,0,1"
		"OnStartTouch" "CW_lake_raft,Open,,20,1"
		"OnStartTouch" "CW_balloon_template,ForceSpawn,,21,1"
	}
}

;-------------------------------------------------
; [Improvement] Rock & Madness stage:
; Disable the final teleport trigger in the lava room until the 3rd gate breaks
; To prevent early trigger by players that jump-skip the last gate
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "RM_maze1_exit"
	}
	replace:
	{
		"StartDisabled" "1"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_once"
		"targetname" "RM_maze1_trigger3"
	}
	insert:
	{
		"OnStartTouch" "RM_maze1_exit,Enable,,18,1"
	}
}

;-------------------------------------------------
; [Improvement] Rock & Madness stage:
; Reduce the push speed (100 -> 80) during the concert segment to make it easier
; Also increase the zombie push speed (350 -> 500) after the sequence is over
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "trigger_push"
		"targetname" "RM_seats_fpush"
	}
	replace:
	{
		"speed" "80"
	}
}
modify:
{
	match:
	{
		"classname" "trigger_push"
		"targetname" "RM_heaven_pushT"
	}
	replace:
	{
		"speed" "500"
	}
}

;-------------------------------------------------
; [Improvement] Rock & Madness stage:
; Delay the zombie teleport to the final arena
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "func_button"
		"targetname" "RM_chapel_script"
	}
	delete:
	{
		"OnPressed" "RM_TP7_to_book,Enable,,20,1"
		"OnPressed" "RM_reverse_teleports_2,Trigger,,22,1"
	}
	insert:
	{
		"OnPressed" "RM_TP7_to_book,Enable,,22,1"
		"OnPressed" "RM_reverse_teleports_2,Trigger,,24,1"
	}
}

;-------------------------------------------------
; [Improvement] Rock & Madness stage:
; Small adjustments the timings of the gates in the book arena
; Open the first gate sooner so humans have some extra time to go through
; Reduce hold time after second gate to ~25s (15s with good timing of the freeze)
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "RM_book_script_p2"
	}
	delete:
	{
		"OnTrigger" "RM_book_gate1,Open,,3,1"
		"OnTrigger" "servercommand,Command,say First gate open,3,1"
	}
	insert:
	{
		"OnTrigger" "RM_book_gate1,Open,,0,1"
		"OnTrigger" "servercommand,Command,say First gate open,0,1"
	}
}
modify:
{
	match:
	{
		"classname" "logic_relay"
		"targetname" "RM_book_script_p3"
	}
	delete:
	{
		"OnTrigger" "RM_book_gate2,Break,,5,1"
		"OnTrigger" "servercommand,Command,say Second gate open,5,1"
		"OnTrigger" "servercommand,Command,say First gate reopening in 10 sec,10,1"
		"OnTrigger" "RM_book_gate1,Open,,20,1"
		"OnTrigger" "servercommand,Command,say Third gate opening in 5 sec ,33,1"
		"OnTrigger" "RM_book_gate3,Open,,38,1"
		"OnTrigger" "servercommand,Command,say Third gate closing in 10 sec,41,1"
		"OnTrigger" "RM_book_gate3,Close,,51,1"
		"OnTrigger" "RM_book_lake_btn,Press,,58,1"
	}
	insert:
	{
		"OnTrigger" "RM_book_gate2,Break,,3,1"
		"OnTrigger" "servercommand,Command,say The light can freeze nearby zombies,3,1"
		"OnTrigger" "RM_book_gate3,Open,,5,1"
		"OnTrigger" "servercommand,Command,say Last gate closing in 40 sec,8,1"
		"OnTrigger" "servercommand,Command,say First gate reopening in 12 sec,10,1"
		"OnTrigger" "RM_book_gate1,Open,,22,1"
		"OnTrigger" "RM_book_lake_btn,Press,,43,1"
		"OnTrigger" "RM_book_gate3,Close,,48,1"
	}
}