;--------------------------------------------------------------------
;STRIPPER CFG BY MOLTARD http://steamcommunity.com/id/0123456789ABC/
;--------------------------------------------------------------------
;FIX STAGE2 EDGING BOSS AREA
;----------------------------

modify:
{
	match:
	{
		"classname" "func_brush"
		"targetname" "dira_pevnost_brush"
		"origin" "-9910 475 302.5"
		"model" "*118"
		"hammerid" "3192"
	}
	replace:
	{
		"origin" "-9910 450 302.5"
	}
}

;-------------------------
;FIX STAGE 1 ENDING CRASH 
;-------------------------

modify:
{
    match:
    {
        "classname" "func_lod"
    }
    insert:
    {
        "disableshadows" "1"
        "disablereceiveshadows" "1"
    }
}

;-------------------------
;FIX STAGE5 GLITCH KRAKEN
;-------------------------

add:
{
	"model" "*305"
	"targetname" "kraken_hurt"
	"origin" "2395 -11801 -1171.5"
	"StartDisabled" "1"
	"spawnflags" "1"
	"damage" "450000"
	"damagecap" "20"
	"nodmgforce" "0"
	"damagemodel" "0"
	"damagetype" "0"
	"classname" "trigger_hurt"
}
add:
{
	"targetname" "kraken_hurt"
	"origin" "2592 -10272 -1120"
	"StartDisabled" "1"
	"spawnflags" "1"
	"damage" "450000"
	"damagecap" "20"
	"nodmgforce" "0"
	"damagemodel" "0"
	"damagetype" "0"
	"classname" "trigger_hurt"
	"OnUser1" "!self,AddOutput,solid 2,0,1"
	"OnUser1" "!self,AddOutput,mins -256 -256 -256,0.1,1"
	"OnUser1" "!self,AddOutput,maxs 256 256 256,0.1,1"
}
modify:
{
	match:
	{
		"classname" "logic_auto"
	}
	insert:
	{
		"OnMapSpawn" "kraken_hurt,FireUser1,,10,1"
	}
}


;--------------------------------------------------------------
;MAKE BARBOSSA ZOMBIE AFFECTED BY MEDAILLION WHEN BOSSES START
;--------------------------------------------------------------

; Naming the 4 physboxes

modify:
{
	match:
	{
		"parentname" "zombie_barbossat_knife"
		"classname" "func_physbox_multiplayer"
	}
	insert:
	{
		"targetname" "zm_barbossa_hitbox"
	}
}

; Safe System to reset Barbossa damage filter

add:
{
	"classname" "logic_branch"
	"targetname" "Branch_BarbossaMedaillion"
	"origin" "-12360.5 14778.5 -887.75"
	"InitialValue" "0"
	"OnFalse" "!activator,SetDamageFilter,anti_medailon,0,-1"
	"OnTrue" "!activator,SetDamageFilter,,0,-1"
	"OnUser1" "!self,SetValue,1,0,1"
	"OnUser1" "zombie_barbossa_predek*,Enable,,0.1,1"
	"OnUser1" "zombie_barbossa_zadek*,Enable,,0.1,1"
	"OnUser1" "zombie_barbossa_prava*,Enable,,0.1,1"
	"OnUser1" "zombie_barbossa_leva*,Enable,,0.1,1"
	"OnUser1" "zombie_barbossa_predek*,Disable,,0.2,1"
	"OnUser1" "zombie_barbossa_zadek*,Disable,,0.2,1"
	"OnUser1" "zombie_barbossa_prava*,Disable,,0.2,1"
	"OnUser1" "zombie_barbossa_leva*,Disable,,0.2,1"
	"OnUser1" "barbossa_player,SetDamageFilter,,0.25,1"
	"OnUser1" "zombie_barbossa_predek*,Kill,,0.5,1"
	"OnUser1" "zombie_barbossa_zadek*,Kill,,0.5,1"
	"OnUser1" "zombie_barbossa_prava*,Kill,,0.5,1"
	"OnUser1" "zombie_barbossa_leva*,Kill,,0.5,1"
	"OnUser1" "zm_barbossa_hitbox*,Kill,,0.5,1"
	"OnUser1" "barbossa_player,SetDamageFilter,,2.00,1"
	"OnUser1" "barbossa_player,Addoutput,targetname nic,2.10,1"
}

