Boss Battle

-- If you want to add support for your own bosses, just add this code to the top of your script:
-- (SLADE might not display this chunk of code as commented out, but trust me, it is)
--[[
local ScarfBossLoaded 

addHook("ThinkFrame", do
	if not ScarfBossLoaded and Scarf then
		-- Use this template for your own bosses:
		Scarf.BossInfo[MT_BOSSTYPE] = { -- Replace MT_BOSSTYPE with the boss's object type
			cutscenefreeze = true, -- Freezes everyone during the boss's intro "cutscene"
			voices = {
				-- Replace with the voice line the boss should use (MUST USE "s)
				boss = "sfx_bossvoicehere", //Eng
				rusboss = "sfx_bossvoicehere", //Rus
				-- :D
				chars = {}
				ruschars = {}
			}
			-- If this is not supplied, the boss's titlecard graphics will be ??? by default
			titlecard = {
				facepic = "TMNTEGG", -- Replace with the title card graphic the boss should use
				namepic = "TMNTEGGTEXT", -- Replace with the title card text graphic the boss should use
				picxoffset = integerhere, -- Offsets the x position of the boss's title card graphic
				picyoffset = integerhere -- Offsets the y position of the boss's title card graphic
			}
		}
		-- Replace "skinname" with your character's skin name and "sfx_characternamehere" with the voice line your character should say (MUST USE "s)
		Scarf.BossInfo[MT_BOSSTYPE].voices.chars["skinname"] = "sfx_charactervoicehere" //English
		Scarf.BossInfo[MT_BOSSTYPE].voices.ruschars["skinname"] = "sfx_charactervoicehere" //Rus
		
		ScarfBossLoaded = true
	end
end)
]]

Player

local ScarfCharLoaded

--[[
Custom Inv:
if source.koflashing <= Scarf.FLASHINGTICS
	source.koflashing = Scarf.FLASHINGTICS
end
]]

addHook("ThinkFrame", do
	if not ScarfCharLoaded and Scarf then
		Scarf.Char["skinnamehere"] = { -- Replace "skinnamehere" with your character's skin name (ex. "sonic")
			ShowBossBar = true, -- Displays the boss's health bar if true
			ShowHitCounter = true, -- Displays the enemy hit counter if true
			ShowHitCombos = true, -- Displays for enemy hit Blood combo if true
			ShowBossCard = true, -- Activates the boss's title card "cutscene"
			ShowBossPinch = true, -- Makes the boss flash red and plays a sound if its health is low enough
			UseScarfHPSystem = true, -- Makes the character use Scarf's HP system
			HPName = "" -- Add NickName in Scarf's HP System
			HPNameColor = V_REDMAP -- Add Color in HPName
			ShowCustomBar = true, -- Add Custom Bar
			Intermissiontally = true, -- Add Intermissiontally
			--Library Change Hp Hud if you are activated him(Only textures)
			HpBarHud = {
				BackFone = "TMNTBAR", -- Back Fone
				BackHp = "TMNTHPE", -- Back Bar Fone
				LowHp = "TMNTHPR", -- Low Bar
				Hp = "TMNTHPG", -- Bar
			},
			StarStones = true, --Activate Get Star Stones if you are another character
			--You can change music in Ultimate Mode if you are Activated BossHitFunction
			UltimateBossMusic = {
				Main = "3UTPS", -- Main Music
				Fang = "3PHU2", -- Music for Fang
				MetalSonic = "3PHU4", -- Music for Metal Sonic
				Final = "BKUPS" -- Music for Final Boss - Brak Eggman.
			},
			--HitBoxCollided = true, --Add in Hitboxes Bosses in Enemies Collide Custom. But he is worked
			RageBar = false, -- in y coordinate you can to raise hits down or up. false - down, true - up.
			CustomBar = "SFBAR", -- Add Custom Bar Image
			HpBossBar = "", -- Add custom Hp Bar Color
			ComboX = 0, --Coordinate X for Hits/Combos
			ComboY = 0, --Coordinate Y for Hits/Combos
			ComboXTrue = true, --Coordinate X for Hits/Combos for Battle
			ComboYTrue = true, --Coordinate Y for Hits/Combos for Battle
			Pause = true, -- Add Pause Hud and Music
			-- If your character has their own HP system, use this chunk of code to "override" it
			-- This should placed near the top of an MobjDamage hook; MAKE SURE TO REPLACE "mo" WITH THE PARAMETER YOU'RE USING FOR THE "target"
			if Scarf and Scarf.Char[mo.skin] and Scarf.Char[mo.skin].UseScarfHPSystem then
				return
			end
			-- You should use a similar check for your HUD if your character's HP system has a HUD
			HPIcon = "CHARHPICON", -- Displays a specified graphic on the character's HP bar; Defaults to the character's 1-up icon
			-- The icon's offsets should be centered around the bottom middile of the icon
			IncrementBossHitsFunction = function(mo)
				-- Increments the boss hit scale by a given factor
				-- The scale SHOULD BE IN FRACUNITS, NOT INTEGERS
				-- Ex.
				mo.ko_bosshitscale = min(Scarf.BOSSHITSCALEMAX, ($ or 0) + FRACUNIT)
			end,
			AntiHitFunction = function(source) -- This is check what if timer or check == true or > 0 and e.t.c, So in this is check not
			-- worked damage. But if are you not have about players attack...So...write this like i writed in Instructions...
				if not (source and source.valid and source.player and source.player.valid) then return end
			end,
			AntiHitObjectFunction = function(inf) -- This is too like AntiHitFunction. But this is for damage. If are you not have Objects.
			-- So write like i am writed in instructions.
				if not (inf and inf.valid and inf.health) then return end
			end,
			EnemyHitFunction = function(mo, inf, source, damage, damagetype)-- Replace this with your own function of five parameters
				-- Parameters names should not matter, but what they store should match the ShouldDamage hook's parameters
				-- It would also be a good idea to check for validity, like so:
				if not (mo and mo.valid) then return end
				if not (source and source.valid) then return end
				if not (source.player and source.player.valid) then return end
				-- It would also be a good idea to do this
				if source.koflashing <= Scarf.FLASHINGTICS
					source.koflashing = Scarf.FLASHINGTICS
				end
				mo.koenemybar = $ - 1 --Enemy Damage
			end,
			BossHitFunction = function(mo, inf, source, damage, damagetype) -- Replace this with your own function of five parameters
				-- Parameters names should not matter, but what they store should match the ShouldDamage hook's parameters
				-- It would also be a good idea to check for validity, like so:
				if not (mo and mo.valid) then return end
				if not (source and source.valid) then return end
				if not (source.player and source.player.valid) then return end
				-- If you wish to increment the hit counter, YOU MUST USE THIS FUNCTION:
				Scarf.IncrementBossHits(source)
				-- It would also be a good idea to do this
				if source.koflashing <= Scarf.FLASHINGTICS
					source.koflashing = Scarf.FLASHINGTICS
				end
				-- If you want the hit scale to adjust the damage dealt to the boss, use something like this
				mo.bosshp = $ - Scarf.BossHitScale(6, source.ko_bosshitscale, nil, mo.info.spawnhealth)
			end
		}
		-- If you wish to add your own character's voice lines to a boss, use this:
		-- Replace "skinname" with your character's skin name and "sfx_charactervoicehere" with the voice line your character should say (MUST USE "s)
		-- This might not work for custom bosses, so please be careful!
		Scarf.BossInfo[MT_BOSSTYPE].voices.chars["skinname"] = "sfx_charactervoicehere"
		ScarfCharLoaded = true
	end
end)
]]