add missing darts, textures, update code

This commit is contained in:
tenplus1 2024-07-15 17:30:14 +01:00
parent ad5c0d5a66
commit cf30f91a67
8 changed files with 126 additions and 36 deletions

87
darts.lua Normal file
View File

@ -0,0 +1,87 @@
--crystalgas arrow
mobs:register_arrow("nssm:crystal_gas_arrow", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"crystal_arrow.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
crystal_gas_explosion(p)
end,
hit_node = function(self, pos, node)
crystal_gas_explosion(pos)
end
})
function crystal_gas_explosion(pos)
if minetest.is_protected(pos, "") then
return
end
for dx= 0,0 do
for dy=-1,2 do
for dz= 0,0 do
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
if minetest.is_protected(p, "") then
return
end
local n = minetest.get_node(p).name
if n== "air" then
minetest.set_node(p, {name="nssm:crystal_gas"})
end
end
end
end
end
--Pumpkid bomb
mobs:register_arrow("nssm:pumpkid_bomb", {
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {"pumpbomb_top.png","pumpbomb_bottom.png", "pumpbomb_side.png", "pumpbomb_side.png", "pumpbomb_side.png", "pumpbomb_front.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
--local pos1 = {x = pos.x, y=pos.y, z=pos.z}
if not minetest.is_protected(p, "") or not minetest.get_item_group(minetest.get_node(p).name, "unbreakable") == 1 then
tnt.boom(p, {damage_radius=3,radius=2,ignore_protection=false})
end
end,
hit_node = function(self, pos, node)
--local pos1 = {x = pos.x, y=pos.y, z=pos.z}
if not minetest.is_protected(pos, "") or not minetest.get_item_group(minetest.get_node(pos).name, "unbreakable") == 1 then
tnt.boom(pos, {damage_radius=3,radius=2,ignore_protection=false})
end
end
})
--Lava_block bomb
mobs:register_arrow("nssm:lava_block_bomb", {
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {"default_lava.png","default_lava.png", "default_lava.png", "default_lava.png", "default_lava.png", "default_lava.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
if not minetest.is_protected(p, "") or not minetest.get_item_group(minetest.get_node(p).name, "unbreakable") == 1 then
minetest.set_node(p, {name="default:lava_source"})
end
end,
hit_node = function(self, pos, node)
if not minetest.is_protected(pos, "") or not minetest.get_item_group(minetest.get_node(pos).name, "unbreakable") == 1 then
minetest.set_node(pos, {name="default:lava_source"})
end
end
})

View File

@ -6,6 +6,9 @@ dofile(path.."/nssm_api.lua")
-- additional items
dofile(path.."/nssm_materials.lua")
-- additional darts
dofile(path.."/darts.lua")
--Mobs
dofile(path.."/mobs/albino_spider.lua")
dofile(path.."/mobs/berinhog.lua")

View File

@ -66,7 +66,7 @@ mobs:register_mob("nssm:salamander", {
local pp = {x = p.x, y = p.y +1.5, z = p.z}
local vel = vector.subtract(pp,ss)
self:set_animation("punch")
print("-- custom")
if minetest.line_of_sight({x = p.x, y = p.y +1.5, z = p.z}, {x = s.x, y = s.y +1.5, z = s.z}) == true then
-- play attack sound
if self.sounds.attack then
@ -81,23 +81,23 @@ mobs:register_mob("nssm:salamander", {
damage_groups = {fleshy=self.damage}
}, nil)
end
minetest.add_particlespawner(
25, --amount
0.5, --time
ss, --minpos
ss, --maxpos
vector.multiply(vel, 2), --minvel
vector.multiply(vel, 4), --maxvel
{x=0,y=0,z=0}, --minacc
{x=0,y=0,z=0}, --maxacc
1, --minexptime
1.5, --maxexptime
5, --minsize
10, --maxsize
true, --collisiondetection
"phoenix_fire.png" --texture
)
print("-- particle")
minetest.add_particlespawner({
amount = 25, --amount
time = 0.5, --time
minpos = ss, --minpos
maxpos = ss, --maxpos
minvel = vector.multiply(vel, 2), --minvel
maxvel = vector.multiply(vel, 4), --maxvel
minacc = {x=0,y=0,z=0}, --minacc
maxacc = {x=0,y=0,z=0}, --maxacc
minexptime = 1, --minexptime
maxexptime = 1.5, --maxexptime
minsize = 5, --minsize
maxsize = 10, --maxsize
collisiondetection = true, --collisiondetection
texture = "phoenix_fire.png" --texture
})
end,

View File

@ -81,21 +81,21 @@ mobs:register_mob("nssm:silversand_dragon", {
}, nil)
end
minetest.add_particlespawner(
225, --amount
0.5, --time
ss, --minpos
ss, --maxpos
vector.multiply(vel, 2), --minvel
vector.multiply(vel, 4), --maxvel
{x=0,y=0,z=0}, --minacc
{x=0,y=0,z=0}, --maxacc
4, --minexptime
5, --maxexptime
5, --minsize
10, --maxsize
true, --collisiondetection
"silversand_particle.png" --texture
)
minetest.add_particlespawner({
amount = 225, --amount
time = 0.5, --time
minpos = ss, --minpos
maxpos = ss, --maxpos
minvel = vector.multiply(vel, 2), --minvel
maxvel = vector.multiply(vel, 4), --maxvel
minacc = {x=0,y=0,z=0}, --minacc
maxacc = {x=0,y=0,z=0}, --maxacc
minexptime = 4, --minexptime
maxexptime = 5, --maxexptime
minsize = 5, --minsize
maxsize = 10, --maxsize
collisiondetection = true, --collisiondetection
texture = "silversand_particle.png" --texture
})
end
})

View File

@ -61,7 +61,7 @@ minetest.register_node(":nssm:crystal_gas", {
minetest.register_node(":nssm:slug_crystal", {
description = "Slug Crystal",
tile_images = {"slug_crystal.png"} ,
tiles = {"slug_crystal.png"} ,
paramtype = "light",
drawtype = "glasslike",
drowning = 10,
@ -74,7 +74,7 @@ minetest.register_node(":nssm:slug_crystal", {
minetest.register_node(":nssm:coldest_ice", {
description = "Coldest Ice",
tile_images = {"coldest_ice.png"} ,
tiles = {"coldest_ice.png"} ,
paramtype = "light",
drowning = 2,
damage_per_second = 1,

BIN
textures/coldest_ice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

BIN
textures/crystal_arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

BIN
textures/slug_crystal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B