46 lines
1.8 KiB
Lua
46 lines
1.8 KiB
Lua
local SimpleSkillTask = require("Script.SimpleSkill.Task.SimpleSkillTask")
|
|
local SimpleSkillTask_Tread = LuaClass("SimpleSkillTask_Tread", SimpleSkillTask)
|
|
|
|
SimpleSkillTask_Tread.AdditionDamageRateTable = {1.5, 2.0, 2.5, 3.0}
|
|
SimpleSkillTask_Tread.StunDurationTable = {1, 1.2, 1.4, 2}
|
|
SimpleSkillTask_Tread.CurDamageRate = 0.0
|
|
SimpleSkillTask_Tread.CurStunDuration = 0.0
|
|
|
|
SimpleSkillTask_Tread.AffectedMonsters = {}
|
|
|
|
function SimpleSkillTask_Tread:ctor(OwnerSkill)
|
|
SimpleSkillTask_Tread.super.ctor(self, OwnerSkill)
|
|
end
|
|
|
|
function SimpleSkillTask_Tread:InitTaskFromData(TaskData, CasterPawn)
|
|
SimpleSkillTask.InitTaskFromData(self, TaskData, CasterPawn)
|
|
|
|
self.TaskName = "Tread"
|
|
end
|
|
|
|
function SimpleSkillTask_Tread:UpdateSkillLevel(NewSkillLevel)
|
|
SimpleSkillTask.UpdateSkillLevel(self, NewSkillLevel)
|
|
|
|
self.CurDamageRate = self.AdditionDamageRateTable[self.SkillLevel]
|
|
self.CurStunDuration = self.StunDurationTable[self.SkillLevel]
|
|
end
|
|
|
|
function SimpleSkillTask_Tread:ActivateTask()
|
|
SimpleSkillTask.ActivateTask(self)
|
|
|
|
self.AffectedMonsters = {}
|
|
|
|
self:EnableEffectWithId(self.EffectId, self.CasterPawn, nil, 0, EEffectSpawnLocationType.Bottom)
|
|
|
|
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
|
|
TargetPawn:SetIsStun(true, self.CurStunDuration)
|
|
UGCGameSystem.ApplyDamage(TargetPawn, DamageAmount, EventInstigator, self.CasterPawn, EDamageType.ShootDamage)
|
|
end
|
|
end
|
|
|
|
return SimpleSkillTask_Tread; |