modify:
{
	match:
	{
		"parentname" "zombie_barbossat_knife"
		"classname" "trigger_push"
		"OnStartTouch" "!activator,SetDamageFilter,anti_medailon,0,-1"
	}
	delete:
	{
		"OnStartTouch" "!activator,SetDamageFilter,anti_medailon,0,-1"
	}
	insert:
	{
		"OnStartTouch" "Branch_BarbossaMedaillion,Test,,0,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "barbossa_start"
		"origin" "-1527 14776 -543"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "Branch_BarbossaMedaillion,FireUser1,,14.5,1"
	}
}

modify:
{
	match:
	{
		"targetname" "set_mapa5"
		"origin" "-3817.5 15095 -1171.37"
		"classname" "trigger_once"
	}
	insert:
	{
		"OnStartTouch" "Branch_BarbossaMedaillion,FireUser1,,21.5,1"
	}
}


;-----------
;KRAKEN GOD
;-----------

;++++++++++++
;Level Start
;++++++++++++

add:
{
	"origin" "-2644 5723 -600"
	"targetname" "saving_relay6"
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"hammerid" "1000000"
	"OnUser1" "saving_brush,AddOutput,OnUser1 saving_relay6:trigger::0:1,0.01,-1"
	"OnUser1" "saving_brush,FireUser1,,0,-1"
	"OnUser1" "saving_brush,FireUser1,,0,-1"
	"OnUser1" "saving_brush,FireUser1,,0,-1"
	"OnUser1" "saving_brush,FireUser1,,0,-1"
	"OnTrigger" "saving_relay*,Disable,,0.01,-1"
	"OnTrigger" "saving_brush,AddOutput,OnUser1 saving_relay6:trigger::0:1,0,-1"
	"OnTrigger" "zombie_barbossa_vchod,Break,,14,-1"
	"OnTrigger" "zombie_hp_timer,Enable,,10,-1"
	"OnTrigger" "dvere_spawn,Open,,6,-1"
	"OnTrigger" "bb_template3,ForceSpawn,,1,-1"
	"OnTrigger" "bb_template2,ForceSpawn,,1,-1"
	"OnTrigger" "bb_template,ForceSpawn,,1,-1"
	"OnTrigger" "lvl5_1,PlaySound,,1,-1"
	"OnTrigger" "jack_final_template,ForceSpawn,,0.5,-1"
	"OnTrigger" "consola,Command,zr_infect_mzombie_ratio 7,0.5,-1"
	"OnTrigger" "template_spawn_5_5,ForceSpawn,,0.5,-1"
	"OnTrigger" "consola,Command,zr_infect_spawntime_min 8,0.5,-1"
	"OnTrigger" "consola,Command,zr_infect_spawntime_max 8,0.5,-1"
	"OnTrigger" "consola,Command,zr_respawn_delay 1,0.5,-1"
	"OnTrigger" "consola,Command,zr_respawn 1,0.5,-1"
	"OnTrigger" "jack_track*,Kill,,0,-1"
	"OnTrigger" "4lvl_lavka,Kill,,0,-1"
	"OnTrigger" "trigger_first,Kill,,0,-1"
	"OnTrigger" "anti_spawn_pf_2,Enable,,0,-1"
	"OnTrigger" "zataaras_spawn,Kill,,0,-1"
	"OnTrigger" "sky_barak,Break,,0,-1"
	"OnTrigger" "voda_44_55_2_sky,Toggle,,0,-1"
	"OnTrigger" "level4_multiple,Kill,,0,-1"
	"OnTrigger" "voda_44_55_sky,Toggle,,0,-1"
	"OnTrigger" "port_case_medailon,PickRandom,,0,-1"
	"OnTrigger" "port_level5,Trigger,,0,-1"
	"OnTrigger" "lvl4_2,Kill,,0,-1"
	"OnTrigger" "lvl4_1,Kill,,0,-1"
	"OnTrigger" "once_5,Enable,,0,-1"
	"OnTrigger" "dvere_mapa3,Break,,0,-1"
	"OnTrigger" "prekazka_most1,Lock,,0,-1"
	"OnTrigger" "jack_track_train,Kill,,0,-1"
	"OnTrigger" "jack_model,Kill,,0,-1"
	"OnTrigger" "zatarasa_predvesnici,Break,,0,-1"
	"OnTrigger" "dvere_mapa3,Break,,0,-1"
	"OnTrigger" "dvere_mapa3,Break,,0,-1"
	"OnTrigger" "map_spawn_cerno,Disable,,0,-1"
	"OnTrigger" "stiny_envi,TurnOn,,0,-1"
	"OnTrigger" "map_spawn_temno,Disable,,0,-1"
	"OnTrigger" "map_spawn_den,Enable,,0,-1"
	"OnTrigger" "map_spawn_mraky,TurnOff,,0,-1"
	"OnTrigger" "text_test,Display,,10.01,1"
	"OnTrigger" "text_test,AddOutput,color 255 255 0,10,1"
	"OnTrigger" "text_test,AddOutput,message >>> |LEVEL 5 KRAKEN GOD!| <<<,10,1"
	"OnTrigger" "text_test,Display,,5.01,1"
	"OnTrigger" "text_test,AddOutput,message Map made by Puklica,5,1"
	"OnTrigger" "text_test,AddOutput,color 0 128 255,5,1"
	"OnTrigger" "consola,Command,say >>> |LEVEL 5 KRAKEN GOD!| <<<,10,1"
	"OnTrigger" "consola,Command,say Map made by Puklica,5,1"
	"OnTrigger" "Branch_Lvl5Win,SetValue,1,0,1"
	"OnTrigger" "kraken_rtv,Enable,,1,1"
	"OnTrigger" "kraken_zacatek_god,Enable,,0,-1"
	"OnTrigger" "kraken_zacatek,Kill,,0,-1"
	"OnTrigger" "TheCurrentLevelPlugin,SetValue,6,0,1"
	
	"OnTrigger" "Bossa_Event_BranchChanged,Test,,3,1"
}


