; Moving outputs on the math_counter
modify:
{
    match:
    {
        "targetname" "end_laser_breakable"
        "classname" "func_physbox_multiplayer"
    }
    delete:
    {
       	        "OnBreak" "end_laser_timer,Kill,,0,-1"
		"OnBreak" "end_sphere_particle,Stop,,0,-1"
		"OnBreak" "ending_break,Break,,7,-1"
		"OnBreak" "breakable_before_dodgeend,Break,,19.5,1"
		"OnBreak" "final_laser_case,PickRandom,,18,1"
		"OnBreak" "LAST_end_sphere_particle,Stop,,18,1"
		"OnBreak" "final_laser_case,PickRandom,,17.2,1"
		"OnBreak" "final_laser_case,PickRandom,,16.4,1"
		"OnBreak" "final_laser_case,PickRandom,,15.7,1"
		"OnBreak" "final_laser_case,PickRandom,,15,1"
		"OnBreak" "final_laser_case,PickRandom,,14,1"
		"OnBreak" "final_laser_case,PickRandom,,13,1"
		"OnBreak" "final_laser_case,PickRandom,,12,1"
		"OnBreak" "LAST_end_sphere_particle,Start,,10,1"
		"OnBreak" "third_music,Volume,0,0,-1"
		"OnBreak" "ending_dodge_music,PlaySound,,0,-1"
		"OnBreak" "once_end_win,Enable,,66,1"
		"OnBreak" "stage6_ending_dodge_ring_timer,Disable,,62,1"
		"OnBreak" "minimal_dodge_particule_bottom,Stop,,62,1"
		"OnBreak" "very_end_timer_laser,Disable,,62,1"
		"OnBreak" "stage6_ending_dodge_ring_timer,Enable,,32,1"
		"OnBreak" "very_end_timer_laser,Enable,,30.2,1"
		"OnBreak" "minimal_dodge_particule_bottom,Start,,28,1"
		"OnBreak" "last_zm_tp,Enable,,25,1"
		"OnBreak" "very_end_dodge_random_door,Open,,25,1"
		"OnBreak" "very_end_dodge_random_rotate_timer,Enable,,25,-1"
		"OnBreak" "boss_die_sound,PlaySound,,0,-1"
		"OnBreak" "very_end_rotate_cube,Start,,24.8,1"
    }
}

modify:
{
    match:
    {
        "targetname" "end_laser_counter"
        "classname" "math_counter"
}
   insert:
    {
            	"OnHitMin" "end_laser_timer,Kill,,0,1"
		"OnHitMin" "end_sphere_particle,Stop,,0,1"
		"OnHitMin" "ending_break,Break,,7,1"
		"OnHitMin" "breakable_before_dodgeend,Break,,19.5,1"
		"OnHitMin" "final_laser_case,PickRandom,,18,1"
		"OnHitMin" "LAST_end_sphere_particle,Stop,,18,1"
		"OnHitMin" "final_laser_case,PickRandom,,17.2,1"
		"OnHitMin" "final_laser_case,PickRandom,,16.4,1"
		"OnHitMin" "final_laser_case,PickRandom,,15.7,1"
		"OnHitMin" "final_laser_case,PickRandom,,15,1"
		"OnHitMin" "final_laser_case,PickRandom,,14,1"
		"OnHitMin" "final_laser_case,PickRandom,,13,1"
		"OnHitMin" "final_laser_case,PickRandom,,12,1"
		"OnHitMin" "LAST_end_sphere_particle,Start,,10,1"
		"OnHitMin" "third_music,Volume,0,0,1"
		"OnHitMin" "ending_dodge_music,PlaySound,,0,1"
		"OnHitMin" "once_end_win,Enable,,66,1"
		"OnHitMin" "stage6_ending_dodge_ring_timer,Disable,,62,1"
		"OnHitMin" "minimal_dodge_particule_bottom,Stop,,62,1"
		"OnHitMin" "very_end_timer_laser,Disable,,62,1"
		"OnHitMin" "stage6_ending_dodge_ring_timer,Enable,,32,1"
		"OnHitMin" "very_end_timer_laser,Enable,,30.2,1"
		"OnHitMin" "minimal_dodge_particule_bottom,Start,,28,1"
		"OnHitMin" "last_zm_tp,Enable,,25,1"
		"OnHitMin" "very_end_dodge_random_door,Open,,25,1"
		"OnHitMin" "very_end_dodge_random_rotate_timer,Enable,,25,1"
		"OnHitMin" "boss_die_sound,PlaySound,,0,1"
		"OnHitMin" "very_end_rotate_cube,Start,,24.8,1"
    }

}

; Fix outputs that were not only once
modify:
{
    match:
    {
        "targetname" "pushtoboss"
        "classname" "trigger_push"
    }
    delete:
    {
                "OnStartTouch" "ending_laser_bossspawn_template,ForceSpawn,,0.5,-1"
		"OnStartTouch" "end_laser_timer,Enable,,1.5,-1"
		"OnStartTouch" "zm_shield_lasers,Enable,,2,-1"
		"OnStartTouch" "zm_shield_lasers,Disable,,11.5,-1"
		"OnStartTouch" "SHIELD_zm,Start,,0,-1"
		"OnStartTouch" "end_laser_breakable,SetDamageFilter,,3,-1"
		"OnStartTouch" "SHIELD_zm,Stop,,11.2,-1"
    }
    insert:
    {

                "OnStartTouch" "ending_laser_bossspawn_template,ForceSpawn,,0.5,1"
		"OnStartTouch" "end_laser_timer,Enable,,1.5,1"
		"OnStartTouch" "zm_shield_lasers,Enable,,2,1"
		"OnStartTouch" "zm_shield_lasers,Disable,,11.5,1"
		"OnStartTouch" "SHIELD_zm,Start,,0,1"
		"OnStartTouch" "end_laser_breakable,SetDamageFilter,,3,1"
		"OnStartTouch" "SHIELD_zm,Stop,,11.2,1"
    }
}

; Lower the trigger teleport for humans on the boss area
modify:
{
    match:
    {
        "targetname" "boss_fall_trigger_humans"
        "classname" "trigger_multiple"
    }
    replace:
    {
        "origin" "3584 -3072 -2128"
    }
}

; Add bit more hp to the final boss
modify:
{
    match:
    {
        "targetname" "add_hp_toboss"
        "classname" "trigger_multiple"
    }
    delete:
    {
        "OnStartTouch" "end_laser_counter,Add,60,0,-1"
    }
    insert:
    {
       "OnStartTouch" "end_laser_counter,Add,70,0,-1"
    }
}

; Make very end lasers bit faster
modify:
{
    match:
    {
        "targetname" "very_end_laser_doormove"
        "classname" "func_door"
    }
    replace:
    {
        "speed" "1660"
    }
}