YN300-小诊所(用毛皮铺盖种小诊所,可买药、住院、做手术)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三00.小诊所(用毛皮铺盖种小诊所,可买药、住院、做手术) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/bedroll_furry.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function createhospital(inst) local pt = inst:GetPosition() local nurse = SpawnPrefab("bedroll_furry") nurse.Transform:SetPosition(pt.x, pt.y, pt.z) nurse.AnimState:SetBank("wilson") nurse.AnimState:SetBuild("wendy") nurse.AnimState:OverrideSymbol("swap_body", "armor_sweatervest", "swap_body") nurse.AnimState:Hide("ARM_carry") nurse.AnimState:Show("ARM_normal") nurse.Transform:SetFourFaced() nurse.AnimState:PlayAnimation("idle") nurse:RemoveComponent("inventoryitem") nurse:RemoveComponent("finiteuses") nurse:RemoveComponent("fuel") nurse:RemoveComponent("sleepingbag") nurse:RemoveComponent("deployable") MakeLargeBurnable(nurse) MakeLargePropagator(nurse) nurse:AddTag("nurse") local light = nurse.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(5) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) nurse:AddComponent("trader") nurse.components.trader:SetAcceptTest(function(nurse, item) if GetPlayer().components.inventory:Has("goldnugget", 5) then if item.prefab == "goldnugget" then return true end end return false end ) nurse.components.trader.onaccept = function(nurse, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 4) GetPlayer().components.playercontroller:Enable(false) nurse.AnimState:OverrideSymbol("swap_object", "swap_hammer", "swap_hammer") nurse.AnimState:Hide("ARM_normal") nurse.AnimState:Show("ARM_carry") nurse.task = nurse:DoPeriodicTask(1, function(nurse) nurse.Transform:SetRotation(GetPlayer().Transform:GetRotation() - 180) nurse.AnimState:PlayAnimation("pickaxe_pre") nurse.AnimState:PlayAnimation("pickaxe_loop", false) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") GetPlayer().sg:GoToState("hit") end ) nurse:DoTaskInTime(5, function() TheFrontEnd:Fade(false,1) if nurse.task then nurse.task:Cancel() nurse.task = nil end nurse.Transform:SetRotation(0) nurse:DoTaskInTime(1, function() nurse.AnimState:Hide("ARM_carry") nurse.AnimState:Show("ARM_normal") nurse.AnimState:PlayAnimation("idle_onemanband1_loop",true) nurse:DoTaskInTime(3, function() nurse.AnimState:PlayAnimation("idle") end ) TheFrontEnd:Fade(true,1) GetPlayer().components.health:DoDelta(GetPlayer().components.health.maxhealth) if GetPlayer():HasTag("poisoning") or GetPlayer():HasTag("fever") then if GetPlayer():HasTag("poisoning") then GetPlayer():RemoveTag("poisoning") end if GetPlayer():HasTag("fever") then GetPlayer():RemoveTag("fever") end if GetPlayer().poison then GetPlayer().poison:Cancel() GetPlayer().poison = nil end if GetPlayer().fever then GetPlayer().fever:Cancel() GetPlayer().fever = nil end GetPlayer().AnimState:SetMultColour(255/255,255/255,255/255,1) GetPlayer().components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED GetPlayer().components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED GetPlayer().components.combat:SetAttackPeriod(TUNING.WILSON_ATTACK_PERIOD) end GetPlayer().sg:GoToState("wakeup") GetPlayer().components.playercontroller:Enable(true) end ) end ) end local medicinebox = SpawnPrefab("bedroll_furry") medicinebox.Transform:SetPosition(pt.x+1.2, 0, pt.z-1.2) medicinebox.AnimState:SetBank("icebox") medicinebox.AnimState:SetBuild("ice_box") medicinebox.AnimState:PlayAnimation("closed") medicinebox.Transform:SetScale(0.5, 0.5, 0.5) medicinebox:RemoveComponent("inventoryitem") medicinebox:RemoveComponent("finiteuses") medicinebox:RemoveComponent("fuel") medicinebox:RemoveComponent("sleepingbag") medicinebox:RemoveComponent("deployable") MakeLargeBurnable(medicinebox) MakeLargePropagator(medicinebox) medicinebox:AddTag("goodbye") medicinebox:AddComponent("trader") medicinebox.components.trader:SetAcceptTest(function(medicinebox, item) if GetPlayer().components.inventory:Has("goldnugget", 5) then if item.prefab == "goldnugget" then return true end end return false end ) medicinebox.components.trader.onaccept = function(medicinebox, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 4) local medicine = SpawnPrefab("bedroll_furry") medicine.AnimState:SetBank("carrot") medicine.AnimState:SetBuild("carrot") medicine.AnimState:PlayAnimation("cooked") medicine.components.inventoryitem:ChangeImageName("carrot_cooked") medicine:RemoveComponent("finiteuses") medicine:RemoveComponent("fuel") medicine:RemoveComponent("sleepingbag") medicine:RemoveComponent("burnable") medicine:RemoveComponent("propagator") medicine:RemoveComponent("deployable") medicine:AddComponent("edible") medicine.components.edible.healthvalue = GetPlayer().components.health.maxhealth *0.5 medicine.components.edible.hungervalue = 0 medicine.components.edible.sanityvalue = GetPlayer().components.sanity.max *0.5 medicine.components.edible.foodtype = "VEGGIE" medicine:AddTag("medicine") GetPlayer().components.inventory:GiveItem(medicine) end local hospital = SpawnPrefab("bedroll_furry") hospital.Transform:SetPosition(pt.x-2, 0, pt.z-2) hospital.AnimState:SetBank("tent") hospital.AnimState:SetBuild("tent") hospital.AnimState:PlayAnimation("idle", true) hospital.Transform:SetScale(1.2, 1.2, 1.2) hospital:RemoveComponent("inventoryitem") hospital:RemoveComponent("finiteuses") hospital:RemoveComponent("fuel") hospital:RemoveComponent("sleepingbag") hospital:RemoveComponent("deployable") MakeLargeBurnable(hospital) MakeLargePropagator(hospital) hospital:AddTag("goodbye") hospital:AddComponent("trader") hospital.components.trader:SetAcceptTest(function(hospital, item) if GetPlayer().components.inventory:Has("goldnugget", 5) then if item.prefab == "goldnugget" then return true end end return false end ) hospital.components.trader.onaccept = function(hospital, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 4) GetPlayer().components.playercontroller:Enable(false) TheFrontEnd:Fade(false,1) hospital:DoTaskInTime(2, function() TheFrontEnd:Fade(true,1) GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) GetPlayer().components.playercontroller:Enable(true) end ) end end local function OnDeploy (inst, pt) createhospital(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("goodbye") then data.goodbye = true end if inst:HasTag("nurse") then data.nurse = true end if inst:HasTag("medicine") then data.medicine = true end end local function onload(inst, data) if data and data.goodbye then inst:Remove() end if data and data.nurse then createhospital(inst) inst:Remove() end if data and data.medicine then inst.AnimState:SetBank("carrot") inst.AnimState:SetBuild("carrot") inst.AnimState:PlayAnimation("cooked") inst.components.inventoryitem:ChangeImageName("carrot_cooked") inst:RemoveComponent("finiteuses") inst:RemoveComponent("fuel") inst:RemoveComponent("sleepingbag") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst:AddComponent("edible") inst.components.edible.healthvalue = GetPlayer().components.health.maxhealth *0.5 inst.components.edible.hungervalue = 0 inst.components.edible.sanityvalue = GetPlayer().components.sanity.max *0.5 inst.components.edible.foodtype = "VEGGIE" inst:AddTag("medicine") end end inst.OnSave = onsave inst.OnLoad = onload 即可用毛皮铺盖种小诊所,给护士5个黄金(拿着黄金对护士点鼠标左键),会为你麻醉并做手术,将生命值恢复到最大,如果同时修改了“小病小灾”,也可治愈感冒和食物中毒。给帐篷5个黄金可以住院,将脑值恢复到最大。给左侧的药箱5个黄金,可以买一份药,吃了可补一半的生命和脑值。不想要小诊所时,烧掉即可。毛皮铺盖在生存选项(画着绳套)下,用1个草席卷、2个兔人尾巴制造

2025/04/23 · Bny

YN301-斗蜘蛛(用啜食者皮种斗蜘蛛场,购买迷你蜘蛛与庄家PK,赢奖金)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0一.斗蜘蛛(用啜食者皮种斗蜘蛛场,购买迷你蜘蛛与庄家PK,赢奖金) 用MT管理器打开游戏目录/assets/scripts/prefabs/slurperpelt.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local colours= { {198/255,43/255,43/255}, {79/255,153/255,68/255}, {35/255,105/255,235/255}, {233/255,208/255,69/255}, {109/255,50/255,163/255}, {222/255,126/255,39/255}, } local function boxing(inst) local pt = inst:GetPosition() local boxer = SpawnPrefab("slurper_pelt") boxer.Transform:SetPosition(pt.x, pt.y, pt.z) boxer.AnimState:SetBank("wilson") boxer.AnimState:SetBuild("wes") boxer.AnimState:OverrideSymbol("swap_hat", "hat_top", "swap_hat") boxer.AnimState:Show("HAT") boxer.AnimState:Show("HAT_HAIR") boxer.AnimState:Hide("HAIR_NOHAT") boxer.AnimState:Hide("HAIR") boxer.AnimState:Hide("ARM_carry") boxer.AnimState:Show("ARM_normal") boxer.Transform:SetFourFaced() boxer.AnimState:PlayAnimation("idle") boxer:RemoveComponent("stackable") boxer:RemoveComponent("tradable") boxer:RemoveComponent("inventoryitem") boxer:RemoveComponent("edible") boxer:RemoveComponent("deployable") MakeLargeBurnable(boxer) MakeLargePropagator(boxer) boxer:AddTag("boxer") boxer:AddComponent("trader") boxer.components.trader:SetAcceptTest(function(boxer, item) if GetPlayer().components.inventory:Has("goldnugget", 100) then if item.prefab == "goldnugget" then return true end end return false end ) boxer.components.trader.onaccept = function(boxer, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 99) boxer.AnimState:PlayAnimation("give") local cricket = SpawnPrefab("slurper_pelt") cricket.Transform:SetPosition(pt.x+1.5, 0, pt.z+1.5) cricket.AnimState:SetBank("spider_queen") cricket.AnimState:SetBuild("spider_queen_build") cricket.AnimState:PlayAnimation("idle", true) cricket.Transform:SetFourFaced() cricket.entity:AddSoundEmitter() cricket.Transform:SetScale(0.3, 0.3, 0.3) cricket.colour_idx = math.random(#colours) cricket.AnimState:SetMultColour(colours[cricket.colour_idx][1],colours[cricket.colour_idx][2],colours[cricket.colour_idx][3],1) cricket.components.inventoryitem:ChangeImageName("spidereggsack") cricket:RemoveComponent("stackable") cricket:RemoveComponent("tradable") cricket:RemoveComponent("edible") cricket:RemoveComponent("burnable") cricket:RemoveComponent("propagator") cricket:RemoveComponent("deployable") local brain = require "brains/abigailbrain" cricket:SetBrain(brain) cricket:AddComponent("lootdropper") cricket.components.lootdropper:SetLoot({"silk"}) cricket:AddComponent("locomotor") cricket.components.locomotor.walkspeed = 5 cricket.components.locomotor.runspeed = 8 cricket:SetStateGraph("SGspiderqueen") cricket:AddComponent("follower") cricket.components.follower:SetLeader(GetPlayer()) cricket.health_num = math.random(100,300) cricket.damage_num = math.random(20,50) cricket:AddComponent("health") cricket.components.health:SetMaxHealth(cricket.health_num) cricket:AddComponent("trader") cricket.components.trader:SetAcceptTest(function(cricket, item) if item.prefab == "smallmeat" then return cricket.components.health:GetPercent() < 1 end return false end ) cricket.components.trader.onaccept = function(cricket, giver, item) cricket.components.health:DoDelta(300) end cricket:AddComponent("combat") cricket.components.combat:SetRetargetFunction(1, function(cricket) if not cricket.components.health:IsDead() then return FindEntity(cricket, 20, function(guy) if guy.components.health and not guy.components.health:IsDead() then return guy:HasTag("cricket") or guy:HasTag("cricket0") end end ) end end ) cricket.components.combat:SetKeepTargetFunction(function(cricket, target) return target and target:IsValid() end ) cricket.components.combat:SetAttackPeriod(2) cricket.components.combat:SetRange(1, 2) cricket.components.combat:SetDefaultDamage(cricket.damage_num) cricket:AddTag("cricket") end boxer.components.inspectable.getstatus = function(boxer) if not boxer:HasTag("startgame") then if GetPlayer().components.inventory:Has("goldnugget", 100) then local target0 = FindEntity(boxer, 30, function(guy) return guy:HasTag("cricket") and guy.components.inventoryitem and not guy.components.inventoryitem:IsHeld() end ) if target0 then boxer:AddTag("startgame") boxer.AnimState:PlayAnimation("give") GetPlayer().components.playercontroller:Enable(false) TheCamera:SetTarget(target0) target0:RemoveComponent("inventoryitem") boxer.task = boxer:DoPeriodicTask(1, function(boxer) if target0.components.health:IsDead() then if boxer.task then boxer.task:Cancel() boxer.task = nil end GetPlayer().components.inventory:ConsumeByName("goldnugget", 100) TheCamera:SetTarget(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") boxer.AnimState:PlayAnimation("idle_onemanband1_loop",true) boxer:DoTaskInTime(2, function() boxer.AnimState:PlayAnimation("idle") local target1 = FindEntity(boxer, 30, function(guy) return guy:HasTag("cricket0") end ) if target1 then target1:Remove() end boxer:RemoveTag("startgame") GetPlayer().components.playercontroller:Enable(true) end ) end end ) local cricket0 = SpawnPrefab("slurper_pelt") cricket0.Transform:SetPosition(pt.x+1.5, 0, pt.z+1.5) cricket0.AnimState:SetBank("spider_queen") cricket0.AnimState:SetBuild("spider_queen_build") cricket0.AnimState:PlayAnimation("idle", true) cricket0.Transform:SetFourFaced() cricket0.entity:AddSoundEmitter() cricket0.Transform:SetScale(0.3, 0.3, 0.3) cricket0:RemoveComponent("stackable") cricket0:RemoveComponent("tradable") cricket0:RemoveComponent("inventoryitem") cricket0:RemoveComponent("edible") cricket0:RemoveComponent("burnable") cricket0:RemoveComponent("propagator") cricket0:RemoveComponent("deployable") local brain = require "brains/abigailbrain" cricket0:SetBrain(brain) cricket0:AddComponent("lootdropper") cricket0.components.lootdropper:SetLoot({"silk"}) cricket0:AddComponent("locomotor") cricket0.components.locomotor.walkspeed = 5 cricket0.components.locomotor.runspeed = 8 cricket0:SetStateGraph("SGspiderqueen") cricket0:AddComponent("follower") cricket0.components.follower:SetLeader(boxer) cricket0:AddComponent("health") cricket0.components.health:SetMaxHealth(math.random(110,330)) cricket0:AddComponent("combat") cricket0.components.combat:SetRetargetFunction(1, function(cricket0) if not cricket0.components.health:IsDead() then return FindEntity(cricket0, 20, function(guy) if guy.components.health and not guy.components.health:IsDead() then return guy:HasTag("cricket") end end ) end end ) cricket0.components.combat:SetKeepTargetFunction(function(cricket0, target) return target and target:IsValid() end ) cricket0.components.combat:SetAttackPeriod(2) cricket0.components.combat:SetRange(1, 2) cricket0.components.combat:SetDefaultDamage(math.random(22,55)) cricket0:ListenForEvent("death", function() boxer.AnimState:PlayAnimation("give") if boxer.task then boxer.task:Cancel() boxer.task = nil end for k = 1, 100 do local goldnugget = SpawnPrefab("goldnugget") GetPlayer().components.inventory:GiveItem(goldnugget) end boxer:RemoveTag("startgame") GetPlayer().components.playercontroller:Enable(true) TheCamera:SetTarget(GetPlayer()) target0:AddComponent("inventoryitem") target0.components.inventoryitem:ChangeImageName("spidereggsack") end ) cricket0:AddTag("cricket0") cricket0:AddTag("goodbye") end end end end local advert = SpawnPrefab("slurper_pelt") advert.Transform:SetPosition(pt.x-2, 0, pt.z-2) advert.AnimState:SetBank("barrel") advert.AnimState:SetBuild("monkey_barrel") advert.AnimState:PlayAnimation("idle", true) advert.Transform:SetScale(1.5, 1.5, 1.5) advert:RemoveComponent("stackable") advert:RemoveComponent("tradable") advert:RemoveComponent("inventoryitem") advert:RemoveComponent("edible") advert:RemoveComponent("deployable") MakeLargeBurnable(advert) MakeLargePropagator(advert) advert:AddTag("lightningrod") local light = advert.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(10) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) advert:DoPeriodicTask(6, function(advert) advert.AnimState:SetBloomEffectHandle("shaders/anim.ksh") advert:DoTaskInTime(3, function(advert) advert.AnimState:SetBloomEffectHandle("") end ) end ) advert:AddTag("goodbye") end local function OnDeploy (inst, pt) boxing(inst) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("goodbye") then data.goodbye = true end if inst:HasTag("boxer") then data.boxer = true end if inst:HasTag("cricket") then data.cricket = true end data.colour_idx = inst.colour_idx data.health_num = inst.health_num data.damage_num = inst.damage_num end local function onload(inst, data) if data and data.goodbye then inst:Remove() end if data and data.boxer then boxing(inst) inst:Remove() end if data and data.cricket then inst.AnimState:SetBank("spider_queen") inst.AnimState:SetBuild("spider_queen_build") inst.AnimState:PlayAnimation("idle", true) inst.Transform:SetFourFaced() inst.entity:AddSoundEmitter() inst.Transform:SetScale(0.3, 0.3, 0.3) inst.colour_idx = math.random(#colours) inst.AnimState:SetMultColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3],1) inst.components.inventoryitem:ChangeImageName("spidereggsack") inst:RemoveComponent("stackable") inst:RemoveComponent("tradable") inst:RemoveComponent("edible") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"silk"}) inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 5 inst.components.locomotor.runspeed = 8 inst:SetStateGraph("SGspiderqueen") inst:AddComponent("follower") inst.components.follower:SetLeader(GetPlayer()) inst.health_num = math.random(100,300) inst.damage_num = math.random(20,50) inst:AddComponent("health") inst.components.health:SetMaxHealth(inst.health_num) inst:AddComponent("trader") inst.components.trader:SetAcceptTest(function(inst, item) if item.prefab == "smallmeat" then return inst.components.health:GetPercent() < 1 end return false end ) inst.components.trader.onaccept = function(inst, giver, item) inst.components.health:DoDelta(300) end inst:AddComponent("combat") inst.components.combat:SetRetargetFunction(1, function(inst) if not inst.components.health:IsDead() then return FindEntity(inst, 20, function(guy) if guy.components.health and not guy.components.health:IsDead() then return guy:HasTag("cricket") or guy:HasTag("cricket0") end end ) end end ) inst.components.combat:SetKeepTargetFunction(function(inst, target) return target and target:IsValid() end ) inst.components.combat:SetAttackPeriod(2) inst.components.combat:SetRange(1, 2) inst.components.combat:SetDefaultDamage(inst.damage_num) inst:AddTag("cricket") end if data and data.colour_idx then inst.colour_idx = math.min(#colours, data.colour_idx) inst.AnimState:SetMultColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3],1) end if data and data.health_num then inst.health_num = data.health_num inst.components.health:SetMaxHealth(inst.health_num) inst.components.health:DoDelta(inst.components.health.maxhealth) end if data and data.damage_num then inst.damage_num = data.damage_num inst.components.combat:SetDefaultDamage(inst.damage_num) end end inst.OnSave = onsave inst.OnLoad = onload 即可用啜食者皮种斗蜘蛛场(拿着1个啜食者皮对地面点鼠标右键,如果拿着多个啜食者皮,则不会种出来),给庄家100个黄金(拿着黄金对庄家点鼠标左键),可购买迷你蜘蛛,鼠标左键点蜘蛛,可将其放入物品栏,显示为蜘蛛卵的图标。如果想与庄家比赛,主角身上至少有100个黄金,将自己的一只蜘蛛放在庄家面前,鼠标左键点庄家,庄家会拿出另一只蜘蛛与你的蜘蛛PK。如果你赢了,将赢得100个黄金的奖金,如果输了就输掉100个黄金,并损失掉自己的蜘蛛。为防止作弊,比赛中主角操作将暂停,比赛结束后恢复。每只迷你蜘蛛的血量、攻击力都不同,如果你买到厉害的蜘蛛,一定要用心呵护,因为它就是你的摇钱树,给蜘蛛喂一块小肉(拿着小肉对蜘蛛点鼠标左键),可以为其补满血。你也可以多买几只蜘蛛,内部PK,挑选出好的品种,再与庄家对赌,会增大你的胜率。不想要斗蜘蛛场了,烧掉即可。啜食者皮可以打啜食者获得,也可在“巨型超市”中,花1-3个黄金购得

2025/04/23 · Bny

YN302-经营动物园(用黄油种动物园,买卖、繁殖小动物,赚门票钱)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0二.经营动物园(用黄油种动物园,买卖、繁殖小动物,赚门票钱) 用MT管理器打开游戏目录/assets/scripts/prefabs/butter.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local slotpos = { Vector3(0,-100,0)} local function itemtest(inst, item, slot) if item.prefab == "carrot" then return true end return false end local widgetbuttoninfo = { text = "Sell", position = Vector3(0, -30, 0), fn = function(inst) local target = FindEntity(inst, 9, function(guy) return guy:HasTag("zoobaby") end ) if target then for k = 1,20 do local pt5 = target:GetPosition() SpawnPrefab("goldnugget").Transform:SetPosition(pt5.x, 0, pt5.z) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") target:Remove() end end end } local function OnDeploy (inst, pt) local brand = SpawnPrefab("butter") brand.Transform:SetPosition(pt.x, pt.y, pt.z) brand.AnimState:SetBank("sign_home") brand.AnimState:SetBuild("sign_home") brand.AnimState:PlayAnimation("idle") brand.Transform:SetScale(0.8, 0.8, 0.8) brand.AnimState:SetMultColour(0/255,255/255,0/255,1) brand:RemoveComponent("stackable") brand:RemoveComponent("inventoryitem") brand:RemoveComponent("edible") brand:RemoveComponent("perishable") brand:RemoveComponent("deployable") brand:RemoveComponent("container") brand:AddTag("brand") local slotpos1 = { Vector3(0,-75,0)} brand:AddComponent("container") brand.components.container:SetNumSlots(#slotpos1) brand.components.container.widgetslotpos = slotpos1 brand.components.container.widgetpos = Vector3(0,180,0) brand.components.container.side_align_tip = 160 brand.components.container.acceptsstacks = false brand.components.container.itemtestfn = function(brand, item, slot) if item.prefab == "charcoal" or item.prefab == "trunk_summer" or item.prefab == "trunk_winter" or item.prefab == "walrus_tusk" or item.prefab == "cave_banana" then return true end return false end brand.components.container.widgetbuttoninfo = { text = "Buy", position = Vector3(0, -145, 0), fn = function(brand) if GetPlayer().components.inventory:Has("goldnugget", 30) then if brand.components.container:Has("charcoal", 1) then brand.components.container:ConsumeByName("charcoal", 1) local zoobaby = SpawnPrefab("butter") local pt1 = brand:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("krampus") zoobaby.AnimState:SetBuild("krampus_build") zoobaby.AnimState:PlayAnimation("idle", true) zoobaby.entity:AddSoundEmitter() zoobaby.AnimState:Hide("SACK") zoobaby.AnimState:Show("ARM") zoobaby.Transform:SetScale(0.7,0.7,0.7) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkrampus") zoobaby:AddTag("zoobaby1") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if brand.components.container:Has("trunk_summer", 1) then brand.components.container:ConsumeByName("trunk_summer", 1) local zoobaby = SpawnPrefab("butter") local pt1 = brand:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_summer_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby2") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if brand.components.container:Has("trunk_winter", 1) then brand.components.container:ConsumeByName("trunk_winter", 1) local zoobaby = SpawnPrefab("butter") local pt1 = brand:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_winter_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby3") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if brand.components.container:Has("walrus_tusk", 1) then brand.components.container:ConsumeByName("walrus_tusk", 1) local zoobaby = SpawnPrefab("butter") local pt1 = brand:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("walrus") zoobaby.AnimState:SetBuild("walrus_baby_build") zoobaby.AnimState:PlayAnimation("idle_happy") zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.8,0.8,0.8) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGwalrus") zoobaby:AddTag("zoobaby4") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if brand.components.container:Has("cave_banana", 1) then brand.components.container:ConsumeByName("cave_banana", 1) local zoobaby = SpawnPrefab("butter") local pt1 = brand:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("kiki") zoobaby.AnimState:SetBuild("kiki_basic") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.soundtype = "" zoobaby.Transform:SetScale(1.2,1.2,1.2) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGmonkey") zoobaby:AddTag("zoobaby5") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end end end } local zooroom = SpawnPrefab("butter") zooroom.Transform:SetPosition(pt.x-7, 0, pt.z-7) zooroom.AnimState:SetBank("rabbithouse") zooroom.AnimState:SetBuild("rabbit_house") zooroom.AnimState:PlayAnimation("idle", true) zooroom.Transform:SetScale(0.4, 0.4, 0.4) zooroom:RemoveComponent("stackable") zooroom:RemoveComponent("inventoryitem") zooroom:RemoveComponent("edible") zooroom:RemoveComponent("perishable") zooroom:RemoveComponent("deployable") zooroom.components.container.canbeopened = true zooroom.entity:AddLight() zooroom.Light:SetFalloff(1) zooroom.Light:SetIntensity(.8) zooroom.Light:SetRadius(15) zooroom.Light:SetColour(180/255, 195/255, 50/255) zooroom.Light:Enable(true) zooroom:AddTag("zooroom") zooroom:DoPeriodicTask(180, function(zooroom) local target = FindEntity(zooroom, 9, function(guy) return guy:HasTag("zoobaby") end ) if target then local target1 = FindEntity(zooroom, 9, function(guy) return guy.prefab == "poop" end ) if not target1 then for k = 1,math.random(5,10) do local pt2 = zooroom:GetPosition() SpawnPrefab("goldnugget").Transform:SetPosition(pt2.x+7.5, 0, pt2.z+7.5) end else for k = 1,math.random(1,3) do local pt2 = zooroom:GetPosition() SpawnPrefab("goldnugget").Transform:SetPosition(pt2.x+7.5, 0, pt2.z+7.5) end end if zooroom.components.container:Has("carrot", 3) then zooroom.components.container:ConsumeByName("carrot", 3) if math.random()<0.1 then if target:HasTag("zoobaby1") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("krampus") zoobaby.AnimState:SetBuild("krampus_build") zoobaby.AnimState:PlayAnimation("idle", true) zoobaby.entity:AddSoundEmitter() zoobaby.AnimState:Hide("SACK") zoobaby.AnimState:Show("ARM") zoobaby.Transform:SetScale(0.7,0.7,0.7) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkrampus") zoobaby:AddTag("zoobaby1") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby2") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_summer_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby2") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby3") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_winter_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby3") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby4") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("walrus") zoobaby.AnimState:SetBuild("walrus_baby_build") zoobaby.AnimState:PlayAnimation("idle_happy") zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.8,0.8,0.8) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGwalrus") zoobaby:AddTag("zoobaby4") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby5") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("kiki") zoobaby.AnimState:SetBuild("kiki_basic") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.soundtype = "" zoobaby.Transform:SetScale(1.2,1.2,1.2) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGmonkey") zoobaby:AddTag("zoobaby5") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end end else target.components.health:Kill() end end end ) zooroom:AddComponent("workable") zooroom.components.workable:SetWorkAction(ACTIONS.HAMMER) zooroom.components.workable:SetWorkLeft(3) zooroom.components.workable:SetOnFinishCallback(function(zooroom) local pos = Vector3(zooroom.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 10) for k,v in pairs(ents) do if v:HasTag("zoofence") or v:HasTag("brand") then SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") v:Remove() end end zooroom:Remove() end ) local pt0 = Vector3(zooroom.Transform:GetWorldPosition()) for k = 1, 40 do local result_offset = FindValidPositionByFan(1 * 2 * PI, 8, 40, function(offset) local x,y,z = (pt0 + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end) if result_offset then local zoofence = SpawnPrefab("butter") zoofence.AnimState:SetBank("wall") zoofence.AnimState:SetBuild("wall_wood") zoofence.AnimState:PlayAnimation("1_2", false) MakeObstaclePhysics(zoofence, .5) zoofence:RemoveComponent("stackable") zoofence:RemoveComponent("inventoryitem") zoofence:RemoveComponent("edible") zoofence:RemoveComponent("perishable") zoofence:RemoveComponent("deployable") zoofence:RemoveComponent("container") zoofence:AddTag("zoofence") zoofence.Transform:SetPosition((pt0 + result_offset):Get()) zoofence.components.inspectable.getstatus = function(zoofence) zoofence.Transform:SetScale(1, 0.1, 1) zoofence.Physics:SetActive(false) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") zoofence:DoTaskInTime(5, function(zoofence) zoofence.Transform:SetScale(1, 1, 1) zoofence.Physics:SetActive(true) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") end ) end end end inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,180,0) inst.components.container.side_align_tip = 160 inst.components.container.itemtestfn = itemtest inst.components.container.canbeopened = false inst.components.container.widgetbuttoninfo = widgetbuttoninfo local function onsave(inst, data) if inst:HasTag("brand") then data.brand = true end if inst:HasTag("zooroom") then data.zooroom = true end if inst:HasTag("zoofence") then data.zoofence = true end if inst:HasTag("zoobaby1") then data.zoobaby1 = true end if inst:HasTag("zoobaby2") then data.zoobaby2 = true end if inst:HasTag("zoobaby3") then data.zoobaby3 = true end if inst:HasTag("zoobaby4") then data.zoobaby4 = true end if inst:HasTag("zoobaby5") then data.zoobaby5 = true end if inst:HasTag("followme") then data.followme = true end end local function onload(inst, data) if data and data.brand then inst.AnimState:SetBank("sign_home") inst.AnimState:SetBuild("sign_home") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.8, 0.8, 0.8) inst.AnimState:SetMultColour(0/255,255/255,0/255,1) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveComponent("container") inst:AddTag("brand") local slotpos1 = { Vector3(0,-75,0)} inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos1) inst.components.container.widgetslotpos = slotpos1 inst.components.container.widgetpos = Vector3(0,180,0) inst.components.container.side_align_tip = 160 inst.components.container.acceptsstacks = false inst.components.container.itemtestfn = function(inst, item, slot) if item.prefab == "charcoal" or item.prefab == "trunk_summer" or item.prefab == "trunk_winter" or item.prefab == "walrus_tusk" or item.prefab == "cave_banana" then return true end return false end inst.components.container.widgetbuttoninfo = { text = "Buy", position = Vector3(0, -145, 0), fn = function(inst) if GetPlayer().components.inventory:Has("goldnugget", 30) then if inst.components.container:Has("charcoal", 1) then inst.components.container:ConsumeByName("charcoal", 1) local zoobaby = SpawnPrefab("butter") local pt1 = inst:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("krampus") zoobaby.AnimState:SetBuild("krampus_build") zoobaby.AnimState:PlayAnimation("idle", true) zoobaby.entity:AddSoundEmitter() zoobaby.AnimState:Hide("SACK") zoobaby.AnimState:Show("ARM") zoobaby.Transform:SetScale(0.7,0.7,0.7) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkrampus") zoobaby:AddTag("zoobaby1") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if inst.components.container:Has("trunk_summer", 1) then inst.components.container:ConsumeByName("trunk_summer", 1) local zoobaby = SpawnPrefab("butter") local pt1 = inst:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_summer_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby2") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if inst.components.container:Has("trunk_winter", 1) then inst.components.container:ConsumeByName("trunk_winter", 1) local zoobaby = SpawnPrefab("butter") local pt1 = inst:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_winter_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby3") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if inst.components.container:Has("walrus_tusk", 1) then inst.components.container:ConsumeByName("walrus_tusk", 1) local zoobaby = SpawnPrefab("butter") local pt1 = inst:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("walrus") zoobaby.AnimState:SetBuild("walrus_baby_build") zoobaby.AnimState:PlayAnimation("idle_happy") zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.8,0.8,0.8) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGwalrus") zoobaby:AddTag("zoobaby4") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end if inst.components.container:Has("cave_banana", 1) then inst.components.container:ConsumeByName("cave_banana", 1) local zoobaby = SpawnPrefab("butter") local pt1 = inst:GetPosition() zoobaby.Transform:SetPosition(pt1.x-6, 0, pt1.z-6) zoobaby.AnimState:SetBank("kiki") zoobaby.AnimState:SetBuild("kiki_basic") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.soundtype = "" zoobaby.Transform:SetScale(1.2,1.2,1.2) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGmonkey") zoobaby:AddTag("zoobaby5") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") GetPlayer().components.inventory:ConsumeByName("goldnugget", 30) end end end } end if data and data.zooroom then inst.AnimState:SetBank("rabbithouse") inst.AnimState:SetBuild("rabbit_house") inst.AnimState:PlayAnimation("idle", true) inst.Transform:SetScale(0.4, 0.4, 0.4) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst.components.container.canbeopened = true inst.entity:AddLight() inst.Light:SetFalloff(1) inst.Light:SetIntensity(.8) inst.Light:SetRadius(15) inst.Light:SetColour(180/255, 195/255, 50/255) inst.Light:Enable(true) inst:AddTag("zooroom") inst:DoPeriodicTask(180, function(inst) local target = FindEntity(inst, 9, function(guy) return guy:HasTag("zoobaby") end ) if target then local target1 = FindEntity(inst, 9, function(guy) return guy.prefab == "poop" end ) if not target1 then for k = 1,math.random(5,10) do local pt2 = inst:GetPosition() SpawnPrefab("goldnugget").Transform:SetPosition(pt2.x+7.5, 0, pt2.z+7.5) end else for k = 1,math.random(1,3) do local pt2 = inst:GetPosition() SpawnPrefab("goldnugget").Transform:SetPosition(pt2.x+7.5, 0, pt2.z+7.5) end end if inst.components.container:Has("carrot", 3) then inst.components.container:ConsumeByName("carrot", 3) if math.random()<0.1 then if target:HasTag("zoobaby1") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("krampus") zoobaby.AnimState:SetBuild("krampus_build") zoobaby.AnimState:PlayAnimation("idle", true) zoobaby.entity:AddSoundEmitter() zoobaby.AnimState:Hide("SACK") zoobaby.AnimState:Show("ARM") zoobaby.Transform:SetScale(0.7,0.7,0.7) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkrampus") zoobaby:AddTag("zoobaby1") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby2") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_summer_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby2") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby3") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("koalefant") zoobaby.AnimState:SetBuild("koalefant_winter_build") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.5,0.5,0.5) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGkoalefant") zoobaby:AddTag("zoobaby3") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby4") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("walrus") zoobaby.AnimState:SetBuild("walrus_baby_build") zoobaby.AnimState:PlayAnimation("idle_happy") zoobaby.entity:AddSoundEmitter() zoobaby.Transform:SetScale(0.8,0.8,0.8) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGwalrus") zoobaby:AddTag("zoobaby4") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end if target:HasTag("zoobaby5") then local zoobaby = SpawnPrefab("butter") local pt4 = target:GetPosition() zoobaby.Transform:SetPosition(pt4.x, 0, pt4.z) zoobaby.AnimState:SetBank("kiki") zoobaby.AnimState:SetBuild("kiki_basic") zoobaby.AnimState:PlayAnimation("idle_loop", true) zoobaby.entity:AddSoundEmitter() zoobaby.soundtype = "" zoobaby.Transform:SetScale(1.2,1.2,1.2) zoobaby:AddComponent("locomotor") zoobaby.components.locomotor.walkspeed = 3 zoobaby.components.locomotor.runspeed = 6 zoobaby:SetStateGraph("SGmonkey") zoobaby:AddTag("zoobaby5") local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby.Transform:SetFourFaced() MakeCharacterPhysics(zoobaby, 15, .5) zoobaby:AddComponent("knownlocations") zoobaby:AddComponent("combat") zoobaby:AddComponent("health") zoobaby.components.health:SetMaxHealth(100) zoobaby:RemoveComponent("stackable") zoobaby:RemoveComponent("inventoryitem") zoobaby:RemoveComponent("edible") zoobaby:RemoveComponent("perishable") zoobaby:RemoveComponent("deployable") zoobaby:RemoveComponent("container") local minimap = zoobaby.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") zoobaby:AddComponent("follower") zoobaby.components.inspectable.getstatus = function(zoobaby) if not zoobaby:HasTag("followme") then local brain = require "brains/abigailbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(GetPlayer()) zoobaby.AnimState:SetBloomEffectHandle("shaders/anim.ksh") zoobaby:AddTag("followme") else local brain = require "brains/frogbrain" zoobaby:SetBrain(brain) zoobaby:RestartBrain() zoobaby.components.follower:SetLeader(nil) zoobaby.AnimState:SetBloomEffectHandle("") zoobaby:RemoveTag("followme") end end zoobaby:DoPeriodicTask(math.random(360, 480), function(zoobaby) SpawnPrefab("poop").Transform:SetPosition(zoobaby.Transform:GetWorldPosition()) end ) zoobaby:AddComponent("lootdropper") zoobaby.components.lootdropper:SetLoot({"smallmeat"}) zoobaby:AddTag("zoobaby") end end else target.components.health:Kill() end end end ) inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 10) for k,v in pairs(ents) do if v:HasTag("zoofence") or v:HasTag("brand") then SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") v:Remove() end end inst:Remove() end ) end if data and data.zoofence then inst.AnimState:SetBank("wall") inst.AnimState:SetBuild("wall_wood") inst.AnimState:PlayAnimation("1_2", false) MakeObstaclePhysics(inst, .5) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveComponent("container") inst:AddTag("zoofence") inst.components.inspectable.getstatus = function(inst) inst.Transform:SetScale(1, 0.1, 1) inst.Physics:SetActive(false) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:DoTaskInTime(5, function(inst) inst.Transform:SetScale(1, 1, 1) inst.Physics:SetActive(true) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") end ) end end if data and data.zoobaby1 then inst.AnimState:SetBank("krampus") inst.AnimState:SetBuild("krampus_build") inst.AnimState:PlayAnimation("idle", true) inst.entity:AddSoundEmitter() inst.AnimState:Hide("SACK") inst.AnimState:Show("ARM") inst.Transform:SetScale(0.7,0.7,0.7) inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 6 inst:SetStateGraph("SGkrampus") inst:AddTag("zoobaby1") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst.Transform:SetFourFaced() MakeCharacterPhysics(inst, 15, .5) inst:AddComponent("knownlocations") inst:AddComponent("combat") inst:AddComponent("health") inst.components.health:SetMaxHealth(100) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveComponent("container") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") inst:AddComponent("follower") inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("followme") then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) inst.AnimState:SetBloomEffectHandle("") inst:RemoveTag("followme") end end inst:DoPeriodicTask(math.random(360, 480), function(inst) SpawnPrefab("poop").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"smallmeat"}) inst:AddTag("zoobaby") end if data and data.zoobaby2 then inst.AnimState:SetBank("koalefant") inst.AnimState:SetBuild("koalefant_summer_build") inst.AnimState:PlayAnimation("idle_loop", true) inst.entity:AddSoundEmitter() inst.Transform:SetScale(0.5,0.5,0.5) inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 6 inst:SetStateGraph("SGkoalefant") inst:AddTag("zoobaby2") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst.Transform:SetFourFaced() MakeCharacterPhysics(inst, 15, .5) inst:AddComponent("knownlocations") inst:AddComponent("combat") inst:AddComponent("health") inst.components.health:SetMaxHealth(100) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveComponent("container") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") inst:AddComponent("follower") inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("followme") then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) inst.AnimState:SetBloomEffectHandle("") inst:RemoveTag("followme") end end inst:DoPeriodicTask(math.random(360, 480), function(inst) SpawnPrefab("poop").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"smallmeat"}) inst:AddTag("zoobaby") end if data and data.zoobaby3 then inst.AnimState:SetBank("koalefant") inst.AnimState:SetBuild("koalefant_winter_build") inst.AnimState:PlayAnimation("idle_loop", true) inst.entity:AddSoundEmitter() inst.Transform:SetScale(0.5,0.5,0.5) inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 6 inst:SetStateGraph("SGkoalefant") inst:AddTag("zoobaby3") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst.Transform:SetFourFaced() MakeCharacterPhysics(inst, 15, .5) inst:AddComponent("knownlocations") inst:AddComponent("combat") inst:AddComponent("health") inst.components.health:SetMaxHealth(100) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveComponent("container") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") inst:AddComponent("follower") inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("followme") then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) inst.AnimState:SetBloomEffectHandle("") inst:RemoveTag("followme") end end inst:DoPeriodicTask(math.random(360, 480), function(inst) SpawnPrefab("poop").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"smallmeat"}) inst:AddTag("zoobaby") end if data and data.zoobaby4 then inst.AnimState:SetBank("walrus") inst.AnimState:SetBuild("walrus_baby_build") inst.AnimState:PlayAnimation("idle_happy") inst.entity:AddSoundEmitter() inst.Transform:SetScale(0.8,0.8,0.8) inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 6 inst:SetStateGraph("SGwalrus") inst:AddTag("zoobaby4") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst.Transform:SetFourFaced() MakeCharacterPhysics(inst, 15, .5) inst:AddComponent("knownlocations") inst:AddComponent("combat") inst:AddComponent("health") inst.components.health:SetMaxHealth(100) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveComponent("container") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") inst:AddComponent("follower") inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("followme") then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) inst.AnimState:SetBloomEffectHandle("") inst:RemoveTag("followme") end end inst:DoPeriodicTask(math.random(360, 480), function(inst) SpawnPrefab("poop").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"smallmeat"}) inst:AddTag("zoobaby") end if data and data.zoobaby5 then inst.AnimState:SetBank("kiki") inst.AnimState:SetBuild("kiki_basic") inst.AnimState:PlayAnimation("idle_loop", true) inst.entity:AddSoundEmitter() inst.soundtype = "" inst.Transform:SetScale(1.2,1.2,1.2) inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 6 inst:SetStateGraph("SGmonkey") inst:AddTag("zoobaby5") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst.Transform:SetFourFaced() MakeCharacterPhysics(inst, 15, .5) inst:AddComponent("knownlocations") inst:AddComponent("combat") inst:AddComponent("health") inst.components.health:SetMaxHealth(100) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst:RemoveComponent("container") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("monkey_barrel.png") inst:AddComponent("follower") inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("followme") then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) inst.AnimState:SetBloomEffectHandle("") inst:RemoveTag("followme") end end inst:DoPeriodicTask(math.random(360, 480), function(inst) SpawnPrefab("poop").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"smallmeat"}) inst:AddTag("zoobaby") end if data and data.followme then local brain = require "brains/abigailbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") end end inst.OnSave = onsave inst.OnLoad = onload 即可在开阔的空地上,用黄油种动物园,在身上有30个黄金时,用鼠标左键点牌子,可打开格子,放入木炭点Buy按钮,可买一只小龙,花费30个黄金;放入夏象鼻点Buy按钮,可买小红象;放入冬象鼻点Buy按钮,可买小蓝象;放入海象牙点Buy按钮,可买小海象;放入香蕉点Buy按钮,可买猴子。鼠标左键点木栅栏,可开门,5秒后自动关门。鼠标左键点中间的胡萝卜房可打开格子,放入小动物爱吃的胡萝卜(每天消耗9个),当格子里的胡萝卜不足3个时,圈里的动物将陆续饿死。当动物园里有动物时,每天都能收到15-30个黄金的门票钱(放在牌子前面),动物会产便便,如果不及时清扫,门票钱将下降为正常的1/3。如果食物充足,小动物还有一定概率会繁殖,点胡萝卜房格子上方的Sell按钮,可卖掉圈舍中的动物,每只20个黄金。如果动物跑出圈舍,或想带领动物转场,就用鼠标左键点动物(手里不要拿武器),它会跟随你,再次用鼠标左键点动物,可以取消跟随。动物在小地图上显示为猴子的图标。不想要动物园时,用锤子砸掉胡萝卜房即可。黄油可以打蝴蝶获得,如果修改了“巨型超市”,也可花1-3个黄金购得