;+++++++++++
;Boss Fight
;+++++++++++

add:
{
	"origin" "1990.28 -11596.3 -841"
	"targetname" "kraken_rtv"
	"StartDisabled" "1"
	"spawnflags" "0"
	"classname" "logic_relay"
	"hammerid" "14089694"
	"OnTrigger" "consola,Command,say >>> KRAKEN GOD! <<<,0,1"
	"OnTrigger" "consola,Command,say >>> KRAKEN GOD! <<<,1,1"
	"OnTrigger" "consola,Command,say >>> KRAKEN GOD! <<<,2,1"
}

modify:
{
	match:
	{
		"targetname" "kraken_path1"
		"classname" "path_track"
	}
	insert:
	{
		"OnPass" "consola,Command,say >>> IT'S KRAKEN. KILL HIM! <<<,6,-1"
		"OnPass" "kraken_zacatek_god,Trigger,,8,-1"
		"OnPass" "kraken_rtv,Trigger,,0,1"
	}
}

modify:
{
	match:
	{
		"targetname" "kraken_hp_iterations"
		"classname" "math_counter"
	}
	insert:
	{
		"OnHitMin" "kraken_zacatek_god,CancelPending,,0,-1"
	}
}
add:
{
	"origin" "2126 -12336 -936.609"
	"targetname" "kraken_zacatek_god"
	"StartDisabled" "1"
	"spawnflags" "0"
	"classname" "logic_relay"
	"hammerid" "14002753"
	"OnTrigger" "kraken_utok_random,PickRandom,,0,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,4.7,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,9.4,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,14.1,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,18.8,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,23.5,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,28.2,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,51.7,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,37.6,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,42.3,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,32.9,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,70.5,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,61.1,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,65.8,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,75.2,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,79.9,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,47,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,56.4,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,84.6,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,89.3,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,94,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,98.7,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,103.4,-1"
	"OnTrigger" "kraken_utok_random,PickRandom,,108.1,-1"
	"OnTrigger" "kraken_dead_all,Trigger,,114,-1"
}

;++++++++++
;Level End
;++++++++++

