Started again working on the new mobs

This commit is contained in:
npx 2016-09-02 16:20:14 +02:00
parent 5523c1fa99
commit 3021deec6f
3 changed files with 17 additions and 6 deletions

View File

@ -1,4 +1,5 @@
local path = minetest.get_modpath("nssm")
nssm = {}
--dofile(path.."/api.lua")
--dofile(path.."/spawn.lua")

View File

@ -107,7 +107,6 @@ mobs:register_mob("nssm:mordain", {
end
end
self.object:setpos(d)
self.timer = 2
end)
end
end

View File

@ -111,10 +111,21 @@ minetest.register_entity("nssm:mortick", {
self.attack = obj
end
end
if self.attack ~= 0 then
local p = self.attack:getpos()
p.y = p.y + 1.3
local m = 10
local yawp = self.attack:get_look_yaw()
local pi = math.pi
p.y = p.y + 1
p.x = p.x-math.cos(yawp)/2.5
p.z = p.z-math.sin(yawp)/2.5
local m = 30
local v = {x=-(s.x-p.x)*m, y=-(s.y-p.y)*m, z=-(s.z-p.z)*m}
local yaws = yawp +pi
self.object:setvelocity(v)
--self.object:setpos(p)
self.object:setyaw(yaws)
end
end
})