---@class BP_MonsterGoldEfficiencyMonster_C:BP_MonsterChallenge_C ---@field UAESkillManager UUAESkillManagerComponent ---@field ThornParticle UParticleSystem --Edit Below-- --local BP_MonsterGoldEfficiencyMonster = {}; local MonsterChallenge = require('Script.Blueprint.Monster.BP_MonsterChallenge') local BP_MonsterGoldEfficiencyMonster = setmetatable( { EnableThornSkill = false; ID = 1006; MonsterName = "GoldEfficiencyMonster", ThornSkillHandle = nil; }, { __index = MonsterChallenge, __metatable = MonsterChallenge } ); function BP_MonsterGoldEfficiencyMonster:ReceiveBeginPlayEx() MonsterChallenge.ReceiveBeginPlayEx(self) if self:HasAuthority() then self:AddThornSkill() self:AddToughAndTensileSkill() end end function BP_MonsterGoldEfficiencyMonster:ReceiveEndPlayEx() MonsterChallenge.ReceiveEndPlayEx(self) self:ReceiveOnMonsterDeath() end function BP_MonsterGoldEfficiencyMonster:AddToughAndTensileSkill() self:AddModifyDamageDelegationFun( "AddToughAndTensileSkill", ---@param DelegationFun fun(DamageAmount:float,DamageEvent:FDamageEvent,EventInstigator:AController,DamageCauser:AActor):float function (DamageAmount, DamageEvent, EventInstigator, DamageCauser) return DamageAmount * 0.7 end ) end function BP_MonsterGoldEfficiencyMonster:AddThornSkill() self:AddModifyDamageDelegationFun( "AddThornSkill", ---@param DelegationFun fun(DamageAmount:float,DamageEvent:FDamageEvent,EventInstigator:AController,DamageCauser:AActor):float function (DamageAmount, DamageEvent, EventInstigator, DamageCauser) if self.EnableThornSkill then local CanDamagePlayers = self:GetCanDamagePlayer() if CanDamagePlayers and table.hasValue(CanDamagePlayers, DamageCauser) then self:MonsterApplyDamage(DamageCauser, DamageAmount * 0.3) end end return DamageAmount end ) self.ThornSkillHandle = EventSystem.SetTimerLoop(self, function () self.EnableThornSkill = true UnrealNetwork.CallUnrealRPC_Multicast(self, "MulticastRPC_SpawnParticleSystemAttach") EventSystem.SetTimer(self, function () self.EnableThornSkill = false end, 3.0) end, 10) end function BP_MonsterGoldEfficiencyMonster:MulticastRPC_SpawnParticleSystemAttach() self.ThornParticleInst = GameplayStatics.SpawnEmitterAttached(self.ThornParticle, self.Mesh, "", VectorHelper.VectorZero(), VectorHelper.RotZero(), VectorHelper.ScaleOne(), EAttachLocation.SnapToTarget, true) end function BP_MonsterGoldEfficiencyMonster:ReceiveOnMonsterDeath() MonsterChallenge.ReceiveOnMonsterDeath(self) if self:HasAuthority() then if self.ThornSkillHandle then EventSystem.StopTimer(self.ThornSkillHandle) self.ThornSkillHandle = nil return end else if UE.IsValid(self.ThornParticleInst) then self.ThornParticleInst:K2_DestroyComponent(self) end end end return BP_MonsterGoldEfficiencyMonster;