add:
{
	"classname" "logic_branch"
	"targetname" "Branch_Lvl5Win"
	"origin" "9723 -12767 -1160.67"
	"InitialValue" "0"
	"OnFalse" "consola,Command,say >>> YOU HAVE WON THE MAP. BUT ONLY EASY KRAKEN <<< ,0,1"	
	"OnFalse" "text_test,AddOutput,message YOU HAVE WON THE MAP. BUT ONLY EASY KRAKEN ,0,1"
	
	"OnTrue" "consola,Command,say >>> YOU KILLED GOD KRAKEN AND WON THE MAP,0,0"
	"OnTrue" "text_test,AddOutput,message YOU KILLED GOD KRAKEN AND WON THE MAP,0,1"
	"OnTrue" "consola,Command,say >>> YOU ARE A REAL PIRATE! <<< ,2,1"
	"OnTrue" "text_test,AddOutput,message  YOU ARE A REAL PIRATE! ,2,1"
	"OnTrue" "text_test,Display,,2.01,1"
}


modify:
{
	match:
	{
		"targetname" "level_5_win"
		"classname" "logic_relay"
	}
	delete:
	{
		"OnTrigger" "text_test,AddOutput,message YOU HAVE WON THE MAP. YOU ARE A REAL PIRATE ,0,1"
		"OnTrigger" "saving_relay5,FireUser1,,0,-1"
	}
	insert:
	{
		"OnTrigger" "Branch_Lvl5Win,Test,,0,1"
		"OnTrigger" "saving_relay6,FireUser1,,0,-1"
	}
}


;-----------------------------
;CONSOLE MESSAGES (LIKE V5.4)
;-----------------------------

;++++++++++++
;Boss Attack
;++++++++++++

modify:
{
	match:
	{
		"targetname" "kraken_utok2"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say ||| KRAKEN HAS USED VORTEX |||,0,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "kraken_utok3"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say  ||| KRAKEN HAS THROWN BARREL ON YOU |||,0,-1"
	}
}

modify:
{
	match:
	{
		"targetname" "kraken_utok3double"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say  ||| KRAKEN HAS THROWN BARRELS ON YOU |||,0,-1"
	}
}
modify:
{
	match:
	{
		"targetname" "kraken_utok4"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say  ||| KRAKEN HAS SENT A WAVE ON YOU |||,0,-1"	
	}
}
modify:
{
	match:
	{
		"targetname" "kraken_utok5"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say  ||| KRAKEN HAS SENT A BUBBLES ON YOU |||,0,-1"
	}
}

;++++++++++++
;Level Start
;STAGE DISPLAY
;++++++++++++

add:
{
	"origin" "9723 -12767 -1160"
	"targetname" "TheCurrentLevelPlugin"
	"min" "1"
	"max" "6"
	"startvalue" "1"
	"classname" "math_counter"
}

modify:
{
	match:
	{
		"targetname" "saving_relay1"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say >>> |LEVEL 1| <<<,10,1"
		"OnTrigger" "consola,Command,say Map made by Puklica,5,1"
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,1,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "saving_relay2"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say >>> |LEVEL 2| <<<,10,1"
		"OnTrigger" "consola,Command,say Map made by Puklica,5,1"
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,2,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "saving_relay3"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say >>> |LEVEL 3| <<<,10,1"
		"OnTrigger" "consola,Command,say Map made by Puklica,5,1"
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,3,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "saving_relay4"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say >>> |LEVEL 4| <<<,10,1"
		"OnTrigger" "consola,Command,say Map made by Puklica,5,1"
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,4,0,1"
	}
}
modify:
{
	match:
	{
		"targetname" "saving_relay5"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consola,Command,say >>> |LEVEL 5| <<<,10,1"
		"OnTrigger" "consola,Command,say Map made by Puklica,5,1"
		"OnTrigger" "skore_1000,AddOutput,points 500,5,1"
		"OnTrigger" "TheCurrentLevelPlugin,SetValue,5,0,1"
	}
}


;------------------
; Admin Room Stuff
;------------------

modify:
{
	match:
	{
		"classname" "func_button"
		"OnPressed" "consola,Command,sm_slay @all,4,-1"
	}
	delete:
	{
		"OnPressed" "consola,Command,sm_slay @all,4,-1"
	}
	insert:
	{
		"OnPressed" "player,SetHealth,0,4,-1"
	}
}

