[分享]饥荒联机版,支持局域网联机。

YN282-肉食店(在猪房买卖肉类)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八二.肉食店(在猪房买卖肉类) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pighouse.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function ShouldAcceptItem(inst, item) 7 if item.prefab == "meat" or item.prefab == "smallmeat" or item.prefab == "fish" or item.prefab == "eel" or item.prefab == "drumstick" or item.prefab == "bird_egg" or item.prefab == "froglegs" or item.prefab == "monstermeat" or item.prefab == "goldnugget" then 8 return true 9 end 10 return false 11end 12local function OnGetItemFromPlayer(inst, giver, item) 13 if item.prefab == "meat" or item.prefab == "smallmeat" or item.prefab == "fish" or item.prefab == "eel" or item.prefab == "drumstick" or item.prefab == "bird_egg" or item.prefab == "froglegs" or item.prefab == "monstermeat" then 14 local goldnugget = SpawnPrefab("goldnugget") 15 giver.components.inventory:GiveItem(goldnugget) 16 end 17 if item.prefab == "goldnugget" then 18 local names = {"meat","smallmeat","fish","eel","drumstick","bird_egg","froglegs","monstermeat"} 19 local name = names[math.random(#names)] 20 local meat = SpawnPrefab(name) 21 giver.components.inventory:GiveItem(meat) 22 end 23end 24 inst:AddComponent("trader") 25 inst.components.trader.onaccept = OnGetItemFromPlayer 26 inst.components.trader:SetAcceptTest(ShouldAcceptItem) 27 28 即可将各种肉类卖给猪房(拿着肉类左键点猪房),获得1个黄金,黄金会自动打入账户(主角物品条)。也可以给猪房黄金,买入随机品种的肉类,可以买卖的肉类包括大肉、小肉、鱼、鳗鱼、鸡腿、鸟蛋、蛙腿、疯肉

2025/04/23 · Bny

YN283-流动商贩(在猪村、兔村摆地摊)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八三.流动商贩(在猪村、兔村摆地摊) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pigman.lua文件,在local function OnEat(inst, food)的下一行插入以下内容: 5 6 if food.components.edible and food.components.edible.foodtype == "MEAT" then 7 for k = 1, 2 do 8 local gold = SpawnPrefab("goldnugget") 9 gold.Transform:SetPosition(inst.Transform:GetWorldPosition()) 10 end 11 end 12 13 14 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/bunnyman.lua文件,在inst:AddComponent("eater")的下一行插入以下内容: 15 16local function OnEat(inst, food) 17 if food.components.edible and food.components.edible.foodtype == "VEGGIE" then 18 for k = 1, 2 do 19 local gold = SpawnPrefab("goldnugget") 20 gold.Transform:SetPosition(inst.Transform:GetWorldPosition()) 21 end 22 end 23end 24 inst.components.eater:SetOnEatFn(OnEat) 25 26 即可在猪村将肉类(包括鱼、鸡蛋、蛙腿等)放在地上,在兔村将蔬菜(包括农产品、香蕉、浆果等)放在地上,它们会自动来买,每个肉类或蔬菜付2个黄金(扔在地上)。如果地图上没有猪村(地上)、兔村(地下一层),可以自己建造猪房、兔房形成

2025/04/23 · Bny

YN284-杂货收购行(将料理、帽子、绳子等杂货卖给帐篷换黄金)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八四.杂货收购行(将料理、帽子、绳子等杂货卖给帐篷换黄金) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rope.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable") 5 6 7 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/boards.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable") 8 9 10 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cutstone.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable") 11 12 13 4.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tent.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 14 15local function ShouldAcceptItem(inst, item) 16 if item:HasTag("hat") then 17 return true 18 end 19 if item:HasTag("preparedfood") and item.prefab ~= "wetgoop" then 20 return true 21 end 22 if item.prefab == "rope" or item.prefab == "boards" or item.prefab == "cutstone" or item.prefab == "foliage" or item.prefab == "honey" or item.prefab == "lightbulb" or item.prefab == "manrabbit_tail" or item.prefab == "pigskin" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "slurper_pelt" or item.prefab == "wormlight" then 23 return true 24 end 25 return false 26end 27local function OnGetItemFromPlayer(inst, giver, item) 28 if item:HasTag("hat") then 29 for k = 1, 3 do 30 local goldnugget = SpawnPrefab("goldnugget") 31 giver.components.inventory:GiveItem(goldnugget) 32 end 33 end 34 if item:HasTag("preparedfood") and item.prefab ~= "wetgoop" then 35 for k = 1, 5 do 36 local goldnugget = SpawnPrefab("goldnugget") 37 giver.components.inventory:GiveItem(goldnugget) 38 end 39 end 40 if item.prefab == "rope" or item.prefab == "boards" or item.prefab == "cutstone" or item.prefab == "foliage" or item.prefab == "honey" or item.prefab == "lightbulb" or item.prefab == "manrabbit_tail" or item.prefab == "pigskin" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "slurper_pelt" or item.prefab == "wormlight" then 41 local goldnugget = SpawnPrefab("goldnugget") 42 giver.components.inventory:GiveItem(goldnugget) 43 end 44end 45 inst:AddComponent("trader") 46 inst.components.trader.onaccept = OnGetItemFromPlayer 47 inst.components.trader:SetAcceptTest(ShouldAcceptItem) 48 49 即可将杂货卖给帐篷换黄金(拿着物品对帐篷点鼠标左键),其中料理收购价5个黄金,帽子3个黄金,绳子、木板、石砖、叶子、蜂蜜、荧光果、兔人尾巴、猪皮、花瓣、噩梦花瓣、啜食者皮、虫子果都是1个黄金

2025/04/23 · Bny

YN285-收藏品黑市(在鱼人房买收藏品卖给猪王赚差价)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八五.收藏品黑市(在鱼人房买收藏品卖给猪王赚差价) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/mermhouse.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function ShouldAcceptItem(inst, item) 7 if GetPlayer().components.inventory:Has("goldnugget", 4) then 8 if item.prefab == "goldnugget" then 9 return true 10 end 11 end 12 return false 13end 14local function OnGetItemFromPlayer(inst, giver, item) 15 local names = {"trinket_1","trinket_2","trinket_3","trinket_4","trinket_5","trinket_6","trinket_7","trinket_8","trinket_9","trinket_10","trinket_11","trinket_12"} 16 inst.name = names[math.random(#names)] 17 local trinket = SpawnPrefab(inst.name) 18 if item.prefab == "goldnugget" then 19 giver.components.inventory:ConsumeByName("goldnugget", 3) 20 giver.components.inventory:GiveItem(trinket) 21 end 22end 23 inst:AddComponent("trader") 24 inst.components.trader.onaccept = OnGetItemFromPlayer 25 inst.components.trader:SetAcceptTest(ShouldAcceptItem) 26 27 即可在鱼人房用黄金买入收藏品(拿着黄金对鱼人房点鼠标左键),4个黄金买1个,品种随机,收藏品会直接装进主角物品栏。拿到猪王那里卖出(拿着收藏品对猪王点鼠标左键),卖出价2-8个黄金(扔在地上),晚上猪王睡觉时不会交易。黑市交易有一定风险,会遭到流氓(鱼人)攻击,有些收藏品买卖会亏钱。身上黄金不足4个时无法买入

2025/04/23 · Bny

YN286-收藏品期货市场(制造栏增加期货市场选项,炒作收藏品)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八六.收藏品期货市场(制造栏增加期货市场选项,炒作收藏品) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/constants.lua文件,在DRESS = {str = "DRESS", sort=9, icon = "tab_dress.tex"},的下一行插入MARKET = {str = "MARKET", sort = 12, icon = "tab_book.tex"}, 5 6 7 2.用MT管理器打开游戏目录/assets/scripts/strings.lua文件,在ANCIENT = "Ancient",的下一行插入MARKET = "Market", 8 9 10 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,在require "tuning"的下一行插入以下内容: 11 12----MARKET---- 13Recipe("trinket_1", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 14Recipe("trinket_2", {Ingredient("goldnugget", math.random(6,12))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 15Recipe("trinket_3", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 16Recipe("trinket_4", {Ingredient("goldnugget", math.random(5,10))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 17Recipe("trinket_5", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 18Recipe("trinket_6", {Ingredient("goldnugget", math.random(5,10))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 19Recipe("trinket_7", {Ingredient("goldnugget", math.random(4,8))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 20Recipe("trinket_8", {Ingredient("goldnugget", math.random(8,16))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 21Recipe("trinket_9", {Ingredient("goldnugget", math.random(7,14))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 22Recipe("trinket_10", {Ingredient("goldnugget", math.random(2,4))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 23Recipe("trinket_11", {Ingredient("goldnugget", math.random(5,10))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 24Recipe("trinket_12", {Ingredient("goldnugget", math.random(8,16))}, RECIPETABS.MARKET, TECH.NONE,nil,nil,true) 25 26 27 4.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/trinkets.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddTag("trinket") 28 29 30 5.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/scienceprototyper.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 31 32local function SpawnLootPrefab(inst, lootprefab) 33 local player = GetPlayer() 34 local loot = SpawnPrefab(lootprefab) 35 player.components.inventory:GiveItem(loot) 36 return loot 37end 38local function ShouldAcceptItem(inst, item) 39 if item:HasTag("trinket") then 40 return true 41 end 42 return false 43end 44local function OnGetItemFromPlayer(inst, giver, item) 45 local recipe = GetRecipe(item.prefab) 46 local loot = {} 47 if item:HasTag("trinket") then 48 for k,v in ipairs(recipe.ingredients) do 49 if not string.find(v.type, "gem") then 50 local amt = math.ceil(v.amount * 1) 51 for n = 1, amt do 52 table.insert(loot, v.type) 53 end 54 end 55 end 56 end 57 if #loot <= 0 then 58 return 59 end 60 for k,v in pairs(loot) do 61 SpawnLootPrefab(item, v) 62 end 63end 64 inst:AddComponent("trader") 65 inst.components.trader.onaccept = OnGetItemFromPlayer 66 inst.components.trader:SetAcceptTest(ShouldAcceptItem) 67 68 即可在主角制造栏添加收藏品期货按钮(画着3本书),收藏品价格随每次读档而改变,在低价时买入(直接从造制造栏买入),在高价时卖出(拿着收藏品对科学机器点鼠标左键),获得当时标价的黄金(自动装入主角物品栏),从而赚取差价。如果同时修改了“手动存档”、“快速读档”(见本修改技巧),就可以在不退出游戏情况下,按F5存档,再按F6读档刷新价格。本条可以与“收藏品黑市”同时修改

2025/04/23 · Bny

YN287-巨型超市(在主角制造栏中增加商店选项,用黄金买珍贵物品)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八七.巨型超市(在主角制造栏中增加商店选项,用黄金买珍贵物品) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/constants.lua文件,将ANCIENT = {str = "ANCIENT", sort = 10, icon = "tab_crafting_table.tex"}替换为以下内容: 5 6 ANCIENT = {str = "ANCIENT", sort = 10, icon = "tab_crafting_table.tex"}, 7 SHOP = {str = "SHOP", sort = 11, icon = "tab_gemology.tex"} 8 9 10 2.用MT管理器打开游戏目录/assets/scripts/strings.lua文件,在ANCIENT = "Ancient",的下一行插入SHOP = "Shop", 11 12 13 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,在----GEMS----的下一行插入以下内容: 14 15----SHOP---- 16Recipe("nightmarefuel", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 17Recipe("livinglog", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 18Recipe("gears", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 19Recipe("marble", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 20Recipe("petals_evil", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 21Recipe("boneshard", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 22Recipe("ice", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 23Recipe("slurtle_shellpieces", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 24Recipe("pigskin", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 25Recipe("silk", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 26Recipe("spidergland", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 27Recipe("tentaclespots", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 28Recipe("tentaclespike", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 29Recipe("feather_crow", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 30Recipe("feather_robin", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 31Recipe("feather_robin_winter", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 32Recipe("stinger", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 33Recipe("honeycomb", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 34Recipe("butterflywings", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 35Recipe("houndstooth", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 36Recipe("horn", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 37Recipe("tallbirdegg", {Ingredient("goldnugget", 1+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 38Recipe("manrabbit_tail", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 39Recipe("slurper_pelt", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 40Recipe("lightninggoathorn", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 41Recipe("batwing", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 42Recipe("trunk_summer", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 43Recipe("trunk_winter", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 44Recipe("walrus_tusk", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 45Recipe("deerclops_eyeball", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 46Recipe("minotaurhorn", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 47Recipe("dragon_scales", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 48Recipe("bearger_fur", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 49Recipe("goose_feather", {Ingredient("goldnugget", 1+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 50Recipe("coontail", {Ingredient("goldnugget", 1+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 51Recipe("poop", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 52Recipe("beardhair", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 53Recipe("mandrake", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 54Recipe("lightbulb", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 55Recipe("cactus_meat", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 56Recipe("cactus_flower", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 57Recipe("wormlight", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 58Recipe("lureplantbulb", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 59Recipe("fireflies", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 60Recipe("redgem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 61Recipe("bluegem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 62Recipe("orangegem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 63Recipe("yellowgem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 64Recipe("greengem", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 65Recipe("thulecite_pieces", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 66Recipe("red_cap", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 67Recipe("green_cap", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 68Recipe("blue_cap", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 69Recipe("monstermeat", {Ingredient("goldnugget", math.random(2))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 70Recipe("honey", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 71Recipe("butter", {Ingredient("goldnugget", math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 72Recipe("butterflymuffin", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 73Recipe("frogglebunwich", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 74Recipe("taffy", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 75Recipe("pumpkincookie", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 76Recipe("stuffedeggplant", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 77Recipe("fishsticks", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 78Recipe("honeynuggets", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 79Recipe("honeyham", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 80Recipe("dragonpie", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 81Recipe("kabobs", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 82Recipe("mandrakesoup", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 83Recipe("baconeggs", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 84Recipe("meatballs", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 85Recipe("bonestew", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 86Recipe("perogies", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 87Recipe("turkeydinner", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 88Recipe("ratatouille", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 89Recipe("jammypreserves", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 90Recipe("fruitmedley", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 91Recipe("fishtacos", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 92Recipe("waffles", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 93Recipe("unagi", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 94Recipe("flowersalad", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 95Recipe("icecream", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 96Recipe("watermelonicle", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 97Recipe("trailmix", {Ingredient("goldnugget", 4+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 98Recipe("hotchili", {Ingredient("goldnugget", 5+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 99Recipe("guacamole", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 100Recipe("krampus_sack", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 101Recipe("slurtlehat", {Ingredient("goldnugget", 3+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 102Recipe("armorsnurtleshell", {Ingredient("goldnugget", 8+math.random(3))}, RECIPETABS.SHOP, TECH.NONE,nil,nil,true) 103 104 即可在主角制造栏中增加商店选项(制造栏最底下画着宝石戒指),用黄金购买珍贵物品,包括坎普斯背包、珍贵材料、料理等。每次读档后,超市价格都会有一定浮动,趁打折时多买一些吧。如果同时修改了“菜市场”、“肉食店”、“流动商贩”、“杂货收购行”、“收藏品黑市”、“收藏品期货市场”(见本修改技巧),即可通过出售农产品、肉类、杂货、收藏品换取购物的黄金,形成饥荒世界完整的金钱交易体系。不要与“制造坎普斯背包”一同修改

2025/04/23 · Bny

YN288-刮刮乐(给路牌黄金买刮刮乐彩票中大奖)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八八.刮刮乐(给路牌黄金买刮刮乐彩票中大奖) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/homesign.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function ShouldAcceptItem(inst, item) 7 if item.prefab == "goldnugget" then 8 return true 9 end 10 return false 11end 12local function OnGetItemFromPlayer(inst, giver, item) 13 if item.prefab == "goldnugget" then 14 local papyrus = SpawnPrefab("papyrus") 15 papyrus:AddComponent("lootdropper") 16 papyrus.components.inspectable.getstatus = function(papyrus) 17 if math.random()<.01 then 18 for k = 1, 50 do 19 papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") 20 end 21 elseif math.random()<.05 then 22 for k = 1, 10 do 23 papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") 24 end 25 elseif math.random()<.15 then 26 for k = 1, 2 do 27 papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") 28 end 29 elseif math.random()<.3 then 30 papyrus.components.lootdropper:SpawnLootPrefab("goldnugget") 31 else 32 papyrus.components.lootdropper:SpawnLootPrefab("ash") 33 end 34 SpawnPrefab("collapse_small").Transform:SetPosition(papyrus.Transform:GetWorldPosition()) 35 papyrus.components.stackable:Get():Remove() 36 end 37 giver.components.inventory:GiveItem(papyrus) 38 end 39end 40 inst:AddComponent("trader") 41 inst.components.trader.onaccept = OnGetItemFromPlayer 42 inst.components.trader:SetAcceptTest(ShouldAcceptItem) 43 44 即可给路牌黄金买刮刮乐彩票(拿黄金对路牌按鼠标左键),彩票(1张纸)直接装入主角物品栏,对物品栏中的纸按鼠标右键即可刮奖,一等奖50个黄金,二等奖10个黄金,三等奖2个黄金,四等奖1个黄金,末等奖只有一团灰。存档退出时,身上不要留彩票,因为再读档后会过期作废(不能再刮奖)

2025/04/23 · Bny

YN289-自动取款机(用活木头种自动取款机,存入的黄金每天给3%利息)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二八九.自动取款机(用活木头种自动取款机,存入的黄金每天给3%利息) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/livinglog.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function itemtest(inst, item, slot) 7 if item.prefab == "goldnugget" then 8 return true 9 end 10 return false 11end 12local slotpos = {} 13for y = 2, 0, -1 do 14 for x = 0, 8 do 15 table.insert(slotpos, Vector3(75*x-75*2+75, 75*y-75*2+75,0)) 16 end 17end 18local function OnDeploy (inst, pt) 19 local bank = SpawnPrefab("livinglog") 20 bank.Transform:SetPosition(pt.x, pt.y, pt.z) 21 bank.Transform:SetScale(1.5, 1.5, 1.5) 22 bank.AnimState:SetBank("ruins_vase") 23 bank.AnimState:SetBuild("ruins_vase") 24 bank.AnimState:PlayAnimation("idle") 25 bank:RemoveComponent("stackable") 26 bank:RemoveComponent("fuel") 27 bank:RemoveComponent("edible") 28 bank:RemoveComponent("inventoryitem") 29 bank:RemoveComponent("repairer") 30 bank:RemoveComponent("burnable") 31 bank:RemoveComponent("propagator") 32 bank:RemoveComponent("deployable") 33 bank.components.container.canbeopened = true 34 bank:AddComponent("workable") 35 bank.components.workable:SetWorkAction(ACTIONS.HAMMER) 36 bank.components.workable:SetWorkLeft(3) 37 bank.components.workable:SetOnFinishCallback(function(bank) 38 SpawnPrefab("collapse_big").Transform:SetPosition(bank.Transform:GetWorldPosition()) 39 GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") 40 bank:Remove() 41 end ) 42 bank:ListenForEvent( "daytime", function() 43 local num_found = 0 44 for k,v in pairs(bank.components.container.slots) do 45 if v and v.prefab == "goldnugget" then 46 num_found = num_found + v.components.stackable:StackSize() 47 end 48 end 49 local Interests = math.floor(num_found/100*3) 50 for k = 1, Interests do 51 bank.components.container:ConsumeByName("goldnugget", -1) 52 end 53 end, GetWorld()) 54 bank:AddTag("banks") 55 inst.components.stackable:Get():Remove() 56end 57 inst:AddComponent("deployable") 58 inst.components.deployable.ondeploy = OnDeploy 59local function onsave(inst, data) 60 if inst:HasTag("banks") then 61 data.banks = true 62 end 63end 64local function onload(inst, data) 65 if data and data.banks then 66 inst.Transform:SetScale(1.5, 1.5, 1.5) 67 inst.AnimState:SetBank("ruins_vase") 68 inst.AnimState:SetBuild("ruins_vase") 69 inst.AnimState:PlayAnimation("idle") 70 inst:RemoveComponent("stackable") 71 inst:RemoveComponent("fuel") 72 inst:RemoveComponent("edible") 73 inst:RemoveComponent("inventoryitem") 74 inst:RemoveComponent("repairer") 75 inst:RemoveComponent("burnable") 76 inst:RemoveComponent("propagator") 77 inst:RemoveComponent("deployable") 78 inst.components.container.canbeopened = true 79 inst:AddComponent("workable") 80 inst.components.workable:SetWorkAction(ACTIONS.HAMMER) 81 inst.components.workable:SetWorkLeft(3) 82 inst.components.workable:SetOnFinishCallback(function(inst) 83 SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) 84 GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") 85 inst:Remove() 86 end ) 87 inst:ListenForEvent( "daytime", function() 88 local num_found = 0 89 for k,v in pairs(inst.components.container.slots) do 90 if v and v.prefab == "goldnugget" then 91 num_found = num_found + v.components.stackable:StackSize() 92 end 93 end 94 local Interests = math.floor(num_found/100*3) 95 for k = 1, Interests do 96 inst.components.container:ConsumeByName("goldnugget", -1) 97 end 98 end, GetWorld()) 99 inst:AddTag("banks") 100 end 101end 102 inst.OnSave = onsave 103 inst.OnLoad = onload 104 inst:AddComponent("container") 105 inst.components.container:SetNumSlots(#slotpos) 106 inst.components.container.widgetslotpos = slotpos 107 inst.components.container.widgetpos = Vector3(-100,200,0) 108 inst.components.container.side_align_tip = 160 109 inst.components.container.canbeopened = false 110 inst.components.container.itemtestfn = itemtest 111 112 即可用活木头种自动取款机,鼠标左键点击打开格子,再点击关闭,只能用于存取黄金。将黄金放入取款机,每日天亮时将给予3%利息,不足1个黄金的零头自动抹去(比如存90个黄金,利息为2.7,则只给2个黄金)。土豪们,这是饥荒世界提供的金融服务,将巨款存进去,躺着吃利息吧。如果不想要自动取款机了,用锤子砸掉即可,记住之前把钱取出来哦

2025/04/23 · Bny

YN290-逝者的赌局(绳子种人骨,用黄金下注猪拳击手生死战)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二九0.逝者的赌局(绳子种人骨,用黄金下注猪拳击手生死战) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rope.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 local skeleton = SpawnPrefab("skeleton") 8 if skeleton then 9 skeleton:PushEvent("growfromrope") 10 skeleton.Transform:SetPosition(pt.x, pt.y, pt.z) 11 inst.components.stackable:Get():Remove() 12 end 13end 14 inst:AddComponent("deployable") 15 inst.components.deployable.ondeploy = OnDeploy 16 17 18 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/skeleton.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 19 20local function game(inst) 21 local light = inst.entity:AddLight() 22 light:Enable(true) 23 local num_found = 0 24 for k,v in pairs(inst.components.container.slots) do 25 if v and v.prefab == "goldnugget" then 26 num_found = num_found + v.components.stackable:StackSize() 27 end 28 end 29 inst.components.container:Close(GetPlayer()) 30 inst.components.container.canbeopened = false 31 GetPlayer().components.playercontroller:Enable(false) 32 local bonuspoint1 = math.random(5) 33 local bonuspoint2 = math.random(5) 34 local pt = Vector3(inst.Transform:GetWorldPosition()) 35 local red = SpawnPrefab("pigman") 36 red.Transform:SetPosition(pt.x+4+3, 0, pt.z+4-3) 37 red.components.health:SetMaxHealth(100 * bonuspoint1) 38 red.components.health:DoDelta(200 * bonuspoint1) 39 red.AnimState:SetMultColour(255/255,0/255,0/255,1) 40 red.AnimState:OverrideSymbol("swap_hat", "hat_football", "swap_hat") 41 red.AnimState:Show("hat") 42 local blue = SpawnPrefab("pigman") 43 blue.Transform:SetPosition(pt.x+4-3, 0, pt.z+4+3) 44 blue.components.health:SetMaxHealth(100 * bonuspoint2) 45 blue.components.health:DoDelta(200 * bonuspoint2) 46 blue.AnimState:SetMultColour(0/255,100/255,255/255,1) 47 blue.AnimState:OverrideSymbol("swap_hat", "hat_football", "swap_hat") 48 blue.AnimState:Show("hat") 49 red.components.combat.target = blue 50 blue.components.combat.target = red 51 TheCamera:SetTarget(red) 52 red:ListenForEvent("death", function() 53 inst:DoTaskInTime(3, function() blue:Remove() 54 GetPlayer().components.sanity:DoDelta(-10) 55 GetPlayer().AnimState:PlayAnimation("hit") 56 GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") 57 inst.components.container:DestroyContents() 58 inst.components.container.canbeopened = true 59 GetPlayer().components.playercontroller:Enable(true) 60 TheCamera:SetTarget(GetPlayer()) 61 light:Enable(false) 62 end ) 63 end ) 64 blue:ListenForEvent("death", function() 65 inst:DoTaskInTime(3, function() red:Remove() 66 GetPlayer().components.sanity:DoDelta(10) 67 for k = 1, num_found do 68 inst.components.container:ConsumeByName("goldnugget", -1) 69 end 70 GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/get_gold") 71 inst.components.container.canbeopened = true 72 GetPlayer().components.playercontroller:Enable(true) 73 TheCamera:SetTarget(GetPlayer()) 74 light:Enable(false) 75 end ) 76 end ) 77end 78local slotpos = { Vector3(0,-75,0)} 79local widgetbuttoninfo = { text = "GO", 80 position = Vector3(0, -165, 0), 81 fn = function(inst) if not inst.components.container:IsEmpty() then game(inst) end 82end } 83local function itemtest(inst, item, slot) 84 if item.prefab == "goldnugget" then 85 return true 86 end 87 return false 88end 89 inst:AddComponent("container") 90 inst.components.container:SetNumSlots(#slotpos) 91 inst.components.container.widgetslotpos = slotpos 92 inst.components.container.widgetpos = Vector3(0,200,0) 93 inst.components.container.side_align_tip = 160 94 inst.components.container.itemtestfn = itemtest 95 inst.components.container.widgetbuttoninfo = widgetbuttoninfo 96 local light = inst.entity:AddLight() 97 light:SetFalloff(1) 98 light:SetIntensity(.8) 99 light:SetRadius(50) 100 light:Enable(false) 101 light:SetColour(180/255, 195/255, 50/255) 102 MakeMediumBurnable(inst) 103 104 即可用绳子种人骨头,鼠标左键点人骨,出现1个格子及GO按钮,在格子中放入黄金后(赌金随意)按GO按钮,红、蓝两个猪拳手出击对战,如果红方获胜,你就赢得1倍奖金(在人骨的格子里领取),并增加10点脑。如果蓝方获胜,格子里的赌金将被收走(逝者获胜),同时减10点脑。平局(双方同时死)判定为逝者获胜。比赛中主角无法走动及攻击(防止作弊),但可以边吃东西边看比赛。人骨最好种在远离猪房、兔房的空旷处,以免干扰比赛。不想要人骨了,烧掉即可。逝者的赌局全天开放,不要沉迷赌博哦

2025/04/23 · Bny

YN291-小酒馆(用剃刀种小酒馆,听音乐、喝烧酒、吃料理、小憩一下)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二九一.小酒馆(用剃刀种小酒馆,听音乐、喝烧酒、吃料理、小憩一下) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/razor.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function bar(inst) 7 local pt = inst:GetPosition() 8 local waiter = SpawnPrefab("razor") 9 waiter.Transform:SetPosition(pt.x, pt.y, pt.z) 10 waiter.AnimState:SetBank("wilson") 11 waiter.AnimState:SetBuild("wes") 12 waiter.AnimState:Hide("ARM_carry") 13 waiter.AnimState:Show("ARM_normal") 14 waiter.Transform:SetFourFaced() 15 waiter.AnimState:PlayAnimation("idle") 16 waiter:AddTag("waiter") 17 waiter:RemoveComponent("inventoryitem") 18 waiter:RemoveComponent("shaver") 19 waiter:RemoveComponent("deployable") 20 waiter:AddComponent("trader") 21 waiter.components.trader:SetAcceptTest(function(waiter, item) 22 if GetPlayer().components.inventory:Has("goldnugget", 1) then 23 if item.prefab == "goldnugget" then 24 return true 25 end 26 end 27 return false 28 end ) 29 waiter.components.trader.onaccept = function(waiter, giver, item) 30 waiter.AnimState:PlayAnimation("idle_onemanband1_loop",true) 31 waiter:DoTaskInTime(5, function() waiter.AnimState:PlayAnimation("idle") end ) 32 GetPlayer().components.sanity:DoDelta(3) 33 end 34 local bar = SpawnPrefab("razor") 35 bar.Transform:SetPosition(pt.x+0.8, 0, pt.z+0.8) 36 bar.AnimState:SetBank("ruins_table") 37 bar.AnimState:SetBuild("ruins_table") 38 bar.AnimState:PlayAnimation("idle") 39 bar:AddTag("goodbye") 40 bar:RemoveComponent("inventoryitem") 41 bar:RemoveComponent("shaver") 42 bar:RemoveComponent("deployable") 43 bar:AddComponent("trader") 44 bar.components.trader:SetAcceptTest(function(bar, item) 45 if GetPlayer().components.inventory:Has("goldnugget", 5) then 46 if item.prefab == "goldnugget" then 47 return true 48 end 49 end 50 return false 51 end ) 52 bar.components.trader.onaccept = function(bar, giver, item) 53 GetPlayer().components.inventory:ConsumeByName("goldnugget", 4) 54 waiter.AnimState:PlayAnimation("give") 55 local wine = SpawnPrefab("razor") 56 wine.AnimState:SetBank("ruins_vase") 57 wine.AnimState:SetBuild("ruins_vase") 58 wine.AnimState:PlayAnimation("idle") 59 wine.Transform:SetScale(0.5, 0.5, 0.5) 60 wine.Physics:SetActive(false) 61 wine:AddTag("goodbye") 62 wine.components.inventoryitem.canbepickedup = false 63 local follower = wine.entity:AddFollower() 64 follower:FollowSymbol( bar.GUID, "swap_object", -100, -170, 0 ) 65 wine.components.inspectable.getstatus = function(wine) 66 wine:Remove() 67 wine = nil 68 GetPlayer().sg:GoToState("eat") 69 GetPlayer().components.sanity:DoDelta(-5) 70 GetPlayer().components.health:DoDelta(20) 71 end 72 end 73 local icebox = SpawnPrefab("razor") 74 icebox.Transform:SetPosition(pt.x-1.6+0.8, 0, pt.z+1.6+0.8) 75 icebox.AnimState:SetBank("icebox") 76 icebox.AnimState:SetBuild("ice_box") 77 icebox.AnimState:PlayAnimation("closed") 78 icebox.AnimState:SetMultColour(255/255,255/255,255/255,1) 79 icebox:AddTag("goodbye") 80 icebox:RemoveComponent("inventoryitem") 81 icebox:RemoveComponent("shaver") 82 icebox:RemoveComponent("deployable") 83 icebox:AddComponent("trader") 84 icebox.components.trader:SetAcceptTest(function(icebox, item) 85 if GetPlayer().components.inventory:Has("goldnugget", 5) then 86 if item.prefab == "goldnugget" then 87 return true 88 end 89 end 90 return false 91 end ) 92 icebox.components.trader.onaccept = function(icebox, giver, item) 93 GetPlayer().components.inventory:ConsumeByName("goldnugget", 4) 94 waiter.AnimState:PlayAnimation("give") 95 local names = {"butterflymuffin","frogglebunwich","taffy","pumpkincookie","stuffedeggplant","fishsticks","honeynuggets","honeyham","dragonpie","kabobs","mandrakesoup","baconeggs","meatballs","bonestew","perogies","turkeydinner","ratatouille","jammypreserves","fruitmedley","fishtacos","waffles","unagi","flowersalad","icecream","watermelonicle","trailmix","hotchili","guacamole"} 96 local name = names[math.random(#names)] 97 local snack = SpawnPrefab(name) 98 giver.components.inventory:GiveItem(snack) 99 end 100 local chair = SpawnPrefab("razor") 101 chair.Transform:SetPosition(pt.x+1.5+0.8, 0, pt.z-1.5+0.8) 102 chair.AnimState:SetBank("ruins_chair") 103 chair.AnimState:SetBuild("ruins_chair") 104 chair.AnimState:PlayAnimation("idle") 105 chair:AddTag("goodbye") 106 chair:RemoveComponent("inventoryitem") 107 chair:RemoveComponent("shaver") 108 chair:RemoveComponent("deployable") 109 chair.components.inspectable.getstatus = function() 110 TheFrontEnd:Fade(true,1) 111 GetClock():NextPhase() 112 GetPlayer().components.hunger:DoDelta(-10) 113 GetPlayer().components.sanity:DoDelta(25) 114 end 115 local music = SpawnPrefab("razor") 116 music.Transform:SetPosition(pt.x+1.5-0.8, 0, pt.z-1.5-0.8) 117 music.AnimState:SetBank("phonograph") 118 music.AnimState:SetBuild("phonograph") 119 music.AnimState:PlayAnimation("idle") 120 music:AddTag("goodbye") 121 music:RemoveComponent("inventoryitem") 122 music:RemoveComponent("shaver") 123 music:RemoveComponent("deployable") 124 music.entity:AddSoundEmitter() 125 music:AddComponent("machine") 126 music.components.machine.turnonfn = function(music) 127 music.AnimState:PlayAnimation("play_loop", true) 128 music.SoundEmitter:PlaySound("dontstarve/maxwell/ragtime", "ragtime") 129 end 130 music.components.machine.turnofffn = function(music) 131 music.AnimState:PlayAnimation("idle") 132 music.SoundEmitter:KillSound("ragtime") 133 music.SoundEmitter:PlaySound("dontstarve/music/gramaphone_end") 134 end 135 music.components.machine:TurnOff() 136 local pot = SpawnPrefab("razor") 137 pot.Transform:SetPosition(pt.x-1.5-1.1, 0, pt.z+1.5-1.1) 138 pot.AnimState:SetBank("cook_pot") 139 pot.AnimState:SetBuild("cook_pot") 140 pot.Transform:SetScale(0.8, 0.8, 0.8) 141 pot.AnimState:PlayAnimation("cooking_loop", true) 142 pot:AddTag("goodbye") 143 pot:RemoveComponent("inventoryitem") 144 pot:RemoveComponent("shaver") 145 pot:RemoveComponent("deployable") 146 pot.AnimState:SetBloomEffectHandle("shaders/anim.ksh") 147 local light = pot.entity:AddLight() 148 light:SetFalloff(1) 149 light:SetIntensity(.8) 150 light:SetRadius(10) 151 light:SetColour(180/255, 195/255, 50/255) 152 light:Enable(true) 153end 154local function OnDeploy (inst, pt) 155 bar(inst) 156 inst:Remove() 157end 158 inst:AddComponent("deployable") 159 inst.components.deployable.ondeploy = OnDeploy 160local function onsave(inst, data) 161 if inst:HasTag("waiter") then 162 data.waiter = true 163 end 164 if inst:HasTag("goodbye") then 165 data.goodbye = true 166 end 167end 168local function onload(inst, data) 169 if data and data.waiter then 170 bar(inst) 171 inst:Remove() 172 end 173 if data and data.goodbye then 174 inst:Remove() 175 end 176end 177 inst.OnSave = onsave 178 inst.OnLoad = onload 179MakeLargeBurnable(inst) 180MakeLargePropagator(inst) 181 182 即可用剃刀种小酒馆,给桌子5个黄金(拿着黄金对桌子点鼠标左键),服务员会为你热1瓶烧酒,左键点桌上的酒瓶即可喝掉,补20点血,但会减5点脑(喝多了会头晕)。给冰箱5个黄金,可以购买料理(直接放入物品栏)。如果你满意酒馆的服务,可以向服务员支付小费(拿着黄金对服务员点鼠标左键),每次1个黄金,补3点脑。如果想休息一下,就用左键点椅子,时间会跳到下一时段,补25点脑,减少10点饥饿。鼠标右键点留声机,可以开关音乐。冬天天冷时,靠近锅会很暖和。不想要小酒馆时,烧掉即可。剃刀在工具选项(画着斧子和镐)下,用2个树枝、2个燧石制造

2025/04/23 · Bny