Don't Starve Revision History Viewer

Comparing Six Feet Under (Rev 86935) to All's Well That Maxwell (Rev 88237)

prefabs/mosquito.lua

345678
Asset("ANIM", "anim/mosquito.zip"), } local sounds = { takeoff = "dontstarve/creatures/mosquito/mosquito_takeoff",
345678910111213
Asset("ANIM", "anim/mosquito.zip"), } local prefabs = { "mosquitosack" } local sounds = { takeoff = "dontstarve/creatures/mosquito/mosquito_takeoff",
131415161718
explode = "dontstarve/creatures/mosquito/mosquito_explo", } local SHARE_TARGET_DIST = 30 local MAX_TARGET_SHARES = 10
1819202122232425262728
explode = "dontstarve/creatures/mosquito/mosquito_explo", } SetSharedLootTable( 'mosquito', { {'mosquitosack', .5}, }) local SHARE_TARGET_DIST = 30 local MAX_TARGET_SHARES = 10
272829303132
end end local function OnDropped(inst) inst.sg:GoToState("idle") if inst.components.workable then
373839404142434445464748495051
end end local function OnWake(inst) inst.SoundEmitter:PlaySound(inst.sounds.buzz, "buzz") end local function OnSleep(inst) inst.SoundEmitter:KillSound("buzz") end local function OnDropped(inst) inst.sg:GoToState("idle") if inst.components.workable then
126127128129130131132133
inst:SetStateGraph("SGmosquito") inst.sounds = sounds inst.SoundEmitter:PlaySound(inst.sounds.buzz, "buzz") inst:AddComponent("inventoryitem") inst:AddComponent("stackable") inst.components.inventoryitem:SetOnDroppedFn(OnDropped)
145146147148149150151152153154155
inst:SetStateGraph("SGmosquito") inst.sounds = sounds inst.OnEntityWake = OnWake inst.OnEntitySleep = OnSleep inst:AddComponent("inventoryitem") inst:AddComponent("stackable") inst.components.inventoryitem:SetOnDroppedFn(OnDropped)
136137138139140141142143144145
--------------------- --inst:AddComponent("lootdropper") --inst.components.lootdropper:AddRandomLoot("honey", 1) --inst.components.lootdropper:AddRandomLoot("stinger", 5) --inst.components.lootdropper.numrandomloot = 1 ------------------ inst:AddComponent("workable")
158159160161162163164165
--------------------- inst:AddComponent("lootdropper") inst.components.lootdropper:SetChanceLootTable('mosquito') ------------------ inst:AddComponent("workable")
147148149150151152153154
inst.components.workable:SetWorkLeft(1) inst.components.workable:SetOnFinishCallback(OnWorked) MakeSmallBurnableCharacter(inst, "body", Vector3(0, -1, 0)) MakeTinyFreezableCharacter(inst, "body", Vector3(0, -1, 0)) ------------------ inst:AddComponent("health")
167168169170171172173174
inst.components.workable:SetWorkLeft(1) inst.components.workable:SetOnFinishCallback(OnWorked) MakeSmallBurnableCharacter(inst, "body", Vector3(0, -1, 1)) MakeTinyFreezableCharacter(inst, "body", Vector3(0, -1, 1)) ------------------ inst:AddComponent("health")
180181182183
return inst end return Prefab( "forest/monsters/mosquito", mosquito, assets)
200201202203
return inst end return Prefab( "forest/monsters/mosquito", mosquito, assets, prefabs)