add:
{
	"model" "*215"
	"wait" "1"
	"unlocked_sound" "0"
	"unlocked_sentence" "0"
	"speed" "1"
	"spawnflags" "1025"
	"sounds" "0"
	"rendermode" "0"
	"renderfx" "0"
	"rendercolor" "255 255 255"
	"renderamt" "255"
	"origin" "-3180.3 5562 -602"
	"movedir" "0 0 0"
	"locked_sound" "0"
	"locked_sentence" "0"
	"lip" "0"
	"health" "0"
	"disablereceiveshadows" "0"
	"classname" "func_button"
	"hammerid" "4491"
	"OnPressed" "consola,Command,say |Admin Room| ***Admin has changed difficulty to LEVEL 6 ***,0,-1"
	"OnPressed" "spawny_1,Trigger,,0,-1"
	"OnPressed" "player,SetHealth,0,4,-1"
	"OnPressed" "consola,Command,say |Admin Room| *** ADMIN KILL ALL ***,4,-1"
	"OnPressed" "saving_relay6,FireUser1,,0,-1"
}

;--------------------------
; EVENT - July 2021
; MULTIPLE BARBOSSA
;--------------------------

; Done it for v5, so I can do it in v3

;*******************
; Template the item
;*******************

filter:
{
	"model" "*441"
	"origin" "-12354 14777.5 -851"
	"classname" "trigger_multiple"
	"hammerid" "7561041"
}
add:
{
	"model" "*441"
	"StartDisabled" "0"
	"spawnflags" "1"
	"targetname" "zombie_barbossa_strip"
	"origin" "-12354 14777.5 -851"
	"filtername" "zombi"
	"classname" "trigger_once"
	"OnStartTouch" "zbrane_strip,StripWeaponsAndSuit,,0,1"
}

add:
{
	"targetname" "Template_BarbossaItem"
	"origin" "-12392 14824 -888"
	"Template01" "zombie_barbossa_strip"
	"Template02" "zm_barbossa_hitbox"
	"Template03" "zombie_barbossa_kill"
	"Template04" "zombie_barbossa_zadek"
	"Template05" "zombie_barbossa_leva"
	"Template06" "zombie_barbossa_predek"
	"Template07" "zombie_barbossa_prava"
	"Template08" "zombie_barbossa"
	"Template09" "zombie_barbossat_knife"
	"Template10" "zombie_barbossa_push"
	"Template11" "zombie_barbossa_speed"
	"Template12" "zombie_barbossa_spawner"
	"Template13" "zombie_barbossa_maker2"
	"Template14" "zombie_barbossa_set"
	"Template15" "zombie_barbossa_set2"
	"Template16" "zombie_barbossa_ui"
	"spawnflags" "0"
	"classname" "point_template"
}


;***********************
; Bomb unique instances
;***********************

add:
{
	"origin" "-12294 14778 -844"
	"targetname" "zombie_barbossa_relay_koule"
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnSpawn" "!self,Trigger,,0,1"
	"OnSpawn" "!self,Kill,,6,1"
	"OnSpawn" "zombie_barbossa_compare_koule,Kill,,6,1"
	"OnTrigger" "zombie_barbossa_compare_koule,FireUser1,,1,1"
	"OnTrigger" "zombie_barbossa_koule,Break,,5,1"
}

; More than one BARBOSSA
; => Let player shoot the bombs away
; Edit: 21-07 => More than 2

add:
{
	"origin" "-12294 14778 -844"
	"targetname" "zombie_barbossa_compare_koule"
	"InitialValue" "0"
	"CompareValue" "2"
	"classname" "logic_compare"
	"OnGreaterThan" "zombie_barbossa_koule,EnableDamageForces,,0,1"
	"OnUser1" "Bossa_Event_CounterPicked,GetValue,,0,1"
}


modify:
{
    match:
    {
        "targetname" "zombie_barbossa_set2"
		"classname" "logic_relay"
    }
	delete:
    {
        "OnTrigger" "zombie_barbossa_koule,Break,,5,-1"
    }
}

modify:
{
    match:
    {
        "targetname" "zombie_barbossa_template_2"
		"classname" "point_template"
    }
    replace:
    {
        "spawnflags" "0"
    }
	insert:
    {
        "Template04" "zombie_barbossa_relay_koule"
        "Template05" "zombie_barbossa_compare_koule"
    }
}

