UGCProjects/GZJ/Script/Blueprint/Monster/BP_MonsterChallenge.lua
2025-01-08 22:46:12 +08:00

48 lines
1.7 KiB
Lua

---@class BP_MonsterChallenge_C:BP_ActiveMonsterBase_C
--Edit Below--
--local BP_MonsterChallenge = {};
local MonsterBase = require('Script.Blueprint.Monster.BP_ActiveMonsterBase')
local BP_MonsterChallenge = setmetatable(
{
},
{
__index = MonsterBase,
__metatable = MonsterBase
}
);
function BP_MonsterChallenge:GetCanDamagePlayer()
local TargetActor = self:GetController():GetBlackboardComponent():GetValueAsObject("TargetActor")
if self.TargetPlayerKey > 0 and UE.IsValid(TargetActor) then
local PlayerPawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.TargetPlayerKey)
if PlayerPawn and PlayerPawn.bIsAlive and PlayerPawn.IsInArena == false then
return {PlayerPawn}
end
end
return {}
end
function BP_MonsterChallenge:ServerOnDeathEx(DeadMonster, KillerController, DamageCauser, KillingHitInfo, KillingHitImpulseDir, KillingHitDamageTypeID, DamageTypeClass, IsHeadShotDamage)
if DeadMonster == self then
if KillerController == nil or UE.IsValid(KillerController) == false then
return
end
local PS = KillerController.PlayerState
if UE.IsValid(PS) then
if PS.EasterEggsData[4] == nil then
PS.EasterEggsData[4] = {}
end
if PS.EasterEggsData[4][DeadMonster.ID] == nil then
PS.EasterEggsData[4][DeadMonster.ID] = 1
else
PS.EasterEggsData[4][DeadMonster.ID] = PS.EasterEggsData[4][DeadMonster.ID] + 1
end
end
-- 进行判断一下
ArchiveTable.Funcs[ArchiveTable.ArchiveType.EasterEggs](PS, 4)
end
end
return BP_MonsterChallenge;