local ____lualib = require("lualib_bundle") local __TS__AsyncAwaiter = ____lualib.__TS__AsyncAwaiter local __TS__Await = ____lualib.__TS__Await local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes local __TS__ArrayIndexOf = ____lualib.__TS__ArrayIndexOf local __TS__ArraySplice = ____lualib.__TS__ArraySplice local ____exports = {} local ____global = require("code.global") local accessor = ____global.accessor local function textGen() return { item_bucket = { name = "Pail", info = function() return { "(A pail. Good for collecting things.)", unpack(accessor.event_home_bucket and ({ "(Apart from rainwater, apparently.)" }) or ({})) } end }, item_card = { name = "Library Card", info = { "(A library card with a blued, jeweled strip.)" } }, item_drill = { name = "Drill", info = function() return ({ { "(An electric drill, fully charged.)" }, { "(An electric drill, half-charged.)" }, { "(An electric drill. The batteries are dead.)" } }) [math.max((accessor.item_crowbar and 1 or 0) + (accessor.state_redleaf_gate == 1 and 1 or 0), 0) + 1] end }, item_goatplush = { name = "Plushie", info1a = { "(Never hurts to have one of these around.)" }, info1b = { "Wear it", "Do nothing" }, info1c = { "(Up you go.)" }, info2a = { "(A worn plushie.)" }, info2b = { "Take it off", "Do nothing" }, info2c = { "(I'll take it off for now.)" } }, item_rope = { name = "Rope", info = function() return accessor.plot < 2 and ({ "(A worn rope, nearly at its end.)" }) or (accessor.plot < 3 and ({ "(If only this were longer...)", accessor.item_cover and "(... then I wouldn't have to make ropes out of blankets.)" or "(... maybe there's something else I could make a rope out of.)" }) or ({ "(A worn rope, nearly at its end.)", "(Nothing like the one I made myself.)" })) end }, item_scissors = { name = "Scissors", info = { "An average pair of kitchen scissors." } } } end local function inventory(game, ____bindingPattern0) local player player = ____bindingPattern0.player local text local inventory = {} local items = { { name = function(self) return text.item_goatplush.name end, priority = 0, script = function(self, reader) return __TS__AsyncAwaiter(function(____awaiter_resolve) if accessor.floof then __TS__Await(reader:text(text.item_goatplush.info2a)) __TS__Await(reader:choice(text.item_goatplush.info2b)) if game.r_choice == 0 then __TS__Await(reader:text(text.item_goatplush.info2c)) accessor.floof = false player.metadata.floof = false end else __TS__Await(reader:text(text.item_goatplush.info1a)) __TS__Await(reader:choice(text.item_goatplush.info1b)) if game.r_choice == 0 then __TS__Await(reader:text(text.item_goatplush.info1c)) accessor.floof = true player.metadata.floof = true end end end) end, show = function(self) return accessor.item_goatplush end }, { name = function(self) return text.item_scissors.name end, priority = 1, script = function(self, reader) return __TS__AsyncAwaiter(function(____awaiter_resolve) __TS__Await(reader:text(text.item_scissors.info)) end) end, show = function(self) return accessor.item_scissors end }, { name = function(self) return text.item_drill.name end, priority = 2, script = function(self, reader) return __TS__AsyncAwaiter(function(____awaiter_resolve) local ____opt_0 = game.script if __TS__Await(____opt_0 and ____opt_0("drillie")) == true then return ____awaiter_resolve(nil) end __TS__Await(reader:text(text.item_drill.info())) end) end, show = function(self) return accessor.item_drill end }, { name = function(self) return text.item_rope.name end, priority = 3, script = function(self, reader) return __TS__AsyncAwaiter(function(____awaiter_resolve) local ____opt_2 = game.script if __TS__Await(____opt_2 and ____opt_2("roper")) == true then return ____awaiter_resolve(nil) end reader:text(text.item_rope.info()) end) end, show = function(self) return accessor.item_rope end }, { name = function(self) return text.item_bucket.name end, priority = 4, script = function(self, reader) return __TS__AsyncAwaiter(function(____awaiter_resolve) local ____opt_4 = game.script if __TS__Await(____opt_4 and ____opt_4("buckey")) == true then return ____awaiter_resolve(nil) end reader:text(text.item_bucket.info()) end) end, show = function(self) return accessor.item_bucket end }, { name = function(self) return text.item_card.name end, priority = 1000, script = function(self, reader) return __TS__AsyncAwaiter(function(____awaiter_resolve) __TS__Await(reader:text(text.item_card.info)) end) end, show = function(self) return accessor.event_home_bookshelf == 2 end } } text = textGen() local function update() local id = 0 while id ~= #items do if items[id + 1]:show() then if #inventory == 0 or not __TS__ArrayIncludes(inventory, id) then inventory[#inventory + 1] = id end else local index = __TS__ArrayIndexOf(inventory, id) if #inventory ~= 0 and index ~= -1 then __TS__ArraySplice(inventory, index, 1) end end id = id + 1 end table.sort( inventory, function(a, b) return items[a + 1].priority < items[b + 1].priority end ) end return { inventory = inventory, items = items, text = text, update = update } end ____exports.default = inventory return ____exports