modify:
{
    match:
    {
        "targetname" "barbossa_start"
		"classname" "trigger_once"
    }
	delete:
    {
        "OnStartTouch" "zombie_barbossa_koule,Break,,22,1"
    }
	insert:
    {
        "OnStartTouch" "zombie_barbossa_koule*,Break,,22,1"
    }
}


modify:
{
    match:
    {
        "targetname" "zombie_barbossa_kill"
		"classname" "trigger_hurt"
    }
	delete:
    {
		; Remove target input so the trigger doesnt need to get a unique name
		; And can be targetted from outside
    	"OnStartTouch" "zombie_barbossa_kill,Kill,,0,-1"
    }	
	insert:
    {
        "OnStartTouch" "!self,Kill,,0,-1"
        "OnStartTouch" "zombie_barbossa_relay_koule*,CancelPending,,0,-1"
    }
}


;***************************
; Multiple Barbossa Counter
;***************************

add:
{
	"origin" "0 0 0"
	"targetname" "THIS_IS_MY_LOGIC_AUTO"
	"StartDisabled" "0"
	"spawnflags" "1"
	"classname" "logic_relay"
	"OnSpawn" "Bossa_Event_Init,FireUser1,,0,1"
	"OnSpawn" "Bossa_Event_CounterInfo,GetValue,,12,1"
	"OnSpawn" "Bossa_Event_SpawnNewOne,Trigger,,20,1"
}

; Relay to spawn a Barbossa

add:
{
	"origin" "0 0 0"
	"targetname" "Bossa_Event_SpawnNewOne"
	"StartDisabled" "0"
	"spawnflags" "0"
	"classname" "logic_relay"
	"OnTrigger" "Template_BarbossaItem,ForceSpawn,,1,-1"
}

; Permanent entity stuff

add:
{
	"targetname" "Bossa_Event_Init"
	"origin" "2552 -2536 840"
	"classname" "info_target"
	"OnUser1" "Template_PermBossaEventMode,ForceSpawn,,0,1"
	"OnUser1" "Bossa_Event_CounterInfo,AddOutput,classname info_target,0.03,1"
	"OnUser1" "Bossa_Event_BranchChanged,AddOutput,classname info_target,0.03,1"
	"OnUser1" "!self,Kill,,0.06,1"
}

add:
{
	"targetname" "Template_PermBossaEventMode"
	"origin" "2552 -2536 776"
	"Template01" "Bossa_Event_BranchChanged"
	"Template02" "Bossa_Event_CounterInfo"
	"spawnflags" "2"
	"classname" "point_template"
	"OnEntitySpawned" "!self,Kill,,0,-1"
}

add:
{
	"origin" "0 0 0"
	"targetname" "Bossa_Event_CounterInfo"
	"startvalue" "1"
	"StartDisabled" "0"
	"min" "1"
	"max" "16"
	"classname" "math_counter"
	"OutValue" "!self,GetValue,,0.05,-1"
	
	"OnGetValue" "Bossa_Event_CaseInfo,InValue,,0,-1"

	"OnGetValue" "Bossa_Event_CounterPicked,SetHitMax,,0,-1"
	"OnGetValue" "Bossa_Event_Compare,SetValueCompare,,0,-1"

}

; Branch executed in Kraken god
; Set 3 barbossa if no admin set a specific amount of barbossa prior to that stage

add:
{
	"targetname" "Bossa_Event_BranchChanged"
	"origin" "0 0 0"
	"InitialValue" "0"
	"classname" "logic_branch"
	"OnFalse" "Bossa_Event_CounterInfo,SetValueNoFire,3,0,-1"
}


;++++++++++++++++++++++++++++++++++
; Barbossa Knife
; Picking one increase the counter
;++++++++++++++++++++++++++++++++++

modify:
{
    match:
    {
        "targetname" "zombie_barbossat_knife"
		"classname" "weapon_knife"
    }
	delete:
    {
		"OnPlayerPickup" "barbossa_port,Enable,,0.5,-1"
    }	
	insert:
    {
        "OnPlayerPickup" "!activator,AddOutput,origin -13209 13962.8 -997,0,1"
        "OnPlayerPickup" "Bossa_Event_CounterPicked,Add,1,0,1"
        "OnPlayerPickup" "Bossa_Event_SpawnNewOne,Trigger,,0,1"
    }
}


