; stage 1 tp01 delay

modify:
{
    match:
    {
        "targetname" "s1_once_coin_01"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s1_door01,Close,,33,1"
		"OnStartTouch" "s1_tp01,Enable,,35,1"
    }
    insert:
    {
		"OnStartTouch" "s1_door01,Close,,38,1"
		"OnStartTouch" "s1_tp01,Enable,,40,1"
    }
}

;fix stage 1 door

modify:
{
    match:
    {
        "targetname" "s1_door01"
        "classname" "func_movelinear"
    }
    replace:
    {
		"movedistance" "128"
    }
}

; stage 1 tp03 delay

modify:
{
    match:
    {
        "targetname" "s1_once_coin_03"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s1_door03,Close,,32,1"
		"OnStartTouch" "s1_tp03,Enable,,35,1"
    }
    insert:
    {
		"OnStartTouch" "s1_door03,Close,,37,1"
		"OnStartTouch" "s1_tp03,Enable,,40,1"
    }
}

; stage 1 tp04 delay

modify:
{
    match:
    {
        "targetname" "s1_counter_trig_01"
        "classname" "math_counter"
    }
    delete:
    {
		"OnHitMax" "cmd,Command,say | 20 |,0,1"
		"OnHitMax" "cmd,Command,say | 15 |,5,1"
		"OnHitMax" "cmd,Command,say | 10 |,10,1"
		"OnHitMax" "cmd,Command,say | 5 |,15,1"
		"OnHitMax" "s1_door05,Break,,20,1"
		"OnHitMax" "s1_tp04,Enable,,35,1"
    }
    insert:
    {
		"OnHitMax" "cmd,Command,say | 15 |,0,1"
		"OnHitMax" "cmd,Command,say | 10 |,5,1"
		"OnHitMax" "cmd,Command,say | 5 |,10,1"
		"OnHitMax" "s1_door05,Break,,15,1"
		"OnHitMax" "s1_tp04,Enable,,40,1"
    }
}


; stage 1 boat part

modify:
{
    match:
    {
        "targetname" "s1_path2_b"
        "classname" "path_track"
    }
    delete:
    {
		"OnPass" "s1_movelinear8,Open,,1.65,1"
		"OnPass" "s1_door_10_break,Break,,18.5,1"
    }
    insert:
    {
		"OnPass" "s1_movelinear8,Open,,1.95,1"
		"OnPass" "s1_door_10_break,Break,,15,1"
    }
}

modify:
{
    match:
    {
        "targetname" "s1_tracktrain01"
        "classname" "func_tracktrain"
    }
    replace:
    {
	"startspeed" "220"
    }
}

; stage 2 start tp

modify:
{
    match:
    {
        "targetname" "s1_once_tp_s2"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s1_tp09,Enable,,21,1"
    }
    insert:
    {
		"OnStartTouch" "s1_tp09,Enable,,45,1"
    }
}

; stage 2 double tp

modify:
{
    match:
    {
        "targetname" "s2_counter_trig_01"
        "classname" "math_counter"
    }
    delete:
    {
		"OnHitMax" "s2_door01_b,Close,,31,1"
		"OnHitMax" "s2_door01_a,Close,,31,1"
		"OnHitMax" "s2_tp_01,Enable,,35,1"
    }
    insert:
    {
		"OnHitMax" "s2_door01_b,Close,,39,1"
		"OnHitMax" "s2_door01_a,Close,,39,1"
		"OnHitMax" "s2_tp_01,Enable,,43,1"
    }
}

; stage 2 elevator speed

modify:
{
    match:
    {
        "targetname" "s2_movelinear_elev01"
        "classname" "func_movelinear"
    }
    replace:
    {
	"speed" "215"
    }
}

; stage 2 tp 03

modify:
{
    match:
    {
        "targetname" "s2_counter_trig_02"
        "classname" "math_counter"
    }
    delete:
    {
		"OnHitMax" "s2_door03_a,Close,,31,1"
		"OnHitMax" "s2_door03_b,Close,,31,1"
		"OnHitMax" "s2_tp_03,Enable,,35,1"
    }
    insert:
    {
		"OnHitMax" "s2_door03_a,Close,,38,1"
		"OnHitMax" "s2_door03_b,Close,,38,1"
		"OnHitMax" "s2_tp_03,Enable,,40,1"
    }
}

; stage 2 tp after surf

