;------------------------------------------
; Replace MAIN vscript file - GENERAL
;------------------------------------------
modify:
{
	match:
	{
		"classname" "logic_script"
		"hammerid" "16586"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/main.nut"
	}
}

;------------------------------------------
; Replace RandomNPC vscript file - GENERAL
;------------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "27093"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/randomnpc.nut"
	}
}

;-----------------------------------------
; Replace Skeleton vscript file - GENERAL
;-----------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "27239"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/skeleton.nut"
	}
}

;---------------------------------------
; Replace Knight vscript file - GENERAL
;---------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "27134"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/knight.nut"
	}
}

;-------------------------------------------
; Replace BoneTurret vscript file - GENERAL
;-------------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "163065"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/boneturret.nut"
	}
}

;-----------------------------------------------
; Replace Giant Bat boss' vscript file - STAGE 1
;-----------------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "4526"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/giantbat.nut"
	}
}

;--------------------------------------------
; Replace WhiteDragon vscript file - STAGE 1
;--------------------------------------------
modify:
{
	match:
	{
		"classname" "prop_dynamic"
		"hammerid" "7808"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/whitedragon_head.nut"
	}
}

;-------------------------------------------
; Replace MedusaHead vscript file - STAGE 1
;-------------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "8084"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/medusahead.nut"
	}
}

;--------------------------------------------
; Replace MedusaSnake vscript file - STAGE 1
;--------------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "8098"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/medusasnake.nut"
	}
}

;--------------------------------------
; Replace Death vscript file - STAGE 2
;--------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "8008"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/death2.nut"
	}
}

;----------------------------------------
; Replace Dracula vscript file - STAGE 2
;----------------------------------------
modify:
{
	match:
	{
		"classname" "hegrenade_projectile"
		"hammerid" "103530"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/dracula.nut"
	}
}

;-------------------------------------------------------------------------
; Make axes go through the world so it's easier to use in enclosed spaces 
;-------------------------------------------------------------------------
modify:
{
	match:
	{
		"hammerid" "23741"
		"targetname" "subweapon_axe_phys"
		"classname" "func_physbox_multiplayer"
	}
	insert:
	{
		"OnUser1" "!selfBreak3-1"
	}
	replace:
	{
		"spawnflags" "16385"
		"notsolid" "1"
	}
}
modify:
{
	match:
	{
		"hammerid" "24169"
		"targetname" "subweapon_axe_relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnSpawn" "subweapon_axe_physFireUser101"
	}
}

;-------------------------------------------------------
; *** Heal, Holy Water, Holy Cross & Sword Familiar item rework ***
;-------------------------------------------------------
;--- Bible ---
modify:
{
	match:
	{
		"classname" "func_button"
		"hammerid" "23744"
	}
	delete:
	{
		"OnPressed" "Item_heart_crystal_filterTestActivator0-1"
	}
	insert:
	{
		"OnPressed" "item_heart_crystal_relay_useTrigger0-1"
		"vscripts" "ze_castlevania_nes/bible.nut"
	}
}
modify: 
{
	match:
	{
		"classname" "logic_relay"
		"hammerid" "23638"
	}
	insert:
	{
		"OnTrigger" "Item_heart_crystal_buttonRunScriptCodeStart()0-1"
	}
}
modify:
{
	match:
	{
		"origin" "-8129.79 2173.43 3308"
		"targetname" "Item_heart_crystal_weapon"
		"classname" "weapon_elite"
	}
	delete:
	{
		"OnPlayerPickup" "!activatorAddOutputtargetname filter_heart_crystal0.02-1"
		"OnPlayerPickup" "filter_heart_crystalAddOutputtargetname none0-1"
	}
	insert:
	{
		"OnPlayerPickup" "Item_heart_crystal_buttonRunScriptCodeInputUse<-@()self.GetMoveParent().GetMoveParent()==activator01"
	}
}
filter:
{
	"classname" "ambient_generic"
	"targetname" "Item_heal_Sound"
}
filter:
{
	"classname" "filter_activator_name"
	"targetname" "Item_heart_crystal_filter"
}
modify:
{
	match:
	{
		"origin" "-8130.19 2176.43 3308.9"
		"targetname" "Item_heart_crystal_template"
		"classname" "point_template"
	}
	delete:
	{
		"Template11" "Item_heal_Sound"
		"Template03" "Item_heart_crystal_filter"
	}
}