add:
{
	"origin" "0 0 0"
	"targetname" "Bossa_Event_CounterPicked"
	"startvalue" "0"
	"StartDisabled" "0"
	"min" "0"
	"max" "1"
	"classname" "math_counter"
	; OnGetValue input used to check how many barbossa were picked for the 'shootable bomb' system
	"OnGetValue" "!caller,SetValueCompare,,0,-1"
	"OnHitMax" "barbossa_port,Enable,,0,-1"
	"OnHitMax" "Bossa_Event_SpawnNewOne,CancelPending,,0.1,-1"
}

;+++++++++++++++++++++++++++
; Message and admin buttons
;+++++++++++++++++++++++++++

add:
{
	"targetname" "Bossa_Event_Compare"
	"origin" "0 0 0"
	"InitialValue" "0"
	"CompareValue" "1"
	"classname" "logic_compare"
	"OnEqualTo" "Bossa_Event_Admin_Subtract,FireUser1,Dummy,0,-1"
	"OnNotEqualTo" "Bossa_Event_Admin_Subtract,FireUser2,Dummy,0,-1"
}
add:
{
	"targetname" "Bossa_Event_Compare"
	"origin" "0 0 0"
	"InitialValue" "0"
	"CompareValue" "16"
	"classname" "logic_compare"
	"OnEqualTo" "Bossa_Event_Admin_Add,FireUser1,Dummy,0,-1"
	"OnNotEqualTo" "Bossa_Event_Admin_Add,FireUser2,Dummy,0,-1"
}

add:
{
	"angles" "0 90 0"
	"model" "*64"
	"targetname" "Bossa_Event_Admin_Subtract"
	"wait" "0.5"
	"unlocked_sound" "0"
	"unlocked_sentence" "0"
	"speed" "1"
	"spawnflags" "1025"
	"sounds" "0"
	"rendermode" "1"
	"renderfx" "0"
	"rendercolor" "0 255 0"
	"renderamt" "255"
	"origin" "-2610 5689.2 -602"
	"movedir" "0 0 0"
	"min_use_angle" "0.8"
	"locked_sound" "0"
	"locked_sentence" "0"
	"lip" "0"
	"health" "0"
	"fadescale" "1"
	"fademindist" "-1"
	"disablereceiveshadows" "0"
	"classname" "func_button"
	"hammerid" "276910"
	"OnPressed" "Bossa_Event_CounterInfo,Subtract,1,0,-1"
	"OnPressed" "consola,Command,say |Admin Room| *** REMOVED ONE BARBOSSA ***,0,-1"
	"OnPressed" "Bossa_Event_BranchChanged,SetValue,1,0,1"
	"OnUser1" "!self,Color,255 0 0,0,-1"
	"OnUser1" "!self,Lock,,0,-1"
	"OnUser2" "!self,Color,0 255 0,0,-1"
	"OnUser2" "!self,Unlock,,0,-1"
}

add:
{
	"angles" "0 90 0"
	"model" "*64"
	"targetname" "Bossa_Event_Admin_Add"
	"wait" "0.5"
	"unlocked_sound" "0"
	"unlocked_sentence" "0"
	"speed" "1"
	"spawnflags" "1025"
	"sounds" "0"
	"rendermode" "1"
	"renderfx" "0"
	"rendercolor" "0 255 0"
	"renderamt" "255"
	"origin" "-2610 5625.2 -602"
	"movedir" "0 0 0"
	"min_use_angle" "0.8"
	"locked_sound" "0"
	"locked_sentence" "0"
	"lip" "0"
	"health" "0"
	"fadescale" "1"
	"fademindist" "-1"
	"disablereceiveshadows" "0"
	"classname" "func_button"
	"hammerid" "276911"
	"OnPressed" "Bossa_Event_CounterInfo,Add,1,0,-1"
	"OnPressed" "consola,Command,say |Admin Room| *** ADDED ONE BARBOSSA ***,0,-1"
	"OnPressed" "Bossa_Event_BranchChanged,SetValue,1,0,1"
	"OnUser1" "!self,Color,255 0 0,0,-1"
	"OnUser1" "!self,Lock,,0,-1"
	"OnUser2" "!self,Color,0 255 0,0,-1"
	"OnUser2" "!self,Unlock,,0,-1"
}

