Compare commits
3 Commits
c55a8f8dcd
...
95f3980694
Author | SHA1 | Date | |
---|---|---|---|
95f3980694 | |||
8bdf40b849 | |||
b2feac105a |
@ -5,7 +5,9 @@ minetest.register_chatcommand("affect",{
|
|||||||
privs = {affects=true},
|
privs = {affects=true},
|
||||||
func = function (name, param)
|
func = function (name, param)
|
||||||
local aname, affectid = string.match(param, "([^ ]+) (.+)")
|
local aname, affectid = string.match(param, "([^ ]+) (.+)")
|
||||||
if ( affects.affectPlayer(aname,affectid) ) then
|
if ( aname == nil or aname == "" or affectid == nil or affectid == '' ) then
|
||||||
|
minetest.chat_send_player(name, "Syntax: affect <name> <affectid>")
|
||||||
|
elseif ( affects.affectPlayer(aname,affectid) ) then
|
||||||
minetest.chat_send_player(name,aname.." has been affected by "..affects._affects[affectid].name)
|
minetest.chat_send_player(name,aname.." has been affected by "..affects._affects[affectid].name)
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(name,"Unable to affect "..aname.." with "..affectid)
|
minetest.chat_send_player(name,"Unable to affect "..aname.." with "..affectid)
|
||||||
|
@ -638,7 +638,14 @@ end
|
|||||||
function mobs:face_pos(self,pos)
|
function mobs:face_pos(self,pos)
|
||||||
local s = self.object:getpos()
|
local s = self.object:getpos()
|
||||||
local vec = {x=pos.x-s.x, y=pos.y-s.y, z=pos.z-s.z}
|
local vec = {x=pos.x-s.x, y=pos.y-s.y, z=pos.z-s.z}
|
||||||
local yaw = math.atan(vec.z/vec.x)+math.pi/2
|
local yaw = 0
|
||||||
|
if vec.x ~= 0 then
|
||||||
|
yaw=math.atan(vec.z/vec.x)+math.pi/2
|
||||||
|
else
|
||||||
|
if vec.z>0 then
|
||||||
|
yaw=math.pi
|
||||||
|
end
|
||||||
|
end
|
||||||
if self.drawtype == "side" then
|
if self.drawtype == "side" then
|
||||||
yaw = yaw+(math.pi/2)
|
yaw = yaw+(math.pi/2)
|
||||||
end
|
end
|
||||||
|
@ -144,7 +144,14 @@ function mobs.on_step(self,dtime)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
|
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
|
||||||
local yaw = math.atan(vec.z/vec.x)+math.pi/2
|
local yaw = 0
|
||||||
|
if vec.x ~= 0 then
|
||||||
|
yaw=math.atan(vec.z/vec.x)+math.pi/2
|
||||||
|
else
|
||||||
|
if vec.z>0 then
|
||||||
|
yaw=math.pi
|
||||||
|
end
|
||||||
|
end
|
||||||
if self.drawtype == "side" then
|
if self.drawtype == "side" then
|
||||||
yaw = yaw+(math.pi/2)
|
yaw = yaw+(math.pi/2)
|
||||||
end
|
end
|
||||||
@ -223,7 +230,13 @@ function mobs.on_step(self,dtime)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
|
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
|
||||||
local yaw = math.atan(vec.z/vec.x)+math.pi/2
|
if vec.x ~= 0 then
|
||||||
|
yaw=math.atan(vec.z/vec.x)+math.pi/2
|
||||||
|
else
|
||||||
|
if vec.z>0 then
|
||||||
|
yaw=math.pi
|
||||||
|
end
|
||||||
|
end
|
||||||
if self.drawtype == "side" then
|
if self.drawtype == "side" then
|
||||||
yaw = yaw+(math.pi/2)
|
yaw = yaw+(math.pi/2)
|
||||||
end
|
end
|
||||||
@ -345,7 +358,13 @@ function mobs.on_step(self,dtime)
|
|||||||
self.v_start = false
|
self.v_start = false
|
||||||
else
|
else
|
||||||
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
|
local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z}
|
||||||
local yaw = math.atan(vec.z/vec.x)+math.pi/2
|
if vec.x ~= 0 then
|
||||||
|
yaw=math.atan(vec.z/vec.x)+math.pi/2
|
||||||
|
else
|
||||||
|
if vec.z>0 then
|
||||||
|
yaw=math.pi
|
||||||
|
end
|
||||||
|
end
|
||||||
if self.drawtype == "side" then
|
if self.drawtype == "side" then
|
||||||
yaw = yaw+(math.pi/2)
|
yaw = yaw+(math.pi/2)
|
||||||
end
|
end
|
||||||
|
@ -3,8 +3,12 @@ quests.chest = {}
|
|||||||
quests.chest.go = function(npc,player)
|
quests.chest.go = function(npc,player)
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
local pos = npc.object:getpos()
|
local pos = npc.object:getpos()
|
||||||
if inv:contains_item("main","farming_plus:flour") and inv:contains_item("main","food:bowl") then
|
if (inv:contains_item("main","farming_plus:flour") or inv:contains_item("main","food:flour")) and inv:contains_item("main","food:bowl") then
|
||||||
inv:remove_item("main","farming_plus:flour")
|
if inv:contains_item("main","farming_plus:flour") then
|
||||||
|
inv:remove_item("main","farming_plus:flour")
|
||||||
|
else
|
||||||
|
inv:remove_item("main","food:flour")
|
||||||
|
end
|
||||||
inv:remove_item("main","food:bowl")
|
inv:remove_item("main","food:bowl")
|
||||||
chat.local_chat(pos,"'Thank you very much, take this as a token of my appreciation!'",6)
|
chat.local_chat(pos,"'Thank you very much, take this as a token of my appreciation!'",6)
|
||||||
local lp = player:getpos()
|
local lp = player:getpos()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user