changed :set :get to :set_ :get_
This commit is contained in:
parent
539fbe5803
commit
4008059780
20
darts.lua
20
darts.lua
@ -6,12 +6,12 @@ mobs:register_arrow("nssm:duck_father", {
|
||||
velocity = 8,
|
||||
-- direct hit
|
||||
hit_player = function(self, player)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
duck_explosion(pos)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
duck_explosion(pos)
|
||||
end,
|
||||
|
||||
@ -76,12 +76,12 @@ mobs:register_arrow("nssm:snow_arrow", {
|
||||
velocity =20,
|
||||
-- direct hit
|
||||
hit_player = function(self, player)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
ice_explosion(pos)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
ice_explosion(pos)
|
||||
end,
|
||||
hit_node = function(self, pos, node)
|
||||
@ -149,7 +149,7 @@ mobs:register_arrow("nssm:webball", {
|
||||
velocity = 8,
|
||||
-- direct hit
|
||||
hit_player = function(self, player)
|
||||
local p = player:getpos()
|
||||
local p = player:get_pos()
|
||||
explosion_web(p)
|
||||
end,
|
||||
|
||||
@ -201,7 +201,7 @@ mobs:register_arrow("nssm:thickwebball", {
|
||||
velocity = 8,
|
||||
-- direct hit
|
||||
hit_player = function(self, player)
|
||||
local p = player:getpos()
|
||||
local p = player:get_pos()
|
||||
explosion_thickweb(p)
|
||||
end,
|
||||
|
||||
@ -256,7 +256,7 @@ mobs:register_arrow("nssm:phoenix_arrow", {
|
||||
|
||||
on_step = function(self, dtime)
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
if minetest.is_protected(pos, "") then
|
||||
return
|
||||
end
|
||||
@ -296,7 +296,7 @@ mobs:register_arrow("nssm:super_gas", {
|
||||
velocity = 8,
|
||||
-- direct hit
|
||||
hit_player = function(self, player)
|
||||
local p = player:getpos()
|
||||
local p = player:get_pos()
|
||||
gas_explosion(p)
|
||||
end,
|
||||
|
||||
@ -335,7 +335,7 @@ mobs:register_arrow("nssm:roar_of_the_dragon", {
|
||||
|
||||
on_step = function(self, dtime)
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
local n = minetest.get_node(pos).name
|
||||
|
||||
@ -382,7 +382,7 @@ mobs:register_arrow("nssm:lava_arrow", {
|
||||
velocity = 10,
|
||||
-- direct hit
|
||||
hit_player = function(self, player)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
if minetest.is_protected(pos, "") then
|
||||
return
|
||||
end
|
||||
|
@ -58,7 +58,7 @@ mobs:register_mob("nssm:larva", {
|
||||
if os.time() - self.metatimer >20 then
|
||||
minetest.log("action",
|
||||
"metatimer expired, metamorphosis! ")
|
||||
local pos=self.object:getpos()
|
||||
local pos=self.object:get_pos()
|
||||
self.object:remove()
|
||||
minetest.add_particlespawner(
|
||||
200, --amount
|
||||
|
@ -52,7 +52,7 @@ mobs:register_mob("nssm:lava_titan", {
|
||||
shoot_offset = 0,
|
||||
--[[
|
||||
on_dist_attack = function(self, player)
|
||||
local pos = player:getpos()
|
||||
local pos = player:get_pos()
|
||||
for dy=-1, 6, 1 do
|
||||
for dx=-1, 1, 2 do
|
||||
for dz=-1, 1, 2 do
|
||||
|
@ -89,7 +89,7 @@ mobs:register_mob("nssm:masticone", {
|
||||
end,
|
||||
|
||||
do_custom = function (self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local n = minetest.get_node(pos).name
|
||||
|
||||
if n == "default:lava_source" or n == "default:lava_flowing" then
|
||||
@ -106,7 +106,7 @@ mobs:register_mob("nssm:masticone", {
|
||||
|
||||
if obj then
|
||||
|
||||
obj:setvelocity({
|
||||
obj:set_velocity({
|
||||
x = math.random(-1, 1),
|
||||
y = 6,
|
||||
z = math.random(-1, 1)
|
||||
|
@ -74,11 +74,11 @@ mobs:register_mob("nssm:mese_dragon", {
|
||||
self.timer = 0
|
||||
self.attack_rip = self.attack_rip+1
|
||||
|
||||
local s = self.object:getpos()
|
||||
local s = self.object:get_pos()
|
||||
if minetest.is_protected(s, "") then
|
||||
return
|
||||
end
|
||||
local p = self.attack:getpos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
p.y = p.y + 1.5
|
||||
s.y = s.y + 1.5
|
||||
|
@ -57,8 +57,8 @@ mobs:register_mob("nssm:mordain", {
|
||||
self.mordain_timer = (self.mordain_timer or os.time())
|
||||
if (os.time() - self.mordain_timer) > 1 then
|
||||
self.mordain_timer = os.time()
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
mobs:set_animation(self, "punch")
|
||||
|
||||
@ -116,7 +116,7 @@ mobs:register_mob("nssm:mordain", {
|
||||
end
|
||||
end
|
||||
end
|
||||
self.object:setpos(d)
|
||||
self.object:set_pos(d)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
@ -59,8 +59,8 @@ mobs:register_mob("nssm:morde", {
|
||||
if (os.time() - self.morde_timer) > 1 then
|
||||
self.morde_timer = os.time()
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
mobs:set_animation(self, "punch")
|
||||
|
||||
@ -101,7 +101,7 @@ mobs:register_mob("nssm:morde", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
minetest.add_entity(pos, "nssm:mortick")
|
||||
end,
|
||||
@ -121,7 +121,7 @@ minetest.register_entity("nssm:mortick", {
|
||||
self.mortick_timer = self.mortick_timer or os.time()
|
||||
self.timer = self.timer or 0
|
||||
self.timer = self.timer+dtime
|
||||
local s = self.object:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local s1 = {x=s.x, y = s.y-1, z = s.z}
|
||||
|
||||
--[[
|
||||
@ -147,7 +147,7 @@ minetest.register_entity("nssm:mortick", {
|
||||
|
||||
--If found a player follow him
|
||||
if self.attack ~= 0 then
|
||||
local p = self.attack:getpos()
|
||||
local p = self.attack:get_pos()
|
||||
local yawp = self.attack:get_look_yaw()
|
||||
local pi = math.pi
|
||||
|
||||
@ -159,8 +159,8 @@ minetest.register_entity("nssm:mortick", {
|
||||
local yaws = yawp +pi
|
||||
|
||||
--stay attached to players back:
|
||||
self.object:setvelocity(v)
|
||||
self.object:setyaw(yaws)
|
||||
self.object:set_velocity(v)
|
||||
self.object:set_yaw(yaws)
|
||||
|
||||
--damage player every ten seconds:
|
||||
if (self.timer>10) then
|
||||
|
@ -70,7 +70,7 @@ mobs:register_mob("nssm:morgut", {
|
||||
if self.flag == 1 then
|
||||
self.state = ""
|
||||
mobs:set_animation(self, "run")
|
||||
self.object:setyaw(self.dir)
|
||||
self.object:set_yaw(self.dir)
|
||||
set_velocity(self, 4)
|
||||
|
||||
if os.time() - self.morgut_timer > 3 then
|
||||
@ -87,8 +87,8 @@ mobs:register_mob("nssm:morgut", {
|
||||
self.dir = (self.dir or 0)
|
||||
if (os.time() - self.morgut_timer) > 1 then
|
||||
if self.attack then
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
mobs:set_animation(self, "punch")
|
||||
local m = 2
|
||||
|
||||
@ -156,7 +156,7 @@ mobs:register_mob("nssm:morgut", {
|
||||
self.state = ""
|
||||
local pyaw = self.curr_attack: get_look_yaw()
|
||||
self.dir = pyaw
|
||||
self.object:setyaw(pyaw)
|
||||
self.object:set_yaw(pyaw)
|
||||
if self then
|
||||
set_velocity(self, 4)
|
||||
end
|
||||
@ -167,14 +167,14 @@ mobs:register_mob("nssm:morgut", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
if (self.inventory ~= nil) then
|
||||
local elem
|
||||
for i = 1,32 do
|
||||
if self.inventory[i].num~=0 then
|
||||
local items = ItemStack(self.inventory[i].name.." "..self.inventory[i].num)
|
||||
local obj = minetest.add_item(pos, items)
|
||||
obj:setvelocity({
|
||||
obj:set_velocity({
|
||||
x = math.random(-1, 1),
|
||||
y = 6,
|
||||
z = math.random(-1, 1)
|
||||
|
@ -72,7 +72,7 @@ mobs:register_mob("nssm:morlu", {
|
||||
if self.flag == 1 then
|
||||
self.state = ""
|
||||
mobs:set_animation(self, "run")
|
||||
self.object:setyaw(self.dir)
|
||||
self.object:set_yaw(self.dir)
|
||||
set_velocity(self, 4)
|
||||
|
||||
if os.time() - self.morlu_timer > 3 then
|
||||
@ -89,8 +89,8 @@ mobs:register_mob("nssm:morlu", {
|
||||
self.dir = (self.dir or 0)
|
||||
if (os.time() - self.morlu_timer) > 1 then
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
mobs:set_animation(self, "punch")
|
||||
local m = 1
|
||||
|
||||
@ -191,7 +191,7 @@ mobs:register_mob("nssm:morlu", {
|
||||
self.state = ""
|
||||
local pyaw = self.curr_attack: get_look_yaw()
|
||||
self.dir = pyaw
|
||||
self.object:setyaw(pyaw)
|
||||
self.object:set_yaw(pyaw)
|
||||
if self then
|
||||
set_velocity(self, 4)
|
||||
end
|
||||
@ -200,8 +200,8 @@ mobs:register_mob("nssm:morlu", {
|
||||
end
|
||||
end
|
||||
else
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
mobs:set_animation(self, "punch")
|
||||
|
||||
@ -224,13 +224,13 @@ mobs:register_mob("nssm:morlu", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
if (self.inventory ~= nil) then
|
||||
if self.invnum > 0 then
|
||||
for i=1,self.invnum do
|
||||
local items = ItemStack(self.inventory[i].name.." 1")
|
||||
local obj = minetest.add_item(pos, items)
|
||||
obj:setvelocity({
|
||||
obj:set_velocity({
|
||||
x = math.random(-1, 1),
|
||||
y = 6,
|
||||
z = math.random(-1, 1)
|
||||
|
@ -77,8 +77,8 @@ mobs:register_mob("nssm:morvalar", {
|
||||
self.dir = (self.dir or 0)
|
||||
if (os.time() - self.morvalar_timer) > 2 then
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
mobs:set_animation(self, "punch")
|
||||
local m = 1
|
||||
|
||||
@ -154,8 +154,8 @@ mobs:register_mob("nssm:morvalar", {
|
||||
end
|
||||
end
|
||||
else
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
mobs:set_animation(self, "punch")
|
||||
|
||||
@ -178,7 +178,7 @@ mobs:register_mob("nssm:morvalar", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
add_entity_and_particles("nssm:morvalar6", pos, "morparticle.png", 10)
|
||||
end,
|
||||
@ -238,8 +238,8 @@ mobs:register_mob("nssm:morvalar6", {
|
||||
self.dir = (self.dir or 0)
|
||||
if (os.time() - self.morvalar6_timer) > 1 then
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
mobs:set_animation(self, "punch")
|
||||
local m = 2
|
||||
|
||||
@ -298,7 +298,7 @@ mobs:register_mob("nssm:morvalar6", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
add_entity_and_particles("nssm:morvalar5", pos, "morparticle.png", 10)
|
||||
end,
|
||||
@ -359,8 +359,8 @@ mobs:register_mob("nssm:morvalar5", {
|
||||
self.dir = (self.dir or 0)
|
||||
if (os.time() - self.morvalar5_timer) > 2 then
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
minetest.after(2, function(self)
|
||||
mobs:set_animation(self, "punch")
|
||||
tnt_boom_nssm(p, {damage_radius=6,radius=5,ignore_protection=false})
|
||||
@ -369,7 +369,7 @@ mobs:register_mob("nssm:morvalar5", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
add_entity_and_particles("nssm:morvalar4", pos, "morparticle.png", 10)
|
||||
end,
|
||||
@ -428,8 +428,8 @@ mobs:register_mob("nssm:morvalar4", {
|
||||
self.morvalar4_timer = (self.morvalar4_timer or os.time())
|
||||
if (os.time() - self.morvalar4_timer) > 1 then
|
||||
self.morvalar4_timer = os.time()
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
mobs:set_animation(self, "punch")
|
||||
|
||||
@ -487,12 +487,12 @@ mobs:register_mob("nssm:morvalar4", {
|
||||
end
|
||||
end
|
||||
end
|
||||
self.object:setpos(d)
|
||||
self.object:set_pos(d)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
add_entity_and_particles("nssm:morvalar3", pos, "morparticle.png", 10)
|
||||
end,
|
||||
@ -553,7 +553,7 @@ mobs:register_mob("nssm:morvalar3", {
|
||||
respawn_block(self)
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
add_entity_and_particles("nssm:morvalar2", pos, "morparticle.png", 10)
|
||||
end,
|
||||
@ -611,8 +611,8 @@ mobs:register_mob("nssm:morvalar2", {
|
||||
self.morvalar2_timer = (self.morvalar2_timer or os.time())
|
||||
if (os.time() - self.morvalar2_timer) > 1 then
|
||||
self.morvalar2_timer = os.time()
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
local counter = 0
|
||||
local objects = minetest.get_objects_inside_radius(s, 7)
|
||||
@ -653,7 +653,7 @@ mobs:register_mob("nssm:morvalar2", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
add_entity_and_particles("nssm:morvalar1", pos, "morparticle.png", 10)
|
||||
end,
|
||||
@ -712,8 +712,8 @@ mobs:register_mob("nssm:morvalar1", {
|
||||
if (os.time() - self.morvalar1_timer) > 3 then
|
||||
self.morvalar1_timer = os.time()
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
mobs:set_animation(self, "punch")
|
||||
|
||||
@ -737,7 +737,7 @@ mobs:register_mob("nssm:morvalar1", {
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
add_entity_and_particles("nssm:morvalar0", pos, "morparticle.png", 10)
|
||||
end,
|
||||
@ -802,8 +802,8 @@ mobs:register_mob("nssm:morvalar0", {
|
||||
if (os.time() - self.morvalar1_timer) > 1 then
|
||||
self.morvalar1_timer = os.time()
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
mobs:set_animation(self, "punch")
|
||||
|
||||
@ -813,11 +813,11 @@ mobs:register_mob("nssm:morvalar0", {
|
||||
s.y = s.y+0.5
|
||||
p.y = p.y+0.9
|
||||
local dir = {x=(p.x-s.x)*m, y=(p.y-s.y)*m, z=(p.z-s.z)*m} --direction of the kamehameha
|
||||
obj:setvelocity(dir)
|
||||
obj:set_velocity(dir)
|
||||
end
|
||||
end,
|
||||
on_die = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
self.object:remove()
|
||||
minetest.add_particlespawner({
|
||||
amount = 500,
|
||||
@ -844,7 +844,7 @@ mobs:register_mob("nssm:morvalar0", {
|
||||
minetest.register_entity("nssm:kamehameha_bad", {
|
||||
textures = {"kamehameha.png"},
|
||||
on_step = function(self, dtime)
|
||||
local pos = self.object:getpos();
|
||||
local pos = self.object:get_pos();
|
||||
if self.timer == 0 then
|
||||
self.timer = os.time()
|
||||
end
|
||||
|
@ -62,8 +62,8 @@ mobs:register_mob("nssm:morvy", {
|
||||
self.morvy_counter = 0
|
||||
local counter = 0
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
p.y = p.y + 1.5
|
||||
s.y = s.y + 1.5
|
||||
|
@ -60,7 +60,7 @@ mobs:register_mob("nssm:morwa", {
|
||||
shoot_end=226,
|
||||
},
|
||||
do_custom = function (self)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local light = minetest.get_node_light(pos)
|
||||
--minetest.chat_send_all("Luce: "..light)
|
||||
if (light < 8) then
|
||||
|
@ -64,8 +64,8 @@ mobs:register_mob("nssm:pumpking", {
|
||||
if (os.time() - self.pumpking_timer) >3 then
|
||||
mobs:set_animation(self, "punch")
|
||||
self.pumpking_timer = os.time()
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
p.y = p.y + 1.5
|
||||
s.y = s.y + 1.5
|
||||
if minetest.line_of_sight(p, s) == true then
|
||||
|
40
nssm_api.lua
40
nssm_api.lua
@ -96,7 +96,7 @@ function check_for_death_hydra(self)
|
||||
end
|
||||
return false
|
||||
end
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local obj = nil
|
||||
if self.sounds.death ~= nil then
|
||||
minetest.sound_play(self.sounds.death,{
|
||||
@ -158,7 +158,7 @@ function explosion(pos, exp_radius, fire, kamehameha_bad)
|
||||
--Damages entities around (not the player)
|
||||
local objects = minetest.get_objects_inside_radius(pos, exp_radius)
|
||||
for _,obj in ipairs(objects) do
|
||||
local obj_p = obj:getpos()
|
||||
local obj_p = obj:get_pos()
|
||||
local vec = {x=obj_p.x-pos.x, y=obj_p.y-pos.y, z=obj_p.z-pos.z}
|
||||
local dist = (vec.x^2+vec.y^2+vec.z^2)^0.5
|
||||
local damage = (-exp_radius*dist+exp_radius^2)*2
|
||||
@ -231,7 +231,7 @@ function explosion(pos, exp_radius, fire, kamehameha_bad)
|
||||
|
||||
if obj then
|
||||
|
||||
obj:setvelocity({
|
||||
obj:set_velocity({
|
||||
x = math.random(-2, 2),
|
||||
y = 7,
|
||||
z = math.random(-2, 2)
|
||||
@ -271,8 +271,8 @@ end
|
||||
|
||||
--if math.random(1,nssm:virulence(self)) ~= 1 then return end
|
||||
|
||||
local v = self.object:getvelocity()
|
||||
local pos = self.object:getpos()
|
||||
local v = self.object:get_velocity()
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
if minetest.is_protected(pos, "") then
|
||||
return
|
||||
@ -282,7 +282,7 @@ end
|
||||
|
||||
local max = 0
|
||||
--local posmax = 0 -- 1 = x, -1=-x, 2 = z, -2 = -z
|
||||
local yaw = (self.object:getyaw() + self.rotate) or 0
|
||||
local yaw = (self.object:get_yaw() + self.rotate) or 0
|
||||
local x = math.sin(yaw)*-1
|
||||
local z = math.cos(yaw)
|
||||
|
||||
@ -338,8 +338,8 @@ function digging_attack(
|
||||
|
||||
--if math.random(1,nssm:virulence(self)) ~= 1 then return end
|
||||
if self.attack and self.attack:is_player() then
|
||||
local s = self.object:getpos()
|
||||
local p = self.attack:getpos()
|
||||
local s = self.object:get_pos()
|
||||
local p = self.attack:get_pos()
|
||||
|
||||
local dir = vector.subtract(p,s)
|
||||
dir = vector.normalize(dir)
|
||||
@ -394,7 +394,7 @@ function putting_ability( --puts under the mob the block defined as 'p_block'
|
||||
)
|
||||
--if math.random(1,nssm:virulence(self)) ~= 1 then return end
|
||||
|
||||
local v = self.object:getvelocity()
|
||||
local v = self.object:get_velocity()
|
||||
|
||||
local dx = 0
|
||||
local dz = 0
|
||||
@ -413,7 +413,7 @@ function putting_ability( --puts under the mob the block defined as 'p_block'
|
||||
end
|
||||
end
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local pos1
|
||||
pos.y=pos.y-1
|
||||
pos1 = {x = pos.x+dx, y = pos.y, z = pos.z+dz}
|
||||
@ -447,7 +447,7 @@ function webber_ability( --puts randomly around the block defined as w_block
|
||||
|
||||
if (nssm:virulence(self)~=0) and (math.random(1,nssm:virulence(self)) ~= 1) then return end
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
if (math.random(1,55)==1) then
|
||||
local dx=math.random(1,radius)
|
||||
local dz=math.random(1,radius)
|
||||
@ -470,15 +470,15 @@ function midas_ability( --ability to transform every blocks it touches in the m
|
||||
)
|
||||
--if math.random(1,nssm:virulence(self)) ~= 1 then return end
|
||||
|
||||
local v = self.object:getvelocity()
|
||||
local pos = self.object:getpos()
|
||||
local v = self.object:get_velocity()
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
if minetest.is_protected(pos, "") then
|
||||
return
|
||||
end
|
||||
|
||||
local max = 0
|
||||
local yaw = (self.object:getyaw() + self.rotate) or 0
|
||||
local yaw = (self.object:get_yaw() + self.rotate) or 0
|
||||
local x = math.sin(yaw)*-1
|
||||
local z = math.cos(yaw)
|
||||
|
||||
@ -634,8 +634,8 @@ local function eject_drops(drops, pos, radius)
|
||||
local obj = minetest.add_item(drop_pos, dropitem)
|
||||
if obj then
|
||||
obj:get_luaentity().collect = true
|
||||
obj:setacceleration({x = 0, y = -10, z = 0})
|
||||
obj:setvelocity({x = math.random(-3, 3),
|
||||
obj:set_acceleration({x = 0, y = -10, z = 0})
|
||||
obj:set_velocity({x = math.random(-3, 3),
|
||||
y = math.random(0, 10),
|
||||
z = math.random(-3, 3)})
|
||||
end
|
||||
@ -680,7 +680,7 @@ end
|
||||
local function entity_physics(pos, radius, drops)
|
||||
local objs = minetest.get_objects_inside_radius(pos, radius)
|
||||
for _, obj in pairs(objs) do
|
||||
local obj_pos = obj:getpos()
|
||||
local obj_pos = obj:get_pos()
|
||||
local dist = math.max(1, vector.distance(pos, obj_pos))
|
||||
|
||||
local damage = (4 / dist) * radius
|
||||
@ -692,7 +692,7 @@ local function entity_physics(pos, radius, drops)
|
||||
local moveoff = vector.multiply(dir, dist + 1.0)
|
||||
local newpos = vector.add(pos, moveoff)
|
||||
newpos = vector.add(newpos, {x = 0, y = 0.2, z = 0})
|
||||
obj:setpos(newpos)
|
||||
obj:set_pos(newpos)
|
||||
|
||||
obj:set_hp(obj:get_hp() - damage)
|
||||
else
|
||||
@ -713,8 +713,8 @@ local function entity_physics(pos, radius, drops)
|
||||
end
|
||||
|
||||
if do_knockback then
|
||||
local obj_vel = obj:getvelocity()
|
||||
obj:setvelocity(calc_velocity(pos, obj_pos,
|
||||
local obj_vel = obj:get_velocity()
|
||||
obj:set_velocity(calc_velocity(pos, obj_pos,
|
||||
obj_vel, radius * 10))
|
||||
end
|
||||
if do_damage then
|
||||
|
@ -870,8 +870,8 @@ minetest.register_tool("nssm:axe_of_pride", {
|
||||
end
|
||||
end
|
||||
if part == 1 then
|
||||
local s = dropper:getpos()
|
||||
local p = obj:getpos()
|
||||
local s = dropper:get_pos()
|
||||
local p = obj:get_pos()
|
||||
local m = 2
|
||||
|
||||
minetest.add_particlespawner(
|
||||
@ -915,7 +915,7 @@ minetest.register_tool("nssm:gratuitousness_battleaxe", {
|
||||
local objects = minetest.get_objects_inside_radius(pos, 10)
|
||||
local flag = 0
|
||||
local vec = dropper:get_look_dir()
|
||||
local pos = dropper:getpos()
|
||||
local pos = dropper:get_pos()
|
||||
--vec.y = 0
|
||||
|
||||
for i=1,10 do
|
||||
@ -983,12 +983,12 @@ minetest.register_tool("nssm:sword_of_eagerness", {
|
||||
minetest.chat_send_player(pname, "You haven't got any Energy Globe!")
|
||||
return
|
||||
else
|
||||
local pos = obj:getpos()
|
||||
local pos = obj:get_pos()
|
||||
pos.y = pos.y + 15
|
||||
if (obj:is_player()) then
|
||||
if (obj:get_player_name()~=dropper:get_player_name()) then
|
||||
part=1
|
||||
obj:setpos(pos)
|
||||
obj:set_pos(pos)
|
||||
--flag = 1
|
||||
|
||||
local items = player_inv:get_stack('main', found)
|
||||
@ -998,7 +998,7 @@ minetest.register_tool("nssm:sword_of_eagerness", {
|
||||
else
|
||||
if (obj:get_luaentity().health) then
|
||||
obj:get_luaentity().old_y = pos.y
|
||||
obj:setpos(pos)
|
||||
obj:set_pos(pos)
|
||||
part=1
|
||||
--flag = 1
|
||||
|
||||
@ -1049,7 +1049,7 @@ minetest.register_tool("nssm:falchion_of_eagerness", {
|
||||
},
|
||||
on_drop = function(itemstack, dropper, pos)
|
||||
local vec = dropper:get_look_dir()
|
||||
local pos = dropper:getpos()
|
||||
local pos = dropper:get_pos()
|
||||
--vec.y = 0
|
||||
|
||||
for i=1,16 do
|
||||
@ -1077,7 +1077,7 @@ minetest.register_tool("nssm:falchion_of_eagerness", {
|
||||
minetest.chat_send_player(pname, "You haven't got enough life_energy!")
|
||||
return
|
||||
else
|
||||
local s = dropper:getpos()
|
||||
local s = dropper:get_pos()
|
||||
minetest.add_particlespawner(
|
||||
25, --amount
|
||||
0.3, --time
|
||||
@ -1099,7 +1099,7 @@ minetest.register_tool("nssm:falchion_of_eagerness", {
|
||||
minetest.remove_node(pos)
|
||||
pos.y=pos.y-2
|
||||
minetest.remove_node(pos)
|
||||
dropper:setpos(pos)
|
||||
dropper:set_pos(pos)
|
||||
s = pos
|
||||
s.y = s.y+10
|
||||
minetest.add_particlespawner(
|
||||
@ -1249,7 +1249,7 @@ minetest.register_tool("nssm:sword_of_gluttony", {
|
||||
else
|
||||
if (obj:get_luaentity().health) then
|
||||
if obj:get_luaentity().health <= 32 then
|
||||
local pos = obj:getpos()
|
||||
local pos = obj:get_pos()
|
||||
obj:remove()
|
||||
|
||||
--check_for_death(obj:get_luaentity())
|
||||
@ -1264,8 +1264,8 @@ minetest.register_tool("nssm:sword_of_gluttony", {
|
||||
drops(drop)
|
||||
end
|
||||
|
||||
local s = obj:getpos()
|
||||
local p = dropper:getpos()
|
||||
local s = obj:get_pos()
|
||||
local p = dropper:get_pos()
|
||||
local m = 3
|
||||
|
||||
minetest.add_particlespawner(
|
||||
@ -1331,7 +1331,7 @@ minetest.register_tool("nssm:death_scythe", {
|
||||
drop = minetest.add_item(pos, "nssm:energy_globe 1")
|
||||
|
||||
if drop then
|
||||
drop:setvelocity({
|
||||
drop:set_velocity({
|
||||
x = math.random(-10, 10) / 9,
|
||||
y = 5,
|
||||
z = math.random(-10, 10) / 9,
|
||||
@ -1340,7 +1340,7 @@ minetest.register_tool("nssm:death_scythe", {
|
||||
end
|
||||
end
|
||||
end
|
||||
local pos = dropper:getpos()
|
||||
local pos = dropper:get_pos()
|
||||
local vec = {x=5,y=5,z=5}
|
||||
local poslist = minetest.find_nodes_in_area(vector.subtract(pos, vec), vector.add(pos,vec), "default:dirt_with_grass")
|
||||
for _,v in pairs(poslist) do
|
||||
|
@ -2,7 +2,7 @@
|
||||
--function
|
||||
function spears_shot (itemstack, player)
|
||||
local spear = itemstack:get_name() .. '_entity'
|
||||
local playerpos = player:getpos()
|
||||
local playerpos = player:get_pos()
|
||||
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear)
|
||||
local dir = player:get_look_dir()
|
||||
if spear == "nssm:spear_of_peace_entity" then
|
||||
@ -13,9 +13,9 @@ function spears_shot (itemstack, player)
|
||||
gravity = 9.8
|
||||
end
|
||||
local dr = .3
|
||||
obj:setvelocity({x=dir.x*sp, y=dir.y*sp, z=dir.z*sp})
|
||||
obj:setacceleration({x=-dir.x*dr, y=-gravity, z=-dir.z*dr})
|
||||
obj:setyaw(player:get_look_yaw()+math.pi)
|
||||
obj:set_velocity({x=dir.x*sp, y=dir.y*sp, z=dir.z*sp})
|
||||
obj:set_acceleration({x=-dir.x*dr, y=-gravity, z=-dir.z*dr})
|
||||
obj:set_yaw(player:get_look_yaw()+math.pi)
|
||||
minetest.sound_play("spears_sound", {pos=playerpos})
|
||||
obj:get_luaentity().wear = itemstack:get_wear()
|
||||
return true
|
||||
@ -47,7 +47,7 @@ function spears_set_entity(kind, eq, toughness)
|
||||
|
||||
SPEAR_ENTITY.on_step = function(self, dtime)
|
||||
self.timer=self.timer+dtime
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local node = minetest.get_node(pos)
|
||||
if not self.wear then
|
||||
self.object:remove()
|
||||
@ -64,7 +64,7 @@ function spears_set_entity(kind, eq, toughness)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
local speed = vector.length(self.object:getvelocity())
|
||||
local speed = vector.length(self.object:get_velocity())
|
||||
local damage = (speed + eq)^1.12-20
|
||||
obj:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
@ -207,7 +207,7 @@ spears_register_spear('felucco_horn', 'Felucco Horn', 7, 9, 'nssm:felucco_horn')
|
||||
|
||||
SUPERSPEAR_ENTITY.on_step = function(self, dtime)
|
||||
self.timer=self.timer+dtime
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local node = minetest.get_node(pos)
|
||||
if not self.wear then
|
||||
self.object:remove()
|
||||
@ -224,7 +224,7 @@ spears_register_spear('felucco_horn', 'Felucco Horn', 7, 9, 'nssm:felucco_horn')
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
local speed = vector.length(self.object:getvelocity())
|
||||
local speed = vector.length(self.object:get_velocity())
|
||||
--minetest.chat_send_all(speed)
|
||||
local damage = (speed + eq)^1.12-20
|
||||
obj:punch(self.object, 1.0, {
|
||||
|
@ -8,10 +8,10 @@ local default_dir = {
|
||||
--Function used to shoot:
|
||||
local function weapons_shot(itemstack, placer, pointed_thing, velocity, name)
|
||||
local dir = placer:get_look_dir();
|
||||
local playerpos = placer:getpos();
|
||||
local playerpos = placer:get_pos();
|
||||
local obj = minetest.add_entity({x=playerpos.x+0+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "nssm:"..name)
|
||||
local vec = {x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}
|
||||
obj:setvelocity(vec)
|
||||
obj:set_velocity(vec)
|
||||
return itemstack
|
||||
end
|
||||
|
||||
@ -39,7 +39,7 @@ local function search_on_step2(
|
||||
radius, --radius in which look for entities to follow
|
||||
vel) --velocity of the projectile
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
--Disappear after a certain time
|
||||
if self.life_time == 0 then
|
||||
@ -59,7 +59,7 @@ local function search_on_step2(
|
||||
for _,obj in ipairs(objects) do
|
||||
if (obj:is_player()) then
|
||||
elseif (obj:get_luaentity() and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= self.object:get_luaentity().name) then
|
||||
obj_p = obj:getpos()
|
||||
obj_p = obj:get_pos()
|
||||
local vec = {x=obj_p.x-pos.x, y=obj_p.y-pos.y, z=obj_p.z-pos.z}
|
||||
local dist = (vec.x^2+vec.y^2+vec.z^2)^0.5
|
||||
if (dist<min_dist) then
|
||||
@ -93,15 +93,15 @@ local function search_on_step2(
|
||||
vec_min.x = (vec_min.x/max_diff)*vel
|
||||
vec_min.y = (vec_min.y/max_diff)*vel
|
||||
vec_min.z = (vec_min.z/max_diff)*vel
|
||||
obj_p = obj_min:getpos()
|
||||
obj_p = obj_min:get_pos()
|
||||
if min_dist <=8 and self.move==0 then
|
||||
self.object:setvelocity({x=0, y=0, z=0})
|
||||
self.object:set_velocity({x=0, y=0, z=0})
|
||||
|
||||
--hit(pos,self)
|
||||
elseif min_dist<=1 and self.move==1 then
|
||||
hit(pos,self)
|
||||
else
|
||||
self.object:setvelocity(vec_min)
|
||||
self.object:set_velocity(vec_min)
|
||||
end
|
||||
end
|
||||
|
||||
@ -120,7 +120,7 @@ local function search_on_step(
|
||||
vel) --velocity of the projectile
|
||||
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
--Disappear after a certain time
|
||||
if self.life_time == 0 then
|
||||
@ -141,7 +141,7 @@ local function search_on_step(
|
||||
for _,obj in ipairs(objects) do
|
||||
if (obj:is_player()) then
|
||||
elseif (obj:get_luaentity() and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= self.object:get_luaentity().name) then
|
||||
obj_p = obj:getpos()
|
||||
obj_p = obj:get_pos()
|
||||
local vec = {x=obj_p.x-pos.x, y=obj_p.y-pos.y, z=obj_p.z-pos.z}
|
||||
local dist = (vec.x^2+vec.y^2+vec.z^2)^0.5
|
||||
if (dist<min_dist) then
|
||||
@ -175,14 +175,14 @@ local function search_on_step(
|
||||
vec_min.x = (vec_min.x/max_diff)*vel
|
||||
vec_min.y = (vec_min.y/max_diff)*vel
|
||||
vec_min.z = (vec_min.z/max_diff)*vel
|
||||
obj_p = obj_min:getpos()
|
||||
obj_p = obj_min:get_pos()
|
||||
if min_dist < 1 then
|
||||
local node = node_ok(pos).name
|
||||
self.hit_node(self, pos, node)
|
||||
self.object:remove()
|
||||
return
|
||||
else
|
||||
self.object:setvelocity(vec_min)
|
||||
self.object:set_velocity(vec_min)
|
||||
end
|
||||
end
|
||||
local n = minetest.get_node(pos).name
|
||||
@ -205,7 +205,7 @@ local function default_on_step(
|
||||
vel) --velocity of the projectile
|
||||
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
if self.life_time == 0 then
|
||||
self.life_time = os.time()
|
||||
@ -248,7 +248,7 @@ local function default_on_step(
|
||||
self.object:remove()
|
||||
return
|
||||
else
|
||||
local vec = self.object:getvelocity()
|
||||
local vec = self.object:get_velocity()
|
||||
local c=vel/10
|
||||
--calculate how many blocks around need to be removed
|
||||
local max = 0
|
||||
@ -403,7 +403,7 @@ nssm_register_weapon("hellzone_grenade", {
|
||||
end,
|
||||
|
||||
on_drop = function(itemstack, user, pointed_thing)
|
||||
local pos = user:getpos()
|
||||
local pos = user:get_pos()
|
||||
activate_balls(pos)
|
||||
end,
|
||||
material = "default:mese",
|
||||
@ -415,7 +415,7 @@ nssm_register_weapon("hellzone_grenade", {
|
||||
move = 0,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local vel = 1
|
||||
|
||||
minetest.add_particlespawner({
|
||||
@ -454,7 +454,7 @@ nssm_register_weapon("hellzone_grenade", {
|
||||
for _,obj in ipairs(objects) do
|
||||
if (obj:is_player()) then
|
||||
elseif (obj:get_luaentity() and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= self.object:get_luaentity().name) then
|
||||
obj_p = obj:getpos()
|
||||
obj_p = obj:get_pos()
|
||||
local vec = {x=obj_p.x-pos.x, y=obj_p.y-pos.y, z=obj_p.z-pos.z}
|
||||
local dist = (vec.x^2+vec.y^2+vec.z^2)^0.5
|
||||
if (dist<min_dist) then
|
||||
@ -488,9 +488,9 @@ nssm_register_weapon("hellzone_grenade", {
|
||||
vec_min.x = (vec_min.x/max_diff)*vel
|
||||
vec_min.y = (vec_min.y/max_diff)*vel
|
||||
vec_min.z = (vec_min.z/max_diff)*vel
|
||||
obj_p = obj_min:getpos()
|
||||
obj_p = obj_min:get_pos()
|
||||
|
||||
self.object:setvelocity(vec_min)
|
||||
self.object:set_velocity(vec_min)
|
||||
if min_dist < 1 then
|
||||
|
||||
local node = nssm:node_ok(pos).name
|
||||
@ -498,7 +498,7 @@ nssm_register_weapon("hellzone_grenade", {
|
||||
self.object:remove()
|
||||
return
|
||||
else
|
||||
self.object:setvelocity(vec_min)
|
||||
self.object:set_velocity(vec_min)
|
||||
end
|
||||
|
||||
end
|
||||
@ -518,7 +518,7 @@ nssm_register_weapon("hellzone_grenade", {
|
||||
end,
|
||||
|
||||
on_drop = function(itemstack, user, pointed_thing)
|
||||
local pos = user:getpos()
|
||||
local pos = user:get_pos()
|
||||
--activate_balls(pos)
|
||||
end,
|
||||
material = "group:wood",
|
||||
@ -531,7 +531,7 @@ nssm_register_weapon("light_ball", {
|
||||
move = 0,
|
||||
|
||||
on_step = function(self, dtime, last_pos)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local vel = 1
|
||||
|
||||
|
||||
@ -565,7 +565,7 @@ nssm_register_weapon("light_ball", {
|
||||
for _,obj in ipairs(objects) do
|
||||
if (obj:is_player()) then
|
||||
elseif (obj:get_luaentity() and obj:get_luaentity().name ~= "__builtin:item" and obj:get_luaentity().name ~= self.object:get_luaentity().name) then
|
||||
obj_p = obj:getpos()
|
||||
obj_p = obj:get_pos()
|
||||
local vec = {x=obj_p.x-pos.x, y=obj_p.y-pos.y, z=obj_p.z-pos.z}
|
||||
local dist = (vec.x^2+vec.y^2+vec.z^2)^0.5
|
||||
if (dist<min_dist) then
|
||||
@ -599,9 +599,9 @@ nssm_register_weapon("light_ball", {
|
||||
vec_min.x = (vec_min.x/max_diff)*vel
|
||||
vec_min.y = (vec_min.y/max_diff)*vel
|
||||
vec_min.z = (vec_min.z/max_diff)*vel
|
||||
obj_p = obj_min:getpos()
|
||||
obj_p = obj_min:get_pos()
|
||||
|
||||
self.object:setvelocity(vec_min)
|
||||
self.object:set_velocity(vec_min)
|
||||
if min_dist < 1 then
|
||||
|
||||
local node = nssm:node_ok(pos).name
|
||||
@ -609,7 +609,7 @@ nssm_register_weapon("light_ball", {
|
||||
self.object:remove()
|
||||
return
|
||||
else
|
||||
self.object:setvelocity(vec_min)
|
||||
self.object:set_velocity(vec_min)
|
||||
end
|
||||
|
||||
end
|
||||
@ -629,7 +629,7 @@ nssm_register_weapon("light_ball", {
|
||||
end,
|
||||
|
||||
on_drop = function(itemstack, user, pointed_thing)
|
||||
local pos = user:getpos()
|
||||
local pos = user:get_pos()
|
||||
--activate_balls(pos)
|
||||
end,
|
||||
material = "group:sand",
|
||||
@ -645,13 +645,13 @@ function nssm_register_throwitem(name, descr, def)
|
||||
--weapons_shot(itemstack, placer, pointed_thing, def.velocity, name)
|
||||
local velocity = 15
|
||||
local dir = placer:get_look_dir();
|
||||
local playerpos = placer:getpos();
|
||||
local playerpos = placer:get_pos();
|
||||
posthrow = playerpos
|
||||
local obj = minetest.add_entity({x=playerpos.x+0+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "nssm:"..name.."_bomb_flying")
|
||||
local vec = {x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}
|
||||
local acc = {x=0, y=-9.8, z=0}
|
||||
obj:setvelocity(vec)
|
||||
obj:setacceleration(acc)
|
||||
obj:set_velocity(vec)
|
||||
obj:set_acceleration(acc)
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end,
|
||||
@ -662,7 +662,7 @@ function nssm_register_throwitem(name, descr, def)
|
||||
hp_max = 20,
|
||||
collisionbox = {-0.1,-0.1,-0.1, 0.1,0.1,0.1},
|
||||
on_step = function(self, dtime)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local node = minetest.get_node(pos)
|
||||
local n = node.name
|
||||
if n ~= "air" then
|
||||
@ -950,7 +950,7 @@ nssm_register_throwitem("teleport", "Teleport Bomb", {
|
||||
if not minetest.is_protected(pos1, "") or not minetest.get_item_group(minetest.get_node(pos1).name, "unbreakable") == 1 then
|
||||
for _,obj in ipairs(minetest.get_objects_inside_radius(posthrow, 2)) do
|
||||
if obj:is_player() then
|
||||
obj:setpos(pos1)
|
||||
obj:set_pos(pos1)
|
||||
minetest.set_node(pos1, {name="air"})
|
||||
minetest.set_node(pos2, {name="air"})
|
||||
end
|
||||
@ -1193,12 +1193,12 @@ function nssm_register_throwegg(name, descr, def)
|
||||
--weapons_shot(itemstack, placer, pointed_thing, def.velocity, name)
|
||||
local velocity = 15
|
||||
local dir = placer:get_look_dir();
|
||||
local playerpos = placer:getpos();
|
||||
local playerpos = placer:get_pos();
|
||||
local obj = minetest.add_entity({x=playerpos.x+0+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "nssm:"..name.."_bomb_flying")
|
||||
local vec = {x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}
|
||||
local acc = {x=0, y=-9.8, z=0}
|
||||
obj:setvelocity(vec)
|
||||
obj:setacceleration(acc)
|
||||
obj:set_velocity(vec)
|
||||
obj:set_acceleration(acc)
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end,
|
||||
@ -1207,7 +1207,7 @@ function nssm_register_throwegg(name, descr, def)
|
||||
minetest.register_entity("nssm:"..name.."_bomb_flying",{
|
||||
textures = {"evocation_bomb.png^"..name.."_egg.png"},
|
||||
on_step = function(self, dtime)
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
local node = minetest.get_node(pos)
|
||||
local n = node.name
|
||||
if n ~= "air" then
|
||||
|
@ -6,7 +6,7 @@ minetest.register_entity("nssm:rainbow", {
|
||||
on_step = function (self, pos, node, dtime)
|
||||
self.timer = self.timer or os.time()
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local pos = self.object:get_pos()
|
||||
if minetest.is_protected(pos, "") then
|
||||
return
|
||||
end
|
||||
@ -36,10 +36,10 @@ minetest.register_tool("nssm:rainbow_staff", {
|
||||
inventory_image = "rainbow_staff.png",
|
||||
on_use = function(itemstack, placer, pointed_thing)
|
||||
local dir = placer:get_look_dir();
|
||||
local playerpos = placer:getpos();
|
||||
local playerpos = placer:get_pos();
|
||||
local obj = minetest.add_entity({x=playerpos.x+0+dir.x,y=playerpos.y+2+dir.y,z=playerpos.z+0+dir.z}, "nssm:rainbow")
|
||||
local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6}
|
||||
obj:setvelocity(vec)
|
||||
obj:set_velocity(vec)
|
||||
return itemstack
|
||||
end,
|
||||
groups = {not_in_creative_inventory=1,}
|
||||
|
Loading…
x
Reference in New Issue
Block a user