add:
{
	"origin" "0 0 0"
	"targetname" "Bossa_Event_CaseInfo"
	"Case01" "1"
	"Case02" "2"
	"Case03" "3"
	"Case04" "4"
	"Case05" "5"
	"Case06" "6"
	"Case07" "7"
	"Case08" "8"
	"Case09" "9"
	"Case10" "10"
	"Case11" "11"
	"Case12" "12"
	"Case13" "13"
	"Case14" "14"
	"Case15" "15"
	"Case16" "16"
	"classname" "logic_case"
	"OnCase01" "consola,Command,say *** Max Barbossa = 1 ***,0,-1"
	"OnCase02" "consola,Command,say *** Max Barbossa = 2 ***,0,-1"
	"OnCase03" "consola,Command,say *** Max Barbossa = 3 ***,0,-1"
	"OnCase04" "consola,Command,say *** Max Barbossa = 4 ***,0,-1"
	"OnCase05" "consola,Command,say *** Max Barbossa = 5 ***,0,-1"
	"OnCase06" "consola,Command,say *** Max Barbossa = 6 ***,0,-1"
	"OnCase07" "consola,Command,say *** Max Barbossa = 7 ***,0,-1"
	"OnCase08" "consola,Command,say *** Max Barbossa = 8 ***,0,-1"
	"OnCase09" "consola,Command,say *** Max Barbossa = 9 ***,0,-1"
	"OnCase10" "consola,Command,say *** Max Barbossa = 10 ***,0,-1"
	"OnCase11" "consola,Command,say *** Max Barbossa = 11 ***,0,-1"
	"OnCase12" "consola,Command,say *** Max Barbossa = 12 ***,0,-1"
	"OnCase13" "consola,Command,say *** Max Barbossa = 13 ***,0,-1"
	"OnCase14" "consola,Command,say *** Max Barbossa = 14 ***,0,-1"
	"OnCase15" "consola,Command,say *** Max Barbossa = 15 ***,0,-1"
	"OnCase16" "consola,Command,say *** Max Barbossa = 16 ***,0,-1"
}

;-----------------------
; ANTI BOOSTS FIXES
;-----------------------

add:
{
	"classname" "logic_relay"
	"targetname" "StripperGlobalFixBoostRelay"
	"spawnflags" "2"
	"StartDisabled" "1"
	"origin" "0 0 0"
	"OnTrigger" "!activator,AddOutput,absvelocity 0 0 0,0,-1"
	"OnUser1" "!self,Enable,,0,-1"
	"OnUser1" "!self,Disable,,0.1,-1"
}

;+++++++++++++++++++++++++
; FIX 1 SPOT FOR BOOST
; Stage 4/5 - Middle Area
;+++++++++++++++++++++++++

modify:
{
	match:
	{
		"targetname" "mapa5_pred_teleport"
		"classname" "trigger_teleport"
	}
	insert:
	{
		"OnEndTouch" "StripperGlobalFixBoostRelay,Trigger,,0,-1"
	}
}
modify:
{
	match:
	{
		"model" "*193"
		"origin" "-3787.5 15222.7 -581.48"
		"classname" "trigger_once"
		"hammerid" "4260"
	}
	insert:
	{
		"OnStartTouch" "StripperGlobalFixBoostRelay,FireUser1,,1.95,1"
	}
}





;; _

;; fix zm barbossa spinning/boosting?

modify:
{
	match:
	{
		"targetname" "zombie_barbossa_zadek"
		"speed" "131"
		"classname" "trigger_push"
	}
	replace:
	{
		"speed" "107"
	}
}
modify:
{
	match:
	{
		"targetname" "zombie_barbossa_predek"
		"speed" "131"
		"classname" "trigger_push"
	}
	replace:
	{
		"speed" "109"
	}
}
modify:
{
	match:
	{
		"targetname" "zombie_barbossa_prava"
		"speed" "117"
		"classname" "trigger_push"
	}
	replace:
	{
		"speed" "117"
	}
}
modify:
{
	match:
	{
		"targetname" "zombie_barbossa_leva"
		"speed" "117"
		"classname" "trigger_push"
	}
	replace:
	{
		"speed" "117"
	}
}