;--- Holy Water ---
modify:
{
	match:
	{
		"classname" "func_button"
		"hammerid" "24142"
	}
	delete:
	{
		"OnPressed" "i_w_holywater_spawnerForceSpawn0-1"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/holywater.nut"
	}
}
filter:
{
	"classname" "env_entity_maker"
	"targetname" "i_w_holywater_spawner"
}
filter:
{
	"classname" "point_template"
	"targetname" "s_holywater"
}
filter:
{
	"classname" "logic_timer"
	"targetname" "i_holywater_timer"
}
filter:
{
	"classname" "phys_thruster"
	"targetname" "i_holywater_t"
}
filter:
{
	"classname" "prop_physics_override"
	"targetname" "i_holywater_flask"
}
filter:
{
	"classname" "info_particle_system"
	"targetname" "i_holywater_particle"
}
filter:
{
	"classname" "info_particle_system"
	"targetname" "trigger_hurt"
}
filter:
{
	"classname" "logic_measure_movement"
	"targetname" "i_holywater_measure"
}
filter:
{
	"classname" "ambient_generic"
	"targetname" "i_holywater_sound"
}

;--- Sword Familiar ---
modify: 
{
	match:
	{
		"classname" "func_button"
		"hammerid" "24245"
	}
	insert:
	{
		"OnPressed" "!selfRunScriptCodeSpawnFamiliar()0-1"
		"vscripts" "ze_castlevania_nes/swordfamiliar.nut"
	}
	delete:
	{
		"OnPressed" "item_sword_special_makerForceSpawn0-1"
		"OnPressed" "item_sword_special_makerKill0.02-1"
	}
}
modify:
{
	match:
	{
		"origin" "-8122.28 3030.11 2936"
		"targetname" "item_sword_holder"
		"hammerid" "24241"
	}
	insert:
	{
		"OnPlayerPickup" "item_sword_buttonRunScriptCodeInputUse<-@()self.GetMoveParent().GetMoveParent()==activator01"
	}
}
modify:
{
	match:
	{
		"origin" "-8122.28 3030.11 2936"
		"targetname" "template_sword_item"
		"classname" "point_template"
	}
	delete:
	{
		"Template03" "item_sword_special_maker"
	}
}
filter:
{
	"classname" "env_entity_maker"
	"targetname" "item_sword_special_maker"
}

;--- Holy Cross ---
modify:
{
	match:
	{
		"classname" "func_button"
		"hammerid" "24237"
	}
	delete:
	{
		"OnPressed" "i_cross_relayTrigger0-1"
		"OnPressed" "i_cross_hurtEnable0-1"
		"OnPressed" "i_cross_hurtDisable3-1"
		"OnPressed" "i_cross_buttonLock0-1"
		"OnPressed" "i_cross_buttonUnlock3-1"
	}
	replace:
	{
		"vscripts" "ze_castlevania_nes/holycross.nut"
	}
}
modify:
{
	match:
	{
		"origin" "-8130.11 1484.72 2978.63"
		"targetname" "i_cross_holder"
		"hammerid" "24151"
	}
	delete:
	{
		"OnPlayerPickup" "i_cross_hurtSetParentAttachmentcrossend01"
		"OnPlayerPickup" "i_cross_particleSetParentAttachmentcrossend01"
	}
	insert:
	{
		"OnPlayerPickup" "i_cross_buttonRunScriptCodeInputUse<-@()self.GetMoveParent().GetMoveParent()==activator01"
	}
}
modify:
{
	match:
	{
		"origin" "-8130.11 1484.72 2978.63"
		"targetname" "template_cross_item"
		"classname" "point_template"
	}
	delete:
	{
		"Template06" "i_cross_particle"
		"Template05" "i_cross_relay"
		"Template03" "i_cross_hurt"
	}
}
filter:
{
	"classname" "info_particle_system"
	"targetname" "i_cross_particle"
}
filter:
{
	"classname" "trigger_hurt"
	"targetname" "i_cross_hurt"
}
filter:
{
	"classname" "logic_relay"
	"targetname" "i_cross_relay"
}

