code tidy (part 1)
This commit is contained in:
parent
bfcf64ba24
commit
c728e35050
56
darts.lua
56
darts.lua
@ -9,19 +9,19 @@ local function duck_explosion(pos)
|
|||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 10,
|
amount = 10,
|
||||||
time = 0.2,
|
time = 0.2,
|
||||||
minpos = {x=pos.x-1, y=pos.y-1, z=pos.z-1},
|
minpos = {x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
|
||||||
maxpos = {x=pos.x+1, y=pos.y+4, z=pos.z+1},
|
maxpos = {x = pos.x + 1, y = pos.y + 4, z = pos.z + 1},
|
||||||
minvel = {x=0, y=0, z=0},
|
minvel = {x = 0, y = 0, z = 0},
|
||||||
maxvel = {x=1, y=1, z=1},
|
maxvel = {x = 1, y = 1, z = 1},
|
||||||
minacc = {x=-0.5,y=5,z=-0.5},
|
minacc = {x = -0.5, y = 5, z = -0.5},
|
||||||
maxacc = {x=0.5,y=5,z=0.5},
|
maxacc = {x = 0.5, y = 5, z = 0.5},
|
||||||
minexptime = 1,
|
minexptime = 1,
|
||||||
maxexptime = 3,
|
maxexptime = 3,
|
||||||
minsize = 4,
|
minsize = 4,
|
||||||
maxsize = 6,
|
maxsize = 6,
|
||||||
collisiondetection = false,
|
collisiondetection = false,
|
||||||
vertical = false,
|
vertical = false,
|
||||||
texture = "duck_egg_fragments.png",
|
texture = "duck_egg_fragments.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
core.after(0.4, function()
|
core.after(0.4, function()
|
||||||
@ -33,19 +33,19 @@ local function duck_explosion(pos)
|
|||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 100,
|
amount = 100,
|
||||||
time = 0.2,
|
time = 0.2,
|
||||||
minpos = {x=pos.x-1, y=pos.y-1, z=pos.z-1},
|
minpos = {x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
|
||||||
maxpos = {x=pos.x+1, y=pos.y+4, z=pos.z+1},
|
maxpos = {x = pos.x + 1, y = pos.y + 4, z = pos.z + 1},
|
||||||
minvel = {x=0, y=0, z=0},
|
minvel = {x = 0, y = 0, z = 0},
|
||||||
maxvel = {x=1, y=5, z=1},
|
maxvel = {x = 1, y = 5, z = 1},
|
||||||
minacc = {x=-0.5,y=5,z=-0.5},
|
minacc = {x = -0.5, y = 5, z = -0.5},
|
||||||
maxacc = {x=0.5,y=5,z=0.5},
|
maxacc = {x = 0.5, y = 5, z = 0.5},
|
||||||
minexptime = 1,
|
minexptime = 1,
|
||||||
maxexptime = 3,
|
maxexptime = 3,
|
||||||
minsize = 2,
|
minsize = 2,
|
||||||
maxsize = 4,
|
maxsize = 4,
|
||||||
collisiondetection = false,
|
collisiondetection = false,
|
||||||
vertical = false,
|
vertical = false,
|
||||||
texture = "tnt_smoke.png",
|
texture = "tnt_smoke.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.add_entity(pos, "nssm:duck")
|
minetest.add_entity(pos, "nssm:duck")
|
||||||
@ -53,6 +53,7 @@ local function duck_explosion(pos)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- arrow (duck_arrow)
|
-- arrow (duck_arrow)
|
||||||
mobs:register_arrow("nssm:duck_father", {
|
mobs:register_arrow("nssm:duck_father", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
@ -73,7 +74,7 @@ mobs:register_arrow("nssm:duck_father", {
|
|||||||
|
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
duck_explosion(pos)
|
duck_explosion(pos)
|
||||||
end,
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ local function ice_explosion(pos)
|
|||||||
|
|
||||||
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
|
||||||
|
|
||||||
local p = {x = i, y = j, z = k}
|
local p = {x = i, y = j, z = k}
|
||||||
local n = minetest.get_node(p).name
|
local n = minetest.get_node(p).name
|
||||||
@ -99,6 +100,7 @@ local function ice_explosion(pos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- snow_arrow
|
-- snow_arrow
|
||||||
mobs:register_arrow("nssm:snow_arrow", {
|
mobs:register_arrow("nssm:snow_arrow", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
@ -119,7 +121,7 @@ mobs:register_arrow("nssm:snow_arrow", {
|
|||||||
|
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
ice_explosion(pos)
|
ice_explosion(pos)
|
||||||
end,
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -134,14 +136,14 @@ mobs:register_arrow("nssm:spine", {
|
|||||||
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,
|
||||||
damage_groups = {fleshy = 2},
|
damage_groups = {fleshy = 2}
|
||||||
}, nil)
|
}, nil)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_mob = function(self, player)
|
hit_mob = 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,
|
||||||
damage_groups = {fleshy = 2},
|
damage_groups = {fleshy = 2}
|
||||||
}, nil)
|
}, nil)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -153,14 +155,14 @@ mobs:register_arrow("nssm:spine", {
|
|||||||
--morbat arrow
|
--morbat arrow
|
||||||
mobs: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,
|
||||||
damage_groups = {fleshy = 3},
|
damage_groups = {fleshy = 3}
|
||||||
}, nil)
|
}, nil)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -215,7 +217,7 @@ mobs:register_arrow("nssm:webball", {
|
|||||||
hit_mob = function(self, player)
|
hit_mob = 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,
|
||||||
damage_groups = {fleshy = 1},
|
damage_groups = {fleshy = 1}
|
||||||
}, nil)
|
}, nil)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -254,6 +256,7 @@ function explosion_thickweb(pos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- thick_web arrow
|
-- thick_web arrow
|
||||||
mobs:register_arrow("nssm:thickwebball", {
|
mobs:register_arrow("nssm:thickwebball", {
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
@ -270,7 +273,7 @@ mobs:register_arrow("nssm:thickwebball", {
|
|||||||
hit_mob = function(self, player)
|
hit_mob = 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,
|
||||||
damage_groups = {fleshy = 6},
|
damage_groups = {fleshy = 6}
|
||||||
}, nil)
|
}, nil)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -310,7 +313,7 @@ mobs:register_arrow("nssm:phoenix_arrow", {
|
|||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
if math.random(1, 2) == 2 then
|
if math.random(2) == 2 then
|
||||||
minetest.set_node(pos, {name = "nssm:phoenix_fire"})
|
minetest.set_node(pos, {name = "nssm:phoenix_fire"})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -328,7 +331,7 @@ mobs:register_arrow("nssm:phoenix_arrow", {
|
|||||||
minetest.set_node(p, {name = "nssm:phoenix_fire"})
|
minetest.set_node(p, {name = "nssm:phoenix_fire"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -358,6 +361,7 @@ function gas_explosion(pos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
mobs: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},
|
||||||
@ -419,7 +423,7 @@ mobs:register_arrow("nssm:roar_of_the_dragon", {
|
|||||||
|
|
||||||
minetest.set_node(pos, {name = "air"})
|
minetest.set_node(pos, {name = "air"})
|
||||||
|
|
||||||
if math.random(1, 2) == 1 then
|
if math.random(2) == 1 then
|
||||||
|
|
||||||
local p = {
|
local p = {
|
||||||
x = pos.x + math.random(-1, 1),
|
x = pos.x + math.random(-1, 1),
|
||||||
|
125
init.lua
125
init.lua
@ -1,82 +1,83 @@
|
|||||||
local path = minetest.get_modpath("nssm")
|
local path = minetest.get_modpath("nssm")
|
||||||
|
|
||||||
nssm = {
|
nssm = {
|
||||||
mymapgenis = tonumber(minetest.settings:get('mymapgenis')) or 7,
|
mymapgenis = tonumber(minetest.settings:get("mymapgenis")) or 7,
|
||||||
multimobs = tonumber(minetest.settings:get('multimobs')) or 1000
|
multimobs = tonumber(minetest.settings:get("multimobs")) or 1000
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Mobs
|
-- Mobs
|
||||||
dofile(path.."/mobs/ant_queen.lua")
|
dofile(path .. "/mobs/ant_queen.lua")
|
||||||
dofile(path.."/mobs/ant_soldier.lua")
|
dofile(path .. "/mobs/ant_soldier.lua")
|
||||||
dofile(path.."/mobs/ant_worker.lua")
|
dofile(path .. "/mobs/ant_worker.lua")
|
||||||
dofile(path.."/mobs/black_widow.lua")
|
dofile(path .. "/mobs/black_widow.lua")
|
||||||
dofile(path.."/mobs/bloco.lua")
|
dofile(path .. "/mobs/bloco.lua")
|
||||||
dofile(path.."/mobs/crab.lua")
|
dofile(path .. "/mobs/crab.lua")
|
||||||
dofile(path.."/mobs/crocodile.lua")
|
dofile(path .. "/mobs/crocodile.lua")
|
||||||
dofile(path.."/mobs/daddy_long_legs.lua")
|
dofile(path .. "/mobs/daddy_long_legs.lua")
|
||||||
dofile(path.."/mobs/dolidrosaurus.lua")
|
dofile(path .. "/mobs/dolidrosaurus.lua")
|
||||||
dofile(path.."/mobs/duck.lua")
|
dofile(path .. "/mobs/duck.lua")
|
||||||
dofile(path.."/mobs/duckking.lua")
|
dofile(path .. "/mobs/duckking.lua")
|
||||||
dofile(path.."/mobs/echidna.lua")
|
dofile(path .. "/mobs/echidna.lua")
|
||||||
dofile(path.."/mobs/enderduck.lua")
|
dofile(path .. "/mobs/enderduck.lua")
|
||||||
dofile(path.."/mobs/flying_duck.lua")
|
dofile(path .. "/mobs/flying_duck.lua")
|
||||||
dofile(path.."/mobs/felucco.lua")
|
dofile(path .. "/mobs/felucco.lua")
|
||||||
dofile(path.."/mobs/giant_sandworm.lua")
|
dofile(path .. "/mobs/giant_sandworm.lua")
|
||||||
dofile(path.."/mobs/icelamander.lua")
|
dofile(path .. "/mobs/icelamander.lua")
|
||||||
dofile(path.."/mobs/icesnake.lua")
|
dofile(path .. "/mobs/icesnake.lua")
|
||||||
dofile(path.."/mobs/kraken.lua")
|
dofile(path .. "/mobs/kraken.lua")
|
||||||
dofile(path.."/mobs/larva.lua")
|
dofile(path .. "/mobs/larva.lua")
|
||||||
dofile(path.."/mobs/lava_titan.lua")
|
dofile(path .. "/mobs/lava_titan.lua")
|
||||||
dofile(path.."/mobs/manticore.lua")
|
dofile(path .. "/mobs/manticore.lua")
|
||||||
dofile(path.."/mobs/mantis_beast.lua")
|
dofile(path .. "/mobs/mantis_beast.lua")
|
||||||
dofile(path.."/mobs/mantis.lua")
|
dofile(path .. "/mobs/mantis.lua")
|
||||||
dofile(path.."/mobs/masticone.lua")
|
dofile(path .. "/mobs/masticone.lua")
|
||||||
dofile(path.."/mobs/moonheron.lua")
|
dofile(path .. "/mobs/moonheron.lua")
|
||||||
dofile(path.."/mobs/mordain.lua")
|
dofile(path .. "/mobs/mordain.lua")
|
||||||
dofile(path.."/mobs/morgre.lua")
|
dofile(path .. "/mobs/morgre.lua")
|
||||||
dofile(path.."/mobs/morde.lua")
|
dofile(path .. "/mobs/morde.lua")
|
||||||
dofile(path.."/mobs/morgut.lua")
|
dofile(path .. "/mobs/morgut.lua")
|
||||||
dofile(path.."/mobs/morlu.lua")
|
dofile(path .. "/mobs/morlu.lua")
|
||||||
dofile(path.."/mobs/morvalar.lua")
|
dofile(path .. "/mobs/morvalar.lua")
|
||||||
dofile(path.."/mobs/morvy.lua")
|
dofile(path .. "/mobs/morvy.lua")
|
||||||
dofile(path.."/mobs/morwa.lua")
|
dofile(path .. "/mobs/morwa.lua")
|
||||||
dofile(path.."/mobs/night_master.lua")
|
dofile(path .. "/mobs/night_master.lua")
|
||||||
dofile(path.."/mobs/octopus.lua")
|
dofile(path .. "/mobs/octopus.lua")
|
||||||
dofile(path.."/mobs/phoenix.lua")
|
dofile(path .. "/mobs/phoenix.lua")
|
||||||
dofile(path.."/mobs/pumpboom.lua")
|
dofile(path .. "/mobs/pumpboom.lua")
|
||||||
dofile(path.."/mobs/pumpking.lua")
|
dofile(path .. "/mobs/pumpking.lua")
|
||||||
dofile(path.."/mobs/sandworm.lua")
|
dofile(path .. "/mobs/sandworm.lua")
|
||||||
dofile(path.."/mobs/scrausics.lua")
|
dofile(path .. "/mobs/scrausics.lua")
|
||||||
dofile(path.."/mobs/sand_bloco.lua")
|
dofile(path .. "/mobs/sand_bloco.lua")
|
||||||
dofile(path.."/mobs/signosigno.lua")
|
dofile(path .. "/mobs/signosigno.lua")
|
||||||
dofile(path.."/mobs/snow_biter.lua")
|
dofile(path .. "/mobs/snow_biter.lua")
|
||||||
dofile(path.."/mobs/spiderduck.lua")
|
dofile(path .. "/mobs/spiderduck.lua")
|
||||||
dofile(path.."/mobs/stone_eater.lua")
|
dofile(path .. "/mobs/stone_eater.lua")
|
||||||
dofile(path.."/mobs/swimming_duck.lua")
|
dofile(path .. "/mobs/swimming_duck.lua")
|
||||||
dofile(path.."/mobs/tarantula.lua")
|
dofile(path .. "/mobs/tarantula.lua")
|
||||||
dofile(path.."/mobs/uloboros.lua")
|
dofile(path .. "/mobs/uloboros.lua")
|
||||||
dofile(path.."/mobs/werewolf.lua")
|
dofile(path .. "/mobs/werewolf.lua")
|
||||||
dofile(path.."/mobs/white_werewolf.lua")
|
dofile(path .. "/mobs/white_werewolf.lua")
|
||||||
|
|
||||||
--Final Boss
|
--Final Boss
|
||||||
dofile(path.."/mobs/mese_dragon.lua")
|
dofile(path .. "/mobs/mese_dragon.lua")
|
||||||
|
|
||||||
--Others
|
--Others
|
||||||
dofile(path.."/darts.lua")
|
dofile(path .. "/darts.lua")
|
||||||
dofile(path.."/nssm_materials.lua")
|
dofile(path .. "/nssm_materials.lua")
|
||||||
dofile(path.."/nssm_spears.lua")
|
dofile(path .. "/nssm_spears.lua")
|
||||||
dofile(path.."/nssm_api.lua")
|
dofile(path .. "/nssm_api.lua")
|
||||||
dofile(path.."/nssm_weapons.lua")
|
dofile(path .. "/nssm_weapons.lua")
|
||||||
|
|
||||||
if minetest.registered_nodes["nyancat:nyancat_rainbow"] then
|
if minetest.registered_nodes["nyancat:nyancat_rainbow"] then
|
||||||
dofile(path.."/rainbow_staff.lua") ; print ("NYAN!!!!!")
|
dofile(path .. "/rainbow_staff.lua") ; print ("NYAN!!!!!")
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("3d_armor") then
|
if minetest.get_modpath("3d_armor") then
|
||||||
dofile(path.."/nssm_armor.lua")
|
dofile(path .. "/nssm_armor.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
--Spawn settings
|
--Spawn settings
|
||||||
dofile(path.."/spawn.lua")
|
dofile(path .. "/spawn.lua")
|
||||||
|
|
||||||
|
|
||||||
print("[MOD] NSSM loaded")
|
print("[MOD] NSSM loaded")
|
||||||
|
90
nssm_api.lua
90
nssm_api.lua
@ -31,7 +31,7 @@ function drops(drop)
|
|||||||
drop:setvelocity({
|
drop:setvelocity({
|
||||||
x = math.random(-10, 10) / 9,
|
x = math.random(-10, 10) / 9,
|
||||||
y = 5,
|
y = 5,
|
||||||
z = math.random(-10, 10) / 9,
|
z = math.random(-10, 10) / 9
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -53,21 +53,21 @@ end
|
|||||||
function add_entity_and_particles(entity, pos, particles, multiplier)
|
function add_entity_and_particles(entity, pos, particles, multiplier)
|
||||||
|
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 100*multiplier,
|
amount = 100 * multiplier,
|
||||||
time = 2,
|
time = 2,
|
||||||
minpos = {x=pos.x-2, y=pos.y-1, z=pos.z-2},
|
minpos = {x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||||
maxpos = {x=pos.x+2, y=pos.y+4, z=pos.z+2},
|
maxpos = {x = pos.x + 2, y = pos.y + 4, z = pos.z + 2},
|
||||||
minvel = {x=0, y=0, z=0},
|
minvel = {x = 0, y = 0, z = 0},
|
||||||
maxvel = {x=1, y=2, z=1},
|
maxvel = {x = 1, y = 2, z = 1},
|
||||||
minacc = {x=-0.5,y=0.6,z=-0.5},
|
minacc = {x = -0.5, y = 0.6, z = -0.5},
|
||||||
maxacc = {x=0.5,y=0.7,z=0.5},
|
maxacc = {x = 0.5, y = 0.7, z = 0.5},
|
||||||
minexptime = 2,
|
minexptime = 2,
|
||||||
maxexptime = 3,
|
maxexptime = 3,
|
||||||
minsize = 3,
|
minsize = 3,
|
||||||
maxsize = 5,
|
maxsize = 5,
|
||||||
collisiondetection = false,
|
collisiondetection = false,
|
||||||
vertical = false,
|
vertical = false,
|
||||||
texture = particles,
|
texture = particles
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.add_entity(pos, entity)
|
minetest.add_entity(pos, entity)
|
||||||
@ -114,10 +114,11 @@ function check_for_death_hydra(self)
|
|||||||
self.health = hp
|
self.health = hp
|
||||||
|
|
||||||
if self.sounds.damage ~= nil then
|
if self.sounds.damage ~= nil then
|
||||||
|
|
||||||
minetest.sound_play(self.sounds.damage,{
|
minetest.sound_play(self.sounds.damage,{
|
||||||
object = self.object,
|
object = self.object,
|
||||||
max_hear_distance = self.sounds.distance
|
max_hear_distance = self.sounds.distance
|
||||||
})
|
}, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
@ -127,10 +128,11 @@ function check_for_death_hydra(self)
|
|||||||
local obj = nil
|
local obj = nil
|
||||||
|
|
||||||
if self.sounds.death ~= nil then
|
if self.sounds.death ~= nil then
|
||||||
|
|
||||||
minetest.sound_play(self.sounds.death,{
|
minetest.sound_play(self.sounds.death,{
|
||||||
object = self.object,
|
object = self.object,
|
||||||
max_hear_distance = self.sounds.distance
|
max_hear_distance = self.sounds.distance
|
||||||
})
|
}, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
@ -145,7 +147,9 @@ function round(n)
|
|||||||
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
|
||||||
n = -n
|
n = -n
|
||||||
|
|
||||||
local t = n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
|
local t = n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
|
||||||
|
|
||||||
return -t
|
return -t
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -153,22 +157,22 @@ end
|
|||||||
|
|
||||||
function explosion_particles(pos, exp_radius)
|
function explosion_particles(pos, exp_radius)
|
||||||
|
|
||||||
minetest.add_particlespawner(
|
minetest.add_particlespawner({
|
||||||
100*exp_radius/2, --amount
|
amount = 100 * exp_radius / 2,
|
||||||
0.1, --time
|
time = 0.1,
|
||||||
{x=pos.x-exp_radius, y=pos.y-exp_radius, z=pos.z-exp_radius}, --minpos
|
minpos = {x = pos.x - exp_radius, y = pos.y - exp_radius, z = pos.z - exp_radius},
|
||||||
{x=pos.x+exp_radius, y=pos.y+exp_radius, z=pos.z+exp_radius}, --maxpos
|
maxpos = {x = pos.x + exp_radius, y = pos.y + exp_radius, z = pos.z + exp_radius},
|
||||||
{x=0, y=0, z=0}, --minvel
|
minvel = {x = 0, y = 0, z = 0},
|
||||||
{x=0.1, y=0.3, z=0.1}, --maxvel
|
maxvel = {x = 0.1, y = 0.3, z = 0.1},
|
||||||
{x=-0.5,y=1,z=-0.5}, --minacc
|
minacc = {x = -0.5, y = 1, z = -0.5},
|
||||||
{x=0.5,y=1,z=0.5}, --maxacc
|
maxacc = {x = 0.5, y = 1, z = 0.5},
|
||||||
0.1, --minexptime
|
minexptime = 0.1,
|
||||||
4, --maxexptime
|
maxexptime = 4,
|
||||||
6, --minsize
|
minsize = 6,
|
||||||
12, --maxsize
|
maxsize = 12,
|
||||||
false, --collisiondetection
|
collisiondetection = false,
|
||||||
"tnt_smoke.png" --texture
|
texture = "tnt_smoke.png"
|
||||||
)
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -196,7 +200,7 @@ function digging_attack(
|
|||||||
--minetest.chat_send_all("La posizione davanti:"..minetest.pos_to_string(posp))
|
--minetest.chat_send_all("La posizione davanti:"..minetest.pos_to_string(posp))
|
||||||
posp = vector.subtract(posp,per)
|
posp = vector.subtract(posp,per)
|
||||||
|
|
||||||
for j = 1,3 do
|
for j = 1, 3 do
|
||||||
--minetest.chat_send_all("pos1:"..minetest.pos_to_string(posp).." per.y= "..dim.y)
|
--minetest.chat_send_all("pos1:"..minetest.pos_to_string(posp).." per.y= "..dim.y)
|
||||||
if minetest.is_protected(posp, "") then
|
if minetest.is_protected(posp, "") then
|
||||||
return
|
return
|
||||||
@ -209,7 +213,6 @@ function digging_attack(
|
|||||||
--minetest.chat_send_all("pos2:"..minetest.pos_to_string(posp).." per.y= "..per.y)
|
--minetest.chat_send_all("pos2:"..minetest.pos_to_string(posp).." per.y= "..per.y)
|
||||||
|
|
||||||
local n = minetest.get_node(pos1).name
|
local n = minetest.get_node(pos1).name
|
||||||
--local up = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
|
||||||
|
|
||||||
if group == nil then
|
if group == nil then
|
||||||
|
|
||||||
@ -217,7 +220,6 @@ function digging_attack(
|
|||||||
or minetest.is_protected(pos1, "")
|
or minetest.is_protected(pos1, "")
|
||||||
or (n == "bones:bones" and not nssm:affectbones(self) ) then
|
or (n == "bones:bones" and not nssm:affectbones(self) ) then
|
||||||
else
|
else
|
||||||
--minetest.set_node(p, {name="air"})
|
|
||||||
minetest.remove_node(pos1)
|
minetest.remove_node(pos1)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -225,13 +227,13 @@ function digging_attack(
|
|||||||
and (minetest.get_item_group(n, "unbreakable") ~= 1)
|
and (minetest.get_item_group(n, "unbreakable") ~= 1)
|
||||||
and (n ~= "bones:bones")
|
and (n ~= "bones:bones")
|
||||||
and not (minetest.is_protected(pos1, "")) ) then
|
and not (minetest.is_protected(pos1, "")) ) then
|
||||||
--minetest.set_node(p, {name="air"})
|
|
||||||
minetest.remove_node(pos1)
|
minetest.remove_node(pos1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pos1.y = pos1.y + 1
|
pos1.y = pos1.y + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
posp.y = s.y
|
posp.y = s.y
|
||||||
posp = vector.add(posp,per)
|
posp = vector.add(posp,per)
|
||||||
--minetest.chat_send_all("pos3:"..minetest.pos_to_string(posp).." per.y= "..per.y)
|
--minetest.chat_send_all("pos3:"..minetest.pos_to_string(posp).." per.y= "..per.y)
|
||||||
@ -323,10 +325,10 @@ function webber_ability( --puts randomly around the block defined as w_block
|
|||||||
|
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
|
|
||||||
if (math.random(1, 55) == 1) then
|
if (math.random(55) == 1) then
|
||||||
|
|
||||||
local dx = math.random(1, radius)
|
local dx = math.random(radius)
|
||||||
local dz = math.random(1, radius)
|
local dz = math.random(radius)
|
||||||
local p = {x = pos.x + dx, y = pos.y - 1, z = pos.z + dz}
|
local p = {x = pos.x + dx, y = pos.y - 1, z = pos.z + dz}
|
||||||
local t = {x = pos.x + dx, y = pos.y, z = pos.z + dz}
|
local t = {x = pos.x + dx, y = pos.y, z = pos.z + dz}
|
||||||
local n = minetest.get_node(p).name
|
local n = minetest.get_node(p).name
|
||||||
@ -390,7 +392,7 @@ function midas_ability( --ability to transform every blocks it touches in the m
|
|||||||
if minetest.get_item_group(n, "unbreakable") == 1
|
if minetest.get_item_group(n, "unbreakable") == 1
|
||||||
or minetest.is_protected(p, "") or n=="air"
|
or minetest.is_protected(p, "") or n=="air"
|
||||||
or (n == "bones:bones" and not nssm:affectbones(self))
|
or (n == "bones:bones" and not nssm:affectbones(self))
|
||||||
or n==m_block then
|
or n == m_block then
|
||||||
else
|
else
|
||||||
minetest.set_node(p, {name = m_block})
|
minetest.set_node(p, {name = m_block})
|
||||||
end
|
end
|
||||||
@ -400,7 +402,6 @@ function midas_ability( --ability to transform every blocks it touches in the m
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- NEW EXPLOSION FUNCTION
|
-- NEW EXPLOSION FUNCTION
|
||||||
|
|
||||||
-- loss probabilities array (one in X will be lost)
|
-- loss probabilities array (one in X will be lost)
|
||||||
@ -459,7 +460,7 @@ local function add_effects(pos, radius, drops)
|
|||||||
size = radius * 10,
|
size = radius * 10,
|
||||||
collisiondetection = false,
|
collisiondetection = false,
|
||||||
vertical = false,
|
vertical = false,
|
||||||
texture = "tnt_boom.png",
|
texture = "tnt_boom.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
@ -475,7 +476,7 @@ local function add_effects(pos, radius, drops)
|
|||||||
maxexptime = 2.5,
|
maxexptime = 2.5,
|
||||||
minsize = radius * 3,
|
minsize = radius * 3,
|
||||||
maxsize = radius * 5,
|
maxsize = radius * 5,
|
||||||
texture = "tnt_smoke.png",
|
texture = "tnt_smoke.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
-- we just dropped some items. Look at the items entities and pick
|
-- we just dropped some items. Look at the items entities and pick
|
||||||
@ -513,7 +514,7 @@ local function add_effects(pos, radius, drops)
|
|||||||
minsize = radius * 0.66,
|
minsize = radius * 0.66,
|
||||||
maxsize = radius * 2,
|
maxsize = radius * 2,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
collisiondetection = true,
|
collisiondetection = true
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -579,7 +580,7 @@ local function calc_velocity(pos1, pos2, old_vel, power)
|
|||||||
vel = vector.add(vel, {
|
vel = vector.add(vel, {
|
||||||
x = math.random() - 0.5,
|
x = math.random() - 0.5,
|
||||||
y = math.random() - 0.5,
|
y = math.random() - 0.5,
|
||||||
z = math.random() - 0.5,
|
z = math.random() - 0.5
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Limit to terminal velocity
|
-- Limit to terminal velocity
|
||||||
@ -650,7 +651,7 @@ local function entity_physics(pos, radius, drops)
|
|||||||
|
|
||||||
obj:punch(obj, 1.0, {
|
obj:punch(obj, 1.0, {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.0,
|
||||||
damage_groups = {fleshy = damage},
|
damage_groups = {fleshy = damage}
|
||||||
}, nil)
|
}, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -683,7 +684,8 @@ local function add_drop(drops, item)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_protection, ignore_on_blast)
|
local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue,
|
||||||
|
ignore_protection, ignore_on_blast)
|
||||||
|
|
||||||
if not ignore_protection and minetest.is_protected(npos, "") then
|
if not ignore_protection and minetest.is_protected(npos, "") then
|
||||||
return cid
|
return cid
|
||||||
@ -838,7 +840,9 @@ end
|
|||||||
|
|
||||||
function tnt_boom_nssm(pos, def)
|
function tnt_boom_nssm(pos, def)
|
||||||
|
|
||||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
minetest.sound_play("tnt_explode", {
|
||||||
|
pos = pos, gain = 1.5, max_hear_distance = 2 * 64}, true)
|
||||||
|
|
||||||
minetest.set_node(pos, {name = "tnt:boom"})
|
minetest.set_node(pos, {name = "tnt:boom"})
|
||||||
|
|
||||||
local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection,
|
local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection,
|
||||||
|
233
nssm_armor.lua
233
nssm_armor.lua
@ -1,108 +1,124 @@
|
|||||||
--Armors
|
--Armors
|
||||||
local stats = {
|
local stats = {
|
||||||
wolf = {name="Werewolf", armor=2.8, heal=0, use=800},
|
wolf = {name = "Werewolf", armor = 2.8, heal = 0, use = 800},
|
||||||
whitewolf = {name="White Werewolf", armor=2.8, heal=0, use=800},
|
whitewolf = {name = "White Werewolf", armor = 2.8, heal = 0, use = 800},
|
||||||
bloco = {name="Bloco", armor=3.2, heal=0, use=500},
|
bloco = {name = "Bloco", armor = 3.2, heal = 0, use = 500},
|
||||||
croco = {name="Crocodile", armor=3, heal=0, use=450},
|
croco = {name = "Crocodile", armor = 3, heal = 0, use = 450},
|
||||||
ant = {name="Ant", armor=3, heal=0, use=400},
|
ant = {name = "Ant", armor = 3, heal = 0, use = 400},
|
||||||
ice = {name="Ice Teeth", armor=3.2, heal=0, use=410},
|
ice = {name = "Ice Teeth", armor = 3.2, heal = 0, use = 410},
|
||||||
felucco = {name="Felucco", armor=2.8, heal=0, use=800},
|
felucco = {name = "Felucco", armor = 2.8, heal = 0, use = 800},
|
||||||
manticore = {name="Manticore", armor=3.4, heal=0, use=440},
|
manticore = {name = "Manticore", armor = 3.4, heal = 0, use = 440},
|
||||||
duck = {name="Duck", armor=1.5, heal=0, use=1000},
|
duck = {name = "Duck", armor = 1.5, heal = 0, use = 1000},
|
||||||
black_duck = {name="Black Duck", armor=1.5, heal=0, use=900},
|
black_duck = {name = "Black Duck", armor = 1.5, heal = 0, use = 900},
|
||||||
mor = {name="Morlu", armor=5.3, heal=0, use=30},
|
mor = {name = "Morlu", armor = 5.3, heal = 0, use = 30},
|
||||||
sky = {name="Sky", armor=4.2, heal=0, use=100},
|
sky = {name = "Sky", armor = 4.2, heal = 0, use = 100},
|
||||||
sandworm = {name="Sandworm", armor=3.4, heal=0, use=400},
|
sandworm = {name = "Sandworm", armor = 3.4, heal = 0, use = 400},
|
||||||
sandbloco = {name="Sand Bloco", armor=3.2, heal=0, use=500},
|
sandbloco = {name = "Sand Bloco", armor = 3.2, heal = 0, use = 500},
|
||||||
web = {name="Cobweb String", armor=2.4, heal=0, use=900},
|
web = {name = "Cobweb String", armor = 2.4, heal = 0, use = 900},
|
||||||
denseweb = {name="Dense Cobweb String", armor=3.5, heal=0, use=400},
|
denseweb = {name = "Dense Cobweb String", armor = 3.5, heal = 0, use = 400}
|
||||||
}
|
}
|
||||||
|
|
||||||
local materials = {
|
local materials = {
|
||||||
wolf="nssm:wolf_fur",
|
wolf = "nssm:wolf_fur",
|
||||||
whitewolf="nssm:white_wolf_fur",
|
whitewolf = "nssm:white_wolf_fur",
|
||||||
bloco="nssm:bloco_skin",
|
bloco = "nssm:bloco_skin",
|
||||||
croco="nssm:crocodile_skin",
|
croco = "nssm:crocodile_skin",
|
||||||
ant="nssm:ant_hard_skin",
|
ant = "nssm:ant_hard_skin",
|
||||||
ice="nssm:little_ice_tooth",
|
ice = "nssm:little_ice_tooth",
|
||||||
felucco="nssm:felucco_fur",
|
felucco = "nssm:felucco_fur",
|
||||||
manticore="nssm:manticore_fur",
|
manticore = "nssm:manticore_fur",
|
||||||
duck="nssm:duck_feather",
|
duck = "nssm:duck_feather",
|
||||||
black_duck="nssm:black_duck_feather",
|
black_duck = "nssm:black_duck_feather",
|
||||||
mor= "nssm:lustful_moranga",
|
mor = "nssm:lustful_moranga",
|
||||||
sandbloco= "nssm:sand_bloco_skin",
|
sandbloco = "nssm:sand_bloco_skin",
|
||||||
sandworm="nssm:sandworm_skin",
|
sandworm = "nssm:sandworm_skin",
|
||||||
sky="nssm:sky_iron",
|
sky = "nssm:sky_iron",
|
||||||
web="nssm:web_string",
|
web = "nssm:web_string",
|
||||||
denseweb="nssm:dense_web_string",
|
denseweb = "nssm:dense_web_string"
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs(stats) do
|
for k, v in pairs(stats) do
|
||||||
|
|
||||||
minetest.register_tool("nssm:helmet_"..k, {
|
minetest.register_tool("nssm:helmet_" .. k, {
|
||||||
description = v.name.." Helmet",
|
description = v.name .. " Helmet",
|
||||||
inventory_image ="inv_helmet_"..k..".png",
|
inventory_image = "inv_helmet_" .. k .. ".png",
|
||||||
groups = {armor_head=math.floor(4*v.armor), armor_heal=v.heal, armor_use=v.use},
|
groups = {
|
||||||
wear = 0,
|
armor_head = math.floor(4 * v.armor),
|
||||||
|
armor_heal = v.heal,
|
||||||
|
armor_use = v.use
|
||||||
|
},
|
||||||
|
wear = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nssm:chestplate_"..k, {
|
minetest.register_tool("nssm:chestplate_" .. k, {
|
||||||
description = v.name.." Chestplate",
|
description = v.name .. " Chestplate",
|
||||||
inventory_image ="inv_chestplate_"..k..".png",
|
inventory_image = "inv_chestplate_" .. k .. ".png",
|
||||||
groups = {armor_torso=math.floor(6*v.armor), armor_heal=v.heal, armor_use=v.use},
|
groups = {
|
||||||
wear = 0,
|
armor_torso = math.floor(6 * v.armor),
|
||||||
|
armor_heal = v.heal,
|
||||||
|
armor_use = v.use
|
||||||
|
},
|
||||||
|
wear = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nssm:leggings_"..k, {
|
minetest.register_tool("nssm:leggings_" .. k, {
|
||||||
description = v.name.." Leggings",
|
description = v.name .. " Leggings",
|
||||||
inventory_image = "inv_leggings_"..k..".png",
|
inventory_image = "inv_leggings_" .. k .. ".png",
|
||||||
groups = {armor_legs=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
|
groups = {
|
||||||
wear = 0,
|
armor_legs = math.floor(5 * v.armor),
|
||||||
|
armor_heal = v.heal,
|
||||||
|
armor_use = v.use
|
||||||
|
},
|
||||||
|
wear = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("nssm:boots_"..k, {
|
minetest.register_tool("nssm:boots_" .. k, {
|
||||||
description = v.name.." Boots",
|
description = v.name .. " Boots",
|
||||||
inventory_image ="inv_boots_"..k..".png",
|
inventory_image = "inv_boots_" .. k .. ".png",
|
||||||
groups = {armor_feet=math.floor(3*v.armor), armor_heal=v.heal, armor_use=v.use},
|
groups = {
|
||||||
wear = 0,
|
armor_feet = math.floor(3 * v.armor),
|
||||||
|
armor_heal = v.heal,
|
||||||
|
armor_use = v.use
|
||||||
|
},
|
||||||
|
wear = 0
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs(materials) do
|
for k, v in pairs(materials) do
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "nssm:helmet_"..k,
|
output = "nssm:helmet_" .. k,
|
||||||
recipe = {
|
recipe = {
|
||||||
{v, v, v},
|
{v, v, v},
|
||||||
{v, "", v},
|
{v, "", v},
|
||||||
{"", "", ""},
|
{"", "", ""}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "nssm:chestplate_"..k,
|
output = "nssm:chestplate_" .. k,
|
||||||
recipe = {
|
recipe = {
|
||||||
{v, "", v},
|
{v, "", v},
|
||||||
{v, v, v},
|
{v, v, v},
|
||||||
{v, v, v},
|
{v, v, v}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "nssm:leggings_"..k,
|
output = "nssm:leggings_" .. k,
|
||||||
recipe = {
|
recipe = {
|
||||||
{v, v, v},
|
{v, v, v},
|
||||||
{v, "", v},
|
{v, "", v},
|
||||||
{v, "", v},
|
{v, "", v}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "nssm:boots_"..k,
|
output = "nssm:boots_" .. k,
|
||||||
recipe = {
|
recipe = {
|
||||||
{v, "", v},
|
{v, "", v},
|
||||||
{v, "", v},
|
{v, "", v}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -110,75 +126,84 @@ end
|
|||||||
if minetest.get_modpath("shields") then
|
if minetest.get_modpath("shields") then
|
||||||
|
|
||||||
local stats = {
|
local stats = {
|
||||||
crab = {name="Crab", armor=4, heal=0, use=500},
|
crab = {name = "Crab", armor = 4, heal = 0, use = 500},
|
||||||
ice ={name="Ice Teeth", armor=3.5, heal=0, use=600},
|
ice = {name = "Ice Teeth", armor = 3.5, heal = 0, use = 600},
|
||||||
mor ={name="Morlu", armor=5, use=100},
|
mor = {name = "Morlu", armor = 5, use = 100},
|
||||||
masticone ={name="Masticone", armor=4.5, use=300},
|
masticone = {name = "Masticone", armor = 4.5, use = 300},
|
||||||
mantis ={name="Mantis", armor=3, use=500},
|
mantis = {name = "Mantis", armor = 3, use = 500}
|
||||||
}
|
}
|
||||||
|
|
||||||
local materials = {
|
local materials = {
|
||||||
crab="nssm:crab_carapace_fragment",
|
crab = "nssm:crab_carapace_fragment",
|
||||||
ice="nssm:little_ice_tooth",
|
ice = "nssm:little_ice_tooth",
|
||||||
mor="nssm:lustful_moranga",
|
mor = "nssm:lustful_moranga",
|
||||||
masticone="nssm:masticone_skull_fragments",
|
masticone = "nssm:masticone_skull_fragments",
|
||||||
mantis="nssm:mantis_skin",
|
mantis = "nssm:mantis_skin"
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs(stats) do
|
for k, v in pairs(stats) do
|
||||||
|
|
||||||
minetest.register_tool("nssm:shield_"..k, {
|
minetest.register_tool("nssm:shield_" .. k, {
|
||||||
description = v.name.." Shield",
|
description = v.name .. " Shield",
|
||||||
inventory_image ="inv_shield_"..k..".png",
|
inventory_image = "inv_shield_" .. k .. ".png",
|
||||||
groups = {armor_head=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
|
groups = {
|
||||||
wear = 0,
|
armor_head = math.floor(5 * v.armor),
|
||||||
|
armor_heal = v.heal,
|
||||||
|
armor_use = v.use
|
||||||
|
},
|
||||||
|
wear = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
local m = materials[k]
|
local m = materials[k]
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "nssm:shield_"..k,
|
output = "nssm:shield_" .. k,
|
||||||
recipe = {
|
recipe = {
|
||||||
{m, m, m},
|
{m, m, m},
|
||||||
{m, m, m},
|
{m, m, m},
|
||||||
{"", m, ""},
|
{"", m, ""}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--Special objects (pumpking helmet, masticone helmet, crowned masticone helmet, crown,)
|
--Special objects (pumpking helmet, masticone helmet, crowned masticone helmet, crown,)
|
||||||
local stats = {
|
local stats = {
|
||||||
pumpking = {name="Pumpking Head", armor=4, heal=0, use=100},
|
pumpking = {name = "Pumpking Head", armor = 4, heal = 0, use = 100},
|
||||||
masticone ={name="Masticone Head", armor=4, heal=0, use=100},
|
masticone = {name = "Masticone Head", armor = 4, heal = 0, use = 100},
|
||||||
crown ={name="Dukking Crown", armor=2, heal=0, use=50},
|
crown = {name = "Dukking Crown", armor = 2, heal = 0, use = 50},
|
||||||
masticone_crowned ={name="Masticone Crowned Head", armor=6, heal=0, use=20},
|
masticone_crowned = {name = "Masticone Crowned Head", armor = 6, heal = 0, use = 20},
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs(stats) do
|
for k, v in pairs(stats) do
|
||||||
|
|
||||||
minetest.register_tool("nssm:helmet_"..k, {
|
minetest.register_tool("nssm:helmet_" .. k, {
|
||||||
description = v.name.." ",
|
description = v.name .. " ",
|
||||||
inventory_image ="inv_helmet_"..k..".png",
|
inventory_image ="inv_helmet_" .. k .. ".png",
|
||||||
groups = {armor_shield=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
|
groups = {
|
||||||
wear = 0,
|
armor_shield = math.floor(5 * v.armor),
|
||||||
})
|
armor_heal = v.heal,
|
||||||
|
armor_use = v.use
|
||||||
minetest.register_tool("nssm:chestplate_snake", {
|
},
|
||||||
description = "Snake Scute Chestplate",
|
wear = 0
|
||||||
inventory_image ="inv_chestplate_snake.png",
|
|
||||||
groups = {armor_torso=40, armor_heal=0, armor_use=100},
|
|
||||||
wear = 0,
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.register_tool("nssm:chestplate_snake", {
|
||||||
|
description = "Snake Scute Chestplate",
|
||||||
|
inventory_image ="inv_chestplate_snake.png",
|
||||||
|
groups = {armor_torso = 40, armor_heal = 0, armor_use = 100},
|
||||||
|
wear = 0
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "nssm:chestplate_snake",
|
output = "nssm:chestplate_snake",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||||
{"default:steel_ingot", "nssm:snake_scute", "default:steel_ingot"},
|
{"default:steel_ingot", "nssm:snake_scute", "default:steel_ingot"},
|
||||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -186,8 +211,8 @@ minetest.register_craft({
|
|||||||
recipe = {
|
recipe = {
|
||||||
{"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
|
{"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
|
||||||
{"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
|
{"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
|
||||||
{"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
|
{"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -195,6 +220,6 @@ minetest.register_craft({
|
|||||||
recipe = {
|
recipe = {
|
||||||
{"", "nssm:helmet_crown", ""},
|
{"", "nssm:helmet_crown", ""},
|
||||||
{"", "nssm:helmet_masticone", ""},
|
{"", "nssm:helmet_masticone", ""},
|
||||||
{"", "", ""},
|
{"", "", ""}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
1624
nssm_materials.lua
1624
nssm_materials.lua
File diff suppressed because it is too large
Load Diff
159
nssm_spears.lua
159
nssm_spears.lua
@ -4,7 +4,11 @@
|
|||||||
local function spears_shot (itemstack, player)
|
local function spears_shot (itemstack, player)
|
||||||
local spear = itemstack:get_name() .. '_entity'
|
local spear = itemstack:get_name() .. '_entity'
|
||||||
local playerpos = player:get_pos()
|
local playerpos = player:get_pos()
|
||||||
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear)
|
local obj = minetest.add_entity({
|
||||||
|
x = playerpos.x,
|
||||||
|
y = playerpos.y + 1.5,
|
||||||
|
z = playerpos.z
|
||||||
|
}, spear)
|
||||||
local dir = player:get_look_dir()
|
local dir = player:get_look_dir()
|
||||||
if spear == "nssm:spear_of_peace_entity" then
|
if spear == "nssm:spear_of_peace_entity" then
|
||||||
sp = 32
|
sp = 32
|
||||||
@ -14,10 +18,10 @@ local function spears_shot (itemstack, player)
|
|||||||
gravity = 9.8
|
gravity = 9.8
|
||||||
end
|
end
|
||||||
local dr = .3
|
local dr = .3
|
||||||
obj:set_velocity({x=dir.x*sp, y=dir.y*sp, z=dir.z*sp})
|
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_acceleration({x = -dir.x * dr, y = -gravity, z = -dir.z * dr})
|
||||||
obj:set_yaw(player:get_look_yaw()+math.pi)
|
obj:set_yaw(player:get_look_yaw() + math.pi)
|
||||||
minetest.sound_play("spears_sound", {pos=playerpos})
|
minetest.sound_play("spears_sound", {pos = playerpos}, true)
|
||||||
obj:get_luaentity().wear = itemstack:get_wear()
|
obj:get_luaentity().wear = itemstack:get_wear()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -26,16 +30,19 @@ end
|
|||||||
local function spears_set_entity(kind, eq, toughness)
|
local function spears_set_entity(kind, eq, toughness)
|
||||||
local SPEAR_ENTITY={
|
local SPEAR_ENTITY={
|
||||||
physical = false,
|
physical = false,
|
||||||
timer=0,
|
timer = 0,
|
||||||
visual = "wielditem",
|
visual = "wielditem",
|
||||||
visual_size = {x=0.15, y=0.1},
|
visual_size = {x = 0.15, y = 0.1},
|
||||||
textures = {"nssm:spear_" .. kind},
|
textures = {"nssm:spear_" .. kind},
|
||||||
lastpos={},
|
lastpos={},
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
on_punch = function(self, puncher)
|
on_punch = function(self, puncher)
|
||||||
if puncher then
|
if puncher then
|
||||||
if puncher:is_player() then
|
if puncher:is_player() then
|
||||||
local stack = {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness}
|
local stack = {
|
||||||
|
name = "nssm:spear_" .. kind,
|
||||||
|
wear = self.wear + 65535 / toughness
|
||||||
|
}
|
||||||
local inv = puncher:get_inventory()
|
local inv = puncher:get_inventory()
|
||||||
if inv:room_for_item("main", stack) then
|
if inv:room_for_item("main", stack) then
|
||||||
inv:add_item("main", stack)
|
inv:add_item("main", stack)
|
||||||
@ -43,11 +50,11 @@ local function spears_set_entity(kind, eq, toughness)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
SPEAR_ENTITY.on_step = function(self, dtime)
|
SPEAR_ENTITY.on_step = function(self, dtime)
|
||||||
self.timer=self.timer+dtime
|
self.timer=self.timer + dtime
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
if not self.wear then
|
if not self.wear then
|
||||||
@ -55,32 +62,44 @@ local function spears_set_entity(kind, eq, toughness)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self.lastpos.x~=nil then
|
if self.lastpos.x~=nil then
|
||||||
if node.name ~= "air" and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') then
|
if node.name ~= "air"
|
||||||
|
and not (string.find(node.name, "grass")
|
||||||
|
and not string.find(node.name, "dirt"))
|
||||||
|
and not string.find(node.name, "flowers:")
|
||||||
|
and not string.find(node.name, "farming:") then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
if self.wear+65535/toughness < 65535 then
|
if self.wear + 65535 / toughness < 65535 then
|
||||||
minetest.add_item(self.lastpos, {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness})
|
minetest.add_item(self.lastpos, {
|
||||||
|
name = "nssm:spear_" .. kind,
|
||||||
|
wear = self.wear + 65535 / toughness
|
||||||
|
})
|
||||||
end
|
end
|
||||||
elseif self.timer>0.2 then
|
elseif self.timer > 0.2 then
|
||||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1)
|
local objs = minetest.get_objects_inside_radius({
|
||||||
|
x = pos.x, y = pos.y, z = pos.z}, 1)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
if obj:get_luaentity() ~= nil then
|
if obj:get_luaentity() ~= nil then
|
||||||
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity"
|
||||||
|
and obj:get_luaentity().name ~= "__builtin:item" then
|
||||||
local speed = vector.length(self.object:get_velocity())
|
local speed = vector.length(self.object:get_velocity())
|
||||||
local damage = (speed + eq)^1.12-20
|
local damage = (speed + eq) ^ 1.12 - 20
|
||||||
obj:punch(self.object, 1.0, {
|
obj:punch(self.object, 1.0, {
|
||||||
full_punch_interval=1.0,
|
full_punch_interval = 1.0,
|
||||||
damage_groups={fleshy=damage},
|
damage_groups={fleshy = damage}
|
||||||
}, nil)
|
}, nil)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
if self.wear+65535/toughness < 65535 then
|
if self.wear + 65535 / toughness < 65535 then
|
||||||
minetest.add_item(self.lastpos, {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness})
|
minetest.add_item(self.lastpos, {
|
||||||
|
name = "nssm:spear_" .. kind,
|
||||||
|
wear = self.wear + 65535 / toughness
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
|
self.lastpos={x = pos.x, y = pos.y, z = pos.z}
|
||||||
end
|
end
|
||||||
return SPEAR_ENTITY
|
return SPEAR_ENTITY
|
||||||
end
|
end
|
||||||
@ -93,7 +112,7 @@ local function spears_register_spear(kind, desc, eq, toughness, material)
|
|||||||
description = desc .. " Spear",
|
description = desc .. " Spear",
|
||||||
wield_image = "spear_" .. kind .. ".png",
|
wield_image = "spear_" .. kind .. ".png",
|
||||||
inventory_image = "spear_" .. kind .. ".png^[transform4",
|
inventory_image = "spear_" .. kind .. ".png^[transform4",
|
||||||
wield_scale= {x=2,y=1,z=1},
|
wield_scale= {x = 2, y = 1, z = 1},
|
||||||
on_drop = function(itemstack, user, pointed_thing)
|
on_drop = function(itemstack, user, pointed_thing)
|
||||||
spears_shot(itemstack, user)
|
spears_shot(itemstack, user)
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
@ -110,11 +129,12 @@ local function spears_register_spear(kind, desc, eq, toughness, material)
|
|||||||
end,
|
end,
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.3,
|
full_punch_interval = 1.3,
|
||||||
max_drop_level=1,
|
max_drop_level = 1,
|
||||||
groupcaps={
|
groupcaps = {
|
||||||
snappy = {times={[3]=0.2, [2]=0.2, [1]=0.2}, uses=toughness, maxlevel=1},
|
snappy = {times = {[3]=0.2, [2]=0.2, [1]=0.2},
|
||||||
|
uses = toughness, maxlevel = 1},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=eq},
|
damage_groups = {fleshy = eq}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -123,34 +143,34 @@ local function spears_register_spear(kind, desc, eq, toughness, material)
|
|||||||
minetest.register_entity("nssm:spear_" .. kind .. "_entity", SPEAR_ENTITY)
|
minetest.register_entity("nssm:spear_" .. kind .. "_entity", SPEAR_ENTITY)
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'nssm:spear_' .. kind,
|
output = "nssm:spear_" .. kind,
|
||||||
recipe = {
|
recipe = {
|
||||||
{'group:wood', 'group:wood', material},
|
{"group:wood", "group:wood", material}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'nssm:spear_' .. kind,
|
output = "nssm:spear_" .. kind,
|
||||||
recipe = {
|
recipe = {
|
||||||
{material, 'group:wood', 'group:wood'},
|
{material, "group:wood", "group:wood"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
spears_register_spear('ant', 'Ant', 6, 25, 'nssm:ant_mandible')
|
spears_register_spear("ant", "Ant", 6, 25, "nssm:ant_mandible")
|
||||||
|
|
||||||
spears_register_spear('mantis', 'Mantis', 6, 10, 'nssm:mantis_claw')
|
spears_register_spear("mantis", "Mantis", 6, 10, "nssm:mantis_claw")
|
||||||
|
|
||||||
spears_register_spear('manticore', 'Manticore', 8, 8, 'nssm:manticore_spine')
|
spears_register_spear("manticore", "Manticore", 8, 8, "nssm:manticore_spine")
|
||||||
|
|
||||||
spears_register_spear('ice_tooth', 'Ice Tooth', 16, 200, 'nssm:ice_tooth')
|
spears_register_spear("ice_tooth", "Ice Tooth", 16, 200, "nssm:ice_tooth")
|
||||||
|
|
||||||
spears_register_spear('little_ice_tooth', 'Little Ice Tooth', 7, 10, 'nssm:little_ice_tooth')
|
spears_register_spear("little_ice_tooth", "Little Ice Tooth", 7, 10, "nssm:little_ice_tooth")
|
||||||
|
|
||||||
spears_register_spear('duck_beak', 'Duck Beak', 5, 6, 'nssm:duck_beak')
|
spears_register_spear("duck_beak", "Duck Beak", 5, 6, "nssm:duck_beak")
|
||||||
|
|
||||||
spears_register_spear('felucco_horn', 'Felucco Horn', 7, 9, 'nssm:felucco_horn')
|
spears_register_spear("felucco_horn", "Felucco Horn", 7, 9, "nssm:felucco_horn")
|
||||||
|
|
||||||
|
|
||||||
--Spear of peace
|
--Spear of peace
|
||||||
@ -158,7 +178,7 @@ minetest.register_tool("nssm:spear_of_peace", {
|
|||||||
description = "Spear of Peace",
|
description = "Spear of Peace",
|
||||||
wield_image = "spear_of_peace.png",
|
wield_image = "spear_of_peace.png",
|
||||||
inventory_image = "spear_of_peace.png^[transform4",
|
inventory_image = "spear_of_peace.png^[transform4",
|
||||||
wield_scale= {x=4,y=2,z=2},
|
wield_scale= {x = 4, y = 2, z = 2},
|
||||||
on_drop = function(itemstack, user, pointed_thing)
|
on_drop = function(itemstack, user, pointed_thing)
|
||||||
spears_shot(itemstack, user)
|
spears_shot(itemstack, user)
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
@ -175,27 +195,30 @@ minetest.register_tool("nssm:spear_of_peace", {
|
|||||||
end,
|
end,
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.7,
|
full_punch_interval = 0.7,
|
||||||
max_drop_level=1,
|
max_drop_level = 1,
|
||||||
groupcaps={
|
groupcaps = {
|
||||||
snappy = {times={[3]=0.2, [2]=0.2, [1]=0.2}, uses=500, maxlevel=1},
|
snappy = {times = {[3]=0.2, [2]=0.2, [1]=0.2}, uses = 500, maxlevel = 1}
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=18},
|
damage_groups = {fleshy = 18}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local function spears_set_sentity(kind, eq, toughness)
|
local function spears_set_sentity(kind, eq, toughness)
|
||||||
local SUPERSPEAR_ENTITY={
|
local SUPERSPEAR_ENTITY={
|
||||||
physical = false,
|
physical = false,
|
||||||
timer=0,
|
timer = 0,
|
||||||
visual = "wielditem",
|
visual = "wielditem",
|
||||||
visual_size = {x=0.15, y=0.1},
|
visual_size = {x = 0.15, y = 0.1},
|
||||||
textures = {"nssm:spear_" .. kind},
|
textures = {"nssm:spear_" .. kind},
|
||||||
lastpos={},
|
lastpos={},
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
on_punch = function(self, puncher)
|
on_punch = function(self, puncher)
|
||||||
if puncher then
|
if puncher then
|
||||||
if puncher:is_player() then
|
if puncher:is_player() then
|
||||||
local stack = {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness}
|
local stack = {
|
||||||
|
name = "nssm:spear_" .. kind,
|
||||||
|
wear = self.wear + 65535 / toughness
|
||||||
|
}
|
||||||
local inv = puncher:get_inventory()
|
local inv = puncher:get_inventory()
|
||||||
if inv:room_for_item("main", stack) then
|
if inv:room_for_item("main", stack) then
|
||||||
inv:add_item("main", stack)
|
inv:add_item("main", stack)
|
||||||
@ -203,7 +226,7 @@ local function spears_set_sentity(kind, eq, toughness)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPERSPEAR_ENTITY.on_step = function(self, dtime)
|
SUPERSPEAR_ENTITY.on_step = function(self, dtime)
|
||||||
@ -214,34 +237,46 @@ local function spears_set_sentity(kind, eq, toughness)
|
|||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self.lastpos.x~=nil then
|
if self.lastpos.x ~= nil then
|
||||||
if node.name ~= "air" and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') then
|
if node.name ~= "air"
|
||||||
|
and not (string.find(node.name, "grass")
|
||||||
|
and not string.find(node.name, "dirt"))
|
||||||
|
and not string.find(node.name, "flowers:")
|
||||||
|
and not string.find(node.name, "farming:") then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
if self.wear+65535/toughness < 65535 then
|
if self.wear + 65535 / toughness < 65535 then
|
||||||
minetest.add_item(self.lastpos, {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness})
|
minetest.add_item(self.lastpos, {
|
||||||
|
name = "nssm:spear_" .. kind,
|
||||||
|
wear = self.wear + 65535 / toughness
|
||||||
|
})
|
||||||
end
|
end
|
||||||
elseif self.timer>0.2 then
|
elseif self.timer > 0.2 then
|
||||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1)
|
local objs = minetest.get_objects_inside_radius({
|
||||||
|
x = pos.x, y = pos.y, z = pos.z}, 1)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
if obj:get_luaentity() ~= nil then
|
if obj:get_luaentity() ~= nil then
|
||||||
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity"
|
||||||
|
and obj:get_luaentity().name ~= "__builtin:item" then
|
||||||
local speed = vector.length(self.object:get_velocity())
|
local speed = vector.length(self.object:get_velocity())
|
||||||
--minetest.chat_send_all(speed)
|
--minetest.chat_send_all(speed)
|
||||||
local damage = (speed + eq)^1.12-20
|
local damage = (speed + eq) ^ 1.12 - 20
|
||||||
obj:punch(self.object, 1.0, {
|
obj:punch(self.object, 1.0, {
|
||||||
full_punch_interval=1.0,
|
full_punch_interval = 1.0,
|
||||||
damage_groups={fleshy=damage},
|
damage_groups={fleshy = damage}
|
||||||
}, nil)
|
}, nil)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
if self.wear+65535/toughness < 65535 then
|
if self.wear + 65535 / toughness < 65535 then
|
||||||
minetest.add_item(self.lastpos, {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness})
|
minetest.add_item(self.lastpos, {
|
||||||
|
name = "nssm:spear_" .. kind,
|
||||||
|
wear = self.wear + 65535 / toughness
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
|
self.lastpos = {x = pos.x, y = pos.y, z = pos.z}
|
||||||
end
|
end
|
||||||
return SUPERSPEAR_ENTITY
|
return SUPERSPEAR_ENTITY
|
||||||
end
|
end
|
||||||
@ -251,8 +286,8 @@ SUPERSPEAR_ENTITY=spears_set_sentity("of_peace", 30, 300)
|
|||||||
minetest.register_entity("nssm:spear_of_peace_entity", SUPERSPEAR_ENTITY)
|
minetest.register_entity("nssm:spear_of_peace_entity", SUPERSPEAR_ENTITY)
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'nssm:spear_of_peace',
|
output = "nssm:spear_of_peace",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'nssm:wrathful_moranga', 'group:wood', 'group:wood'},
|
{"nssm:wrathful_moranga", "group:wood", "group:wood"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
628
nssm_weapons.lua
628
nssm_weapons.lua
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
--rainbow!
|
--rainbow!
|
||||||
|
|
||||||
minetest.register_entity("nssm:rainbow", {
|
minetest.register_entity("nssm:rainbow", {
|
||||||
@ -14,18 +13,18 @@ minetest.register_entity("nssm:rainbow", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if os.time() - self.timer > 10 then
|
if os.time() - self.timer > 10 then
|
||||||
minetest.set_node(pos, {name="nyancat:nyancat"})
|
minetest.set_node(pos, {name = "nyancat:nyancat"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_node(pos) then
|
if minetest.get_node(pos) then
|
||||||
local n = minetest.get_node(pos).name
|
local n = minetest.get_node(pos).name
|
||||||
if n ~= "nyancat:nyancat_rainbow" then
|
if n ~= "nyancat:nyancat_rainbow" then
|
||||||
if n=="air" then
|
if n == "air" then
|
||||||
minetest.set_node(pos, {name="nyancat:nyancat_rainbow"})
|
minetest.set_node(pos, {name = "nyancat:nyancat_rainbow"})
|
||||||
else
|
else
|
||||||
minetest.chat_send_all("Nome:"..n)
|
minetest.chat_send_all("Nome:" .. n)
|
||||||
minetest.set_node(pos, {name="nyancat:nyancat"})
|
minetest.set_node(pos, {name = "nyancat:nyancat"})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -37,12 +36,16 @@ minetest.register_tool("nssm:rainbow_staff", {
|
|||||||
description = "Rainbow Staff",
|
description = "Rainbow Staff",
|
||||||
inventory_image = "rainbow_staff.png",
|
inventory_image = "rainbow_staff.png",
|
||||||
on_use = function(itemstack, placer, pointed_thing)
|
on_use = function(itemstack, placer, pointed_thing)
|
||||||
local dir = placer:get_look_dir();
|
local dir = placer:get_look_dir()
|
||||||
local playerpos = placer:get_pos();
|
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 obj = minetest.add_entity({
|
||||||
local vec = {x=dir.x*6,y=dir.y*6,z=dir.z*6}
|
x = playerpos.x + dir.x,
|
||||||
|
y = playerpos.y + 2 + dir.y,
|
||||||
|
z = playerpos.z + dir.z
|
||||||
|
}, "nssm:rainbow")
|
||||||
|
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
|
||||||
obj:set_velocity(vec)
|
obj:set_velocity(vec)
|
||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
groups = {not_in_creative_inventory=1,}
|
groups = {not_in_creative_inventory = 1}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user