;----------------------------------
; Stripper #2 by .Rushaway & Heavy
; Edited on 2025-02-07 (Heavy)
;-------------------------------
; Adjust game_text
;-----------------
modify:
{
    match:
    {
        "targetname" "text_boss_hp"
        "classname" "game_text"
        "hammerid" "918088"
    }
    replace:
    {
        "holdtime" "5"
        "color2" "164 65 65"
        "color" "200 65 65"
    }
}

modify:
{
    match:
    {
        "targetname" "text_boss_crit"
        "classname" "game_text"
        "hammerid" "918047"
    }
    replace:
    {
        "holdtime" "5"
    }
}

;--------------------------
; Remove un-needed outputs
;--------------------------
modify:
{
    match:
    {
        "targetname" "draftwinds_pushes"
        "classname" "trigger_push"
    }
    delete:
    {
        "OnEndTouch" "mapmanager,RunScriptCode,DraftWindClamp();,0,-1"
    }
}

;--------------------------------------------
; Change zm item "wing" basevolcity (too op)
;--------------------------------------------
modify:
{
    match:
    {
        "origin" "-8964 -10852 -7672"
        "targetname" "item_wing_relay"
        "classname" "logic_relay"
    }
    delete:
    {
        "OnTrigger" "!activator,AddOutput,basevelocity 0 0 600,0,-1"
    }
    insert:
    {
        "OnTrigger" "!activator,AddOutput,basevelocity 0 0 250,0,-1"
    }
}

;----------------------------
; Change end area trigger tp so zm's not gonna die
;----------------------------
modify:
{
    match:
    {
        "model" "*60"
        "targetname" "teleport_falldown"
        "origin" "10912 -12288 -9056"
        "classname" "trigger_teleport"
    }
    replace:
    {
        "origin" "10912 -12288 -8960"
    }
}

;----------------------------
; Add missing zm tp in the temple entrance
;----------------------------
add:
{
    "model" "*300"
    "filtername" "filter_t"
    "origin" "10144 -11520 -12672"
    "spawnflags" "1"
    "StartDisabled" "0"
    "classname" "trigger_teleport"
    "target" "teleport_destination"
}

;----------------------------
; Add more hp to temple_guardians
;----------------------------
modify:
{
    match:
    {
        "targetname" "guardian_hp_trigger"
        "classname" "trigger_multiple"
    }
    delete:
    {
        "OnStartTouch" "g_templeguardian_hp_outside_math,Add,300,0,-1"
    }
    insert:
    {
        "OnStartTouch" "g_templeguardian_hp_outside_math,Add,700,0,-1"
    }
}

;----------------------------
; Add more hp to boss
;----------------------------
modify:
{
    match:
    {
        "model" "*100"
        "origin" "11883.5 -12185.5 13846.5"
        "targetname" "i_minotaurgod_hp_trig"
        "classname" "trigger_once"
    }
    delete:
    {
        "OnStartTouch" "i_minotaurgod_hp,AddHealth,2000,0.02,-1"
    }
    insert:
    {
        "OnStartTouch" "i_minotaurgod_hp,AddHealth,4000,0.02,-1"
    }
}

;----------------------------
; Fix boss not falling down
;----------------------------
modify:
{
    match:
    {
        "targetname" "end_deathfall_trigger"
        "classname" "trigger_once"
    }
    replace:
    {
        "spawnflags" "1032"
    }
}

; Convert to physbox
filter:
{
    "targetname" "i_minotaurgod_dead_phys"
    "classname" "func_breakable"
}

