Skip to content

Commit

Permalink
remove a lot from items stored on unit
Browse files Browse the repository at this point in the history
  • Loading branch information
white-haired-uncle committed May 25, 2024
1 parent fa66f10 commit 47e7c11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
17 changes: 7 additions & 10 deletions lua/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -926,16 +926,13 @@ loti.item.describe_item = function(number, sort, set_items)
elseif effect.set == "lawful" then line = "<span color='yellow'>" .. _"Sets alignment to lawful" .. "</span>"
elseif effect.set == "neutral" then line = "<span color='yellow'>" .. _"Sets alignment to neutral" .. "</span>" end
elseif effect.apply_to == "status" then
for part in string.gmatch(effect.add, '([^,]+)') do
if line then table.insert(desc, line) end
if part == "unpoisonable" then line = "<span color='yellow'>" .. _"Immune to Poison" .. "</span>"
elseif part == "unslowable" then line = "<span color='yellow'>" .. _"Immune to Slow" .. "</span>"
elseif part == "undrainable" then line = "<span color='yellow'>" .. _"Immune to Drain" .. "</span>"
elseif part == "unplaguable" then line = "<span color='yellow'>" .. _"Immune to Plague" .. "</span>"
elseif part == "unpretrifiable" then line = "<span color='yellow'>" .. _"Immune to Petrify" .. "</span>"
elseif part == "unhealable" then line = "<span color='yellow'>" .. _"Unhealable" .. "</span>"
elseif part == "invulnerable" then line = "<span color='yellow'>" .. _"Invulnerable" .. "</span>" end
end
if effect.add == "unpoisonable" then line = "<span color='yellow'>" .. _"Immune to Poison" .. "</span>"
elseif effect.add == "unslowable" then line = "<span color='yellow'>" .. _"Immune to Slow" .. "</span>"
elseif effect.add == "undrainable" then line = "<span color='yellow'>" .. _"Immune to Drain" .. "</span>"
elseif effect.add == "unplaguable" then line = "<span color='yellow'>" .. _"Immune to Plague" .. "</span>"
elseif effect.add == "unpretrifiable" then line = "<span color='yellow'>" .. _"Immune to Petrify" .. "</span>"
elseif effect.add == "unhealable" then line = "<span color='yellow'>" .. _"Unhealable" .. "</span>"
elseif effect.add == "invulnerable" then line = "<span color='yellow'>" .. _"Invulnerable" .. "</span>" end
elseif effect.apply_to == "bonus_attack" then
line = "<span color='green'>" .. _"Bonus attack: " .. effect.description .. "</span>"
elseif effect.apply_to == "status" and effect.add == "not_living" then
Expand Down
4 changes: 3 additions & 1 deletion lua/unitdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ local wml_based_implementation = {
add_item = function(unit, item_number, item_sort)
unit = normalize_unit_param(unit)

local item = wesnoth.deepcopy(loti.item.type[item_number])
local item = {}
item.number = item_number
item.name = loti.item.type[item_number].name
if item_sort then
item.sort = item_sort
end
Expand Down

0 comments on commit 47e7c11

Please sign in to comment.