local o=game:GetService("\068\101\098\114\105\115")local V=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local u={}local K=script:FindFirstAncestor("\067\111\109\098\097\116\083\121\115\116\101\109")local G=require(K.Modules.DamageBillboardHandler)local A=K.Assets.Sounds local w=K.Assets.Effects local L=K.Configuration function u.createHighlightEffect(u,o)local K=L.VisualEffects if K.Value then local u=w.Highlight:Clone()u.Enabled=true u.Parent=o local K=TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)local G=V:Create(u,K,{FillTransparency=1,OutlineTransparency=1})G.Completed:Once(function()u:Destroy()end)G:Play()end end function u.playPunchedSoundEffect(u,V)local K=L.SoundEffects if K.Value then local u=A.Punched1:Clone()u.Parent=V u:Play()o:AddItem(u,1)end end function u.playSwingSoundEffect(u,V)local K=L.SoundEffects if K.Value then local u=A.Swing:Clone()u.Parent=V u:Play()o:AddItem(u,1)end end function u.showDamage(u,o,V)local A=K.Configuration.VisualEffects if A.Value then G:showDamageBillboard(o,V)end end return u
local Debris = game:GetService("Debris")
local TweenService = game:GetService("TweenService")

local EffectsHandler = {}

local CombatSystem = script:FindFirstAncestor("CombatSystem")

local DamageBillboardHandler = require(CombatSystem.Modules.DamageBillboardHandler)

local sounds = CombatSystem.Assets.Sounds
local effects = CombatSystem.Assets.Effects
local configuration = CombatSystem.Configuration

function EffectsHandler:createHighlightEffect(characterOther)
	local visualEffects = configuration.VisualEffects
	if visualEffects.Value then
		local highlightEffect = effects.Highlight:Clone()
		highlightEffect.Enabled = true
		highlightEffect.Parent = characterOther

		local highlightTweenInfo = TweenInfo.new(
			3, -- time
			Enum.EasingStyle.Linear,
			Enum.EasingDirection.Out,
			0, -- repeatCount
			false, -- reverses
			0 -- delayTime
		)
		local highlightTween = TweenService:Create(
			highlightEffect,
			highlightTweenInfo, {
				FillTransparency = 1,
				OutlineTransparency = 1
			}
		)

		highlightTween.Completed:Once(function()
			highlightEffect:Destroy()
		end)

		highlightTween:Play()
	end
end

function EffectsHandler:playPunchedSoundEffect(characterOther)
	local soundEffects = configuration.SoundEffects
	if soundEffects.Value then
		local sound = sounds.Punched1:Clone()
		sound.Parent = characterOther
		sound:Play()

		Debris:AddItem(sound, 1)
	end
end

function EffectsHandler:playSwingSoundEffect(character)
	local soundEffects = configuration.SoundEffects
	if soundEffects.Value then
		local sound = sounds.Swing:Clone()
		sound.Parent = character
		sound:Play()

		Debris:AddItem(sound, 1)
	end
end

-- Function to show damagebilboard
function EffectsHandler:showDamage(adornee, damage)
	local visualEffects = CombatSystem.Configuration.VisualEffects
	if visualEffects.Value then
		DamageBillboardHandler:showDamageBillboard(adornee, damage)
	end
end

return EffectsHandler
