;---------------------------------
;Add math_counter for stagedisplay
;---------------------------------

add:
{
	"origin" "3253 -300 8"
	"targetname" "TheCurrentLevelPlugin"
	"min" "1"
	"max" "4"
	"startvalue" "1"
	"classname" "math_counter"
}

modify:
{
	match:
	{
		"targetname" "lvl1"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,1,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "lvl2"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,2,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "lvl3"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,3,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "lvl4"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,4,0,1"
	}
}


;--------------
; Map fixes
;--------------

; Fix level 4 falling boss train not to be blockable
modify:
{
    match:
    {
		"classname" "func_tracktrain"
		"hammerid" "1186582"
		; Original value
		"spawnflags" "0"
    }
	replace:
	{
		"spawnflags" "539"
	}
}
; Fix final boss collisions to not solid
modify:
{
    match:
    {
		"targetname" "santa_boss_model_move"
		"classname" "prop_dynamic_override"
		"hammerid" "1186565"
		; Original value
		"solid" "6"
    }
	replace:
	{
		"solid" "0"
	}
}
modify:
{
    match:
    {
		"targetname" "santa_boss_model"
		"classname" "prop_dynamic_override"
		"hammerid" "1020646"
		; Original value
		"solid" "6"
    }
	replace:
	{
		"solid" "0"
	}
}
; Fix final santa boss incorrect filtering
modify:
{
    match:
    {
		"classname" "trigger_multiple"
		"hammerid" "1020660"
    }
		delete:
		{
			; Original value
			"OnStartTouch" "santatarget,AddOutput,targetname humans,4.9,-1"
		}
		insert:
		{
			"OnStartTouch" "santatarget,AddOutput,targetname normal,4.9,-1"
		}
}



;; _

;; reset cvars on round start

modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "1431823"
	}
	insert:
	{
		"OnMapSpawn" "command,Command,sv_accelerate 5,0,1"
		"OnMapSpawn" "command,Command,sv_airaccelerate 10,0,1"
	}
}

