Changes to pipe bombs, cops, and node groups

This commit is contained in:
2022-11-22 15:32:50 -05:00
parent ba2da987ad
commit 71d289d98e
10 changed files with 56 additions and 88 deletions

View File

@@ -1,6 +1,13 @@
cops = {}
cops.copsSpawned = 0
-- Pig spawner
minetest.register_node("cops:pig_spawner", {
walkable = false;
drawtype = "glasslike",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
--[[on_timer = function(pos)
minetest.add_entity(pos, "cops:cop_regular_female")
return true
@@ -11,7 +18,7 @@ minetest.register_node("cops:pig_spawner", {
end,]]
})
--[[
minetest.register_abm({
nodenames = {"cops:pig_spawner"},
interval = 30,
@@ -29,25 +36,27 @@ minetest.register_abm({
elseif i == 2 then
minetest.add_entity(pos, "cops:cop_armedthug")
end
end})
end})]]
minetest.register_abm({
nodenames = {"main:bricks_stone"},
interval = 40,
chance = 50,
chance = 140,
action = function(pos, node, active_object_count, active_object_count_wider)
newPos = {x = pos.x, y = pos.y + 2, z = pos.z}
local i = math.random(0, 2)
if i == 0 then
minetest.add_entity(newPos, "cops:cop_regular_female")
if cops.copsSpawned < 20 then
newPos = {x = pos.x, y = pos.y + 2, z = pos.z}
local i = math.random(0, 7)
if i < 2 then
minetest.add_entity(newPos, "cops:cop_regular_female")
elseif i < 6 then
minetest.add_entity(newPos, "cops:cop_regular_male")
elseif i == 1 then
minetest.add_entity(newPos, "cops:cop_regular_male")
elseif i == 2 then
minetest.add_entity(newPos, "cops:cop_armedthug")
elseif i == 7 then
minetest.add_entity(newPos, "cops:cop_armedthug")
end
cops.copsSpawned = cops.copsSpawned + 1
end
end})
@@ -79,7 +88,7 @@ mobs:register_mob("cops:cop_regular_female", {
{
random = "female_noise",
},
on_die = onCopDie,
walk_velocity = 2,
run_velocity = 8,
jump_height = 1,
@@ -136,7 +145,7 @@ mobs:register_mob("cops:cop_regular_male", {
{
random = "male_noise",
},
on_die = onCopDie,
walk_velocity = 2,
run_velocity = 8,
jump_height = 1,
@@ -193,7 +202,7 @@ mobs:register_mob("cops:cop_armedthug", {
{
random = "male_noise",
},
on_die = onCopDie,
walk_velocity = 2,
run_velocity = 8,
jump_height = 1,
@@ -220,4 +229,8 @@ mobs:register_mob("cops:cop_armedthug", {
punch_start = 200,
punch_end = 219
},
})
})
onCopDie = function()
cops.copsSpawned = cops.copsSpawned - 1
end