Differences From
Artifact [7112e6c94b]:
61 61 return w
62 62 end;
63 63 onReconfigure = function(self, inv)
64 64 -- apply any changes to item metadata and export any subinventories
65 65 -- to the provided invref, as they may have changed
66 66 local sc = starlit.item.container(self.item, inv, {pfx = 'starlit_suit'})
67 67 sc:push()
68 - self:pullCanisters(inv)
68 +-- self:pullCanisters(inv)
69 69 end;
70 70 onItemMove = function(self, user, list, act, what)
71 71 -- called when the suit inventory is changed
72 72 if act == 'put' then
73 73 if list == 'starlit_suit_bat' then
74 74 user:suitSound('starlit-suit-battery-in')
75 75 elseif list == 'starlit_suit_chips' then
................................................................................
86 86 user:suitSound('starlit-insert-snap')
87 87 end
88 88 end
89 89 end;
90 90 def = function(self)
91 91 return self.item:get_definition()._starlit.suit
92 92 end;
93 + --[[
93 94 pullCanisters = function(self, inv)
94 95 starlit.item.container.dropPrefix(inv, 'starlit_canister')
95 96 self:forCanisters(inv, function(sc) sc:pull() end)
96 97 end;
97 98 pushCanisters = function(self, inv, st, i)
98 99 self:forCanisters(inv, function(sc)
99 100 sc:push()
................................................................................
108 109 local sc = starlit.item.container(st, inv, {pfx = pfx})
109 110 if fn(sc, st, i, pfx) then
110 111 inv:set_stack('starlit_suit_canisters', i, st)
111 112 end
112 113 end
113 114 end end
114 115 end;
116 + ]]
115 117 establishInventories = function(self, obj)
116 118 local inv = obj:get_inventory()
117 119 local ct = suitContainer(self.item, inv)
118 120 ct:pull()
121 + --[[
119 122 self:pullCanisters(inv)
120 123
121 - --[[
122 124 local def = self:def()
123 125 local sst = suitStore(self.item)
124 126 local function readList(listName, prop)
125 127 inv:set_size(listName, def.slots[prop])
126 128 if def.slots[prop] > 0 then
127 129 local lst = sst.read(prop)
128 130 inv:set_list(listName, lst)
................................................................................
213 215 on_use = function(st, luser, pointed)
214 216 local user = starlit.activeUsers[luser:get_player_name()]
215 217 if not user then return end
216 218 -- have mercy on users who've lost their suits and wound
217 219 -- up naked and dying of exposure
218 220 if user:naked() then
219 221 local ss = st:take_item(1)
220 - user:setSuit(starlit.type.suit(ss))
222 + user:changeSuit(starlit.type.suit(ss))
221 223 user:suitSound('starlit-suit-don')
222 224 return st
223 225 end
224 226 end;
225 227 inventory_image = icon:render();
226 228 _starlit = {
227 229 container = {