add:
{
    "model" "*111"
    "targetname" "i_minotaurgod_dead_phys"
    "disablereceiveshadows" "1"
    "classname" "func_physbox"
    "disableshadows" "1"
    "health" "10000000"
    "material" "10"
    "nodamageforces" "1"
    "origin" "12288 -12288 15262"
    "parentname" "i_minotaurgod_jumper"
    "PerformanceMode" "1"
    "spawnflags" "44032"
    "OnUser2" "i_minotaurgod_thrust_forward,Deactivate,,0.3,-1"
    "OnUser2" "i_minotaurgod_jumper_dead,Open,,0.3,-1"
    "OnUser2" "i_minotaurgod_model,SetAnimation,falling_death,0.3,-1"
    "OnUser2" "i_minotaurgod_pillarbreaker_dash,Kill,,0.4,1"
    "OnUser2" "i_minotaurgod_gallop_timer,Disable,,0,-1"
    "OnUser2" "i_minotaurgod_s_death_fall,PlaySound,,0.31,-1"
    "OnUser2" "i_minotaurgod_s_death_fall,Volume,10,0.31,-1"
    "OnUser2" "i_minotaurgod_s_death_fall,StopSound,,0.3,-1"
    "OnUser2" "i_minotaurgod_s_death_fall,Volume,0 ,0.3,-1"
    "OnUser2" "i_minotaurgod_gallop_timer,Kill,,0.05,-1"
    "OnUser2" "i_minotaurgod_gallop_case,Kill,,0.05,-1"
    "OnUser2" "i_minotaurgod_jumper_dead,SetParent,0,0,-1"
}

;--------------
; Fix telehopp
;-------------
modify:
{
    match:
    {
        "targetname" "teleport_falldown"
        "classname" "trigger_teleport"
    }
    insert:
    {
        "OnStartTouch" "!activator,AddOutput,absvelocity 0 0 0,0,-1"
    }
}

;------------------------------------------
; Fix last lever glowe not getting killed
;------------------------------------------
modify:
{
    match:
    {
        "model" "*67"
        "origin" "13216 -12288 -5102.46"
        "targetname" "lever_button_boss2"
        "classname" "func_button"
    }
    delete:
    {
        "OnPressed" "lever_glow,Kill,,0,1"
    }
    insert:
    {
        "OnPressed" "lever_glow*,Kill,,0,1"
    }
}



modify:
{
    match:
    {
        "model" "*133"
        "origin" "-8988 -10879 -7614"
        "targetname" "zm_item1_push"
        "classname" "trigger_push"
    }
    replace:
    {
        "speed" "250"
    }
}

;------------------------------------------------------
; Fix temple_guardians not giving hp signal to the npc
;------------------------------------------------------
modify:
{
    match:
    {
        "targetname" "guardian_hp_trigger"
        "classname" "trigger_multiple"
    }
    replace:
    {
        "wait" "8"
    }
}

modify:
{
    match:
    {
        "targetname" "i_templeguardian_hp"
        "classname" "func_physbox"
    }
    delete:
    {
        "OnDamaged" "i_templeguardian_hp_inside_math,FireUser1,,0,-1"
    }
    insert:
    {
        "OnDamaged" "i_templeguardian_hp_inside_math,FireUser1,,0,1"
    }
}

modify:
{
    match:
    {
        "targetname" "i_templeguardian_hp_inside_math"
        "classname" "math_counter"
    }
    delete:
    {
        "OnUser1" "g_templeguardian_hp_outside_math,GetValue,,0,1"
    }
    insert:
    {
        "OnUser1" "g_templeguardian_hp_outside_math,GetValue,,0.02,1"
    }
}

modify:
{
    match:
    {
        "targetname" "g_templeguardian_hp_outside_math"
        "classname" "math_counter"
    }
    insert:
    {
        "OnGetValue" "!caller,SetValue,,0,-1"
    }
}

;----------------------------------------------------------------------
; Adding wall to prevent zms reaching the end elvator before humans
;----------------------------------------------------------------------
modify:
{
    match:
    {
        "classname" "logic_auto"
    }
    insert:
    {
        "OnMapSpawn" "new_wall1,addoutput,angles 0 60 0,1,-1"
        "OnMapSpawn" "new_wall2,addoutput,angles 0 60 0,1,-1"
    }
}

add:
{
    "model" "*75"
    "targetname" "new_wall1"
    "spawnobject" "0"
    "spawnflags" "0"
    "rendermode" "10"
    "renderfx" "0"
    "rendercolor" "255 255 255"
    "renderamt" "255"
    "propdata" "0"
    "pressuredelay" "0"
    "physdamagescale" "1.0"
    "PerformanceMode" "0"
    "origin" "11048.6 -11233.1 -4344"
    "nodamageforces" "0"
    "minhealthdmg" "0"
    "material" "10"
    "health" "0"
    "gibdir" "0 0 0"
    "fadescale" "1"
    "fademindist" "-1"
    "explosion" "0"
    "ExplodeRadius" "0"
    "explodemagnitude" "0"
    "ExplodeDamage" "0"
    "disableshadows" "0"
    "disablereceiveshadows" "0"
    "classname" "func_breakable"
}