;-------------------------------------------------
; - V - Stripper Fixes And Balance Changes - V -
;-------------------------------------------------
modify:
{
	match:
	{
		"classname" "logic_auto"
		"hammerid" "10068"
	}
	insert:
	{
		"OnMapSpawn" "consoleCommandsay *** STRIPPER 2 LOADED ***13-1"
		"OnMapSpawn" "consoleCommandsv_enablebunnyhopping 101"
	}
}

;----------------------------------------
; Filters out broken particle
;----------------------------------------
filter:
{
	"classname" "info_particle_system"
	"targetname" "item_zombie_nade_spritehold"
}

;----------------------------------------
; Add fire to show fucked up clipping cant be entered
;----------------------------------------
add:
{
"origin" "-1680 11167.9 -4644.96"
"targetname" "fuck_particle_mamamia"
"start_active" "1"
"flag_as_weather" "0"
"effect_name" "hobcv_big_fire3"
"cpoint7_parent" "0"
"cpoint6_parent" "0"
"cpoint5_parent" "0"
"cpoint4_parent" "0"
"cpoint3_parent" "0"
"cpoint2_parent" "0"
"cpoint1_parent" "0"
"angles" "0 0 0"
"classname" "info_particle_system"
}
add:
{
"origin" "-1682.2 6364.11 -4640.93"
"targetname" "fuck_particle_mamamia2"
"start_active" "1"
"flag_as_weather" "0"
"effect_name" "hobcv_big_fire3"
"cpoint7_parent" "0"
"cpoint6_parent" "0"
"cpoint5_parent" "0"
"cpoint4_parent" "0"
"cpoint3_parent" "0"
"cpoint2_parent" "0"
"cpoint1_parent" "0"
"angles" "0 0 0"
"classname" "info_particle_system"
}

;----------------------------------------
; Nerf S1 chain adder
;----------------------------------------
modify:
{
	match:
	{
		"origin" "8656 8400 -2864"
		"targetname" "s1_chain_adder"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "s1_chain1_mathAdd250-1"
		"OnStartTouch" "s1_chain2_mathAdd250-1"
	}
	insert:
	{
		"OnStartTouch" "s1_chain1_mathAdd150-1"
		"OnStartTouch" "s1_chain2_mathAdd150-1"
	}
}

;----------------------------------------
; Nerf S1 garden gate hold
;----------------------------------------
modify:
{
	match:
	{
		"origin" "6028.15 8781.5 -2683.63"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "consoleCommandsay *** GATES OPEN IN 20 SECONDS ***01"
		"OnStartTouch" "s1_gate2_mover2Open201"
	}
	insert:
	{
		"OnStartTouch" "consoleCommandsay *** GATES OPEN IN 15 SECONDS ***01"
		"OnStartTouch" "s1_gate2_mover2Open151"
	}
}

;----------------------------------------
; Nerf S1 lever hold
;----------------------------------------
modify:
{
	match:
	{
		"origin" "-1296 8768 -2975.75"
		"targetname" "s1_counter1"
	}
	delete:
	{
		"OnHitMax" "s1_secretfloor1Open15-1"
		"OnHitMax" "consoleCommandsay *** FALL BACK! ***15-1"
	}
	insert:
	{
		"OnHitMax" "s1_secretfloor1Open8-1"
		"OnHitMax" "consoleCommandsay *** FALL BACK! ***8-1"
	}
}

