InsaneProtestor/mods/ip_people/init.lua

131 lines
2.2 KiB
Lua
Raw Normal View History

2022-11-22 21:54:42 +01:00
local peopleSpawned = 0
minetest.register_abm({
nodenames = {"main:bricks_stone"},
interval = 10,
chance = 340,
action = function(pos, node, active_object_count, active_object_count_wider)
if peopleSpawned < 100 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, "people:female")
else
minetest.add_entity(newPos, "people:male")
end
peopleSpawned = peopleSpawned + 1
end
end})
2022-11-21 22:12:22 +01:00
-- People
2022-11-22 21:54:42 +01:00
-- Currently only male and female.
-- No non-binary erasure intended; there just aren't that many non-binary guys in Eastern Europe.
2022-11-24 07:06:37 +01:00
mobs:register_mob(":people:female", {
2022-11-22 21:54:42 +01:00
type = "npc",
passive = true,
2022-11-21 22:12:22 +01:00
attack_type = "dogfight",
pathfinding = true,
reach = 2,
2022-11-22 21:54:42 +01:00
damage = 1,
2022-11-21 22:12:22 +01:00
hp_min = 10,
hp_max = 15,
collisionbox =
{
-.4, 0, -.4, .4, 2, .4
},
pushable = true,
visual = "mesh",
mesh = "character.b3d",
textures =
{
{"female_person.png"},
{"female_person1.png"},
{"female_person2.png"},
{"female_person3.png"},
},
makes_footstep_sound = true,
sounds =
{
random = "female_noise",
},
walk_velocity = 2,
run_velocity = 8,
jump_height = 1,
stepheight = 0,
floats = 0,
view_range = 45,
fall_damage = true,
2022-11-22 21:54:42 +01:00
animation =
{
speed_normal = 30,
speed_run = 50,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219
},
})
2022-11-24 07:06:37 +01:00
mobs:register_mob(":people:male", {
2022-11-22 21:54:42 +01:00
type = "npc",
passive = true,
attack_type = "dogfight",
pathfinding = true,
reach = 2,
damage = 1,
hp_min = 10,
hp_max = 15,
collisionbox =
{
-.4, 0, -.4, .4, 2, .4
},
pushable = true,
visual = "mesh",
mesh = "character.b3d",
textures =
{
{"male_person.png"},
{"male_person1.png"},
{"male_person2.png"},
},
makes_footstep_sound = true,
sounds =
{
random = "male_noise",
},
walk_velocity = 2,
run_velocity = 8,
jump_height = 1,
stepheight = 0,
floats = 0,
view_range = 45,
fall_damage = true,
2022-11-21 22:12:22 +01:00
animation =
{
speed_normal = 30,
speed_run = 50,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219
},
})