UGCProjects/GZJ/Script/Blueprint/Monster/BP_MonsterAccessoryMonster.lua

74 lines
2.1 KiB
Lua
Raw Normal View History

2025-01-08 22:46:12 +08:00
---@class BP_MonsterAccessoryMonster_C:BP_MonsterChallenge_C
---@field SM_UGC_TZG3_WUQI UStaticMeshComponent
---@field ReapParticle UParticleSystemComponent
---@field UAESkillManager UUAESkillManagerComponent
---@field DoomsdayParticle UParticleSystem
--Edit Below--
--local BP_MonsterAccessoryMonster = {};
local MonsterChallenge = require('Script.Blueprint.Monster.BP_MonsterChallenge')
local BP_MonsterAccessoryMonster = setmetatable(
{
LastDoomsdayPositions = {};
BaseAttackValue = 0;
ID = 1005;
WhirlwindSkillHandle = nil
},
{
__index = MonsterChallenge,
__metatable = MonsterChallenge
}
);
function BP_MonsterAccessoryMonster:ReceiveBeginPlayEx()
MonsterChallenge.ReceiveBeginPlayEx(self)
if self:HasAuthority() then
self:AddWhirlwindSkill()
end
end
function BP_MonsterAccessoryMonster:AddWhirlwindSkill()
self.WhirlwindSkillHandle = EventSystem.SetTimerLoop(
self,
function()
if self:GetController() and self:GetController():GetBlackboardComponent() then
self:GetController():GetBlackboardComponent():SetValueAsBool("CanPlayWhirlwind", true)
end
end,
10.0
)
end
function BP_MonsterAccessoryMonster:AddAttack()
if self:HasAuthority() then
self:AddAdditionalAttack(self.BaseAttackValue)
UnrealNetwork.CallUnrealRPC_Multicast(self, "MulticastRPC_SetParticleVisibility", true)
end
end
function BP_MonsterAccessoryMonster:MulticastRPC_SetParticleVisibility(NewVisibility)
if self:HasAuthority() then return end
self.ReapParticle:SetVisibility(NewVisibility)
EventSystem.SetTimer(
self,
function()
self.ReapParticle:SetVisibility(false)
end,
1.5
)
end
function BP_MonsterAccessoryMonster:ReceiveOnMonsterDeath()
MonsterChallenge.ReceiveOnMonsterDeath(self)
if self:HasAuthority() then
if self.WhirlwindSkillHandle then
EventSystem.StopTimer(self.WhirlwindSkillHandle)
self.WhirlwindSkillHandle = nil
return
end
end
end
return BP_MonsterAccessoryMonster;