2025/04/23 · Bny

YN303-良种山羊(用闪电羊角种良种山羊,会生小羊,能跟随、产羊奶)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0三.良种山羊(用闪电羊角种良种山羊,会生小羊,能跟随、产羊奶) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/lightninggoathorn.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function OnDeploy (inst, pt) local goodgoat = SpawnPrefab("lightninggoathorn") goodgoat.Transform:SetPosition(pt.x, pt.y, pt.z) goodgoat.AnimState:SetBank("lightning_goat") goodgoat.AnimState:SetBuild("lightning_goat_build") goodgoat.AnimState:PlayAnimation("idle_loop", true) goodgoat.Transform:SetFourFaced() goodgoat.entity:AddSoundEmitter() local shadow = goodgoat.entity:AddDynamicShadow() shadow:SetSize(1.75,.75) MakeCharacterPhysics(goodgoat, 100, 1) goodgoat.entity:AddLight() goodgoat.Light:Enable(false) local minimap = goodgoat.entity:AddMiniMapEntity() minimap:SetIcon( "toothtrap.png" ) goodgoat:RemoveComponent("stackable") goodgoat:RemoveComponent("inventoryitem") goodgoat:RemoveComponent("deployable") goodgoat:AddComponent("knownlocations") goodgoat:AddComponent("leader") goodgoat:AddComponent("follower") goodgoat.components.follower:SetLeader(GetPlayer()) goodgoat.AnimState:SetBloomEffectHandle("shaders/anim.ksh") goodgoat:AddTag("followme") goodgoat:AddComponent("locomotor") goodgoat.components.locomotor.walkspeed = 4 goodgoat.components.locomotor.runspeed = 8 goodgoat:SetStateGraph("SGlightninggoat") local brain = require "brains/chesterbrain" goodgoat:SetBrain(brain) goodgoat:AddComponent("health") goodgoat.components.health:SetMaxHealth(200) goodgoat:AddComponent("combat") goodgoat.components.combat.hiteffectsymbol = "lightning_goat_body" goodgoat.components.combat:SetAttackPeriod(1) goodgoat.components.combat:SetRange(1, 2) goodgoat.components.combat:SetDefaultDamage(10) goodgoat:AddComponent("lootdropper") goodgoat.components.lootdropper:SetLoot({"meat","meat","meat","meat","meat","meat"}) goodgoat:ListenForEvent("attacked", function(goodgoat, data) if data.attacker ~= GetPlayer() then goodgoat.components.combat:SetTarget(data.attacker) goodgoat.components.combat:ShareTarget(data.attacker, 30, function(dude) return dude:HasTag("goodgoats") and not dude.components.health:IsDead() end, 10) else goodgoat.components.health:Kill() end end ) goodgoat.components.inspectable.getstatus = function(goodgoat) if not goodgoat:HasTag("followme") then local brain = require "brains/chesterbrain" goodgoat:SetBrain(brain) goodgoat:RestartBrain() goodgoat.components.follower:SetLeader(GetPlayer()) goodgoat.AnimState:SetBloomEffectHandle("shaders/anim.ksh") goodgoat:AddTag("followme") else local brain = require "brains/frogbrain" goodgoat:SetBrain(brain) goodgoat:RestartBrain() goodgoat.components.follower:SetLeader(nil) goodgoat.AnimState:SetBloomEffectHandle("") goodgoat:RemoveTag("followme") end end goodgoat:DoPeriodicTask(math.random(180, 360), function(goodgoat) SpawnPrefab("goatmilk").Transform:SetPosition(goodgoat.Transform:GetWorldPosition()) end ) goodgoat:ListenForEvent( "nighttime", function() if math.random()<.3 then local pt0 = goodgoat:GetPosition() local smallgoat = SpawnPrefab("lightninggoathorn") smallgoat.Transform:SetPosition(pt0.x, pt0.y, pt0.z) smallgoat.AnimState:SetBank("lightning_goat") smallgoat.AnimState:SetBuild("lightning_goat_build") smallgoat.AnimState:PlayAnimation("idle_loop", true) smallgoat.Transform:SetFourFaced() smallgoat.Transform:SetScale(0.6, 0.6, 0.6) smallgoat.entity:AddSoundEmitter() local shadow = smallgoat.entity:AddDynamicShadow() shadow:SetSize(1,.5) MakeCharacterPhysics(smallgoat, 60, 0.6) smallgoat.entity:AddLight() smallgoat.Light:Enable(false) local minimap = smallgoat.entity:AddMiniMapEntity() minimap:SetIcon( "toothtrap.png" ) smallgoat:RemoveComponent("stackable") smallgoat:RemoveComponent("inventoryitem") smallgoat:RemoveComponent("deployable") smallgoat:AddComponent("knownlocations") smallgoat:AddComponent("follower") smallgoat:AddComponent("locomotor") smallgoat.components.locomotor.walkspeed = 4 smallgoat.components.locomotor.runspeed = 8 smallgoat:SetStateGraph("SGlightninggoat") smallgoat:AddComponent("health") smallgoat.components.health:SetMaxHealth(100) smallgoat:AddComponent("combat") smallgoat.components.combat.hiteffectsymbol = "lightning_goat_body" smallgoat.components.combat:SetAttackPeriod(1) smallgoat.components.combat:SetRange(1, 2) smallgoat.components.combat:SetDefaultDamage(5) smallgoat:AddComponent("lootdropper") smallgoat.components.lootdropper:SetLoot({"meat","meat","meat","lightninggoathorn"}) smallgoat:ListenForEvent("attacked", function(smallgoat, data) if data.attacker ~= GetPlayer() then smallgoat.components.combat:SetTarget(data.attacker) smallgoat.components.combat:ShareTarget(data.attacker, 30, function(dude) return dude:HasTag("goodgoats") and not dude.components.health:IsDead() end, 10) else smallgoat.components.health:Kill() end end ) smallgoat:DoPeriodicTask(math.random(180, 360), function(smallgoat) SpawnPrefab("poop").Transform:SetPosition(smallgoat.Transform:GetWorldPosition()) end ) smallgoat:DoTaskInTime(1, function(smallgoat) local mama = FindEntity(smallgoat, 100, function(guy) return guy:HasTag("goodgoats") and guy.components.leader and guy.components.health and not guy.components.health:IsDead() end) if mama then local brain = require "brains/chesterbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(mama) else local brain = require "brains/frogbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(nil) end end ) smallgoat.components.inspectable.getstatus = function(smallgoat) local mama = FindEntity(smallgoat, 100, function(guy) return guy:HasTag("goodgoats") and guy.components.leader and guy.components.health and not guy.components.health:IsDead() end) if mama then local brain = require "brains/chesterbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(mama) else local brain = require "brains/frogbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(nil) end end smallgoat:AddTag("smallgoats") end end , GetWorld()) goodgoat:AddTag("goodgoats") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("goodgoats") then data.goodgoats = true end if inst:HasTag("followme") then data.followme = true end if inst:HasTag("smallgoats") then data.smallgoats = true end end local function onload(inst, data) if data and data.goodgoats then inst.AnimState:SetBank("lightning_goat") inst.AnimState:SetBuild("lightning_goat_build") inst.AnimState:PlayAnimation("idle_loop", true) inst.Transform:SetFourFaced() inst.entity:AddSoundEmitter() local shadow = inst.entity:AddDynamicShadow() shadow:SetSize(1.75,.75) MakeCharacterPhysics(inst, 100, 1) inst.entity:AddLight() inst.Light:Enable(false) local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "toothtrap.png" ) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("deployable") inst:AddComponent("knownlocations") inst:AddComponent("leader") inst:AddComponent("follower") inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 4 inst.components.locomotor.runspeed = 8 inst:SetStateGraph("SGlightninggoat") local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:AddComponent("health") inst.components.health:SetMaxHealth(200) inst:AddComponent("combat") inst.components.combat.hiteffectsymbol = "lightning_goat_body" inst.components.combat:SetAttackPeriod(1) inst.components.combat:SetRange(1, 2) inst.components.combat:SetDefaultDamage(10) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"meat","meat","meat","meat","meat","meat"}) inst:ListenForEvent("attacked", function(inst, data) if data.attacker ~= GetPlayer() then inst.components.combat:SetTarget(data.attacker) inst.components.combat:ShareTarget(data.attacker, 30, function(dude) return dude:HasTag("goodgoats") and not dude.components.health:IsDead() end, 10) else inst.components.health:Kill() end end ) inst.components.inspectable.getstatus = function(inst) if not inst:HasTag("followme") then local brain = require "brains/chesterbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) inst.AnimState:SetBloomEffectHandle("") inst:RemoveTag("followme") end end inst:DoPeriodicTask(math.random(180, 360), function(inst) SpawnPrefab("goatmilk").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) inst:ListenForEvent( "nighttime", function() if math.random()<.3 then local pt0 = inst:GetPosition() local smallgoat = SpawnPrefab("lightninggoathorn") smallgoat.Transform:SetPosition(pt0.x, pt0.y, pt0.z) smallgoat.AnimState:SetBank("lightning_goat") smallgoat.AnimState:SetBuild("lightning_goat_build") smallgoat.AnimState:PlayAnimation("idle_loop", true) smallgoat.Transform:SetFourFaced() smallgoat.Transform:SetScale(0.6, 0.6, 0.6) smallgoat.entity:AddSoundEmitter() local shadow = smallgoat.entity:AddDynamicShadow() shadow:SetSize(1,.5) MakeCharacterPhysics(smallgoat, 60, 0.6) smallgoat.entity:AddLight() smallgoat.Light:Enable(false) local minimap = smallgoat.entity:AddMiniMapEntity() minimap:SetIcon( "toothtrap.png" ) smallgoat:RemoveComponent("stackable") smallgoat:RemoveComponent("inventoryitem") smallgoat:RemoveComponent("deployable") smallgoat:AddComponent("knownlocations") smallgoat:AddComponent("follower") smallgoat:AddComponent("locomotor") smallgoat.components.locomotor.walkspeed = 4 smallgoat.components.locomotor.runspeed = 8 smallgoat:SetStateGraph("SGlightninggoat") smallgoat:AddComponent("health") smallgoat.components.health:SetMaxHealth(100) smallgoat:AddComponent("combat") smallgoat.components.combat.hiteffectsymbol = "lightning_goat_body" smallgoat.components.combat:SetAttackPeriod(1) smallgoat.components.combat:SetRange(1, 2) smallgoat.components.combat:SetDefaultDamage(5) smallgoat:AddComponent("lootdropper") smallgoat.components.lootdropper:SetLoot({"meat","meat","meat","lightninggoathorn"}) smallgoat:ListenForEvent("attacked", function(smallgoat, data) if data.attacker ~= GetPlayer() then smallgoat.components.combat:SetTarget(data.attacker) smallgoat.components.combat:ShareTarget(data.attacker, 30, function(dude) return dude:HasTag("goodgoats") and not dude.components.health:IsDead() end, 10) else smallgoat.components.health:Kill() end end ) smallgoat:DoPeriodicTask(math.random(180, 360), function(smallgoat) SpawnPrefab("poop").Transform:SetPosition(smallgoat.Transform:GetWorldPosition()) end ) smallgoat:DoTaskInTime(1, function(smallgoat) local mama = FindEntity(smallgoat, 100, function(guy) return guy:HasTag("goodgoats") and guy.components.leader and guy.components.health and not guy.components.health:IsDead() end) if mama then local brain = require "brains/chesterbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(mama) else local brain = require "brains/frogbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(nil) end end ) smallgoat.components.inspectable.getstatus = function(smallgoat) local mama = FindEntity(smallgoat, 100, function(guy) return guy:HasTag("goodgoats") and guy.components.leader and guy.components.health and not guy.components.health:IsDead() end) if mama then local brain = require "brains/chesterbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(mama) else local brain = require "brains/frogbrain" smallgoat:SetBrain(brain) smallgoat:RestartBrain() smallgoat.components.follower:SetLeader(nil) end end smallgoat:AddTag("smallgoats") end end , GetWorld()) inst:AddTag("goodgoats") end if data and data.followme then local brain = require "brains/chesterbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddTag("followme") end if data and data.smallgoats then inst.AnimState:SetBank("lightning_goat") inst.AnimState:SetBuild("lightning_goat_build") inst.AnimState:PlayAnimation("idle_loop", true) inst.Transform:SetFourFaced() inst.Transform:SetScale(0.6, 0.6, 0.6) inst.entity:AddSoundEmitter() local shadow = inst.entity:AddDynamicShadow() shadow:SetSize(1,.5) MakeCharacterPhysics(inst, 60, 0.6) inst.entity:AddLight() inst.Light:Enable(false) local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "toothtrap.png" ) inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("deployable") inst:AddComponent("knownlocations") inst:AddComponent("follower") inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 4 inst.components.locomotor.runspeed = 8 inst:SetStateGraph("SGlightninggoat") inst:AddComponent("health") inst.components.health:SetMaxHealth(100) inst:AddComponent("combat") inst.components.combat.hiteffectsymbol = "lightning_goat_body" inst.components.combat:SetAttackPeriod(1) inst.components.combat:SetRange(1, 2) inst.components.combat:SetDefaultDamage(5) inst:AddComponent("lootdropper") inst.components.lootdropper:SetLoot({"meat","meat","meat","lightninggoathorn"}) inst:ListenForEvent("attacked", function(inst, data) if data.attacker ~= GetPlayer() then inst.components.combat:SetTarget(data.attacker) inst.components.combat:ShareTarget(data.attacker, 30, function(dude) return dude:HasTag("goodgoats") and not dude.components.health:IsDead() end, 10) else inst.components.health:Kill() end end ) inst:DoPeriodicTask(math.random(180, 360), function(inst) SpawnPrefab("poop").Transform:SetPosition(inst.Transform:GetWorldPosition()) end ) inst:DoTaskInTime(1, function(inst) local mama = FindEntity(inst, 100, function(guy) return guy:HasTag("goodgoats") and guy.components.leader and guy.components.health and not guy.components.health:IsDead() end) if mama then local brain = require "brains/chesterbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(mama) else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) end end ) inst.components.inspectable.getstatus = function(inst) local mama = FindEntity(inst, 100, function(guy) return guy:HasTag("goodgoats") and guy.components.leader and guy.components.health and not guy.components.health:IsDead() end) if mama then local brain = require "brains/chesterbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(mama) else local brain = require "brains/frogbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(nil) end end inst:AddTag("smallgoats") end end inst.OnSave = onsave inst.OnLoad = onload 即可用闪电羊角种良种山羊,鼠标左键点山羊(手里不要拿武器,以免误伤)可跟随,再次点击取消跟随。良种山羊每天可产1-2份羊奶,夜里还有一定概率生下小羊,杀掉良种山羊可得6块大肉。小羊只跟随大羊,如果你杀掉了小羊的妈妈,它会乱跑,这时带一只大羊,用鼠标左键点小羊,可让它认新的妈妈。小羊会产便便,不会长大,可作为你的肉食来源,屠宰后得到3块大肉和闪电羊角,其中闪电羊角可用于再种良种山羊,逐步壮大你的羊群。良种山羊在小地图上显示为犬牙陷阱图标。闪电羊角可打闪电羊获得,如修改了“巨型超市”,也可花1-3个黄金购得

