mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 02:00:21 +01:00
re-enabled catch-up to spawn more mobs
This commit is contained in:
parent
80ba7db8ba
commit
542cb3d474
16
api.lua
16
api.lua
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
-- Mobs Api (18th June 2016)
|
-- Mobs Api (21st July 2016)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
@ -82,9 +82,7 @@ end
|
|||||||
|
|
||||||
set_velocity = function(self, v)
|
set_velocity = function(self, v)
|
||||||
|
|
||||||
v = v or 0
|
local yaw = self.object:getyaw() + self.rotate or 0
|
||||||
|
|
||||||
local yaw = (self.object:getyaw() + self.rotate) or 0
|
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:setvelocity({
|
||||||
x = sin(yaw) * -v,
|
x = sin(yaw) * -v,
|
||||||
@ -382,7 +380,7 @@ end
|
|||||||
-- is mob facing a cliff
|
-- is mob facing a cliff
|
||||||
local function is_at_cliff(self)
|
local function is_at_cliff(self)
|
||||||
|
|
||||||
if self.fear_height == 0 then -- if 0, no falling protection!
|
if self.fear_height == 0 then -- 0 for no falling protection!
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -544,8 +542,6 @@ do_jump = function(self)
|
|||||||
local v = self.object:getvelocity()
|
local v = self.object:getvelocity()
|
||||||
|
|
||||||
v.y = self.jump_height + 1
|
v.y = self.jump_height + 1
|
||||||
v.x = v.x * 2.2
|
|
||||||
v.z = v.z * 2.2
|
|
||||||
|
|
||||||
self.object:setvelocity(v)
|
self.object:setvelocity(v)
|
||||||
|
|
||||||
@ -1021,7 +1017,6 @@ local monster_attack = function(self)
|
|||||||
-- field of view check goes here
|
-- field of view check goes here
|
||||||
|
|
||||||
-- choose closest player to attack
|
-- choose closest player to attack
|
||||||
--if minetest.line_of_sight(sp, p, 2) == true
|
|
||||||
if line_of_sight_water(self, sp, p, 2) == true
|
if line_of_sight_water(self, sp, p, 2) == true
|
||||||
and dist < min_dist then
|
and dist < min_dist then
|
||||||
min_dist = dist
|
min_dist = dist
|
||||||
@ -1662,7 +1657,6 @@ local do_states = function(self, dtime)
|
|||||||
p2.y = p2.y + 1.5
|
p2.y = p2.y + 1.5
|
||||||
s2.y = s2.y + 1.5
|
s2.y = s2.y + 1.5
|
||||||
|
|
||||||
--if minetest.line_of_sight(p2, s2) == true then
|
|
||||||
if line_of_sight_water(self, p2, s2) == true then
|
if line_of_sight_water(self, p2, s2) == true then
|
||||||
|
|
||||||
-- play attack sound
|
-- play attack sound
|
||||||
@ -2270,7 +2264,7 @@ minetest.register_entity(name, {
|
|||||||
fall_damage = def.fall_damage or 1,
|
fall_damage = def.fall_damage or 1,
|
||||||
fall_speed = def.fall_speed or -10, -- must be lower than -2 (default: -10)
|
fall_speed = def.fall_speed or -10, -- must be lower than -2 (default: -10)
|
||||||
drops = def.drops or {},
|
drops = def.drops or {},
|
||||||
armor = def.armor,
|
armor = def.armor or 100,
|
||||||
on_rightclick = def.on_rightclick,
|
on_rightclick = def.on_rightclick,
|
||||||
arrow = def.arrow,
|
arrow = def.arrow,
|
||||||
shoot_interval = def.shoot_interval,
|
shoot_interval = def.shoot_interval,
|
||||||
@ -2402,7 +2396,7 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
|
|||||||
neighbors = neighbors,
|
neighbors = neighbors,
|
||||||
interval = interval,
|
interval = interval,
|
||||||
chance = chance,
|
chance = chance,
|
||||||
catch_up = false,
|
catch_up = true,
|
||||||
|
|
||||||
action = function(pos, node, aoc, active_object_count_wider)
|
action = function(pos, node, aoc, active_object_count_wider)
|
||||||
|
|
||||||
|
@ -10,6 +10,14 @@ This mod contains the API only for adding your own mobs into the world, so pleas
|
|||||||
https://forum.minetest.net/viewtopic.php?f=11&t=9917
|
https://forum.minetest.net/viewtopic.php?f=11&t=9917
|
||||||
|
|
||||||
|
|
||||||
|
Crafts:
|
||||||
|
|
||||||
|
- Nametag (paper, black dye, string) can be used right-click on a tamed mob to give them a name.
|
||||||
|
- Nets can be used to right-click tamed mobs to pick them up and place inside inventory as a spawn egg.
|
||||||
|
- Magic Lasso is similar to nets but with a better chance of picking up larger mobs.
|
||||||
|
- Shears are used to right-click sheep and return 1-3 wool.
|
||||||
|
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
|
||||||
- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code
|
- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code
|
||||||
|
Loading…
Reference in New Issue
Block a user