Module:Monsters: Difference between revisions

Added separate p.getMonsterBarrier function
(Added p._getMonsterBarrier)
(Added separate p.getMonsterBarrier function)
Line 138: Line 138:
if monster ~= nil then
if monster ~= nil then
return math.floor((p._getMonsterHP(monster)/(1 - p._getMonsterStat(monster, 'damageReduction')/100)) + 0.5)
return math.floor((p._getMonsterHP(monster)/(1 - p._getMonsterStat(monster, 'damageReduction')/100)) + 0.5)
else
return Shared.printError('No monster with that name found')
end
end
function p.getMonsterBarrier(frame)
local MonsterName = frame.args ~= nil and frame.args[1] or frame
local monster = p.getMonster(MonsterName)
if monster ~= nil then
return p._getMonsterBarrier(monster)
else
else
return Shared.printError('No monster with that name found')
return Shared.printError('No monster with that name found')