Module:CalculatedStats: Difference between revisions

Jump to navigation Jump to search
m
Fix
No edit summary
m (Fix)
Line 6: Line 6:
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local p = {}
local p = {}
local function round(number)
return math.floor(number + 0.5)
end


function p.smt1(frame)
function p.smt1(frame)
Line 22: Line 26:
end
end
local statTable = {
local statTable = {
atk = levelMinus19 + (strength * 3) + math.floor(vitality/4),
atk = levelMinus19 + (strength * 3) + round(vitality/4),
acc = math.floor(strength/4) + agility,
acc = round(strength/4) + agility,
def = math.floor(levelMinus19/2) + math.floor(strength/4) + (vitality * 2),
def = round(levelMinus19/2) + round(strength/4) + (vitality * 2),
eva = math.floor(intelligence/8) + agility,
eva = round(intelligence/8) + agility,
matk = math.floor(intelligence/8) + magic,
matk = round(intelligence/8) + magic,
mefc = intelligence + math.floor(magic/8)
mefc = intelligence + round(magic/8)
}
}
if statTable[stat] then
if statTable[stat] then

Navigation menu