;----------------------------------------
; Nerf S1 dungeon hold/clarify tp
;----------------------------------------
modify:
{
	match:
	{
		"origin" "1643 -12927 -14140.5"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "s1_shortcutBreak201"
		"OnStartTouch" "s1_dungeon_afkEnable51"
	}
	insert:
	{
		"OnStartTouch" "s1_dungeon_afkEnable251"
		"OnStartTouch" "ConsoleCommandsay *** ZM TP IN 10 SECONDS ***151"
	}
}
modify:
{
	match:
	{
		"targetname" "s1_door_key"
		"classname" "func_breakable"
		"origin" "2751 -13818 -14173.5"
	}
	delete:
	{
		"OnBreak" "s1_dungeon_afk2Enable81"
	}
	insert:
	{
		"OnBreak" "ConsoleCommandsay *** ZM TP IN 10 SECONDS ***81"
		"OnBreak" "s1_dungeon_afk2Enable181"
	}
}

;----------------------------------------
; Nerf S2 beam hold
;----------------------------------------
modify:
{
	match:
	{
		"origin" "-9248 4320 6600"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "fdr_cp5Open181"
	}
	insert:
	{
		"OnStartTouch" "fdr_cp5Open121"
	}
}

;----------------------------------------
; Nerf S2 shortcut open
;----------------------------------------
modify:
{
	match:
	{
		"origin" "-4432 3576 6512"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "s2_shortcut1Break31"
	}
	insert:
	{
		"OnStartTouch" "s2_shortcut1Break71"
	}
}


;------------------------
; Nerf S2 pre-death hold
;------------------------
modify:
{
	match:
	{
		"origin" "-7968 9916.83 6729.63"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "s2_gate_big2Open201"
	}
	insert:
	{
		"OnStartTouch" "s2_gate_big2Open151"
	}
}

;----------------------------------------------------------------
; Give Belmont and Alucard a strip trigger to help with entwatch
;----------------------------------------------------------------
add:
{
	"model" "*225"
	"targetname" "belmont_s_strip"
	"StartDisabled" "0"
	"spawnflags" "4097"
	"origin" "-1575.45 2145.47 3357.44"
	"filtername" "MapFilterCT"
	"classname" "trigger_once"
	"hammerid" "30337"
	"OnStartTouch" "strip_weaponsStripWeaponsAndSuit01"
}
modify:
{
	match:
	{
		"targetname" "s_belmont_buttonfilter"
		"origin" "-1295.89 2129.68 2882.49"
		"classname" "filter_activator_team"
	}
	delete:
	{
		"OnPass" "game_stripStrip01"
	}
}
add:
{
	"model" "*225"
	"targetname" "alucard_s_strip"
	"StartDisabled" "0"
	"spawnflags" "4097"
	"origin" "462.7 2099.18 3035.38"
	"filtername" "MapFilterCT"
	"classname" "trigger_once"
	"hammerid" "30337"
	"OnStartTouch" "strip_weaponsStripWeaponsAndSuit01"
}
modify:
{
	match:
	{
		"targetname" "s_alucard_buttonfilter"
		"origin" "612.556 2244.77 2886.02"
		"classname" "filter_activator_team"
	}
	delete:
	{
		"OnPass" "game_stripStrip01"
	}
}

;-----------
; Fix skins
;-----------
modify:
{
	match:
	{
		"origin" "-15232 8960 -6927"
		"targetname" "skin_case"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase01" "!activatorAddOutputmodelindex 5150-1"
		"OnCase02" "!activatorAddOutputmodelindex 5140-1"
		"OnCase03" "!activatorAddOutputmodelindex 5130-1"
		"OnCase04" "!activatorAddOutputmodelindex 5080-1"
	}
	insert:
	{
		"OnCase01" "!activatorAddOutputmodelindex 5080-1"
		"OnCase02" "!activatorAddOutputmodelindex 5130-1"
		"OnCase03" "!activatorAddOutputmodelindex 5140-1"
		"OnCase04" "!activatorAddOutputmodelindex 5150-1"
	}
}

