Module:Blight

From Path of Exile Wiki
Revision as of 15:32, 7 September 2019 by >OmegaK2 (Created page with "-- -- Module for bestiary templates -- local m_cargo = require('Module:Cargo') local m_util = require('Module:Util') local getArgs = require('Module:Arguments').getArgs loca...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
--
-- Module for bestiary templates
--

local m_cargo = require('Module:Cargo')
local m_util = require('Module:Util')
local getArgs = require('Module:Arguments').getArgs

local p = {}

-- ----------------------------------------------------------------------------
-- Strings
-- ----------------------------------------------------------------------------

local i18n = {
}

-- ----------------------------------------------------------------------------
-- Helper functions and globals
-- ----------------------------------------------------------------------------

-- ----------------------------------------------------------------------------
-- Cargo tables
-- ----------------------------------------------------------------------------
local tables = {}

tables.blight_towers = {
    table = 'blight_towers',
    order = {'id'},
    fields = {
        id = {
            field = 'id',
            type = 'String',
        },
        name = {
            field = 'name',
            type = 'String',
        },
        description = {
            field = 'description',
            type = 'String',
        },
        tier = {
            field = 'tier',
            type = 'String',
        },
        icon = {
            field = 'icon',
            type = 'File',
        },
        cost = {
            field = 'cost',
            type = 'Integer'
        },
    },
}

-- next two tables are a composite of the following files
--  BlightCraftingItems.dat
--  BlightCraftingRecipes.dat
--  BlightCraftingResults.dat
--  BlightCraftingTypes.dat
tables.blight_crafting_recipes = {
    table = 'blight_crafting_recipes',
    order = {'id', 'modifier_id', 'passive_id', 'type'},
    fields = {
        id = {
            field = 'id',
            type = 'String',
        },
        modifier_id = {
            field = 'modifier_id',
            type = 'String',
        },
        passive_id = {
            field = 'passive_id',
            type = 'String',
        },
        type = {
            field = 'type',
            type = 'String',
        },
    },
}

tables.blight_crafting_recipes_items = {
    table = 'blight_crafting_recipes_items',
    order = {'recipe_id', 'item_id'},
    fields = {
        recipe_id = {
            field = 'recipe_id',
            type = 'String',
        },
        item_id = {
            field = 'item_id',
            type = 'String',
        },
    },
}
-- ----------------------------------------------------------------------------
-- Page functions
-- ----------------------------------------------------------------------------

local p = {}

p.table_blight_towers = m_cargo.declare_factory{data=tables.blight_towers}
p.table_blight_crafting_recipes = m_cargo.declare_factory{data=tables.blight_crafting_recipes}
p.table_blight_crafting_recipes_items = m_cargo.declare_factory{data=tables.blight_crafting_recipes_items}

p.store_data = m_cargo.store_from_lua{tables=tables, module='Blight'}

function p.crafting_table(frame)
    -- Get args
    tpl_args = getArgs(frame, {
        parentFirst = true
    })
    frame = m_util.misc.get_frame(frame)
    return
end

-- ----------------------------------------------------------------------------
-- End
-- ----------------------------------------------------------------------------

return p