37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
![]() |
--> Services
|
||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||
|
local ServerStorage = game:GetService("ServerStorage")
|
||
|
|
||
|
--> Dependencies
|
||
|
local Utils = require(ReplicatedStorage.Tools.Utils)
|
||
|
local TypeList = require(ServerStorage.Base.TypeList)
|
||
|
local Rune = require(ServerStorage.Base.Rune)
|
||
|
|
||
|
--> Json
|
||
|
local JsonLevel = require(ReplicatedStorage.Json.Level)
|
||
|
|
||
|
local RuneHpToAtk = {}
|
||
|
RuneHpToAtk.__index = RuneHpToAtk
|
||
|
setmetatable(RuneHpToAtk, {__index = Rune})
|
||
|
|
||
|
|
||
|
function RuneHpToAtk:Init(PlayerAI, Character: TypeList.Character)
|
||
|
local self = Rune:Init(PlayerAI, Character, script.Name)
|
||
|
setmetatable(self, RuneHpToAtk)
|
||
|
|
||
|
return self
|
||
|
end
|
||
|
|
||
|
function RuneHpToAtk:Check(index: number, AttributesData: table, BehaviorNameList: table)
|
||
|
return true
|
||
|
end
|
||
|
|
||
|
function RuneHpToAtk:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||
|
local baseAttribute = AttributesData.atkRate or 100
|
||
|
local addAttribute = math.floor(baseAttribute * AttributesData.hp * 0.035)
|
||
|
Utils:TableSafeAddValue(AttributesData, "atkRate", addAttribute)
|
||
|
return nil
|
||
|
end
|
||
|
|
||
|
|
||
|
return RuneHpToAtk
|