Skip to content

Commit

Permalink
Refactoring: lottarmor: mini restruct function. Relates to lord-ser…
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Jul 28, 2024
1 parent 5cc6586 commit 2839feb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mods/lord/lottarmor/armor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,19 @@ local function collect_armor_data(player)
end

local function rebuild_armor_groups(player, armor_level)
local armor_groups = {fleshy=100}
local immortal = player:get_armor_groups().immortal
if player:get_meta():get("lott:immunity") ~= nil and (not immortal or immortal == 0) then
return {fleshy = 1}
end

local armor_groups = {fleshy=100}
if immortal and immortal ~= 0 then
armor_groups.immortal = 1
end
if armor_level > 0 then
armor_groups.level = math_floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
end
if player:get_meta():get("lott:immunity") ~= nil and (not immortal or immortal == 0) then
return {fleshy = 1}
end

return armor_groups
end
Expand Down

0 comments on commit 2839feb

Please sign in to comment.