2025/04/23 · Bny

YN304-商业采矿机(用晶体管种商业采矿机,20个黄金租用一次,收购采出的矿石,赔钱、赚钱天注定)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0四.商业采矿机(用晶体管种商业采矿机,20个黄金租用一次,收购采出的矿石,赔钱、赚钱天注定) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/transistor.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function makeluckypit(inst) local pt = inst:GetPosition() local luckypit = SpawnPrefab("transistor") luckypit.Transform:SetPosition(pt.x, pt.y, pt.z) luckypit.AnimState:SetBank("coldfirepit") luckypit.AnimState:SetBuild("coldfirepit") luckypit.AnimState:PlayAnimation("idle",false) luckypit.entity:AddSoundEmitter() luckypit.Transform:SetScale(1.5,1.5,1.5) luckypit:RemoveComponent("stackable") luckypit:RemoveComponent("inventoryitem") luckypit:RemoveComponent("deployable") luckypit:AddComponent("workable") luckypit.components.workable:SetWorkAction(ACTIONS.HAMMER) luckypit.components.workable:SetWorkLeft(3) luckypit.components.workable:SetOnFinishCallback(function(luckypit) SpawnPrefab("collapse_big").Transform:SetPosition(luckypit.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") luckypit:Remove() end ) luckypit:AddComponent("trader") luckypit.components.trader:SetAcceptTest(function(luckypit, item) if GetPlayer().components.inventory:Has("goldnugget", 20) then if not luckypit:HasTag("domining") then if item.prefab == "goldnugget" then return true end end end if item.prefab == "rocks" or item.prefab == "nitre" or item.prefab == "flint" or item.prefab == "redgem" or item.prefab == "bluegem" or item.prefab == "purplegem" or item.prefab == "greengem" or item.prefab == "orangegem" or item.prefab == "yellowgem" or item.prefab == "thulecite" or item.prefab == "ice" then return true end return false end ) luckypit.components.trader.onaccept = function(luckypit, giver, item) if item.prefab == "goldnugget" then giver.components.inventory:ConsumeByName("goldnugget", 19) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") luckypit:AddTag("domining") luckypit.task = luckypit:DoPeriodicTask(1, function() local pt0 = luckypit:GetPosition() luckypit.AnimState:SetBloomEffectHandle("shaders/anim.ksh") luckypit:DoTaskInTime(0.5, function() luckypit.AnimState:SetBloomEffectHandle("") end ) SpawnPrefab("collapse_small").Transform:SetPosition(pt0.x, 1, pt0.z) luckypit.SoundEmitter:PlaySound("dontstarve/wilson/rock_break") GetPlayer().components.playercontroller:ShakeCamera(luckypit, "FULL", 0.7, 0.02, .5, 40) local ores = {"rocks","nitre","flint","redgem","bluegem","purplegem","greengem","orangegem","yellowgem","thulecite","ice","goldnugget","ash"} local ore = ores[math.random(#ores)] local myore = SpawnPrefab(ore) myore.Transform:SetPosition(pt0.x, 0, pt0.z) myore.components.inventoryitem.canbepickedup = false myore:AddComponent("complexprojectile") myore.components.complexprojectile.yOffset = 2.5 myore.components.complexprojectile:Launch(Point(pt0.x+(math.random(10)-math.random(10)), 0, pt0.z+(math.random(10)-math.random(10)))) myore.components.complexprojectile:SetOnHit(function() SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(myore.Transform:GetWorldPosition()) myore:RemoveComponent("complexprojectile") myore.components.inventoryitem.canbepickedup = true end ) end ) luckypit:DoTaskInTime(math.random(10,60), function() SpawnPrefab("collapse_big").Transform:SetPosition(luckypit.Transform:GetWorldPosition()) luckypit.SoundEmitter:PlaySound("dontstarve/common/destroy_wood") if luckypit.task then luckypit.task:Cancel() luckypit.task = nil end luckypit:RemoveTag("domining") end ) end if item.prefab == "thulecite" then for k = 1, 3 do local goldnugget = SpawnPrefab("goldnugget") giver.components.inventory:GiveItem(goldnugget) end end if item.prefab == "rocks" or item.prefab == "nitre" or item.prefab == "flint" or item.prefab == "redgem" or item.prefab == "bluegem" or item.prefab == "purplegem" or item.prefab == "greengem" or item.prefab == "orangegem" or item.prefab == "yellowgem" or item.prefab == "ice" then local goldnugget = SpawnPrefab("goldnugget") giver.components.inventory:GiveItem(goldnugget) end end luckypit:AddTag("luckypit") end local function OnDeploy (inst, pt) makeluckypit(inst) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("luckypit") then data.luckypit = true end end local function onload(inst, data) if data and data.luckypit then makeluckypit(inst) inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload 即可用晶体管种商业采矿机(拿着1个晶体管对地面点鼠标右键,如果拿着多个,则不会种出来),给它20个黄金(拿着黄金对采矿机点鼠标左键)可租用一次,采出的矿石数量不确定,还有一定概率采出灰。你可以将矿石留下自用,也可以卖给商业采矿机(拿着矿石对采矿机点鼠标左键),除铥矿石可卖3个黄金外,其余每个矿石可卖1个黄金,能否平衡你支付的租金,就要看天意了,开启矿业大亨的生涯吧。不想要商业采矿机了,用锤子砸掉即可。晶体管在精炼选项(画着白色宝石)下,用2个黄金、1个石砖制造

2025/04/23 · Bny

YN305-环保公司(用草种环保公司,将接收的垃圾搬到粉碎区,点铃粉碎后得黄金)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0五.环保公司(用草种环保公司,将接收的垃圾搬到粉碎区,点铃粉碎后得黄金) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cutgrass.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function makegrinder(inst) local pt = inst:GetPosition() local redmark = SpawnPrefab("cutgrass") redmark.Transform:SetPosition(pt.x, pt.y, pt.z) redmark.AnimState:SetBank("gridplacer") redmark.AnimState:SetBuild("gridplacer") redmark.AnimState:PlayAnimation("anim", true) redmark.Transform:SetScale(1.5, 1.5, 1.5) redmark.AnimState:SetOrientation( ANIM_ORIENTATION.OnGround ) redmark.AnimState:SetLayer( LAYER_BACKGROUND ) redmark.AnimState:SetSortOrder( 3 ) redmark.Transform:SetRotation( 45 ) redmark.AnimState:SetMultColour(255/255,0/255,0/255,1) redmark.AnimState:SetLightOverride(1) redmark:AddTag("NOCLICK") redmark:RemoveComponent("stackable") redmark:RemoveComponent("edible") redmark:RemoveComponent("tradable") redmark:RemoveComponent("fuel") redmark:RemoveComponent("burnable") redmark:RemoveComponent("propagator") redmark:RemoveComponent("repairer") redmark:RemoveComponent("inventoryitem") redmark:RemoveComponent("deployable") redmark:RemoveTag("cattoy") redmark:AddTag("redmark") local yellowmark = SpawnPrefab("cutgrass") yellowmark.Transform:SetPosition(pt.x-12.5, 0, pt.z+12.5) yellowmark.AnimState:SetBank("gridplacer") yellowmark.AnimState:SetBuild("gridplacer") yellowmark.AnimState:PlayAnimation("anim", true) yellowmark.Transform:SetScale(2, 2, 2) yellowmark.AnimState:SetOrientation( ANIM_ORIENTATION.OnGround ) yellowmark.AnimState:SetLayer( LAYER_BACKGROUND ) yellowmark.AnimState:SetSortOrder( 3 ) yellowmark.Transform:SetRotation( 45 ) yellowmark.AnimState:SetMultColour(255/255,255/255,0/255,1) yellowmark.AnimState:SetLightOverride(1) yellowmark:AddTag("NOCLICK") yellowmark:RemoveComponent("stackable") yellowmark:RemoveComponent("edible") yellowmark:RemoveComponent("tradable") yellowmark:RemoveComponent("fuel") yellowmark:RemoveComponent("burnable") yellowmark:RemoveComponent("propagator") yellowmark:RemoveComponent("repairer") yellowmark:RemoveComponent("inventoryitem") yellowmark:RemoveComponent("deployable") yellowmark:RemoveTag("cattoy") yellowmark:ListenForEvent( "daytime", function() for k = 1,math.random(6,12) do local pt1 = yellowmark:GetPosition() local trash = SpawnPrefab("cutgrass") trash.Transform:SetPosition(pt1.x+(math.random(6)-math.random(6)), 0, pt1.z+(math.random(6)-math.random(6))) trash.AnimState:SetBank("fertilizer") trash.AnimState:SetBuild("fertilizer") trash.AnimState:PlayAnimation("idle") trash.Transform:SetScale(1.5, 1.5, 1.5) trash.AnimState:SetMultColour(0/255,255/255,0/255,1) trash.components.inventoryitem:ChangeImageName("fertilizer") trash:RemoveComponent("stackable") trash:RemoveComponent("edible") trash:RemoveComponent("tradable") trash:RemoveComponent("fuel") trash:RemoveComponent("burnable") trash:RemoveComponent("propagator") trash:RemoveComponent("repairer") trash:RemoveComponent("deployable") trash:RemoveTag("cattoy") trash:AddComponent("named") trash.components.named:SetName("Refuse") trash.flies = trash:SpawnChild("flies") trash.components.inventoryitem:SetOnDroppedFn(function() trash.flies = trash:SpawnChild("flies") end ) trash.components.inventoryitem:SetOnPickupFn(function() if trash.flies then trash.flies:Remove() trash.flies = nil end end ) trash.components.inventoryitem:SetOnPutInInventoryFn(function() if trash.flies then trash.flies:Remove() trash.flies = nil end end ) MakeSmallBurnable(trash) MakeSmallPropagator(trash) trash:AddTag("trash") end end , GetWorld() ) yellowmark:ListenForEvent( "nighttime", function() for k = 1,math.random(3,5) do local pt1 = yellowmark:GetPosition() local trash = SpawnPrefab("cutgrass") trash.Transform:SetPosition(pt1.x+(math.random(6)-math.random(6)), 0, pt1.z+(math.random(6)-math.random(6))) trash.AnimState:SetBank("fertilizer") trash.AnimState:SetBuild("fertilizer") trash.AnimState:PlayAnimation("idle") trash.Transform:SetScale(1.5, 1.5, 1.5) trash.AnimState:SetMultColour(0/255,255/255,0/255,1) trash.components.inventoryitem:ChangeImageName("fertilizer") trash:RemoveComponent("stackable") trash:RemoveComponent("edible") trash:RemoveComponent("tradable") trash:RemoveComponent("fuel") trash:RemoveComponent("burnable") trash:RemoveComponent("propagator") trash:RemoveComponent("repairer") trash:RemoveComponent("deployable") trash:RemoveTag("cattoy") trash:AddComponent("named") trash.components.named:SetName("Refuse") trash.flies = trash:SpawnChild("flies") trash.components.inventoryitem:SetOnDroppedFn(function() trash.flies = trash:SpawnChild("flies") end ) trash.components.inventoryitem:SetOnPickupFn(function() if trash.flies then trash.flies:Remove() trash.flies = nil end end ) trash.components.inventoryitem:SetOnPutInInventoryFn(function() if trash.flies then trash.flies:Remove() trash.flies = nil end end ) MakeSmallBurnable(trash) MakeSmallPropagator(trash) trash:AddTag("trash") end end , GetWorld() ) yellowmark:ListenForEvent( "dusktime", function() for k = 1,math.random(5,7) do local pt1 = yellowmark:GetPosition() local trash = SpawnPrefab("cutgrass") trash.Transform:SetPosition(pt1.x+(math.random(6)-math.random(6)), 0, pt1.z+(math.random(6)-math.random(6))) trash.AnimState:SetBank("fertilizer") trash.AnimState:SetBuild("fertilizer") trash.AnimState:PlayAnimation("idle") trash.Transform:SetScale(1.5, 1.5, 1.5) trash.AnimState:SetMultColour(0/255,255/255,0/255,1) trash.components.inventoryitem:ChangeImageName("fertilizer") trash:RemoveComponent("stackable") trash:RemoveComponent("edible") trash:RemoveComponent("tradable") trash:RemoveComponent("fuel") trash:RemoveComponent("burnable") trash:RemoveComponent("propagator") trash:RemoveComponent("repairer") trash:RemoveComponent("deployable") trash:RemoveTag("cattoy") trash:AddComponent("named") trash.components.named:SetName("Refuse") trash.flies = trash:SpawnChild("flies") trash.components.inventoryitem:SetOnDroppedFn(function() trash.flies = trash:SpawnChild("flies") end ) trash.components.inventoryitem:SetOnPickupFn(function() if trash.flies then trash.flies:Remove() trash.flies = nil end end ) trash.components.inventoryitem:SetOnPutInInventoryFn(function() if trash.flies then trash.flies:Remove() trash.flies = nil end end ) MakeSmallBurnable(trash) MakeSmallPropagator(trash) trash:AddTag("trash") end end , GetWorld() ) yellowmark:AddTag("yellowmark") local footbell = SpawnPrefab("cutgrass") footbell.Transform:SetPosition(pt.x-5, 0, pt.z+5) footbell.AnimState:SetBank("bell") footbell.AnimState:SetBuild("bell") footbell.AnimState:PlayAnimation("idle") footbell.AnimState:SetMultColour(255/255,255/255,0/255,1) footbell.AnimState:SetBloomEffectHandle("shaders/anim.ksh") footbell:RemoveComponent("stackable") footbell:RemoveComponent("edible") footbell:RemoveComponent("tradable") footbell:RemoveComponent("fuel") footbell:RemoveComponent("burnable") footbell:RemoveComponent("propagator") footbell:RemoveComponent("repairer") footbell:RemoveComponent("inventoryitem") footbell:RemoveComponent("deployable") footbell:RemoveTag("cattoy") footbell:AddComponent("named") footbell.components.named:SetName("Bell") footbell:AddTag("footbell") footbell:AddComponent("workable") footbell.components.workable:SetWorkAction(ACTIONS.HAMMER) footbell.components.workable:SetWorkLeft(3) footbell.components.workable:SetOnFinishCallback(function() SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(footbell.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") local pos2 = Vector3(footbell.Transform:GetWorldPosition()) local ents2 = TheSim:FindEntities(pos2.x,pos2.y,pos2.z, 30) for k,v in pairs(ents2) do if v:HasTag("redmark") or v:HasTag("yellowmark") or v:HasTag("trash") or v:HasTag("footfoot") then SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) v:Remove() end end footbell:Remove() end ) footbell.components.inspectable.getstatus = function() GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") local foot = SpawnPrefab("cutgrass") foot.Transform:SetPosition(pt.x, 10, pt.z) foot.AnimState:SetBank("foot") foot.AnimState:SetBuild("foot_build") foot.AnimState:PlayAnimation("idle") foot.Transform:SetFourFaced() foot.Transform:SetRotation( 270 ) foot:RemoveComponent("stackable") foot:RemoveComponent("edible") foot:RemoveComponent("tradable") foot:RemoveComponent("fuel") foot:RemoveComponent("burnable") foot:RemoveComponent("propagator") foot:RemoveComponent("repairer") foot:RemoveComponent("inventoryitem") foot:RemoveComponent("deployable") foot:RemoveTag("cattoy") foot:AddTag("footfoot") foot.falling = foot:DoPeriodicTask(.01, function() foot.Physics:SetMotorVelOverride(0,-55,0) end) foot:DoTaskInTime(0.1, function() if foot.falling then foot.falling:Cancel() foot.falling = nil end GetPlayer().SoundEmitter:PlaySound("dontstarve_DLC001/creatures/glommer/foot_ground") GetPlayer().components.playercontroller:ShakeCamera(foot, "FULL", 0.5, 0.05, 2, 40) SpawnPrefab("collapse_big").Transform:SetPosition(pt.x, 0, pt.z) local pos = Vector3(foot.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,0,pos.z, 5) for k,v in pairs(ents) do if v:HasTag("trash") and v.components.inventoryitem and not v.components.inventoryitem:IsHeld() then SpawnPrefab("goldnugget").Transform:SetPosition(v.Transform:GetWorldPosition()) v:Remove() end if v:HasTag("player") then v.AnimState:PlayAnimation("hit") v.components.health:DoDelta(-5) end end foot:DoTaskInTime(0.5, function() GetPlayer().SoundEmitter:PlaySound("dontstarve/common/stone_drop") SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(foot.Transform:GetWorldPosition()) foot:Remove() end ) end ) end end local function OnDeploy (inst, pt) makegrinder(inst) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("redmark") then data.redmark = true end if inst:HasTag("yellowmark") then data.yellowmark = true end if inst:HasTag("trash") then data.trash = true end if inst:HasTag("footbell") then data.footbell = true end if inst:HasTag("footfoot") then data.footfoot = true end end local function onload(inst, data) if data and data.redmark then makegrinder(inst) inst:Remove() end if data and data.yellowmark then inst:Remove() end if data and data.footbell then inst:Remove() end if data and data.footfoot then inst:Remove() end if data and data.trash then inst.AnimState:SetBank("fertilizer") inst.AnimState:SetBuild("fertilizer") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(1.5, 1.5, 1.5) inst.AnimState:SetMultColour(0/255,255/255,0/255,1) inst.components.inventoryitem:ChangeImageName("fertilizer") inst:RemoveComponent("stackable") inst:RemoveComponent("edible") inst:RemoveComponent("tradable") inst:RemoveComponent("fuel") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("repairer") inst:RemoveComponent("deployable") inst:RemoveTag("cattoy") inst:AddComponent("named") inst.components.named:SetName("Refuse") inst.flies = inst:SpawnChild("flies") inst.components.inventoryitem:SetOnDroppedFn(function() inst.flies = inst:SpawnChild("flies") end ) inst.components.inventoryitem:SetOnPickupFn(function() if inst.flies then inst.flies:Remove() inst.flies = nil end end ) inst.components.inventoryitem:SetOnPutInInventoryFn(function() if inst.flies then inst.flies:Remove() inst.flies = nil end end ) MakeSmallBurnable(inst) MakeSmallPropagator(inst) inst:AddTag("trash") end end inst.OnSave = onsave inst.OnLoad = onload 即可在开阔的空地上,用草种环保公司(拿着1个草对地面点鼠标右键,如果拿着多个,则不会种出来),每天白天、傍晚、黑夜都会有垃圾被送到黄区,将它们搬到红区后,鼠标左键点地上的铃,可将垃圾粉碎,其中的贵金属(黄金)将留在地上,这就是环保公司的收入来源。粉碎垃圾时,不要站在红区附近,会被砸伤(减5点血)。黄区的垃圾如不及时清理,会越来越多,如果实在处理不过来,可以将垃圾烧掉,但那样就没有收入了。这是饥荒世界唯一一家环保公司,整块大陆的清洁就仰赖你了,承担起这肮脏而又崇高的事业吧。不想要环保公司了,用锤子砸掉铃即可

2025/04/23 · Bny

YN306-生鲜售卖机(用木板种生鲜售卖机,放入生鲜产品,每天清晨自动卖出换黄金)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0六.生鲜售卖机(用木板种生鲜售卖机,放入生鲜产品,每天清晨自动卖出换黄金) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/boards.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function OnDeploy (inst, pt) local vending = SpawnPrefab("boards") vending.Transform:SetPosition(pt.x, pt.y, pt.z) vending.AnimState:SetBank("icebox") vending.AnimState:SetBuild("ice_box") vending.AnimState:PlayAnimation("closed") vending.Transform:SetScale(1.3, 1.3, 1.3) vending.AnimState:SetMultColour(255/255,255/255,0/255,1) vending:RemoveComponent("stackable") vending:RemoveComponent("tradable") vending:RemoveComponent("edible") vending:RemoveComponent("inventoryitem") vending:RemoveComponent("repairer") vending:RemoveComponent("fuel") vending:RemoveComponent("burnable") vending:RemoveComponent("propagator") vending:RemoveComponent("deployable") vending.components.container.canbeopened = true vending:DoPeriodicTask(2, function(vending) vending.AnimState:SetBloomEffectHandle("shaders/anim.ksh") vending:DoTaskInTime(1, function() vending.AnimState:SetBloomEffectHandle("") end ) end ) vending:AddComponent("workable") vending.components.workable:SetWorkAction(ACTIONS.HAMMER) vending.components.workable:SetWorkLeft(3) vending.components.workable:SetOnFinishCallback(function(vending) SpawnPrefab("collapse_big").Transform:SetPosition(vending.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") vending:Remove() end ) vending:ListenForEvent( "daytime", function() local num_found = 0 for k,v in pairs(vending.components.container.slots) do if v and v.prefab ~= "goldnugget" and v.prefab ~= "spoiled_food" then num_found = num_found + v.components.stackable:StackSize() v:Remove() end end for k = 1, num_found do local goldnugget = SpawnPrefab("goldnugget") vending.components.container:GiveItem(goldnugget) end end, GetWorld()) vending:AddTag("vendings") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("vendings") then data.vendings = true end end local function onload(inst, data) if data and data.vendings then inst.AnimState:SetBank("icebox") inst.AnimState:SetBuild("ice_box") inst.AnimState:PlayAnimation("closed") inst.Transform:SetScale(1.3, 1.3, 1.3) inst.AnimState:SetMultColour(255/255,255/255,0/255,1) inst:RemoveComponent("stackable") inst:RemoveComponent("tradable") inst:RemoveComponent("edible") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("repairer") inst:RemoveComponent("fuel") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst.components.container.canbeopened = true inst:DoPeriodicTask(2, function(inst) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:DoTaskInTime(1, function() inst.AnimState:SetBloomEffectHandle("") end ) end ) inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:Remove() end ) inst:ListenForEvent( "daytime", function() local num_found = 0 for k,v in pairs(inst.components.container.slots) do if v and v.prefab ~= "goldnugget" and v.prefab ~= "spoiled_food" then num_found = num_found + v.components.stackable:StackSize() v:Remove() end end for k = 1, num_found do local goldnugget = SpawnPrefab("goldnugget") inst.components.container:GiveItem(goldnugget) end end, GetWorld()) inst:AddTag("vendings") end end inst.OnSave = onsave inst.OnLoad = onload local slotpos = {} for y = 3, 0, -1 do for x = 0, 2 do table.insert(slotpos, Vector3(75*x-75*2+75, 75*y-75*2+75,0)) end end inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,100,0) inst.components.container.side_align_tip = 160 inst.components.container.canbeopened = false inst.components.container.onopenfn = function(inst) inst.AnimState:PlayAnimation("open") GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst.components.container.onclosefn = function(inst) inst.AnimState:PlayAnimation("close") GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst.components.container.itemtestfn = function(inst, item, slot) if item.prefab == "cave_banana" or item.prefab == "carrot" or item.prefab == "corn" or item.prefab == "pumpkin" or item.prefab == "eggplant" or item.prefab == "durian" or item.prefab == "pomegranate" or item.prefab == "dragonfruit" or item.prefab == "berries" or item.prefab == "cactus_meat" or item.prefab == "watermelon" or item.prefab == "acorn" or 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 == "spoiled_food" or item.prefab == "butter" or item.prefab == "butterflywings" or item.prefab == "cutlichen" or item.prefab == "foliage" or item.prefab == "honey" or item.prefab == "lightbulb" or item.prefab == "red_cap" or item.prefab == "green_cap" or item.prefab == "blue_cap" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "goatmilk" or item.prefab == "goldnugget" then return true end return false end inst:AddTag("fridge") 即可用木板种生鲜售卖机,鼠标左键点售卖机,可打开格子,将蔬菜和肉类等生鲜产品放入格子中,每天清晨将全部卖出,每个售价1个黄金,结算的黄金在售卖机中领取。有了生鲜售卖机,不用发愁过剩的产品不好销售了。可以出售的生鲜产品包括香蕉、胡萝卜、玉米、南瓜、茄子、榴莲、石榴、火龙果、浆果、仙人掌肉、西瓜、橡果、大肉、小肉、鱼、鳗鱼、鸡腿、鸟蛋、蛙腿、疯肉、黄油、蝴蝶翅膀、苔藓、叶子、蜂蜜、荧光果、红蘑菇、绿蘑菇、蓝蘑菇、花瓣、噩梦花瓣。不想要生鲜售卖机了,用锤子砸掉即可。不要与“用木板种鱼人房”一同修改

2025/04/23 · Bny

YN307-炸弹客(用红色护身符种炸弹客,购买遥控炸弹,放在地上按键盘Delete键引爆)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0七.炸弹客(用红色护身符种炸弹客,购买遥控炸弹,放在地上按键盘Delete键引爆) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("playeractionpicker")的下一行插入以下内容: TheInput:AddKeyUpHandler(KEY_DELETE, function() GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") inst:DoTaskInTime(0.1, function() local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 100) for k,v in pairs(ents) do if v:HasTag("bomballright") and v.components.inventoryitem and not v.components.inventoryitem:IsHeld() then local pos1 = Vector3(v.Transform:GetWorldPosition()) local ents1 = TheSim:FindEntities(pos1.x,pos1.y,pos1.z, 15) for k,i in pairs(ents1) do if i.components.combat and i.components.health and not i.components.health:IsDead() and not i:HasTag("player") then SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(i.Transform:GetWorldPosition()) i.components.health:Kill() end if i.components.workable and i.components.workable.workleft > 0 and not i.components.inventoryitem then SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(i.Transform:GetWorldPosition()) i.components.workable:Destroy(v) end end GetPlayer().SoundEmitter:PlaySound("dontstarve_DLC001/creatures/glommer/foot_ground") SpawnPrefab("collapse_big").Transform:SetPosition(v.Transform:GetWorldPosition()) SpawnPrefab("explode_small").Transform:SetPosition(v.Transform:GetWorldPosition()) SpawnPrefab("groundpoundring_fx").Transform:SetPosition(v.Transform:GetWorldPosition()) GetClock():DoLightningLighting() GetPlayer().components.playercontroller:ShakeCamera(v, "FULL", 0.7, 0.02, .5, 40) v:Remove() end end end ) end ) 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/amulet.lua文件,在inst.AnimState:PlayAnimation("redamulet")的下一行插入以下内容: local function makebomber(inst) local pt = inst:GetPosition() local bomber = SpawnPrefab("amulet") bomber.Transform:SetPosition(pt.x, pt.y, pt.z) bomber.AnimState:SetBank("wilson") bomber.AnimState:SetBuild("wx78") bomber.AnimState:OverrideSymbol("swap_hat", "hat_catcoon", "swap_hat") bomber.AnimState:OverrideSymbol("swap_body", "swap_krampus_sack", "backpack") bomber.AnimState:OverrideSymbol("swap_body", "swap_krampus_sack", "swap_body") bomber.AnimState:Show("HAT") bomber.AnimState:Show("HAT_HAIR") bomber.AnimState:Hide("HAIR_NOHAT") bomber.AnimState:Hide("HAIR") bomber.AnimState:Hide("ARM_carry") bomber.AnimState:Show("ARM_normal") bomber.Transform:SetFourFaced() bomber.AnimState:PlayAnimation("idle") bomber:RemoveComponent("equippable") bomber:RemoveComponent("inventoryitem") bomber:RemoveComponent("finiteuses") bomber:RemoveComponent("deployable") MakeLargeBurnable(bomber) MakeLargePropagator(bomber) bomber:AddComponent("trader") bomber.components.trader:SetAcceptTest(function(bomber, item) if GetPlayer().components.inventory:Has("goldnugget", 10) then if item.prefab == "goldnugget" then return true end end return false end ) bomber.components.trader.onaccept = function(bomber, giver, item) GetPlayer().components.inventory:ConsumeByName("goldnugget", 9) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") bomber.AnimState:PlayAnimation("give") local bomb = SpawnPrefab("amulet") bomb.AnimState:SetBank("bee_mine_maxwell") bomb.AnimState:SetBuild("bee_mine_maxwell") bomb.AnimState:PlayAnimation("idle") bomb.Transform:SetScale(0.8, 0.8, 0.8) bomb.AnimState:SetMultColour(255/255,255/255,0/255,1) bomb.AnimState:SetBloomEffectHandle("shaders/anim.ksh") bomb:AddComponent("named") bomb.components.named:SetName("Bomb") local minimap = bomb.entity:AddMiniMapEntity() minimap:SetIcon( "beemine.png" ) bomb:RemoveComponent("equippable") bomb:RemoveComponent("inventoryitem") bomb:RemoveComponent("finiteuses") bomb:RemoveComponent("deployable") bomb:AddComponent("inventoryitem") bomb.components.inventoryitem:ChangeImageName("beemine") bomb.components.inventoryitem:SetOnDroppedFn(function() bomb:AddTag("bomballright") end ) bomb.components.inventoryitem:SetOnPickupFn(function() bomb:RemoveTag("bomballright") end ) bomb.components.inventoryitem:SetOnPutInInventoryFn(function() bomb:RemoveTag("bomballright") end ) bomb:AddTag("bomb") GetPlayer().components.inventory:GiveItem(bomb) end bomber:AddTag("bomber") for k = 1, 11 do local result_offset = FindValidPositionByFan(1 * 2 * PI, 2, 11, function(offset) local x,y,z = (pt + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end) if result_offset then local bombbye = SpawnPrefab("amulet") bombbye.Transform:SetPosition((pt + result_offset):Get()) bombbye.AnimState:SetBank("bee_mine_maxwell") bombbye.AnimState:SetBuild("bee_mine_maxwell") bombbye.AnimState:PlayAnimation("idle") bombbye.Transform:SetScale(0.8, 0.8, 0.8) bombbye.AnimState:SetMultColour(255/255,255/255,0/255,1) bombbye.AnimState:SetBloomEffectHandle("shaders/anim.ksh") bombbye:RemoveComponent("equippable") bombbye:RemoveComponent("inventoryitem") bombbye:RemoveComponent("finiteuses") bombbye:RemoveComponent("deployable") MakeLargeBurnable(bombbye) MakeLargePropagator(bombbye) bombbye:AddTag("NOCLICK") bombbye:AddTag("bombbye") end end end local function OnDeploy (inst, pt) makebomber(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("bomber") then data.bomber = true end if inst:HasTag("bombbye") then data.bombbye = true end if inst:HasTag("bomb") then data.bomb = true end if inst:HasTag("bomballright") then data.bomballright = true end end local function onload(inst, data) if data and data.bomber then makebomber(inst) inst:Remove() end if data and data.bombbye then inst:Remove() end if data and data.bomb then inst.AnimState:SetBank("bee_mine_maxwell") inst.AnimState:SetBuild("bee_mine_maxwell") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.8, 0.8, 0.8) inst.AnimState:SetMultColour(255/255,255/255,0/255,1) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:AddComponent("named") inst.components.named:SetName("Bomb") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "beemine.png" ) inst:RemoveComponent("equippable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("finiteuses") inst:RemoveComponent("deployable") inst:AddComponent("inventoryitem") inst.components.inventoryitem:ChangeImageName("beemine") inst.components.inventoryitem:SetOnDroppedFn(function() inst:AddTag("bomballright") end ) inst.components.inventoryitem:SetOnPickupFn(function() inst:RemoveTag("bomballright") end ) inst.components.inventoryitem:SetOnPutInInventoryFn(function() inst:RemoveTag("bomballright") end ) inst:AddTag("bomb") end if data and data.bomballright then inst:AddTag("bomballright") end end inst.OnSave = onsave inst.OnLoad = onload 即可用红色护身符种炸弹客,给炸弹客10个黄金(拿着黄金对炸弹客点鼠标左键),可购买遥控炸弹,将炸弹放在地上,按键盘Delete键可遥控引爆,能炸死除主角外的任何生物,炸毁建筑、树木等。遥控炸弹在小地图上显示为炸弹图标,引爆时不要让同伴靠近。不想要炸弹客了,烧掉即可(拿着火炬对其点鼠标右键)。红色护身符在魔法选项(画着红骷髅)下,用3个黄金、2个噩梦燃料、1个红宝石制造

2025/04/23 · Bny

YN308-百变存钱罐(用鱼竿种百变存钱罐,每天获得3个黄金的零花钱,可变外型、防雷击、照明、补脑)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0八.百变存钱罐(用鱼竿种百变存钱罐,每天获得3个黄金的零花钱,可变外型、防雷击、照明、补脑) 用MT管理器打开游戏目录/assets/scripts/prefabs/fishingrod.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function itemtest(inst, item, slot) if item.prefab == "goldnugget" then return true end return false end local slotpos = { Vector3(0,-75,0)} local widgetbuttoninfo = { text = "Change", position = Vector3(0, -15, 0), fn = function(inst) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst:RemoveTag("doll_1") inst:RemoveTag("doll_2") inst:RemoveTag("doll_3") inst:RemoveTag("doll_4") inst:RemoveTag("doll_5") inst:RemoveTag("doll_6") inst:RemoveTag("doll_7") inst:RemoveTag("doll_8") inst:RemoveTag("doll_9") inst:RemoveTag("doll_10") if math.random()<.08 then inst:AddTag("doll_1") inst.AnimState:SetBank("bearger") inst.AnimState:SetBuild("bearger_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.2,0.2,0.2) elseif math.random()<.16 then inst:AddTag("doll_2") inst.AnimState:SetBank("lightning_goat") inst.AnimState:SetBuild("lightning_goat_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.6,0.6,0.6) elseif math.random()<.24 then inst:AddTag("doll_3") inst.AnimState:SetBank("leif") inst.AnimState:SetBuild("leif_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.35,0.35,0.35) elseif math.random()<.32 then inst:AddTag("doll_4") inst.AnimState:SetBank("beefalo") inst.AnimState:SetBuild("beefalo_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.5,0.5,0.5) elseif math.random()<.4 then inst:AddTag("doll_5") inst.AnimState:SetBank("rook") inst.AnimState:SetBuild("rook_build") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) elseif math.random()<.48 then inst:AddTag("doll_6") inst.AnimState:SetBank("deerclops") inst.AnimState:SetBuild("deerclops_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.35,0.35,0.35) elseif math.random()<.56 then inst:AddTag("doll_7") inst.AnimState:SetBank("rook") inst.AnimState:SetBuild("rook_rhino") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) elseif math.random()<.64 then inst:AddTag("doll_8") inst.AnimState:SetBank("Pig_King") inst.AnimState:SetBuild("Pig_King") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.4,0.4,0.4) elseif math.random()<.72 then inst:AddTag("doll_9") inst.AnimState:SetBank("goosemoose") inst.AnimState:SetBuild("goosemoose_build") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) elseif math.random()<.95 then inst:AddTag("doll_10") inst.AnimState:SetBank("dragonfly") inst.AnimState:SetBuild("dragonfly_build") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) else inst.AnimState:SetBank("trinkets") inst.AnimState:SetBuild("trinkets") inst.AnimState:PlayAnimation(tostring(4)) inst.Transform:SetScale(1.5,1.5,1.5) end end } local function OnDeploy (inst, pt) local doll = SpawnPrefab("fishingrod") doll.Transform:SetPosition(pt.x, pt.y, pt.z) doll.AnimState:SetBank("trinkets") doll.AnimState:SetBuild("trinkets") doll.AnimState:PlayAnimation(tostring(4)) doll.Transform:SetFourFaced() doll.Transform:SetScale(1.5,1.5,1.5) local light = doll.entity:AddLight() light:SetFalloff(0.5) light:SetIntensity(.8) light:SetRadius(3.0) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) MakeObstaclePhysics(doll, 0.5) doll:RemoveComponent("fishingrod") doll:RemoveComponent("finiteuses") doll:RemoveComponent("inventoryitem") doll:RemoveComponent("equippable") if doll.components.weapon then doll:RemoveComponent("weapon") end doll:RemoveComponent("deployable") doll.components.container.canbeopened = true doll:AddComponent("named") doll.components.named:SetName("Piggy bank") doll:AddComponent("sanityaura") doll.components.sanityaura.aura = TUNING.SANITYAURA_MED doll:AddTag("lightningrod") doll:ListenForEvent("lightningstrike", function() doll.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) doll:DoTaskInTime(60, function() doll.AnimState:SetBloomEffectHandle("") end ) end ) doll:AddComponent("workable") doll.components.workable:SetWorkAction(ACTIONS.HAMMER) doll.components.workable:SetWorkLeft(3) doll.components.workable:SetOnFinishCallback(function(doll) doll.Light:Enable(false) doll.components.container:DropEverything() SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(doll.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") doll:Remove() end ) doll:ListenForEvent( "daytime", function() for k = 1, 3 do local goldnugget = SpawnPrefab("goldnugget") doll.components.container:GiveItem(goldnugget) end end, GetWorld()) doll:AddTag("scarytoprey") doll:AddTag("dolls") inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("dolls") then data.dolls = true end if inst:HasTag("doll_1") then data.doll_1 = true end if inst:HasTag("doll_2") then data.doll_2 = true end if inst:HasTag("doll_3") then data.doll_3 = true end if inst:HasTag("doll_4") then data.doll_4 = true end if inst:HasTag("doll_5") then data.doll_5 = true end if inst:HasTag("doll_6") then data.doll_6 = true end if inst:HasTag("doll_7") then data.doll_7 = true end if inst:HasTag("doll_8") then data.doll_8 = true end if inst:HasTag("doll_9") then data.doll_9 = true end if inst:HasTag("doll_10") then data.doll_10 = true end end local function onload(inst, data) if data and data.dolls then inst.AnimState:SetBank("trinkets") inst.AnimState:SetBuild("trinkets") inst.AnimState:PlayAnimation(tostring(4)) inst.Transform:SetFourFaced() inst.Transform:SetScale(1.5,1.5,1.5) local light = inst.entity:AddLight() light:SetFalloff(0.5) light:SetIntensity(.8) light:SetRadius(3.0) light:SetColour(180/255, 195/255, 50/255) light:Enable(true) MakeObstaclePhysics(inst, 0.5) inst:RemoveComponent("fishingrod") inst:RemoveComponent("finiteuses") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("equippable") if inst.components.weapon then inst:RemoveComponent("weapon") end inst:RemoveComponent("deployable") inst.components.container.canbeopened = true inst:AddComponent("named") inst.components.named:SetName("Piggy bank") inst:AddComponent("sanityaura") inst.components.sanityaura.aura = TUNING.SANITYAURA_MED inst:AddTag("lightningrod") inst:ListenForEvent("lightningstrike", function() inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) inst:DoTaskInTime(60, function() inst.AnimState:SetBloomEffectHandle("") end ) end ) inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) inst.Light:Enable(false) inst.components.container:DropEverything() SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:Remove() end ) inst:ListenForEvent( "daytime", function() for k = 1, 3 do local goldnugget = SpawnPrefab("goldnugget") inst.components.container:GiveItem(goldnugget) end end, GetWorld()) inst:AddTag("scarytoprey") inst:AddTag("dolls") end if data and data.doll_1 then inst:AddTag("doll_1") inst.AnimState:SetBank("bearger") inst.AnimState:SetBuild("bearger_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.2,0.2,0.2) end if data and data.doll_2 then inst:AddTag("doll_2") inst.AnimState:SetBank("lightning_goat") inst.AnimState:SetBuild("lightning_goat_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.6,0.6,0.6) end if data and data.doll_3 then inst:AddTag("doll_3") inst.AnimState:SetBank("leif") inst.AnimState:SetBuild("leif_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.35,0.35,0.35) end if data and data.doll_4 then inst:AddTag("doll_4") inst.AnimState:SetBank("beefalo") inst.AnimState:SetBuild("beefalo_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.5,0.5,0.5) end if data and data.doll_5 then inst:AddTag("doll_5") inst.AnimState:SetBank("rook") inst.AnimState:SetBuild("rook_build") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) end if data and data.doll_6 then inst:AddTag("doll_6") inst.AnimState:SetBank("deerclops") inst.AnimState:SetBuild("deerclops_build") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.35,0.35,0.35) end if data and data.doll_7 then inst:AddTag("doll_7") inst.AnimState:SetBank("rook") inst.AnimState:SetBuild("rook_rhino") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) end if data and data.doll_8 then inst:AddTag("doll_8") inst.AnimState:SetBank("Pig_King") inst.AnimState:SetBuild("Pig_King") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.4,0.4,0.4) end if data and data.doll_9 then inst:AddTag("doll_9") inst.AnimState:SetBank("goosemoose") inst.AnimState:SetBuild("goosemoose_build") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) end if data and data.doll_10 then inst:AddTag("doll_10") inst.AnimState:SetBank("dragonfly") inst.AnimState:SetBuild("dragonfly_build") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(0.3,0.3,0.3) end end inst.OnSave = onsave inst.OnLoad = onload inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,150,0) inst.components.container.side_align_tip = 160 inst.components.container.itemtestfn = itemtest inst.components.container.widgetbuttoninfo = widgetbuttoninfo inst.components.container.canbeopened = false 即可用鱼竿种百变存钱罐,鼠标左键点存钱罐可打开格子,每天将获得3个黄金的零花钱,在格子中拿取。点格子上方的“Change”按钮,可使存钱罐改换为巨鹿、猪王、熊等造型。百变存钱罐放在家中,可防雷击、照明,靠近会补脑,并且可以吓阻火鸡、兔子等小动物,让它们不敢偷吃你扔在地上的食物。不想要百变存钱罐了,用锤子砸掉即可,里面的黄金会掉在地上。鱼竿在生存选项(画着绳套)下,用2个树枝、2个蛛丝制造

