Already-purring cats should not randomly meow
This commit is contained in:
parent
15dc658a59
commit
509beca433
9
node.lua
9
node.lua
@ -52,15 +52,6 @@ reg(5, "#e0c040", "#ff8000") -- light orange
|
||||
reg(6, "#804000", "#402000") -- dark brown
|
||||
reg(7, "#c0a080", "#806020") -- light brown
|
||||
|
||||
nodecore.register_ambiance({
|
||||
label = modname .. " ambiance",
|
||||
nodenames = {"group:" .. modname .. "_cat"},
|
||||
interval = 5,
|
||||
chance = 5,
|
||||
sound_name = modname .. "_mew",
|
||||
sound_gain = 0.5
|
||||
})
|
||||
|
||||
function myapi.makecat(pos, param2)
|
||||
nodecore.set_loud(pos, {
|
||||
name = modname .. ":cat_" .. math_random(1, myapi.maxcatid),
|
||||
|
16
pet.lua
16
pet.lua
@ -57,16 +57,26 @@ nodecore.register_dnt({
|
||||
action = purr
|
||||
})
|
||||
|
||||
local function notpurring(pos) return not purring[hashpos(pos)] and {} end
|
||||
|
||||
nodecore.register_craft({
|
||||
label = "pet cat",
|
||||
action = "pummel",
|
||||
toolgroups = {thumpy = 1},
|
||||
indexkeys = {"group:" .. modname .. "_cat"},
|
||||
check = function(pos)
|
||||
return not purring[hashpos(pos)]
|
||||
end,
|
||||
check = notpurring,
|
||||
nodes = {
|
||||
{match = {groups = {[modname .. "_cat"] = true}}}
|
||||
},
|
||||
after = purr
|
||||
})
|
||||
|
||||
nodecore.register_ambiance({
|
||||
label = modname .. " ambiance",
|
||||
nodenames = {"group:" .. modname .. "_cat"},
|
||||
interval = 5,
|
||||
chance = 5,
|
||||
check = notpurring,
|
||||
sound_name = modname .. "_mew",
|
||||
sound_gain = 0.5
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user