;--------------------
; Fix 50/50 TP on S1
;--------------------
modify:
{
	match:
	{
		"origin" "12688 8968 -2931"
		"targetname" "s1_randomtp_zm"
		"classname" "logic_case"
	}
	delete:
	{
		"OnCase01" "s1_tp_leftzmTeleport0-1"
	}
	insert:
	{
		"OnCase01" "s1_tp_rightzmTeleport0-1"
	}
}

;-------------------------------------------------
; Add nutless filter for Belmont/Alucard abilities
;-------------------------------------------------
modify:
{
	match:
	{
		"origin" "-1580.28 2145.3 3353.73"
		"targetname" "belmont_holder"
		"classname" "weapon_knife"
	}
	insert:
	{
		"OnPlayerPickup" "belmont_button2RunScriptCodeInputUse<-@()self.GetMoveParent().GetMoveParent()==activator01"
	}
}
modify:
{
	match:
	{
		"origin" "457.777 2099.12 3033.7"
		"targetname" "alucard_holder"
		"classname" "weapon_knife"
	}
	insert:
	{
		"OnPlayerPickup" "alucard_button2RunScriptCodeInputUse<-@()self.GetMoveParent().GetMoveParent()==activator01"
	}
}

;-----------------------------------------------------------------------------------------
; Remove Belmont's freeze trigger coming from his ability and replace it with SetMovetype
;-----------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"origin" "-1576.28 2145.3 3353.73"
		"targetname" "s_belmont"
		"classname" "point_template"
	}
	delete:
	{
		"Template06" "belmont_freeze_trigger"
	}
}
filter:
{
	"model" "*251"
	"hammerid" "30434"
	"classname" "trigger_multiple"
}
modify:
{
	match:
	{
		"origin" "-1548.28 2145.3 3449.72"
		"targetname" "belmont_button2"
		"classname" "func_button"
	}
	delete:
	{
		"OnPressed" "belmont_freeze_triggerFireUser10-1"
	}
	insert:
	{
		"OnPressed" "belmont_guyRunScriptCodeactivator.SetMoveType(0, 0)0-1"
		"OnPressed" "belmont_guyRunScriptCodeactivator.SetMoveType(2, 0)4-1"
	}
}

;-----------------------------------------------------------------------------------------
; Increase time before church shortcuts appear
;-----------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"origin" "-4804.75 8565.54 7253.06"
		"classname" "trigger_once"
	}
	delete:
	{
		"OnStartTouch" "s2_rope_shortcut2Toggle31"
	}
	insert:
	{
		"OnStartTouch" "s2_rope_shortcut2Toggle151"
	}
}

;-----------------------------------------------------------------------------------------
; Disable BHOP after bat boss
;-----------------------------------------------------------------------------------------
modify:
{
	match:
	{
		"origin" "2856 8866.5 -2645"
		"targetname" "s1_bat_end_relay"
		"classname" "logic_relay"
	}
	insert:
	{
		"OnTrigger" "consoleCommandsv_enablebunnyhopping 001"
	}
}
modify:
{
	match:
	{
		"origin" "6073.15 8714.8 -2732.64"
		"targetname" "s1_gate2_mover2"
		"classname" "func_movelinear"
	}
	insert:
	{
		"OnFullyOpen" "consoleCommandsv_enablebunnyhopping 15-1"
	}
}

;----------------------------------------------------------------
; Raise bat boost strength so people can make it over the statue
;----------------------------------------------------------------
modify:
{
	match:
	{
		"origin" "258.5 8777 -3046.5"
		"targetname" "s1_bat_push"
		"classname" "trigger_push"
	}
	replace:
	{
		"speed" "800"
	}
}