35 lines
1.5 KiB
Lua
35 lines
1.5 KiB
Lua
local SimpleSkillTask = require("Script.SimpleSkill.Task.SimpleSkillTask")
|
|
local SimpleSkillTask_AbsorbSoul = LuaClass("SimpleSkillTask_AbsorbSoul", SimpleSkillTask)
|
|
|
|
SimpleSkillTask_AbsorbSoul.AdditionDamageRateTable = {1.5, 2.5, 3.5, 4.5} --伤害加成百分比
|
|
SimpleSkillTask_AbsorbSoul.CurDamageRate = 0.0
|
|
|
|
function SimpleSkillTask_AbsorbSoul:ctor(OwnerSkill)
|
|
SimpleSkillTask_AbsorbSoul.super.ctor(self, OwnerSkill)
|
|
end
|
|
|
|
function SimpleSkillTask_AbsorbSoul:InitTaskFromData(TaskData, CasterPawn)
|
|
SimpleSkillTask.InitTaskFromData(self, TaskData, CasterPawn)
|
|
end
|
|
|
|
function SimpleSkillTask_AbsorbSoul:UpdateSkillLevel(NewSkillLevel)
|
|
SimpleSkillTask.UpdateSkillLevel(self, NewSkillLevel)
|
|
|
|
self.CurDamageRate = self.AdditionDamageRateTable[self.SkillLevel]
|
|
end
|
|
|
|
function SimpleSkillTask_AbsorbSoul:ActivateTask()
|
|
SimpleSkillTask.ActivateTask(self)
|
|
|
|
local Base_Attack = UGCGameSystem.GetPlayerStateByPlayerKey(self.CasterPawn.PlayerKey).Attributes[AttributeType.Base].Base_Attack
|
|
local DamageAmount = 180 + Base_Attack * self.CurDamageRate
|
|
local EventInstigator = UGCGameSystem.GetPlayerControllerByPlayerKey(self.CasterPawn.PlayerKey)
|
|
|
|
local TargetPawns = self:GetTargetPawns()
|
|
for _, TargetPawn in pairs(TargetPawns) do
|
|
UGCGameSystem.ApplyDamage(TargetPawn, DamageAmount, EventInstigator, self.CasterPawn, EDamageType.ShootDamage)
|
|
self:EnableEffectWithId(24, TargetPawn, nil, 0, EEffectSpawnLocationType.Attach, "spine_01")
|
|
end
|
|
end
|
|
|
|
return SimpleSkillTask_AbsorbSoul; |