Editing Module:ItemListDebug

From Fallen London Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 455: Line 455:
 
The returned list contains item detail tables as described in the top-level documentation for this module.
 
The returned list contains item detail tables as described in the top-level documentation for this module.
 
]]
 
]]
local function smw_fetch_items(header)
+
local function smw_fetch_items(header, effectproperty)
 
     local extendedResult = mw.smw.getQueryResult(header .. [===[  
 
     local extendedResult = mw.smw.getQueryResult(header .. [===[  
 
         [[!The Imperturbable Patroness]]
 
         [[!The Imperturbable Patroness]]
Line 461: Line 461:
 
         |?=Item
 
         |?=Item
 
         |?Has icon=Icon
 
         |?Has icon=Icon
         |?Has effect#-=Effects
+
         |?]===] .. effectproperty .. [===[#-=Effects
        |?Has gain effect#-=GainEffects
 
 
         |?Category:Fate Items=Fate
 
         |?Category:Fate Items=Fate
 
         |?-Has renown item=Faction
 
         |?-Has renown item=Faction
Line 508: Line 507:
 
         local effs = {};
 
         local effs = {};
 
         for j, e in ipairs(item.printouts.Effects) do
 
         for j, e in ipairs(item.printouts.Effects) do
            effs[e["Modifies quality"].item[1].fulltext] = e["Modifies by"].item[1];
+
        local qual = e["Modifies quality"].item[1].fulltext
        end
+
        local modprop = "Modifies by"
        for j, e in ipairs(item.printouts.GainEffects) do
+
        if menace[qual] then
             effs[e["Modifies quality"].item[1].fulltext] = e["Modifies gain by"].item[1];
+
        modprop = "Modifies gain by"
 +
        end
 +
             effs[qual] = e[modprop].item[1];
 
         end
 
         end
 
         local icon
 
         local icon
Line 545: Line 546:
 
     end
 
     end
 
     if other then header = header .. other end
 
     if other then header = header .. other end
     return smw_fetch_items(header);
+
     return smw_fetch_items(header, effectproperty);
 
end
 
end
  

Please note that all contributions to Fallen London Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see Fallen London Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)
Preview page with this template

Template used on this page: