Removed references to the old APIS
parent
0f1610be11
commit
1121f6cbc7
|
@ -91,7 +91,7 @@ mobs:register_mob("nssm:ant_queen", {
|
||||||
and (minetest.env:get_node(pos1).name == "air")
|
and (minetest.env:get_node(pos1).name == "air")
|
||||||
and (counter < 4)
|
and (counter < 4)
|
||||||
then
|
then
|
||||||
nssm:explosion_particles(pos1, 1)
|
explosion_particles(pos1, 1)
|
||||||
minetest.add_entity(pos1, "nssm:ant_soldier")
|
minetest.add_entity(pos1, "nssm:ant_soldier")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,6 +53,6 @@ mobs:register_mob("nssm:black_widow", {
|
||||||
punch_end = 160,
|
punch_end = 160,
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:webber_ability(self, "nssm:web", 2)
|
webber_ability(self, "nssm:web", 2)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
46
darts.lua
46
darts.lua
|
@ -1,5 +1,5 @@
|
||||||
-- arrow (duck_arrow)
|
-- arrow (duck_arrow)
|
||||||
nssm:register_arrow("nssm:duck_father", {
|
mobs:register_arrow("nssm:duck_father", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"duck_egg.png"},
|
textures = {"duck_egg.png"},
|
||||||
|
@ -7,21 +7,21 @@ nssm:register_arrow("nssm:duck_father", {
|
||||||
-- direct hit
|
-- direct hit
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
nssm:duck_explosion(pos)
|
duck_explosion(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_mob = function(self, player)
|
hit_mob = function(self, player)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
nssm:duck_explosion(pos)
|
duck_explosion(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:duck_explosion(pos)
|
duck_explosion(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function nssm:duck_explosion(pos)
|
function duck_explosion(pos)
|
||||||
pos.y = pos.y+1;
|
pos.y = pos.y+1;
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 10,
|
amount = 10,
|
||||||
|
@ -66,7 +66,7 @@ function nssm:duck_explosion(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- snow_arrow
|
-- snow_arrow
|
||||||
nssm:register_arrow("nssm:snow_arrow", {
|
mobs:register_arrow("nssm:snow_arrow", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"transparent.png"},
|
textures = {"transparent.png"},
|
||||||
|
@ -74,19 +74,19 @@ nssm:register_arrow("nssm:snow_arrow", {
|
||||||
-- direct hit
|
-- direct hit
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
nssm:ice_explosion(pos)
|
ice_explosion(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_mob = function(self, player)
|
hit_mob = function(self, player)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
nssm:ice_explosion(pos)
|
ice_explosion(pos)
|
||||||
end,
|
end,
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:ice_explosion(pos)
|
ice_explosion(pos)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
function nssm:ice_explosion(pos)
|
function ice_explosion(pos)
|
||||||
for i=pos.x-math.random(0, 1), pos.x+math.random(0, 1), 1 do
|
for i=pos.x-math.random(0, 1), pos.x+math.random(0, 1), 1 do
|
||||||
for j=pos.y-1, pos.y+4, 1 do
|
for j=pos.y-1, pos.y+4, 1 do
|
||||||
for k=pos.z-math.random(0, 1), pos.z+math.random(0, 1), 1 do
|
for k=pos.z-math.random(0, 1), pos.z+math.random(0, 1), 1 do
|
||||||
|
@ -97,7 +97,7 @@ function nssm:ice_explosion(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- arrow manticore
|
-- arrow manticore
|
||||||
nssm:register_arrow("nssm:spine", {
|
mobs:register_arrow("nssm:spine", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"manticore_spine_flying.png"},
|
textures = {"manticore_spine_flying.png"},
|
||||||
|
@ -119,12 +119,12 @@ nssm:register_arrow("nssm:spine", {
|
||||||
})
|
})
|
||||||
|
|
||||||
--morbat arrow
|
--morbat arrow
|
||||||
nssm:register_arrow("nssm:morarrow", {
|
mobs:register_arrow("nssm:morarrow", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x=0.5, y=0.5},
|
visual_size = {x=0.5, y=0.5},
|
||||||
textures = {"morarrow.png"},
|
textures = {"morarrow.png"},
|
||||||
velocity= 13,
|
velocity= 13,
|
||||||
|
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
player:punch(self.object, 1.0, {
|
player:punch(self.object, 1.0, {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.0,
|
||||||
|
@ -134,7 +134,7 @@ nssm:register_arrow("nssm:morarrow", {
|
||||||
})
|
})
|
||||||
|
|
||||||
-- web arrow
|
-- web arrow
|
||||||
nssm:register_arrow("nssm:webball", {
|
mobs:register_arrow("nssm:webball", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"web_ball.png"},
|
textures = {"web_ball.png"},
|
||||||
|
@ -142,7 +142,7 @@ nssm:register_arrow("nssm:webball", {
|
||||||
-- direct hit
|
-- direct hit
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
local p = player:getpos()
|
local p = player:getpos()
|
||||||
nssm:explosion_web(p)
|
explosion_web(p)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_mob = function(self, player)
|
hit_mob = function(self, player)
|
||||||
|
@ -153,11 +153,11 @@ nssm:register_arrow("nssm:webball", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:explosion_web(pos)
|
explosion_web(pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
function nssm:explosion_web(pos)
|
function explosion_web(pos)
|
||||||
if minetest.is_protected(pos, "") then
|
if minetest.is_protected(pos, "") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -182,7 +182,7 @@ function nssm:explosion_web(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- arrow=>phoenix arrow
|
-- arrow=>phoenix arrow
|
||||||
nssm:register_arrow("nssm:phoenix_arrow", {
|
mobs:register_arrow("nssm:phoenix_arrow", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"transparent.png"},
|
textures = {"transparent.png"},
|
||||||
|
@ -223,7 +223,7 @@ nssm:register_arrow("nssm:phoenix_arrow", {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
nssm:register_arrow("nssm:super_gas", {
|
mobs:register_arrow("nssm:super_gas", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"transparent.png"},
|
textures = {"transparent.png"},
|
||||||
|
@ -231,16 +231,16 @@ nssm:register_arrow("nssm:super_gas", {
|
||||||
-- direct hit
|
-- direct hit
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
local p = player:getpos()
|
local p = player:getpos()
|
||||||
nssm:gas_explosion(p)
|
gas_explosion(p)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:gas_explosion(pos)
|
gas_explosion(pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
function nssm:gas_explosion(pos)
|
function gas_explosion(pos)
|
||||||
if minetest.is_protected(pos, "") then
|
if minetest.is_protected(pos, "") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -261,7 +261,7 @@ function nssm:gas_explosion(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
nssm:register_arrow("nssm:roar_of_the_dragon", {
|
mobs:register_arrow("nssm:roar_of_the_dragon", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
visual_size = {x = 1, y = 1},
|
visual_size = {x = 1, y = 1},
|
||||||
textures = {"transparent.png"},
|
textures = {"transparent.png"},
|
||||||
|
|
|
@ -62,6 +62,6 @@ mobs:register_mob("nssm:icelamander", {
|
||||||
shoot_end = 210,
|
shoot_end = 210,
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:midas_ability(self, "default:ice", self.run_velocity,1, 3)
|
midas_ability(self, "default:ice", self.run_velocity,1, 3)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -53,6 +53,6 @@ mobs:register_mob("nssm:icesnake", {
|
||||||
punch_end = 160,
|
punch_end = 160,
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:putting_ability(self, "default:ice", self.run_velocity)
|
putting_ability(self, "default:ice", self.run_velocity)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
4
init.lua
4
init.lua
|
@ -1,5 +1,5 @@
|
||||||
local path = minetest.get_modpath("nssm")
|
local path = minetest.get_modpath("nssm")
|
||||||
dofile(path.."/api.lua")
|
--dofile(path.."/api.lua")
|
||||||
--dofile(path.."/spawn.lua")
|
--dofile(path.."/spawn.lua")
|
||||||
|
|
||||||
--Mobs
|
--Mobs
|
||||||
|
@ -8,7 +8,7 @@ dofile(path.."/ant_soldier.lua")
|
||||||
dofile(path.."/ant_worker.lua")
|
dofile(path.."/ant_worker.lua")
|
||||||
dofile(path.."/black_widow.lua")
|
dofile(path.."/black_widow.lua")
|
||||||
dofile(path.."/bloco.lua")
|
dofile(path.."/bloco.lua")
|
||||||
dofile(path.."/pupumolle.lua")
|
--dofile(path.."/pupumolle.lua")
|
||||||
dofile(path.."/crab.lua")
|
dofile(path.."/crab.lua")
|
||||||
dofile(path.."/crocodile.lua")
|
dofile(path.."/crocodile.lua")
|
||||||
dofile(path.."/daddy_long_legs.lua")
|
dofile(path.."/daddy_long_legs.lua")
|
||||||
|
|
|
@ -80,7 +80,7 @@ mobs:register_mob("nssm:lava_titan", {
|
||||||
shoot_end=400,
|
shoot_end=400,
|
||||||
},
|
},
|
||||||
do_custom = function (self)
|
do_custom = function (self)
|
||||||
nssm:digging_ability(self, nil, self.run_velocity, {x=0, y=5, z=0})
|
digging_ability(self, nil, self.run_velocity, {x=0, y=5, z=0})
|
||||||
nssm:putting_ability(self, "default:lava_source", self.run_velocity)
|
putting_ability(self, "default:lava_source", self.run_velocity)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -61,7 +61,7 @@ mobs:register_mob("nssm:mese_dragon", {
|
||||||
dattack_end = 160,
|
dattack_end = 160,
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:midas_ability(self, "default:mese_block", self.run_velocity,2, 3)
|
midas_ability(self, "default:mese_block", self.run_velocity,2, 3)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
custom_attack = function(self)
|
custom_attack = function(self)
|
||||||
|
|
|
@ -92,7 +92,7 @@ mobs:register_mob("nssm:mordain", {
|
||||||
d.x = p.x + math.random(-m,m)
|
d.x = p.x + math.random(-m,m)
|
||||||
d.z = p.z + math.random(-m,m)
|
d.z = p.z + math.random(-m,m)
|
||||||
d.y = p.y
|
d.y = p.y
|
||||||
local dist = nssm:dist_pos(d, p)
|
local dist = dist_pos(d, p)
|
||||||
if dist>=2 then
|
if dist>=2 then
|
||||||
for j = -3,3 do
|
for j = -3,3 do
|
||||||
ty = d.y + j
|
ty = d.y + j
|
||||||
|
|
42
nssm_api.lua
42
nssm_api.lua
|
@ -6,7 +6,7 @@ local c_brick = minetest.get_content_id("default:obsidianbrick")
|
||||||
local c_chest = minetest.get_content_id("default:chest_locked")
|
local c_chest = minetest.get_content_id("default:chest_locked")
|
||||||
|
|
||||||
-- get node but use fallback for nil or unknown
|
-- get node but use fallback for nil or unknown
|
||||||
function nssm:node_ok(pos, fallback)
|
function node_ok(pos, fallback)
|
||||||
fallback = fallback or "default:dirt"
|
fallback = fallback or "default:dirt"
|
||||||
local node = minetest.get_node_or_nil(pos)
|
local node = minetest.get_node_or_nil(pos)
|
||||||
if not node then
|
if not node then
|
||||||
|
@ -18,14 +18,14 @@ function nssm:node_ok(pos, fallback)
|
||||||
return minetest.registered_nodes[fallback]
|
return minetest.registered_nodes[fallback]
|
||||||
end
|
end
|
||||||
|
|
||||||
function nssm:dist_pos(p, s)
|
function dist_pos(p, s)
|
||||||
local v = {x = math.abs(s.x-p.x), y = math.abs(s.y-p.y), z = math.abs(s.z-p.z)}
|
local v = {x = math.abs(s.x-p.x), y = math.abs(s.y-p.y), z = math.abs(s.z-p.z)}
|
||||||
local r = math.sqrt(v.x^2+v.y^2+v.z^2)
|
local r = math.sqrt(v.x^2+v.y^2+v.z^2)
|
||||||
return r
|
return r
|
||||||
end
|
end
|
||||||
|
|
||||||
--check_for_death functions customized for monsters who respawns (Masticone)
|
--check_for_death functions customized for monsters who respawns (Masticone)
|
||||||
function nssm:check_for_death_hydra(self)
|
function check_for_death_hydra(self)
|
||||||
local hp = self.object:get_hp()
|
local hp = self.object:get_hp()
|
||||||
if hp > 0 then
|
if hp > 0 then
|
||||||
self.health = hp
|
self.health = hp
|
||||||
|
@ -50,7 +50,7 @@ function nssm:check_for_death_hydra(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function nssm:round(n)
|
function round(n)
|
||||||
if (n>0) then
|
if (n>0) then
|
||||||
return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
|
return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
|
||||||
else
|
else
|
||||||
|
@ -60,7 +60,7 @@ function nssm:round(n)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function nssm:explosion_particles(pos, exp_radius)
|
function explosion_particles(pos, exp_radius)
|
||||||
minetest.add_particlespawner(
|
minetest.add_particlespawner(
|
||||||
100*exp_radius/2, --amount
|
100*exp_radius/2, --amount
|
||||||
0.1, --time
|
0.1, --time
|
||||||
|
@ -79,7 +79,7 @@ function nssm:explosion_particles(pos, exp_radius)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
function nssm:explosion(pos, exp_radius, fire)
|
function explosion(pos, exp_radius, fire)
|
||||||
local radius = exp_radius
|
local radius = exp_radius
|
||||||
-- if area protected or near map limits then no blast damage
|
-- if area protected or near map limits then no blast damage
|
||||||
if minetest.is_protected(pos, "")
|
if minetest.is_protected(pos, "")
|
||||||
|
@ -94,7 +94,7 @@ function nssm:explosion(pos, exp_radius, fire)
|
||||||
})
|
})
|
||||||
|
|
||||||
--particles:
|
--particles:
|
||||||
nssm:explosion_particles(pos, exp_radius)
|
explosion_particles(pos, exp_radius)
|
||||||
|
|
||||||
--Damages entities around (not the player)
|
--Damages entities around (not the player)
|
||||||
local objects = minetest.env:get_objects_inside_radius(pos, exp_radius)
|
local objects = minetest.env:get_objects_inside_radius(pos, exp_radius)
|
||||||
|
@ -134,7 +134,7 @@ function nssm:explosion(pos, exp_radius, fire)
|
||||||
and data[vi] ~= c_brick
|
and data[vi] ~= c_brick
|
||||||
and data[vi] ~= c_chest then
|
and data[vi] ~= c_chest then
|
||||||
|
|
||||||
local n = nssm:node_ok(p).name
|
local n = node_ok(p).name
|
||||||
local on_blast = minetest.registered_nodes[n].on_blast
|
local on_blast = minetest.registered_nodes[n].on_blast
|
||||||
|
|
||||||
if on_blast then
|
if on_blast then
|
||||||
|
@ -173,7 +173,7 @@ function nssm:explosion(pos, exp_radius, fire)
|
||||||
or math.random(1, 100) <= 3) then
|
or math.random(1, 100) <= 3) then
|
||||||
minetest.set_node(p, {name = "fire:basic_flame"})
|
minetest.set_node(p, {name = "fire:basic_flame"})
|
||||||
else
|
else
|
||||||
local dist = nssm:round(((pos.x-p.x)^2 + (pos.y-p.y)^2 + (pos.z-p.z)^2)^1/2)
|
local dist = round(((pos.x-p.x)^2 + (pos.y-p.y)^2 + (pos.z-p.z)^2)^1/2)
|
||||||
local prob = 2/dist
|
local prob = 2/dist
|
||||||
if math.random(1,100)<=prob*100 then
|
if math.random(1,100)<=prob*100 then
|
||||||
minetest.env:remove_node(p)
|
minetest.env:remove_node(p)
|
||||||
|
@ -188,7 +188,7 @@ function nssm:explosion(pos, exp_radius, fire)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- SPECIAL ABILITIES OF SOME MOBS
|
-- SPECIAL ABILITIES OF SOME MOBS
|
||||||
function nssm:digging_ability(
|
function digging_ability(
|
||||||
self, --the entity of the mob
|
self, --the entity of the mob
|
||||||
group, --group of the blocks the mob can dig: nil=everything
|
group, --group of the blocks the mob can dig: nil=everything
|
||||||
max_vel, --max velocity of the mob
|
max_vel, --max velocity of the mob
|
||||||
|
@ -218,15 +218,15 @@ function nssm:digging_ability(
|
||||||
local multiplier = 2
|
local multiplier = 2
|
||||||
|
|
||||||
if x>0 then
|
if x>0 then
|
||||||
i = nssm:round(x*max_vel)*multiplier
|
i = round(x*max_vel)*multiplier
|
||||||
else
|
else
|
||||||
i1 = nssm:round(x*max_vel)*multiplier
|
i1 = round(x*max_vel)*multiplier
|
||||||
end
|
end
|
||||||
|
|
||||||
if z>0 then
|
if z>0 then
|
||||||
k = nssm:round(z*max_vel)*multiplier
|
k = round(z*max_vel)*multiplier
|
||||||
else
|
else
|
||||||
k1 = nssm:round(z*max_vel)*multiplier
|
k1 = round(z*max_vel)*multiplier
|
||||||
end
|
end
|
||||||
|
|
||||||
for dx = i1, i do
|
for dx = i1, i do
|
||||||
|
@ -252,7 +252,7 @@ function nssm:digging_ability(
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function nssm:putting_ability( --puts under the mob the block defined as 'p_block'
|
function putting_ability( --puts under the mob the block defined as 'p_block'
|
||||||
self, --the entity of the mob
|
self, --the entity of the mob
|
||||||
p_block, --definition of the block to use
|
p_block, --definition of the block to use
|
||||||
max_vel --max velocity of the mob
|
max_vel --max velocity of the mob
|
||||||
|
@ -292,7 +292,7 @@ function nssm:putting_ability( --puts under the mob the block defined as 'p_blo
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function nssm:webber_ability( --puts randomly around the block defined as w_block
|
function webber_ability( --puts randomly around the block defined as w_block
|
||||||
self, --the entity of the mob
|
self, --the entity of the mob
|
||||||
w_block, --definition of the block to use
|
w_block, --definition of the block to use
|
||||||
radius --max distance the block can be put
|
radius --max distance the block can be put
|
||||||
|
@ -312,7 +312,7 @@ function nssm:webber_ability( --puts randomly around the block defined as w_blo
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function nssm:midas_ability( --ability to transform every blocks it touches in the m_block block
|
function midas_ability( --ability to transform every blocks it touches in the m_block block
|
||||||
self, --the entity of the mob
|
self, --the entity of the mob
|
||||||
m_block,
|
m_block,
|
||||||
max_vel, --max velocity of the mob
|
max_vel, --max velocity of the mob
|
||||||
|
@ -340,15 +340,15 @@ function nssm:midas_ability( --ability to transform every blocks it touches in
|
||||||
local multiplier = mult
|
local multiplier = mult
|
||||||
|
|
||||||
if x>0 then
|
if x>0 then
|
||||||
i = nssm:round(x*max_vel)*multiplier
|
i = round(x*max_vel)*multiplier
|
||||||
else
|
else
|
||||||
i1 = nssm:round(x*max_vel)*multiplier
|
i1 = round(x*max_vel)*multiplier
|
||||||
end
|
end
|
||||||
|
|
||||||
if z>0 then
|
if z>0 then
|
||||||
k = nssm:round(z*max_vel)*multiplier
|
k = round(z*max_vel)*multiplier
|
||||||
else
|
else
|
||||||
k1 = nssm:round(z*max_vel)*multiplier
|
k1 = round(z*max_vel)*multiplier
|
||||||
end
|
end
|
||||||
|
|
||||||
for dx = i1, i do
|
for dx = i1, i do
|
||||||
|
|
|
@ -279,7 +279,7 @@ minetest.register_node("nssm:pumpbomb", {
|
||||||
groups = {not_in_creative_inventory =1},
|
groups = {not_in_creative_inventory =1},
|
||||||
drop = "",
|
drop = "",
|
||||||
on_timer = function(pos, elapsed)
|
on_timer = function(pos, elapsed)
|
||||||
nssm:explosion(pos, 3, 1)
|
explosion(pos, 3, 1)
|
||||||
minetest.env:set_node(pos, {name="air"})
|
minetest.env:set_node(pos, {name="air"})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -16,7 +16,7 @@ local function weapons_shot(itemstack, placer, pointed_thing, velocity, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function hit(pos, self)
|
local function hit(pos, self)
|
||||||
local node = nssm:node_ok(pos).name
|
local node = node_ok(pos).name
|
||||||
self.hit_node(self, pos, node)
|
self.hit_node(self, pos, node)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
@ -177,7 +177,7 @@ local function search_on_step(
|
||||||
vec_min.z = (vec_min.z/max_diff)*vel
|
vec_min.z = (vec_min.z/max_diff)*vel
|
||||||
obj_p = obj_min:getpos()
|
obj_p = obj_min:getpos()
|
||||||
if min_dist < 1 then
|
if min_dist < 1 then
|
||||||
local node = nssm:node_ok(pos).name
|
local node = node_ok(pos).name
|
||||||
self.hit_node(self, pos, node)
|
self.hit_node(self, pos, node)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
@ -187,7 +187,7 @@ local function search_on_step(
|
||||||
end
|
end
|
||||||
local n = minetest.env:get_node(pos).name
|
local n = minetest.env:get_node(pos).name
|
||||||
if n ~= "air" and n ~= "default:water_source" and n ~= "default:water_flowing" then
|
if n ~= "air" and n ~= "default:water_source" and n ~= "default:water_flowing" then
|
||||||
local node = nssm:node_ok(pos).name
|
local node = node_ok(pos).name
|
||||||
self.hit_node(self, pos, node)
|
self.hit_node(self, pos, node)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
@ -213,7 +213,7 @@ local function default_on_step(
|
||||||
|
|
||||||
|
|
||||||
if os.time() - self.life_time > max_time then
|
if os.time() - self.life_time > max_time then
|
||||||
local node = nssm:node_ok(pos).name
|
local node = node_ok(pos).name
|
||||||
self.hit_node(self, pos, node)
|
self.hit_node(self, pos, node)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
@ -236,7 +236,7 @@ local function default_on_step(
|
||||||
|
|
||||||
local n = minetest.env:get_node(pos).name
|
local n = minetest.env:get_node(pos).name
|
||||||
if n==not_transparent or minetest.get_item_group(n, not_transparent)==1 then
|
if n==not_transparent or minetest.get_item_group(n, not_transparent)==1 then
|
||||||
local node = nssm:node_ok(pos).name
|
local node = node_ok(pos).name
|
||||||
self.hit_node(self, pos, node)
|
self.hit_node(self, pos, node)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
|
@ -351,7 +351,7 @@ nssm_register_weapon("kamehameha", {
|
||||||
default_on_step(self, dtime, 4, 20, default_dir, 1, "stone", 25)
|
default_on_step(self, dtime, 4, 20, default_dir, 1, "stone", 25)
|
||||||
end,
|
end,
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:explosion(pos, 6, 1)
|
explosion(pos, 6, 1)
|
||||||
end,
|
end,
|
||||||
material = "default:diamondblock",
|
material = "default:diamondblock",
|
||||||
description = "Kamehameha from DragonBall",
|
description = "Kamehameha from DragonBall",
|
||||||
|
@ -376,7 +376,7 @@ nssm_register_weapon("spirit_ball", {
|
||||||
search_on_step(self, dtime, 5, 30, 25)
|
search_on_step(self, dtime, 5, 30, 25)
|
||||||
end,
|
end,
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:explosion(pos, 4, 0)
|
explosion(pos, 4, 0)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
material = "nssm:cursed_pumpkin_seed",
|
material = "nssm:cursed_pumpkin_seed",
|
||||||
|
@ -390,7 +390,7 @@ nssm_register_weapon("hellzone_grenade", {
|
||||||
search_on_step2(self, dtime, 30, 30, 25)
|
search_on_step2(self, dtime, 30, 30, 25)
|
||||||
end,
|
end,
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
nssm:explosion(pos, 4, 0)
|
explosion(pos, 4, 0)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_drop = function(itemstack, user, pointed_thing)
|
on_drop = function(itemstack, user, pointed_thing)
|
||||||
|
|
|
@ -45,7 +45,7 @@ mobs:register_mob("nssm:pumpking", {
|
||||||
speed_normal = 15, speed_run = 15,
|
speed_normal = 15, speed_run = 15,
|
||||||
},
|
},
|
||||||
on_die=function(self,pos)
|
on_die=function(self,pos)
|
||||||
nssm:explosion(pos, 3, 0, 1, self.sounds.explode)
|
explosion(pos, 3, 0, 1, self.sounds.explode)
|
||||||
end,
|
end,
|
||||||
custom_attack = function(self)
|
custom_attack = function(self)
|
||||||
if self.timer >3 then
|
if self.timer >3 then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
nssm:register_mob("nssm:pupumolle", {
|
mobs:register_mob("nssm:pupumolle", {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
hp_max = 15,
|
hp_max = 15,
|
||||||
hp_min = 14,
|
hp_min = 14,
|
||||||
|
|
|
@ -46,6 +46,6 @@ mobs:register_mob("nssm:sandworm", {
|
||||||
punch_end = 180,
|
punch_end = 180,
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:digging_ability(self, "sand", self.run_velocity, {x=0, y=2, z=0})
|
digging_ability(self, "sand", self.run_velocity, {x=0, y=2, z=0})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -58,6 +58,6 @@ mobs:register_mob("nssm:snow_biter", {
|
||||||
punch2_end = 215
|
punch2_end = 215
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:putting_ability(self, "default:ice", self.run_velocity)
|
putting_ability(self, "default:ice", self.run_velocity)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -51,6 +51,6 @@ mobs:register_mob("nssm:stone_eater", {
|
||||||
punch_end = 185,
|
punch_end = 185,
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:digging_ability(self, "stone", self.run_velocity, {x=0, y=2, z=0})
|
digging_ability(self, "stone", self.run_velocity, {x=0, y=2, z=0})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -53,6 +53,6 @@ mobs:register_mob("nssm:uloboros", {
|
||||||
punch_end = 110,
|
punch_end = 110,
|
||||||
},
|
},
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
nssm:webber_ability(self, "nssm:web", 2)
|
webber_ability(self, "nssm:web", 2)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue