Module:Shop: Difference between revisions

168 bytes removed ,  1 November 2022
Undo revision 56589 by Gau Cho (talk)
(Pet description support)
(Undo revision 56589 by Gau Cho (talk))
Tag: Undo
Line 6: Line 6:
local Items = require('Module:Items')
local Items = require('Module:Items')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local Pets = require('Module:Pets')


-- Overrides for various items, mostly relating to icon overrides
-- Overrides for various items, mostly relating to icon overrides
Line 97: Line 96:
         end
         end
         if purch.contains.petID ~= nil then
         if purch.contains.petID ~= nil then
             local pet = Pets.getPetByID(purch.contains.petID)
             local pet = GameData.getEntityByID('pets', purch.contains.petID)
             if pet ~= nil then
             if pet ~= nil then
                 return pet.name
                 return pet.name
Line 114: Line 113:
if purch.contains.modifiers ~= nil then
if purch.contains.modifiers ~= nil then
return Constants.getModifiersText(purch.contains.modifiers, false)
return Constants.getModifiersText(purch.contains.modifiers, false)
elseif purch.contains.petID ~= nil then
            local pet = Pets.getPetByID(purch.contains.petID)
            return Pets._getPetEffect(pet)
elseif purch.contains.items ~= nil and Shared.tableCount(purch.contains.items) == 1 then
elseif purch.contains.items ~= nil and Shared.tableCount(purch.contains.items) == 1 then
item = Items.getItemByID(purch.contains.items[1].id)
item = Items.getItemByID(purch.contains.items[1].id)
572

edits