;---------------------------------
;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"
	}
}

;--------------
; Entwatch fixes
;--------------
; Replace the hammerid of the two zm item that have the same id as the ammo button

; Imuri
modify:
{
    match:
    {
		"targetname" "imuri_nappi"
		"classname" "func_button"
		"hammerid" "1042429"
    }
	replace:
	{
		"hammerid" "1042430"
	}
}

; Slayer
modify:
{
    match:
    {
		"targetname" "slayer_nappi"
		"classname" "func_button"
		"hammerid" "1042429"
    }
	replace:
	{
		"hammerid" "1042431"
	}
}

;--------------
; Animations fixes
;--------------
; Secrets Seagull

; Level 1: Icecap
modify:
{
    match:
    {
		"classname" "prop_dynamic_override"
		"hammerid" "1396153"
    }
	replace:
	{
		"DefaultAnim" "Idle01"
	}
}

; Level 2: Cavern
modify:
{
    match:
    {
		"classname" "prop_dynamic_override"
		"hammerid" "1396165"
    }
	replace:
	{
		"DefaultAnim" "Idle01"
	}
}

; Level 3: Mountain 
modify:
{
    match:
    {
		"classname" "prop_dynamic_override"
		"hammerid" "1396171"
    }
	replace:
	{
		"DefaultAnim" "Idle01"
	}
}

; Level 4: Finale
modify:
{
    match:
    {
		"classname" "prop_dynamic_override"
		"hammerid" "1396179"
    }
	replace:
	{
		"DefaultAnim" "Idle01"
	}
}

; Spawn
modify:
{
    match:
    {
		"classname" "prop_dynamic_override"
		"hammerid" "937692"
    }
	replace:
	{
		"DefaultAnim" "Hop"
	}
}

modify:
{
    match:
    {
		"targetname" "lokki_trigger"
		"classname" "trigger_once"
		"hammerid" "980555"
    }
	delete:
	{
		"OnStartTouch" "lokki,SetAnimation,ACT_FLY,0,-1"
	}
	insert:
	{
		"OnStartTouch" "lokki,SetAnimation,Fly,0,-1"
	}
}

modify:
{
    match:
    {
		"targetname" "lokki_track2"
		"classname" "path_track"
		"hammerid" "937754"
    }
	delete:
	{
		"OnPass" "lokki,SetAnimation,ACT_IDLE,0,-1"
	}
	insert:
	{
		"OnPass" "lokki,SetAnimation,Idle01,0,-1"
	}
}

; Spider boss
modify:
{
    match:
    {
		"targetname" "spider1_boss_model"
		"classname" "prop_dynamic_override"
		"hammerid" "961365"
    }
	replace:
	{
		"DefaultAnim" "walk_lower"
	}
}

; Spider boss entrance
modify:
{
    match:
    {
		"targetname" "spider1_boss_model_temp"
		"classname" "prop_dynamic_override"
		"hammerid" "1346072"
    }
	replace:
	{
		"DefaultAnim" "walk_lower"
	}
}

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

; Fix Icecap boat message
modify:
{
    match:
    {
		"classname" "trigger_once"
		"hammerid" "974211"
    }
	delete:
	{
		"OnStartTouch" "command,Command,say **BOAT LEAVING IN 15 SECONDS**,0,1"
	}
	insert:
	{
		"OnStartTouch" "command,Command,say **BOAT LEAVING IN 10 SECONDS**,0,1"
	}
}

; Adjusting some push force
modify:
{
    match:
    {
		"targetname" "lvl2_spider_push"
		"classname" "trigger_push"
		"hammerid" "1317096"
		; Original value
		"speed" "500"
    }
	replace:
	{
		"speed" "1000"
	}
}

modify:
{
    match:
    {
		"targetname" "Lvl2_BossPush2"
		"classname" "trigger_push"
		"hammerid" "829026"
		; Original value
		"speed" "700"
    }
	replace:
	{
		"speed" "1200"
	}
}

; Adjusting some boss hp
modify:
{
    match:
    {
		"targetname" "Lvl2_Boss_HealthTr"
		"classname" "trigger_multiple"
		"hammerid" "829549"
    }
	delete:
	{
		"OnStartTouch" "Boss_Health,Add,175,0,-1"
	}
	insert:
	{
		"OnStartTouch" "Boss_Health,Add,600,0,-1"
	}
}

modify:
{
    match:
    {
		"origin" "8069.3 14449.5 398.99"
		"classname" "trigger_multiple"
		"hammerid" "963895"
    }
	delete:
	{
		"OnStartTouch" "spider1_dynamic_hp,Add,175,0,-1"
	}
	insert:
	{
		"OnStartTouch" "spider1_dynamic_hp,Add,600,0,-1"
	}
}

modify:
{
    match:
    {
		"targetname" "lvl4_bosshp"
		"classname" "trigger_multiple"
		"hammerid" "1020798"
    }
	delete:
	{
		"OnStartTouch" "santa_boss_dynamic_hp,Add,150,0,-1"
	}
	insert:
	{
		"OnStartTouch" "santa_boss_dynamic_hp,Add,400,0,-1"
	}
}

modify:
{
    match:
    {
		"targetname" "santa_boss_phys"
		"classname" "func_physbox"
		; Original value
		"health" "99999"
    }
	replace:
	{
		"health" "9999999"
	}
}

modify:
{
    match:
    {
		"targetname" "santa_boss_phys2"
		"classname" "func_physbox"
		; Original value
		"health" "99999"
    }
	replace:
	{
		"health" "9999999"
	}
}

modify:
{
    match:
    {
		"targetname" "spider1_boss_phys"
		"classname" "func_physbox"
		; Original value
		"health" "99999"
    }
	replace:
	{
		"health" "9999999"
	}
}

modify:
{
    match:
    {
		"targetname" "spider_boss_phys"
		"classname" "func_physbox"
		; Original value
		"health" "99999"
    }
	replace:
	{
		"health" "9999999"
	}
}

modify:
{
    match:
    {
		"targetname" "Boss2_Phys2"
		"classname" "func_physbox"
		; Original value
		"health" "99999"
    }
	replace:
	{
		"health" "9999999"
	}
}

; Deleting some entities
filter:
{
	"targetname" "HeliLaserTarget1_1"
	"classname" "func_movelinear"
}

filter:
{
	"targetname" "HeliLaserTarget1_3"
	"classname" "func_movelinear"
}

filter:
{
	"targetname" "HeliLaserTarget1_4"
	"classname" "func_movelinear"
}
filter:
{
	"targetname" "start_tele2"
	"classname" "info_teleport_destination"
}
