mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-29 13:30:22 +02:00
Compare commits
4 Commits
f033cd401c
...
1271570780
Author | SHA1 | Date | |
---|---|---|---|
1271570780 | |||
ec3c6fb518 | |||
c4f56f4204 | |||
4814f53885 |
8
api.lua
8
api.lua
@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi")
|
||||
|
||||
mobs = {
|
||||
mod = "redo",
|
||||
version = "20200717",
|
||||
version = "20200720",
|
||||
intllib = S,
|
||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||
}
|
||||
@ -195,7 +195,7 @@ end
|
||||
|
||||
-- calculate distance
|
||||
local get_distance = function(a, b)
|
||||
|
||||
if not a or not b then return 50 end -- nil check
|
||||
local x, y, z = a.x - b.x, a.y - b.y, a.z - b.z
|
||||
|
||||
return square(x * x + y * y + z * z)
|
||||
@ -2001,7 +2001,7 @@ function mob_class:follow_flop()
|
||||
and self.state ~= "attack"
|
||||
and self.state ~= "runaway" then
|
||||
|
||||
local s = self.object:get_pos()
|
||||
local s = self.object:get_pos() ; if not s then return end
|
||||
local players = minetest.get_connected_players()
|
||||
|
||||
for n = 1, #players do
|
||||
@ -2132,7 +2132,7 @@ end
|
||||
-- execute current state (stand, walk, run, attacks)
|
||||
function mob_class:do_states(dtime)
|
||||
|
||||
local yaw = self.object:get_yaw() or 0
|
||||
local yaw = self.object:get_yaw() ; if not yaw then return end
|
||||
|
||||
if self.state == "stand" then
|
||||
|
||||
|
2
api.txt
2
api.txt
@ -31,7 +31,7 @@ functions needed for the mob to work properly which contains the following:
|
||||
'hp_max' has the maximum health value the mob can spawn with.
|
||||
'armor' holds strength of mob, 100 is normal, lower is more powerful
|
||||
and needs more hits and better weapons to kill.
|
||||
'passive' when true allows animals to defend themselves when hit,
|
||||
'passive' when false allows animals to defend themselves when hit,
|
||||
otherwise they amble onwards.
|
||||
'walk_velocity' is the speed that your mob can walk around.
|
||||
'run_velocity' is the speed your mob can run with, usually when attacking.
|
||||
|
Reference in New Issue
Block a user