Working on weapons
This commit is contained in:
parent
d1223d3b94
commit
e49d27e86e
6
api.lua
6
api.lua
@ -2670,6 +2670,7 @@ end
|
|||||||
--end of NSSM additions
|
--end of NSSM additions
|
||||||
|
|
||||||
-- explosion (cannot break protected or unbreakable nodes)
|
-- explosion (cannot break protected or unbreakable nodes)
|
||||||
|
--[[
|
||||||
function nssm:explosion(pos, radius, fire, smoke, sound)
|
function nssm:explosion(pos, radius, fire, smoke, sound)
|
||||||
|
|
||||||
radius = radius or 0
|
radius = radius or 0
|
||||||
@ -2767,7 +2768,7 @@ function nssm:explosion(pos, radius, fire, smoke, sound)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--NSSM modification is it really useful?
|
--NSSM modification is it really useful?
|
||||||
--[[
|
|
||||||
else if (x<3)and(y<3)and(z<3)and(x>-3)and(y>-3)and(z>-3) then
|
else if (x<3)and(y<3)and(z<3)and(x>-3)and(y>-3)and(z>-3) then
|
||||||
if (math.random(1,100))>25 then
|
if (math.random(1,100))>25 then
|
||||||
minetest.remove_node(p)
|
minetest.remove_node(p)
|
||||||
@ -2778,7 +2779,7 @@ function nssm:explosion(pos, radius, fire, smoke, sound)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
]]--
|
--end of NSSM modification
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -2789,6 +2790,7 @@ function nssm:explosion(pos, radius, fire, smoke, sound)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
]]
|
||||||
|
|
||||||
-- register arrow for shoot attack
|
-- register arrow for shoot attack
|
||||||
function nssm:register_arrow(name, def)
|
function nssm:register_arrow(name, def)
|
||||||
|
4
init.lua
4
init.lua
@ -53,5 +53,7 @@ dofile(path.."/rainbow_staff.lua")
|
|||||||
dofile(path.."/darts.lua")
|
dofile(path.."/darts.lua")
|
||||||
dofile(path.."/nssm_materials.lua")
|
dofile(path.."/nssm_materials.lua")
|
||||||
dofile(path.."/kienzan.lua")
|
dofile(path.."/kienzan.lua")
|
||||||
dofile(path.."/kamehameha.lua")
|
--dofile(path.."/kamehameha.lua")
|
||||||
dofile(path.."/nssm_spears.lua")
|
dofile(path.."/nssm_spears.lua")
|
||||||
|
dofile(path.."/nssm_api.lua")
|
||||||
|
dofile(path.."/nssm_weapons.lua")
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
kame_velocity = 30
|
kame_velocity = 30
|
||||||
exp_radius = 4
|
exp_radius = 4
|
||||||
|
|
||||||
local function round(n)
|
|
||||||
return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_entity("nssm:kamehameha", {
|
minetest.register_entity("nssm:kamehameha", {
|
||||||
textures = {"kamehameha.png"},
|
textures = {"kamehameha.png"},
|
||||||
on_step = function (self, pos, node, dtime)
|
on_step = function (self, pos, node, dtime)
|
||||||
@ -38,9 +33,9 @@ minetest.register_entity("nssm:kamehameha", {
|
|||||||
local c=3
|
local c=3
|
||||||
|
|
||||||
--calculate how many blocks around the kamehameha need to be removed
|
--calculate how many blocks around the kamehameha need to be removed
|
||||||
local i = round(math.abs(math.abs(vec.x)-kame_velocity)*0.01*c)
|
local i = nssm:round(math.abs(math.abs(vec.x)-kame_velocity)*0.01*c)
|
||||||
local j = round(math.abs(math.abs(vec.y)-kame_velocity)*0.01*c)
|
local j = nssm:round(math.abs(math.abs(vec.y)-kame_velocity)*0.01*c)
|
||||||
local k = round(math.abs(math.abs(vec.z)-kame_velocity)*0.01*c)
|
local k = nssm:round(math.abs(math.abs(vec.z)-kame_velocity)*0.01*c)
|
||||||
|
|
||||||
for dx = -i,i do
|
for dx = -i,i do
|
||||||
for dy= -j,j do
|
for dy= -j,j do
|
||||||
@ -163,7 +158,6 @@ minetest.register_tool("nssm:kamehameha_hand", {
|
|||||||
obj:setvelocity(vec)
|
obj:setvelocity(vec)
|
||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
light_source = 12,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user