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 = "一把电钻", info = function() return ({ { "(一把电钻,满电。)" }, { "(一把电钻,还剩一半电量。)" }, { "(一把电钻,没电了。)" } }) [math.max((accessor.item_crowbar and 1 or 0) + (accessor.state_redleaf_gate == 1 and 1 or 0), 0) + 1] end }, item_goatplush = { name = "一个毛绒玩偶", info1a = { "(带上一个作伴也没什么害处。)" }, info1b = { "戴上它", "什么都不做" }, info1c = { "(走你。)" }, info2a = { "(A worn plushie.)" }, info2b = { "拿下来", "算了" }, info2c = { "(我先把它拿下来好了。)" } }, item_rope = { name = "一段绳子", info = function() return accessor.plot < 2 and ({ "(一截老麻绳,快用完了。)" }) or (accessor.plot < 3 and ({ "(再长点就好了...)", accessor.item_cover and "(...那样我就不用\n把床单剪了编绳子了。)" or "(...看看有没有什么\n能拿来编绳子的吧。)" }) or ({ "(一截老麻绳,快用完了。)", "(肯定比不上我编的那根啦。)" })) end }, item_scissors = { name = "一把剪刀", info = { "一把普通的料理剪。" } } } 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