2025/04/23 · Bny

YN309-度假营地(按键盘B键租赁度假营地,各种设施一应俱全,再按B键退房)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三0九.度假营地(按键盘B键租赁度假营地,各种设施一应俱全,再按B键退房) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("playeractionpicker")的下一行插入以下内容: TheInput:AddKeyUpHandler(KEY_B, function() if not inst:HasTag("campsite") then if inst.components.inventory:Has("goldnugget", 50) then inst.components.inventory:ConsumeByName("goldnugget", 50) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") inst:AddTag("campsite") local pt = inst:GetPosition() local pt0 = Vector3(inst.Transform:GetWorldPosition()) for k = 1, 50 do local result_offset = FindValidPositionByFan(1 * 2 * PI, 8.5, 50, function(offset) local x,y,z = (pt0 + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end ) if result_offset then local wall = SpawnPrefab("wall_wood") wall.Transform:SetScale(0.65,0.65,0.65) MakeObstaclePhysics(wall, .25) wall:RemoveComponent("workable") wall.components.health:SetInvincible(true) wall.persists = false wall:AddTag("tempbuilding") wall.Transform:SetPosition((pt0 + result_offset):Get()) wall.components.inspectable.getstatus = function(wall) wall.Transform:SetScale(0.65, 0.1, 0.65) wall.Physics:SetActive(false) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") wall:DoTaskInTime(5, function(wall) wall.Transform:SetScale(0.65, 0.65, 0.65) wall.Physics:SetActive(true) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") end ) end end end local building1 = SpawnPrefab("tent") building1.Transform:SetPosition(pt.x-4, 0, pt.z-4) building1.AnimState:SetMultColour(255/255,105/255,0/255,1) building1.persists = false building1:AddTag("tempbuilding") local building2 = SpawnPrefab("ancient_altar") building2.Transform:SetPosition(pt.x-4+2.5, 0, pt.z-4-2.5) building2.Transform:SetScale(0.45,0.45,0.45) building2.persists = false building2:AddTag("NOCLICK") building2:AddTag("tempbuilding") local building3 = SpawnPrefab("lightning_rod") building3.Transform:SetPosition(pt.x-4-2.4, 0, pt.z-4+2.4) building3.Transform:SetScale(0.7,0.7,0.7) building3.persists = false building3:AddTag("NOCLICK") building3:AddTag("tempbuilding") local building4 = SpawnPrefab("ruins_table") building4.Transform:SetPosition(pt.x+3.3, 0, pt.z-3.3) building4.persists = false building4:AddTag("NOCLICK") building4:AddTag("tempbuilding") local building5 = SpawnPrefab("ruins_chair") building5.Transform:SetPosition(pt.x+4.9, 0, pt.z-4.9) building5.persists = false building5:AddTag("NOCLICK") building5:AddTag("tempbuilding") local building6 = SpawnPrefab("cookpot") building6.Transform:SetPosition(pt.x+4.3, 0, pt.z+4.3) building6.Transform:SetScale(0.7,0.7,0.7) building6.persists = false building6:AddTag("tempbuilding") local building7 = SpawnPrefab("icebox") building7.Transform:SetPosition(pt.x+4.5-1.3, 0, pt.z+4.5+1.3) building7.persists = false building7:AddTag("tempbuilding") for k = 1, 3 do local foodnames = {"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"} local foodname = foodnames[math.random(#foodnames)] local food = SpawnPrefab(foodname) building7.components.container:GiveItem(food) end local building8 = SpawnPrefab("dragonflychest") building8.Transform:SetPosition(pt.x+3.8+3, 0, pt.z-3.8+3) building8.persists = false building8:AddTag("tempbuilding") local lantern = SpawnPrefab("lantern") building8.components.container:GiveItem(lantern) if not GetSeasonManager():IsSummer() then local building9 = SpawnPrefab("firepit") building9.Transform:SetPosition(pt.x, 0, pt.z) building9:RemoveAllEventCallbacks() building9:ListenForEvent("onextinguish", function(building9) if building9.components.cooker then building9:RemoveComponent("cooker") end if building9.components.fueled then building9.components.fueled:InitializeFuelLevel(0) end end ) building9:ListenForEvent("onignite", function(building9) if not building9.components.cooker then building9:AddComponent("cooker") end end ) building9.persists = false building9:AddTag("tempbuilding") for k = 1, 10 do local log = SpawnPrefab("log") building8.components.container:GiveItem(log) end else local building9 = SpawnPrefab("coldfirepit") building9.Transform:SetPosition(pt.x, 0, pt.z) building9.persists = false building9:AddTag("tempbuilding") for k = 1, 10 do local nitre = SpawnPrefab("nitre") building8.components.container:GiveItem(nitre) end end local building10 = SpawnPrefab("firesuppressor") building10.Transform:SetPosition(pt.x-4+3, 0, pt.z+4+3) building10.Transform:SetScale(0.8,0.8,0.8) building10.persists = false building10:AddTag("tempbuilding") local building11 = SpawnPrefab("eyeturret") building11.Transform:SetPosition(pt.x-4+1, 0, pt.z+4+1) building11.components.combat:SetAttackPeriod(0.5) if building11.components.machine then building11:RemoveComponent("machine") end building11.persists = false building11:AddTag("tempbuilding") local building12 = SpawnPrefab("pumpkin_lantern") building12.Transform:SetPosition(pt.x-4-2, 0, pt.z+4-2) building12.Transform:SetScale(1.5,1.5,1.5) building12.components.inventoryitem.canbepickedup = false building12.persists = false building12:AddTag("NOCLICK") building12:AddTag("tempbuilding") end else GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") inst:RemoveTag("campsite") local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 3000) for k,v in pairs(ents) do if v:HasTag("tempbuilding") then v:Remove() end end end end ) 即可在身上有50个黄金时,在空旷的地方,按键盘B键租赁度假营地(身上黄金不足时无法租赁),再次按B键退房。度假营地外有围墙保护(鼠标左键点围墙可开门,5秒后自动关门),内有火堆、帐篷、锅、箱子、冰箱、南瓜灯等生活设施,还配有眼睛炮塔、灭火器、避雷针等安全设备,其中箱子里有火堆燃料(夏天为硝石,其余季节为木头),还提供一盏提灯供你外出使用,冰箱里有3份料理(品种随机),让你在野外也可以品尝新鲜美味。由于环保原因,度假营地为临时设施,存档退出后再读档,度假营地将消失,记得之前取出箱子中的私人物品哦

2025/04/23 · Bny