add:
{
    "model" "*75"
    "targetname" "new_wall2"
    "spawnobject" "0"
    "spawnflags" "0"
    "rendermode" "10"
    "renderfx" "0"
    "rendercolor" "255 255 255"
    "renderamt" "255"
    "propdata" "0"
    "pressuredelay" "0"
    "physdamagescale" "1.0"
    "PerformanceMode" "0"
    "origin" "11048.6 -11233.1 -2424"
    "nodamageforces" "0"
    "minhealthdmg" "0"
    "material" "10"
    "health" "0"
    "gibdir" "0 0 0"
    "fadescale" "1"
    "fademindist" "-1"
    "explosion" "0"
    "ExplodeRadius" "0"
    "explodemagnitude" "0"
    "ExplodeDamage" "0"
    "disableshadows" "0"
    "disablereceiveshadows" "0"
    "classname" "func_breakable"
}

add:
{
    "model" "*75"
    "targetname" "new_wall3"
    "spawnobject" "0"
    "spawnflags" "0"
    "rendermode" "10"
    "renderfx" "0"
    "rendercolor" "255 255 255"
    "renderamt" "255"
    "propdata" "0"
    "pressuredelay" "0"
    "physdamagescale" "1.0"
    "PerformanceMode" "0"
    "origin" "12256 -10544 -4104"
    "nodamageforces" "0"
    "minhealthdmg" "0"
    "material" "10"
    "health" "0"
    "gibdir" "0 0 0"
    "fadescale" "1"
    "fademindist" "-1"
    "explosion" "0"
    "ExplodeRadius" "0"
    "explodemagnitude" "0"
    "ExplodeDamage" "0"
    "disableshadows" "0"
    "disablereceiveshadows" "0"
    "classname" "func_breakable"
}

add:
{
    "model" "*75"
    "targetname" "new_wall4"
    "spawnobject" "0"
    "spawnflags" "0"
    "rendermode" "10"
    "renderfx" "0"
    "rendercolor" "255 255 255"
    "renderamt" "255"
    "propdata" "0"
    "pressuredelay" "0"
    "physdamagescale" "1.0"
    "PerformanceMode" "0"
    "origin" "12256 -10544 -2184"
    "nodamageforces" "0"
    "minhealthdmg" "0"
    "material" "10"
    "health" "0"
    "gibdir" "0 0 0"
    "fadescale" "1"
    "fademindist" "-1"
    "explosion" "0"
    "ExplodeRadius" "0"
    "explodemagnitude" "0"
    "ExplodeDamage" "0"
    "disableshadows" "0"
    "disablereceiveshadows" "0"
    "classname" "func_breakable"
}


;------------------------------------------------------------------
; Fix temple_guardians stuck looping relasing and grabbing trigger
;------------------------------------------------------------------
modify:
{
    match:
    {
        "targetname" "i_templeguardian_base"
        "classname" "func_physbox"
    }
    delete:
    {
        "OnUser2" "i_templeguardian_grab_tp,Enable,,6.00,-1"
        "OnUser2" "!self,EnableMotion,,6.00,-1"
        "OnUser2" "i_templeguardian_model,SetPlaybackRate,1.0,6.00,-1"
    }
    insert:
    {
        "OnUser2" "i_templeguardian_grab_tp,Enable,,8.00,-1"
        "OnUser2" "i_templeguardian_grab_tp,Disable,,0,-1"
        "OnUser2" "!self,EnableMotion,,8.00,-1"
        "OnUser2" "i_templeguardian_model,SetPlaybackRate,1.0,8.00,-1"
    }
}




;; _

;; restart round on warmup

modify:
{
	match:
	{
		"targetname" "Level_Case"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase01" "KILL_ALL_SPAWN,Enable,,91.36,1"
	}
	insert:
	{
		"OnCase01" "server,Command,mp_restartgame 1,91.36,1"
	}
}


