Module:CalculatedStats: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 69: Line 69:
local agility = args[6] --Agility
local agility = args[6] --Agility
local luck = args[7] --Luck
local luck = args[7] --Luck
local levelMinus19 = math.max(level - 19,0)
local levelMinus20 = math.max(level - 20,0)
local levelMinus20 = math.max(level - 20,0)
local isBoss = false
local isBoss = false
Line 79: Line 78:
acc = math.floor(vitality / 4) + agility,
acc = math.floor(vitality / 4) + agility,
def = math.floor(levelMinus20 / 2) + math.floor(strength / 4) + (vitality * 3),
def = math.floor(levelMinus20 / 2) + math.floor(strength / 4) + (vitality * 3),
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 isBoss then
if isBoss then
statTable["atk"] = levelMinus19 + (strength * 3) + math.floor(vitality / 4) --Incorrect
statTable["atk"] = levelMinus20 + 1 + (strength * 3) + round(vitality / 4)
statTable["acc"] = math.floor(strength / 4) + agility
statTable["acc"] = round(strength / 4) + agility
statTable["def"] = math.floor(levelMinus20 / 2) + math.floor(strength / 4) + (vitality * 2)
statTable["def"] = math.floor(levelMinus19 / 2) + math.floor(strength / 4) + (vitality * 2)
statTable["eva"] = math.floor(intelligence / 8) + agility
statTable["matk"] = math.floor(intelligence / 8) + magic
statTable["mefc"] = intelligence + math.floor(magic / 8)
end
end
local stats = { "atk", "acc", "def", "eva", "matk", "mefc" }
local stats = { "atk", "acc", "def", "eva", "matk", "mefc" }
Line 92: Line 94:
for i, stat in ipairs(stats) do --Manual override
for i, stat in ipairs(stats) do --Manual override
if args[stat] then
if args[stat] then
statTable[stat] = args[stat]
additionalOutput = "[[Category:Pages with manually inputted calcuated stats]]"
additionalOutput = "[[Category:Pages with manually inputted calcuated stats]]"
end
end

Navigation menu