min. follow range set to 3, xanadu's safe fire hurts fire intolerant mobs

This commit is contained in:
TenPlus1 2015-09-09 10:48:32 +01:00
parent fb2929f13d
commit 93dd5d6146

34
api.lua
View File

@ -1,4 +1,4 @@
-- Mobs Api (8th September 2015) -- Mobs Api (9th September 2015)
mobs = {} mobs = {}
mobs.mod = "redo" mobs.mod = "redo"
@ -322,7 +322,9 @@ function mobs:register_mob(name, def)
-- lava or fire -- lava or fire
if self.lava_damage ~= 0 if self.lava_damage ~= 0
and (nodef.groups.lava or nod.name == "fire:basic_flame") then and (nodef.groups.lava
or nod.name == "fire:basic_flame"
or nod.name == "xanadu:safe_fire") then
self.object:set_hp(self.object:get_hp() - self.lava_damage) self.object:set_hp(self.object:get_hp() - self.lava_damage)
effect(pos, 5, "fire_basic_flame.png") effect(pos, 5, "fire_basic_flame.png")
if check_for_death(self) then return end if check_for_death(self) then return end
@ -519,23 +521,23 @@ function mobs:register_mob(name, def)
for i,obj in ipairs(ents) do for i,obj in ipairs(ents) do
ent = obj:get_luaentity() ent = obj:get_luaentity()
-- check for same animal with different colour -- check for same animal with different colour
local canmate = false local canmate = false
if ent then if ent then
if ent.name == self.name then if ent.name == self.name then
canmate = true canmate = true
else else
local entname = string.split(ent.name,":") local entname = string.split(ent.name,":")
local selfname = string.split(self.name,":") local selfname = string.split(self.name,":")
if entname[1] == selfname[1] then
entname = string.split(entname[2],"_")
selfname = string.split(selfname[2],"_")
if entname[1] == selfname[1] then if entname[1] == selfname[1] then
canmate = true entname = string.split(entname[2],"_")
selfname = string.split(selfname[2],"_")
if entname[1] == selfname[1] then
canmate = true
end
end end
end end
end end
end
if ent if ent
and canmate == true and canmate == true
@ -640,7 +642,7 @@ function mobs:register_mob(name, def)
self.object:setyaw(yaw) self.object:setyaw(yaw)
-- anyone but standing npc's can move along -- anyone but standing npc's can move along
if dist > 2 if dist > 3 -- was 2
and self.order ~= "stand" then and self.order ~= "stand" then
if (self.jump if (self.jump
and self.get_velocity(self) <= 0.5 and self.get_velocity(self) <= 0.5