Module:Heist
Jump to navigation
Jump to search
The above documentation is transcluded from Module:Heist/doc.
Editors can experiment in this module's sandbox and testcases pages.
Subpages of this module.
Editors can experiment in this module's sandbox and testcases pages.
Subpages of this module.
--
-- 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.heist_areas = {
table = 'heist_areas',
fields = {
id = {
field = 'id',
type = 'String',
},
area_ids = {
field = 'area_ids',
type = 'List (,) of String',
},
job_ids = {
field = 'job_ids',
type = 'List (,) of String',
},
contract_id = {
field = 'contract_id',
type = 'String',
},
blueprint_id = {
field = 'blueprint_id',
type = 'String',
},
reward_text = {
field = 'reward_text',
type = 'Text',
},
},
}
tables.heist_jobs = {
table = 'heist_jobs',
fields = {
id = {
field = 'id',
type = 'String',
},
name = {
field = 'name',
type = 'String',
},
},
}
tables.heist_npcs = {
table = 'heist_npcs',
fields = {
id = {
field = 'id',
type = 'String',
},
name = {
field = 'name',
type = 'String',
},
job_id = {
field = 'job_id',
type = 'String',
},
stat_text = {
field = 'stat_text',
type = 'String',
},
},
}
tables.heist_npc_skills = {
table = 'heist_npc_skills',
fields = {
npc_id = {
field = 'npc_id',
type = 'String',
},
job_id = {
field = 'job_id',
type = 'String',
},
level = {
field = 'level',
type = 'String',
},
},
}
tables.heist_npc_stats = {
table = 'heist_npc_stats',
fields = {
npc_id = {
field = 'npc_id',
type = 'String',
},
stat_id = {
field = 'stat_id',
type = 'String',
},
-- For some reasons, the stat values here are float. Probably scale with level?
value = {
field = 'value',
type = 'Float',
},
},
}
-- ----------------------------------------------------------------------------
-- Page functions
-- ----------------------------------------------------------------------------
local p = {}
p.table_heist_areas = m_cargo.declare_factory{data=tables.heist_areas}
p.table_heist_jobs = m_cargo.declare_factory{data=tables.heist_jobs}
p.table_heist_npcs = m_cargo.declare_factory{data=tables.heist_npcs}
p.table_heist_npc_skills = m_cargo.declare_factory{data=tables.heist_npc_skills}
p.table_heist_npc_stats = m_cargo.declare_factory{data=tables.heist_npc_stats}
p.store_data = m_cargo.store_from_lua{tables=tables, module='Heist'}
-- ----------------------------------------------------------------------------
-- End
-- ----------------------------------------------------------------------------
return p