;; _

;; music volume

modify:
{
	match:
	{
		"message" "epic_end_sound/ninja.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#epic_end_sound/ninja.mp3"
	}
}
modify:
{
	match:
	{
		"message" "epic_end_sound/stage_music_11_3.mp3"
		"classname" "ambient_generic"
	}
	replace:
	{
		"message" "#epic_end_sound/stage_music_11_3.mp3"
	}
}

;; possible playercrash fix

modify:
{
	match:
	{
		"classname" "/prop_.*/"
	}
	replace:
	{
		"disableshadows" "1"
		"disablereceiveshadows" "1"
	}
}
modify:
{
	match:
	{
		"classname" "/func_.*/"
	}
	replace:
	{
		"disableshadows" "1"
		"disablereceiveshadows" "1"
	}
}

;; lock completed stages

add:
{
	"model" "*237"
	"targetname" "check_zm"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "582 5930 400"
	"filtername" "Filter_ct"
	"classname" "trigger_once"
	"OnStartTouch" "check_ct,Kill,,0,1"
}
add:
{
	"model" "*237"
	"targetname" "check_ct"
	"StartDisabled" "1"
	"spawnflags" "1"
	"origin" "582 5930 400"
	"filtername" "Filter_ter"
	"classname" "trigger_once"
	"OnStartTouch" "points,ApplyScore,,0,-1"
}
add:
{
	"origin" "-640 1376 34"
	"targetname" "points"
	"spawnflags" "0"
	"points" "100"
	"classname" "game_score"
}
add:
{
	"origin" "3457 -2896 376"
	"targetname" "stage_counter"
	"StartDisabled" "0"
	"startvalue" "0"
	"min" "0"
	"max" "10"
	"classname" "math_counter"
	"OnHitMax" "Button_stage_*,Unlock,,1,1"
	"OnHitMax" "Button_stage_*,AddOutput,rendermode 1,1,1"
}
modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "24860"
	}
	insert:
	{
		"OnNewGame" "worldspawn,FireUser2,,2,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Bla_bla"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin -5016 14999 12797,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Bla_bla:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Bla_bla:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "Stage_button_9"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_zm,Enable,,36,1"
		"OnPressed" "check_ct,Enable,,37,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Crash"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin -2810 -11357 -6119,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Crash:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Crash:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "patc_rock2_3"
		"classname" "path_track"
	}
	insert:
	{
		"OnPass" "check_zm,Enable,,22,1"
		"OnPass" "check_ct,Enable,,23,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Devil_my_cry"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin 1115 1639 -12932,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Devil_my_cry:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Devil_my_cry:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "Stage_trigger_4_5"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "check_zm,Enable,,2,1"
		"OnStartTouch" "check_ct,Enable,,3,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Fortress"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin 9459 -8954 13574,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Fortress:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Fortress:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "Stage_trigger_6_4"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "check_zm,Enable,,32,1"
		"OnStartTouch" "check_ct,Enable,,33,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_GOD"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin 580 6803 1150,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_GOD:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_GOD:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "Stage_trigger_end_1"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "check_zm,Enable,,2,1"
		"OnStartTouch" "check_ct,Enable,,3,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Gravity"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin -5678 -10617 -12083,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Gravity:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Gravity:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "Stage_trigger_3_4"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "check_zm,Enable,,65,1"
		"OnStartTouch" "check_ct,Enable,,66,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Lego"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin 5595 755 -2777,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Lego:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Lego:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "lego_bottom_door2"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_zm,Enable,,61,1"
		"OnPressed" "check_ct,Enable,,62,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Montain"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin -10553 714 -5060,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Montain:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Montain:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "Stage_Trigger_win_7"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "check_zm,Enable,,2,1"
		"OnStartTouch" "check_ct,Enable,,3,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_Peg_top"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin -3595 364 11181,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_Peg_top:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_Peg_top:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"targetname" "Track7"
		"classname" "path_track"
	}
	insert:
	{
		"OnPass" "check_zm,Enable,,4,1"
		"OnPass" "check_ct,Enable,,5,1"
	}
}

modify:
{
	match:
	{
		"targetname" "Button_stage_ZM"
		"classname" "func_button"
	}
	insert:
	{
		"OnPressed" "check_*,AddOutput,origin -4176 14378 -3144,0,1"
		"OnPressed" "check_ct,AddOutput,OnStartTouch Button_stage_ZM:FireUser1::0:1,0,1"
		"OnUser1" "worldspawn,AddOutput,OnUser2 Button_stage_ZM:FireUser2::0:-1,0,1"
		"OnUser2" "!self,Lock,,0,1"
		"OnUser2" "!self,AddOutput,rendermode 10,0,1"
		"OnUser2" "stage_counter,Add,1,1,1"
	}
}
modify:
{
	match:
	{
		"origin" "-1853 14332 -3242.32"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "check_zm,Enable,,73,1"
		"OnStartTouch" "check_ct,Enable,,74,1"
	}
}

;; mountain, pegtop - delay meteor spawn

modify:
{
	match:
	{
		"targetname" "Trigger_meteor"
		"classname" "trigger_multiple"
	}
	replace:
	{
		"StartDisabled" "1"
	}
}
modify:
{
	match:
	{
		"targetname" "/Stage_trigger_[7-8]/"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "Trigger_meteor,Enable,,5,1"
	}
}