Module:Pantheon

From Path of Exile Wiki
Revision as of 23:44, 22 November 2019 by >OmegaK2
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
-- ----------------------------------------------------------------------------

-- references are PantheonPanelLayout and PantheonSouls
local tables = {}

tables.pantheon = {
    table = 'pantheon',
    order = {'id', 'is_major_god'},
    fields = {
        id = {
            field = 'id',
            type = 'String',
        },
        is_major_god = {
            field = 'is_major_god',
            type = 'Boolean',
        },
    },
}

tables.pantheon_souls = {
    table = 'pantheon_souls',
    order = {'id', 'order', 'name', 'stat_text', 'target_area_id', 'target_monster_id', 'item_id'},
    fields = {
        id = {
            field = 'id',
            type = 'String',
        },
        order = {
            field = 'order',
            type = 'Integer',
        },
        name = {
            field = 'name',
            type = 'String',
        },
        stat_text = {
            field = 'stat_text',
            type = 'String',
        },
        target_area_id = {
            field = 'target_area_id',
            type = 'String',
        },
        target_monster_id = {
            field = 'target_monster_id',
            type = 'String',
        },
        item_id = {
            field = 'item_id',
            type = 'String',
        },
    },
}

tables.pantheon_stats = {
    table = 'pantheon_stats',
    order = {'pantheon_id', 'pantheon_order', 'ordinal', 'id', 'value'},
    fields = {
        pantheon_id = {
            field = 'pantheon_id',
            type = 'String',
        },
        pantheon_order = {
            field = 'pantheon_order',
            type = 'Integer',
        },
        ordinal = {
            field = 'ordinal',
            type = 'Integer',
        },
        id = {
            field = 'id',
            type = 'String',
        },
        value = {
            field = 'value',
            type = 'Integer',
        },
    }
}

-- ----------------------------------------------------------------------------
-- Page functions
-- ----------------------------------------------------------------------------

local p = {}

p.table_pantheon = m_cargo.declare_factory{data=tables.pantheon}
p.table_pantheon_souls = m_cargo.declare_factory{data=tables.pantheon_souls}
p.table_pantheon_stats = m_cargo.declare_factory{data=tables.pantheon_stats}

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

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

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

return p