- Closes #19
This commit is contained in:
Leslie Krause 2020-05-09 08:34:00 -04:00
parent f9d3fbf0b7
commit 3409ac4b54
2 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,4 @@
Mobs Lite Mod v1.2 Mobs Lite Mod v1.3
By Leslie E. Krause By Leslie E. Krause
Mobs Lite is a fully-working proof of concept for the Extended Motion Mechanics API for Mobs Lite is a fully-working proof of concept for the Extended Motion Mechanics API for
@ -36,6 +36,9 @@ Here are some of the other highlights of the Mobs Lite engine:
* Timekeeper helper class ensures efficient dispatching of mob-related callbacks at the * Timekeeper helper class ensures efficient dispatching of mob-related callbacks at the
appropriate server step. appropriate server step.
* Builtin lookup table allows for efficiently iterating over multiple classes of objects
within a specific radius.
* And of course, much much more! * And of course, much much more!
Since Mobs Lite is still in early beta, there is the likelihood of lingering bugs. The API Since Mobs Lite is still in early beta, there is the likelihood of lingering bugs. The API

View File

@ -98,7 +98,7 @@ end
-------------------- --------------------
mobs.effect( pos, amount, texture, min_size, max_size, radius, gravity ) mobs.effect = function ( pos, amount, texture, min_size, max_size, radius, gravity )
minetest.add_particlespawner({ minetest.add_particlespawner({
amount = amount, amount = amount,
time = 0.5, time = 0.5,
@ -1401,6 +1401,28 @@ mobs.presets = {
-------------------- --------------------
local emit_defs = { "mobs:griefer_ghost" }
minetest.register_chatcommand( "mobs", {
description = "Spawn random mobs in the area (for testing purposes or just plain fun).",
privs = { server = true },
func = function( player_name, param )
local pos = minetest.get_player_by_name( player_name ):getpos( )
local total = param ~= "" and tonumber( param ) or 10
for count = 1, total do
local index = math.random( #emit_defs )
local y = pos.y + minetest.registered_entities[ emit_defs[ index ] ].y_offset + 2
local x = pos.x + math.random( -5, 5 )
local z = pos.z + math.random( -5, 5 )
minetest.add_entity( { x = x, y = y, z = z }, emit_defs[ index ] )
end
end
} )
--------------------
dofile( minetest.get_modpath( "mobs" ) .. "/extras.lua" ) dofile( minetest.get_modpath( "mobs" ) .. "/extras.lua" )
dofile( minetest.get_modpath( "mobs" ) .. "/monsters.lua" ) dofile( minetest.get_modpath( "mobs" ) .. "/monsters.lua" )
dofile( minetest.get_modpath( "mobs" ) .. "/animals.lua" ) dofile( minetest.get_modpath( "mobs" ) .. "/animals.lua" )