8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
47
48
49
50
51
52
53
|
local T,G = lib.marshal.t, lib.marshal.g
starlit.store = {} -- the serialization equivalent of .type
-------------
-- persona --
------------- -----------------------------------------------
-- a Persona is a structure that defines the nature of --
-- an (N)PC and how it interacts with the Starsoul-managed --
-- portion of the game world -- things like name, species, --
-- stat values, physical characteristics, and so forth --
local statStructFields = {}
for k,v in pairs(starlit.world.stats) do
statStructFields[k] = v.srzType or (
(v.base == true or v.base > 0) and T.s16 or T.u16
................................................................................
starlit.store.suitMeta = lib.marshal.metaStore {
batteries = {key = 'starlit:suit_slots_bat', type = T.inventoryList};
chips = {key = 'starlit:suit_slots_chips', type = T.inventoryList};
elements = {key = 'starlit:suit_slots_elem', type = T.inventoryList};
guns = {key = 'starlit:suit_slots_gun', type = T.inventoryList};
ammo = {key = 'starlit:suit_slots_ammo', type = T.inventoryList};
}
|
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
47
48
49
50
51
52
53
54
55
56
57
58
59
|
local T,G = lib.marshal.t, lib.marshal.g
starlit.store = {} -- the serialization equivalent of .type
-------------
-- persona --
------------- -----------------------------------------------
-- a Persona is a structure that defines the nature of --
-- an (N)PC and how it interacts with the Starlit-managed --
-- portion of the game world -- things like name, species, --
-- stat values, physical characteristics, and so forth --
local statStructFields = {}
for k,v in pairs(starlit.world.stats) do
statStructFields[k] = v.srzType or (
(v.base == true or v.base > 0) and T.s16 or T.u16
................................................................................
starlit.store.suitMeta = lib.marshal.metaStore {
batteries = {key = 'starlit:suit_slots_bat', type = T.inventoryList};
chips = {key = 'starlit:suit_slots_chips', type = T.inventoryList};
elements = {key = 'starlit:suit_slots_elem', type = T.inventoryList};
guns = {key = 'starlit:suit_slots_gun', type = T.inventoryList};
ammo = {key = 'starlit:suit_slots_ammo', type = T.inventoryList};
}
starlit.store.volume = G.struct {
kind = T.str;
id = T.str;
mass = T.decimal;
}
|