modify:
{
    match:
    {
        "targetname" "s2_once_coin_05"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s2_door05,Close,,26,1"
		"OnStartTouch" "s2_tp_05,Enable,,30,1"
    }
    insert:
    {
		"OnStartTouch" "s2_door05,Close,,35,1"
		"OnStartTouch" "s2_tp_05,Enable,,38,1"
    }
}

; stage 2 before multiple doors

modify:
{
    match:
    {
        "targetname" "s2_once_multiple_doors"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s2_tp_06,Enable,,17,1"
    }
    insert:
    {
		"OnStartTouch" "s2_tp_06,Enable,,25,1"
    }
}


; stage 2 last tp

modify:
{
    match:
    {
        "targetname" "s2_counter_trig_03"
        "classname" "math_counter"
    }
    delete:
    {
		"OnHitMax" "s2_door08,Close,,25,1"
		"OnHitMax" "s2_tp_07,Enable,,30,1"
    }
    insert:
    {
		"OnHitMax" "s2_door08,Close,,35,1"
		"OnHitMax" "s2_tp_07,Enable,,38,1"
    }
}

; stage 3 tp01

modify:
{
    match:
    {
        "targetname" "s3_break02"
        "classname" "func_breakable"
    }
    delete:
    {
		"OnBreak" "stage3_tp01,Enable,,12,-1"
    }
    insert:
    {
		"OnBreak" "stage3_tp01,Enable,,26,-1"
    }
}

; stage 3 tp02

modify:
{
    match:
    {
        "targetname" "s3_counter_trig_02"
        "classname" "math_counter"
    }
    delete:
    {
		"OnHitMax" "s3_tp02,Enable,,25,1"
    }
    insert:
    {
		"OnHitMax" "s3_tp02,Enable,,35,1"
    }
}

; stage 3 tp03

modify:
{
    match:
    {
        "targetname" "s3_oncetp"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s3_tp_03,Enable,,15,-1"
    }
    insert:
    {
		"OnStartTouch" "s3_tp_03,Enable,,30,-1"
    }
}

; stage 4 to before gravity

modify:
{
    match:
    {
        "targetname" "s3_once_coin_08_a"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s3_door08,Close,,31,1"
		"OnStartTouch" "s4_tp01,Enable,,35,1"
		"OnStartTouch" "cmd,Command,say | 20 |,0,1"
		"OnStartTouch" "cmd,Command,say | 15 |,5,1"
		"OnStartTouch" "cmd,Command,say | 10 |,10,1"
		"OnStartTouch" "s3_door08,Open,,20,1"
    }
    insert:
    {

		"OnStartTouch" "cmd,Command,say | 15 |,0,1"
		"OnStartTouch" "cmd,Command,say | 10 |,5,1"
		"OnStartTouch" "cmd,Command,say | 5 |,10,1"
		"OnStartTouch" "s3_door08,Open,,15,1"
		"OnStartTouch" "s3_door08,Close,,45,1"
		"OnStartTouch" "s4_tp01,Enable,,48,1"
    }
}

; stage 4 tp gravity

modify:
{
    match:
    {
        "targetname" "s4_once_coin_01"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s4_tp02,Enable,,32,1"
    }
    insert:
    {
		"OnStartTouch" "s4_tp02,Enable,,50,1"
    }
}

; stage 4 tp outside

modify:
{
    match:
    {
        "targetname" "s4_once_outside"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s4_door03,Close,,28,1"
		"OnStartTouch" "s4_tp03,Enable,,28,1"
    }
    insert:
    {
		"OnStartTouch" "s4_door03,Close,,36,1"
		"OnStartTouch" "s4_tp03,Enable,,39,1"
    }
}

; stage 4 outside 1

modify:
{
    match:
    {
        "targetname" "s4_once_coin_02"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s4_door04,Close,,27,1"
		"OnStartTouch" "s4_tp04,Enable,,30,1"
    }
    insert:
    {
		"OnStartTouch" "s4_door04,Close,,37,1"
		"OnStartTouch" "s4_tp04,Enable,,40,1"
    }
}

; stage 4 before ending

modify:
{
    match:
    {
        "targetname" "s4_once_coin_06"
        "classname" "trigger_once"
    }
    delete:
    {
		"OnStartTouch" "s4_door08,Close,,27,1"
		"OnStartTouch" "s4_tp08,Enable,,30,1"
    }
    insert:
    {
		"OnStartTouch" "s4_door08,Close,,37,1"
		"OnStartTouch" "s4_tp08,Enable,,40,1"
    }
}

