use newer functions

This commit is contained in:
tenplus1 2022-02-03 17:10:55 +00:00
parent 24bb0a311c
commit b9281f225e
4 changed files with 272 additions and 281 deletions

View File

@ -1,6 +1,8 @@
--Nssb
nssb = {} nssb = {}
local path = minetest.get_modpath("nssb") local path = minetest.get_modpath("nssb")
dofile(path.."/nodes.lua")
dofile(path.."/mapgen.lua") dofile(path .. "/nodes.lua")
dofile(path.."/spawn.lua") dofile(path .. "/mapgen.lua")
dofile(path .. "/spawn.lua")

View File

@ -1,17 +1,23 @@
local moreores local moreores
if minetest.get_modpath("moreores") then if minetest.get_modpath("moreores") then
moreores=true moreores = true
end end
nssb.mymapgenis = tonumber(minetest.setting_get('mymapgenis')) or 7 nssb.mymapgenis = tonumber(minetest.setting_get('mymapgenis')) or 7
if (nssb.mymapgenis~=6) and (nssb.mymapgenis~=7) then
if (nssb.mymapgenis ~= 6) and (nssb.mymapgenis ~= 7) then
nssb.mymapgenis = 7 nssb.mymapgenis = 7
end end
--schematichs generation --schematichs generation
local posplace = {x=0, y=-30093, z=0}
local posmemory = {x=0, y=-30092, z=0} local posplace = {x = 0, y = -30093, z = 0}
local postest = {x=5, y=-30091, z=6} local posmemory = {x = 0, y = -30092, z = 0}
local postest = {x = 5, y = -30091, z = 6}
function nssb_register_buildings( function nssb_register_buildings(
build, -- name of the schematic build, -- name of the schematic
rand, -- 1/rand is the probability of the spawning of the schematic if the place found is acceptable rand, -- 1/rand is the probability of the spawning of the schematic if the place found is acceptable
@ -960,10 +966,10 @@ minetest.register_abm({
--the timer is saved inside a position because for me the tonumber function doesn't work --the timer is saved inside a position because for me the tonumber function doesn't work
local timer_pos = minetest.string_to_pos(meta:get_string("player_timer"..obj:get_player_name())) local timer_pos = minetest.string_to_pos(meta:get_string("player_timer"..obj:get_player_name()))
if not timer_pos or ((timer_pos) and ((os.time() - timer_pos.x) >= 30)) then if not timer_pos or ((timer_pos) and ((os.time() - timer_pos.x) >= 30)) then
local posp = obj:getpos() local posp = obj:get_pos()
--minetest.chat_send_all("Posizione: "..minetest.pos_to_string(posp)) --minetest.chat_send_all("Posizione: "..minetest.pos_to_string(posp))
obj:setpos({x=5, y=pos1.y+2, z =5}) obj:set_pos({x=5, y=pos1.y+2, z =5})
meta:set_string("player"..obj:get_player_name(), minetest.pos_to_string(posp)) meta:set_string("player"..obj:get_player_name(), minetest.pos_to_string(posp))
timer_pos = {x=os.time(), y = 0, z = 0} timer_pos = {x=os.time(), y = 0, z = 0}
meta:set_string("player_timer"..obj:get_player_name(), minetest.pos_to_string(timer_pos)) meta:set_string("player_timer"..obj:get_player_name(), minetest.pos_to_string(timer_pos))
@ -1020,7 +1026,7 @@ minetest.register_abm({
local target = minetest.string_to_pos(meta:get_string("player"..obj:get_player_name())) local target = minetest.string_to_pos(meta:get_string("player"..obj:get_player_name()))
if target then if target then
obj:setpos({x = target.x, y=target.y+1, z=target.z}) obj:set_pos({x = target.x, y=target.y+1, z=target.z})
timer_pos = {x=os.time(), y = 0, z = 0} timer_pos = {x=os.time(), y = 0, z = 0}
meta:set_string("player_timer"..obj:get_player_name(), minetest.pos_to_string(timer_pos)) meta:set_string("player_timer"..obj:get_player_name(), minetest.pos_to_string(timer_pos))
end end

442
nodes.lua
View File

@ -1,127 +1,128 @@
--Materials -- Materials
minetest.register_node("nssb:memoryone", { minetest.register_node("nssb:memoryone", {
description = "Memoryone", description = "Memoryone",
tiles = {"very_mossy_stone_brick.png"}, tiles = {"very_mossy_stone_brick.png"},
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:mossy_stone_brick", { minetest.register_node("nssb:mossy_stone_brick", {
description = "Mossy Stone Brick", description = "Mossy Stone Brick",
tiles = {"mossy_stone_brick.png"}, tiles = {"mossy_stone_brick.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=2, stone=2}, groups = {cracky = 2, stone = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:stone_brick", { minetest.register_node("nssb:stone_brick", {
description = "Stone Brick", description = "Stone Brick",
tiles = {"default_stone_brick.png"}, tiles = {"default_stone_brick.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=2, stone=2}, groups = {cracky = 2, stone = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:very_mossy_stone_brick", { minetest.register_node("nssb:very_mossy_stone_brick", {
description = "Very Mossy Stone Brick", description = "Very Mossy Stone Brick",
tiles = {"very_mossy_stone_brick.png"}, tiles = {"very_mossy_stone_brick.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=2, stone=2}, groups = {cracky = 2, stone = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:mossy_stone_column", { minetest.register_node("nssb:mossy_stone_column", {
description = "Mossy Stone Column", description = "Mossy Stone Column",
tiles = {"mossy_stone_column.png"}, tiles = {"mossy_stone_column.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=2, stone=2}, groups = {cracky = 2, stone = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:stone_column", { minetest.register_node("nssb:stone_column", {
description = "Stone Column", description = "Stone Column",
tiles = {"stone_column.png"}, tiles = {"stone_column.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=2, stone=2}, groups = {cracky = 2, stone = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:marine_stone", { minetest.register_node("nssb:marine_stone", {
description = "Seastone", description = "Seastone",
tiles = {"marine_stone.png"}, tiles = {"marine_stone.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=1, stone=2}, groups = {cracky = 1, stone = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:marine_brick", { minetest.register_node("nssb:marine_brick", {
description = "Seastone Brick", description = "Seastone Brick",
tiles = {"marine_brick.png"}, tiles = {"marine_brick.png"},
is_ground_content = false, is_ground_content = false,
groups = {stone=2}, groups = {stone = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:marine_meselamp", { minetest.register_node("nssb:marine_meselamp", {
description = "Sea Meselamp", description = "Sea Meselamp",
tiles = {"marine_meselamp.png"}, tiles = {"marine_meselamp.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=3}, groups = {cracky = 3},
drop = "", drop = "",
light_source = 15, light_source = 15,
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults()
}) })
minetest.register_node("nssb:morlamp", { minetest.register_node("nssb:morlamp", {
description = "Morlamp", description = "Morlamp",
tiles = {"morlamp.png"}, tiles = {"morlamp.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=3}, groups = {cracky = 3},
drop = "", drop = "",
light_source = 15, light_source = 15,
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults()
}) })
minetest.register_node("nssb:mantis_clay", { minetest.register_node("nssb:mantis_clay", {
description = "Mantis Clay", description = "Mantis Clay",
tiles = {"mantis_clay.png"}, tiles = {"mantis_clay.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=2}, groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:hardened_mantis_clay", { minetest.register_node("nssb:hardened_mantis_clay", {
description = "Hardened Mantis Clay", description = "Hardened Mantis Clay",
tiles = {"hard_mantis_clay.png"}, tiles = {"hard_mantis_clay.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=1}, groups = {cracky = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:ant_stone", { minetest.register_node("nssb:ant_stone", {
description = "Ant Stone", description = "Ant Stone",
tiles = {"ant_stone.png"}, tiles = {"ant_stone.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky=1, stone=1}, groups = {cracky = 1, stone = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:vine", { minetest.register_node("nssb:vine", {
description = "Vine", description = "Vine",
drawtype = "signlike", drawtype = "signlike",
tiles = {"climbing_plant.png"}, tiles = {"climbing_plant.png"},
inventory_image = {"vine.png"}, inventory_image = "climbing_plant.png",
walkable = false, walkable = false,
climbable = true, climbable = true,
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
selection_box = {type="wallmounted"}, selection_box = {type = "wallmounted"},
legacy_wallmounted = true, legacy_wallmounted = true,
groups = {flammable=3, snappy = 3}, groups = {flammable=3, snappy = 3},
sounds = default.node_sound_leaves_defaults() sounds = default.node_sound_leaves_defaults()
@ -130,12 +131,12 @@ minetest.register_node("nssb:vine", {
minetest.register_node("nssb:liana", { minetest.register_node("nssb:liana", {
description = "Liana", description = "Liana",
drawtype = "plantlike", drawtype = "plantlike",
inventory_image = {"liana.png"}, inventory_image = "liana.png",
tiles = {"liana.png"}, tiles = {"liana.png"},
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
climbable = true, climbable = true,
groups = {flammable=3, snappy = 3}, groups = {flammable = 3, snappy = 3},
sounds = default.node_sound_leaves_defaults() sounds = default.node_sound_leaves_defaults()
}) })
@ -157,7 +158,7 @@ minetest.register_node("nssb:vertical_web", {
liquid_alternative_flowing = "nssb:vertical_web", liquid_alternative_flowing = "nssb:vertical_web",
liquid_alternative_source = "nssb:vertical_web", liquid_alternative_source = "nssb:vertical_web",
liquid_viscosity = 20, liquid_viscosity = 20,
groups = {flammable=2, snappy=1, liquid=1}, groups = {flammable = 2, snappy = 1, liquid = 1}
}) })
minetest.register_node("nssb:web_cone_up", { minetest.register_node("nssb:web_cone_up", {
@ -178,7 +179,7 @@ minetest.register_node("nssb:web_cone_up", {
liquid_alternative_flowing = "nssb:web_cone_up", liquid_alternative_flowing = "nssb:web_cone_up",
liquid_alternative_source = "nssb:web_cone_up", liquid_alternative_source = "nssb:web_cone_up",
liquid_viscosity = 20, liquid_viscosity = 20,
groups = {flammable=2, snappy=1, liquid=1}, groups = {flammable = 2, snappy = 1, liquid = 1}
}) })
minetest.register_node("nssb:web_cone_down", { minetest.register_node("nssb:web_cone_down", {
@ -199,24 +200,24 @@ minetest.register_node("nssb:web_cone_down", {
liquid_alternative_flowing = "nssb:web_cone_down", liquid_alternative_flowing = "nssb:web_cone_down",
liquid_alternative_source = "nssb:web_cone_down", liquid_alternative_source = "nssb:web_cone_down",
liquid_viscosity = 20, liquid_viscosity = 20,
groups = {flammable=2, snappy=1, liquid=1}, groups = {flammable = 2, snappy = 1, liquid = 1}
}) })
minetest.register_craft({ minetest.register_craft({
output = 'nssb:marine_meselamp', output = "nssb:marine_meselamp",
recipe = { recipe = {
{'default:glass', 'bucket:bucket_water', 'default:glass'}, {"default:glass", "bucket:bucket_water", "default:glass"},
{'default:glass', 'default:mese_crystal', 'default:glass'}, {"default:glass", "default:mese_crystal", "default:glass"},
{'default:glass', 'bucket:bucket_water', 'default:glass'}, {"default:glass", "bucket:bucket_water", "default:glass"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'nssb:morlamp', output = "nssb:morlamp",
recipe = { recipe = {
{'nssb:morelentir_dust','nssb:morelentir_dust','nssb:morelentir_dust',}, {"nssb:morelentir_dust","nssb:morelentir_dust","nssb:morelentir_dust"},
{'nssb:morelentir_dust','nssb:morelentir_dust','nssb:morelentir_dust',}, {"nssb:morelentir_dust","nssb:morelentir_dust","nssb:morelentir_dust"},
{'nssb:morelentir_dust','nssb:morelentir_dust','nssb:morelentir_dust',}, {"nssb:morelentir_dust","nssb:morelentir_dust","nssb:morelentir_dust"}
} }
}) })
@ -226,276 +227,238 @@ minetest.register_node("nssb:web_cocoon", {
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
{ {items = {"nssm:spider_leg 2"}, rarity = 4},
items = {'node "nssm:spider_leg" 2'}, {items = {"nssm:web 1"}, rarity = 4},
rarity = 4 {items = {"nssm:ant_sword 1"}, rarity = 20},
}, {items = {"nssm:sun_sword 1"}, rarity = 100},
{ {items = {"nssm:night_sword 1"}, rarity = 100},
items = {'node "nssm:web 1'}, {items = {"nssm:spear_ant 1"}, rarity = 20},
rarity = 4 {items = {"nssm:spear_mantis 1"}, rarity = 20},
}, {items = {"nssm:spear_manticore 1"}, rarity = 22},
{ {items = {"nssm:spear_little_ice_tooth 1"}, rarity = 20},
items = {'node "nssm:ant_sword" 1'}, {items = {"nssm:spear_duck_beak 1"}, rarity = 20},
rarity = 20 {items = {"default:sword_wood 1"}, rarity = 14},
}, {items = {"default:sword_steel 1"}, rarity = 20},
{ {items = {"default:sword_mese 1"}, rarity = 20},
items = {'node "nssm:sun_sword" 1'}, {items = {"default:axe_bronze 1"}, rarity = 20},
rarity = 100 {items = {"nssm:raw_scrausics_wing 2"}, rarity = 20},
}, {items = {"nssm:nssm:mantis_claw 1"}, rarity = 20},
{ {items = {"default:axe_mese 1"}, rarity = 20},
items = {'node "nssm:night_sword" 1'}, {items = {"nssm:mantis_sword 1"}, rarity = 20},
rarity = 100 {items = {"default:axe_steel 1"}, rarity = 20},
}, {items = {"nssm:crab_light_mace 1"}, rarity = 20},
{ {items = {"nssm:masticone_fang_sword 1"}, rarity = 20}
items = {'node "nssm:spear_ant" 1'},
rarity = 20
},
{
items = {'node "nssm:spear_mantis" 1'},
rarity = 20
},
{
items = {'node "nssm:spear_manticore" 1'},
rarity = 22
},
{
items = {'node "nssm:spear_little_ice_tooth" 1'},
rarity = 20
},
{
items = {'node "nssm:spear_duck_beak" 1'},
rarity = 20
},
{
items = {'node "default:sword_wood" 1'},
rarity = 14
},
{
items = {'node "default:sword_steel" 1'},
rarity = 20
},{
items = {'node "default:sword_mese" 1'},
rarity = 20
},{
items = {'node "default:axe_bronze" 1'},
rarity = 20
},
{
items = {'node "nssm:raw_scrausics_wing" 2'},
rarity = 20
},
{
items = {'node "nssm:nssm:mantis_claw" 1'},
rarity = 20
},
{
items = {'node "default:axe_mese" 1'},
rarity = 20
},
{
items = {'node "nssm:mantis_sword" 1'},
rarity = 20
},
{
items = {'node "default:axe_steel" 1'},
rarity = 20
},
{
items = {'node "nssm:crab_light_mace" 1'},
rarity = 20
},
{
items = {'node "nssm:masticone_fang_sword" 1'},
rarity = 20
}
} }
}, },
is_ground_content = false, is_ground_content = false,
groups = {snappy=1, flammable=2}, groups = {snappy = 1, flammable = 2}
}) })
--Eggs --Eggs
function nssb_register_eggs ( function nssb_register_eggs (
name, -- name of the mobs and the eggs name, -- name of the mobs and the eggs
descr, -- Description of the mob and eggs descr, -- Description of the mob and eggs
int, -- time interval between each birth int, -- time interval between each birth
wide, -- the radius in wich mobs are generated wide, -- the radius in wich mobs are generated
troppi, -- maximun number of mobs spawned troppi, -- maximun number of mobs spawned
neigh, -- block that need to be near for spawning the mobs neigh, -- block that need to be near for spawning the mobs
night, --if only at night night, --if only at night
lumin) --luminosity parameter of the egg_block lumin) --luminosity parameter of the egg_block
minetest.register_node("nssb:".. name .."_eggs", { minetest.register_node("nssb:" .. name .. "_eggs", {
description = descr .." Eggs", description = descr .." Eggs",
tiles = {name .."_eggs.png"}, tiles = {name .. "_eggs.png"},
light_source = lumin, light_source = lumin,
is_ground_content = false, is_ground_content = false,
groups = {choppy=1}, groups = {choppy = 1}
}) })
minetest.register_abm({ minetest.register_abm({
nodenames = {"nssb:".. name .."_eggs"}, nodenames = {"nssb:" .. name .. "_eggs"},
neighbors = {neigh}, neighbors = {neigh},
interval = int, interval = int,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local pos1 = {x=pos.x+math.random(-wide,wide), y=pos.y+0.5, z=pos.z+math.random(-wide,wide)}
local pos1 = {
x = pos.x + math.random(-wide, wide),
y = pos.y + 0.5,
z = pos.z + math.random(-wide, wide)
}
local n = minetest.env:get_node(pos1).name local n = minetest.env:get_node(pos1).name
if n ~= "air" and n ~= "default:water_source" then if n ~= "air" and n ~= "default:water_source" then
return return
end end
local count = 0 local count = 0
local objects = minetest.env:get_objects_inside_radius(pos, 12) local objects = minetest.env:get_objects_inside_radius(pos, 12)
for _,obj in ipairs(objects) do for _,obj in ipairs(objects) do
count = count +1 count = count + 1
--minetest.chat_send_all("Count: "..count)
end end
local t = minetest.get_timeofday() local t = minetest.get_timeofday()
--minetest.chat_send_all("Time of day: "..t)
if (t>=0.75 and t<=1) or (t>=0 and t<=0.25) or night==false then if (t >= 0.75 and t <= 1) or (t >= 0 and t <= 0.25) or night == false then
if count < troppi then if count < troppi then
minetest.add_entity(pos1, "nssm:" .. name) minetest.add_entity(pos1, "nssm:" .. name)
end end
end end
end end
}) })
end end
nssb_register_eggs ('ant_worker', 'Ant Worker', 16, 2, 4, "air", false, 5) nssb_register_eggs ("ant_worker", "Ant Worker", 16, 2, 4, "air", false, 5)
nssb_register_eggs ('ant_soldier', 'Ant Soldier', 16, 2, 4, "air", false, 5) nssb_register_eggs ("ant_soldier", "Ant Soldier", 16, 2, 4, "air", false, 5)
nssb_register_eggs ('larva', 'Larva', 16, 2, 4, "air", false, 5) nssb_register_eggs ("larva", "Larva", 16, 2, 4, "air", false, 5)
nssb_register_eggs ('crab', 'Crab', 18, 2, 4, "default:sand", false, 5) nssb_register_eggs ("crab", "Crab", 18, 2, 4, "default:sand", false, 5)
nssb_register_eggs ('black_widow', 'Black Widow', 18, 2, 4, "air", false, 5) nssb_register_eggs ("black_widow", "Black Widow", 18, 2, 4, "air", false, 5)
nssb_register_eggs ('uloboros', 'Uloboros', 18, 2, 4, "air", false, 5) nssb_register_eggs ("uloboros", "Uloboros", 18, 2, 4, "air", false, 5)
nssb_register_eggs ('daddy_long_legs', 'Daddy Long Legs', 18, 2, 4, "air", false, 5) nssb_register_eggs ("daddy_long_legs", "Daddy Long Legs", 18, 2, 4, "air", false, 5)
nssb_register_eggs ('xgaloctopus', 'Xgaloctopus', 18, 2, 4, "default:water_source", false, 5) nssb_register_eggs ("xgaloctopus", "Xgaloctopus", 18, 2, 4, "default:water_source", false, 5)
nssb_register_eggs ('bloco', 'Bloco', 14, 2, 4, "default:gravel", false, 5) nssb_register_eggs ("bloco", "Bloco", 14, 2, 4, "default:gravel", false, 5)
nssb_register_eggs ('icesnake', 'Icesnake', 18, 2, 4, "default:ice", false, 5) nssb_register_eggs ("icesnake", "Icesnake", 18, 2, 4, "default:ice", false, 5)
nssb_register_eggs ('snow_biter', 'Snowbiter', 18, 2, 4, "default:ice", false, 5) nssb_register_eggs ("snow_biter", "Snowbiter", 18, 2, 4, "default:ice", false, 5)
nssb_register_eggs ('scrausics', 'Scrausics', 18, 2, 4, "air", false, 5) nssb_register_eggs ("scrausics", "Scrausics", 18, 2, 4, "air", false, 5)
nssb_register_eggs ('moonheron', 'Moonheron', 18, 2, 4, "air", true, 0) nssb_register_eggs ("moonheron", "Moonheron", 18, 2, 4, "air", true, 0)
function nssb_register_eggboss ( function nssb_register_eggboss (
name, -- name of the mobs and the eggs name, -- name of the mobs and the eggs
descr, -- Description of the mob and eggs descr, -- Description of the mob and eggs
int, -- time interval between each birth int, -- time interval between each birth
wide, -- the radius in wich mobs are generated wide, -- the radius in wich mobs are generated
troppi, -- maximun number of mobs spawned troppi, -- maximun number of mobs spawned
neigh, -- block that need to be near for spawning the mobs neigh, -- block that need to be near for spawning the mobs
night, --if only at night night, --if only at night
lumin) --luminosity parameter of the egg_block lumin) --luminosity parameter of the egg_block
minetest.register_node("nssb:".. name .."_eggboss", { minetest.register_node("nssb:" .. name .. "_eggboss", {
description = descr .." Eggs", description = descr .. " Eggs",
tiles = {name .."_eggs.png"}, tiles = {name .. "_eggs.png"},
light_source = lumin, light_source = lumin,
is_ground_content = false, is_ground_content = false,
groups = {choppy=1}, groups = {choppy = 1}
}) })
minetest.register_abm({ minetest.register_abm({
nodenames = {"nssb:".. name .."_eggboss"}, nodenames = {"nssb:" .. name .. "_eggboss"},
neighbors = {neigh}, neighbors = {neigh},
interval = int, interval = int,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local pos1 = {x=pos.x+math.random(-wide,wide), y=pos.y+0.5, z=pos.z+math.random(-wide,wide)}
local pos1 = {
x = pos.x + math.random(-wide, wide),
y = pos.y + 0.5,
z = pos.z + math.random(-wide, wide)
}
local n = minetest.env:get_node(pos1).name local n = minetest.env:get_node(pos1).name
if n ~= "air" and n ~= "default:water_source" then if n ~= "air" and n ~= "default:water_source" then
return return
end end
local count = 0
local count = 0
local objects = minetest.env:get_objects_inside_radius(pos, 12) local objects = minetest.env:get_objects_inside_radius(pos, 12)
for _,obj in ipairs(objects) do for _,obj in ipairs(objects) do
count = count +1 count = count +1
--minetest.chat_send_all("Count: "..count)
end end
local t = minetest.get_timeofday() local t = minetest.get_timeofday()
--minetest.chat_send_all("Time of day: "..t)
if (t>=0.75 and t<=1) or (t>=0 and t<=0.25) or night==false then if (t >= 0.75 and t <= 1) or (t >= 0 and t <= 0.25) or night == false then
if count < troppi then if count < troppi then
minetest.add_entity(pos1, "nssm:" .. name) minetest.add_entity(pos1, "nssm:" .. name)
end end
end end
end end
}) })
end end
--Bosses of the eggs: --Bosses of the eggs:
nssb_register_eggboss ('phoenix', 'Phoenix', 900, 10, 1, "air", false, 15) nssb_register_eggboss ("phoenix", "Phoenix", 900, 10, 1, "air", false, 15)
nssb_register_eggboss ('tarantula', 'Tarantula', 900, 2, 1, "air", false, 5) nssb_register_eggboss ("tarantula", "Tarantula", 900, 2, 1, "air", false, 5)
nssb_register_eggboss ('night_master', 'Night Master', 900, 10, 1, "air", true, 0) nssb_register_eggboss ("night_master", "Night Master", 900, 10, 1, "air", true, 0)
nssb_register_eggboss ('ant_queen', 'Ant Queen', 900, 10, 1, "air", false, 5) nssb_register_eggboss ("ant_queen", "Ant Queen", 900, 10, 1, "air", false, 5)
nssb_register_eggboss ('icelamander', 'Icelamander', 900, 10, 1, "air", false, 5) nssb_register_eggboss ("icelamander", "Icelamander", 900, 10, 1, "air", false, 5)
minetest.register_node("nssb:giant_sandworm_eggs", { minetest.register_node("nssb:giant_sandworm_eggs", {
description = "Giant Sandworm Egg", description = "Giant Sandworm Egg",
tiles = {"giant_sandworm_eggs.png"}, tiles = {"giant_sandworm_eggs.png"},
is_ground_content = false, is_ground_content = false,
groups = {choppy=1}, groups = {choppy = 1}
}) })
minetest.register_abm({ minetest.register_abm({
nodenames = {"nssb:giant_sandworm_eggs"}, nodenames = {"nssb:giant_sandworm_eggs"},
neighbors = {"default:desert_stone"}, neighbors = {"default:desert_stone"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node) action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
local pos1 = {x = pos.x, y = pos.y + 1, z = pos.z}
local n = minetest.env:get_node(pos1).name local n = minetest.env:get_node(pos1).name
if n ~= "air" then if n ~= "air" then
return return
end end
minetest.add_entity(pos1, "nssm:giant_sandworm") minetest.add_entity(pos1, "nssm:giant_sandworm")
minetest.remove_node(pos) minetest.remove_node(pos)
end end
}) })
--Morlavala nodes --Morlavala nodes
minetest.register_node("nssb:morentir", { minetest.register_node("nssb:morentir", {
description = "Dark Stone", description = "Dark Stone",
tiles = {"morentir.png"}, tiles = {"morentir.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=1}, groups = {cracky = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:boum_morentir", { minetest.register_node("nssb:boum_morentir", {
description = "Exploding Dark Stone", description = "Exploding Dark Stone",
tiles = {"morentir.png"}, tiles = {"morentir.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=1}, groups = {cracky = 1},
drop = "nssb:morentir", drop = "nssb:morentir",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:fall_morentir", { minetest.register_node("nssb:fall_morentir", {
description = "Falling Dark Stone", description = "Falling Dark Stone",
tiles = {"morentir.png"}, tiles = {"morentir.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=1,falling_node = 1}, groups = {cracky = 1, falling_node = 1},
drop = "nssb:morentir", drop = "nssb:morentir",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:indistructible_morentir", { minetest.register_node("nssb:indistructible_morentir", {
description = "Dark Indistructible Stone", description = "Dark Indistructible Stone",
tiles = {"morentir.png"}, tiles = {"morentir.png"},
--groups = {oddly_breakable_by_hand = 2},
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:morelentir", { minetest.register_node("nssb:morelentir", {
@ -506,19 +469,22 @@ minetest.register_node("nssb:morelentir", {
tiles = { tiles = {
{ {
name = "morelentir_animated.png", name = "morelentir_animated.png",
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 6.0}, animation = {
},}, type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 6.0
}
}
},
is_ground_content = false, is_ground_content = false,
groups = {cracky=1}, groups = {cracky = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:morkemen", { minetest.register_node("nssb:morkemen", {
description = "Dark Dirt", description = "Dark Dirt",
tiles = {"morkemen.png"}, tiles = {"morkemen.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=1}, groups = {crumbly = 1},
sounds = default.node_sound_dirt_defaults(), sounds = default.node_sound_dirt_defaults()
}) })
minetest.register_node("nssb:morvilya", { minetest.register_node("nssb:morvilya", {
@ -534,7 +500,7 @@ minetest.register_node("nssb:morvilya", {
drop = "", drop = "",
drowning = 1, drowning = 1,
damage_per_second = 2, damage_per_second = 2,
post_effect_color = {a=800, r=1, g=1, b=1}, post_effect_color = {a = 800, r = 1, g = 1, b = 1}
}) })
minetest.register_node("nssb:mornar", { minetest.register_node("nssb:mornar", {
@ -548,11 +514,11 @@ minetest.register_node("nssb:mornar", {
inventory_image = "mornar.png", inventory_image = "mornar.png",
light_source = 12, light_source = 12,
groups = {igniter = 2}, groups = {igniter = 2},
drop = '', drop = "",
walkable = false, walkable = false,
buildable_to = false, buildable_to = false,
damage_per_second = 4, damage_per_second = 4
}) })
minetest.register_node("nssb:mornen", { minetest.register_node("nssb:mornen", {
description = "Black Water", description = "Black Water",
@ -561,8 +527,10 @@ minetest.register_node("nssb:mornen", {
tiles = { tiles = {
{ {
name = "mornen_animated.png", name = "mornen_animated.png",
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0}, animation = {
}, type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0
}
}
}, },
alpha = 650, alpha = 650,
paramtype = "light", paramtype = "light",
@ -581,8 +549,8 @@ minetest.register_node("nssb:mornen", {
liquid_alternative_flowing = "nssb:mornen_flowing", liquid_alternative_flowing = "nssb:mornen_flowing",
liquid_alternative_source = "nssb:mornen", liquid_alternative_source = "nssb:mornen",
liquid_viscosity = 6, liquid_viscosity = 6,
post_effect_color = {a=500, r=1, g=1, b=1}, post_effect_color = {a = 500, r = 1, g = 1, b = 1},
groups = {liquid=3, puts_out_fire=1}, groups = {liquid = 3, puts_out_fire = 1}
}) })
minetest.register_node("nssb:mornen_flowing", { minetest.register_node("nssb:mornen_flowing", {
@ -598,8 +566,8 @@ minetest.register_node("nssb:mornen_flowing", {
type = "vertical_frames", type = "vertical_frames",
aspect_w = 16, aspect_w = 16,
aspect_h = 16, aspect_h = 16,
length = 3.3, length = 3.3
}, }
}, },
{ {
name = "mornen_animated.png", name = "mornen_animated.png",
@ -608,9 +576,9 @@ minetest.register_node("nssb:mornen_flowing", {
type = "vertical_frames", type = "vertical_frames",
aspect_w = 16, aspect_w = 16,
aspect_h = 16, aspect_h = 16,
length = 3.3, length = 3.3
}, }
}, }
}, },
paramtype = "light", paramtype = "light",
paramtype2 = "flowingliquid", paramtype2 = "flowingliquid",
@ -629,8 +597,8 @@ minetest.register_node("nssb:mornen_flowing", {
liquid_viscosity = 6, liquid_viscosity = 6,
liquid_renewable = true, liquid_renewable = true,
damage_per_second = 2, damage_per_second = 2,
post_effect_color = {a=500, r=1, g=1, b=1}, post_effect_color = {a = 500, r = 1, g = 1, b = 1},
groups = {liquid=3, puts_out_fire=1, water=1, not_in_creative_inventory=1}, groups = {liquid = 3, puts_out_fire = 1, water = 1, not_in_creative_inventory = 1}
}) })
minetest.register_node("nssb:portal", { minetest.register_node("nssb:portal", {
@ -640,8 +608,10 @@ minetest.register_node("nssb:portal", {
tiles = { tiles = {
{ {
name = "mornen_animated.png", name = "mornen_animated.png",
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0}, animation = {
}, type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0
}
}
}, },
alpha = 800, alpha = 800,
paramtype = "light", paramtype = "light",
@ -659,9 +629,9 @@ minetest.register_node("nssb:portal", {
liquid_alternative_flowing = "nssb:portal", liquid_alternative_flowing = "nssb:portal",
liquid_alternative_source = "nssb:portal", liquid_alternative_source = "nssb:portal",
liquid_viscosity = 0, liquid_viscosity = 0,
post_effect_color = {a=10, r=1, g=1, b=1}, post_effect_color = {a = 10, r = 1, g = 1, b = 1},
groups = {liquid=3, puts_out_fire=1}, groups = {liquid = 3, puts_out_fire = 1},
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:portalhome", { minetest.register_node("nssb:portalhome", {
@ -671,8 +641,10 @@ minetest.register_node("nssb:portalhome", {
tiles = { tiles = {
{ {
name = "portalhome_animated.png", name = "portalhome_animated.png",
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0}, animation = {
}, type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0
}
}
}, },
alpha = 800, alpha = 800,
paramtype = "light", paramtype = "light",
@ -690,9 +662,9 @@ minetest.register_node("nssb:portalhome", {
liquid_alternative_flowing = "nssb:portalhome", liquid_alternative_flowing = "nssb:portalhome",
liquid_alternative_source = "nssb:portalhome", liquid_alternative_source = "nssb:portalhome",
liquid_viscosity = 0, liquid_viscosity = 0,
post_effect_color = {a=10, r=1, g=1, b=1}, post_effect_color = {a = 10, r = 1, g = 1, b = 1},
groups = {liquid=3, puts_out_fire=1}, groups = {liquid = 3, puts_out_fire = 1},
on_blast = function() end, on_blast = function() end
}) })
minetest.register_node("nssb:morlote", { minetest.register_node("nssb:morlote", {
@ -711,16 +683,16 @@ minetest.register_node("nssb:morlote", {
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
}, }
}) })
minetest.register_node("nssb:moranga", { minetest.register_node("nssb:moranga", {
description = "Moranga Ore", description = "Moranga Ore",
tiles = {"morentir.png^moranga.png"}, tiles = {"morentir.png^moranga.png"},
groups = {cracky = 1}, groups = {cracky = 1},
drop = 'nssb:moranga_lump', drop = "nssb:moranga_lump",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_node("nssb:life_energy_ore", { minetest.register_node("nssb:life_energy_ore", {
@ -728,42 +700,43 @@ minetest.register_node("nssb:life_energy_ore", {
tiles = {"morentir.png^life_energy_ore.png"}, tiles = {"morentir.png^life_energy_ore.png"},
groups = {cracky = 1}, groups = {cracky = 1},
light_source = 4, light_source = 4,
drop = 'nssm:energy_globe', drop = "nssm:energy_globe",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults()
}) })
minetest.register_craftitem("nssb:moranga_lump", { minetest.register_craftitem("nssb:moranga_lump", {
description = "Moranga Lump", description = "Moranga Lump",
image = "moranga_lump.png", image = "moranga_lump.png"
}) })
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
output = "nssb:moranga_ingot", output = "nssb:moranga_ingot",
recipe = "nssb:moranga_lump", recipe = "nssb:moranga_lump",
cooktime = 160, cooktime = 160
}) })
minetest.register_craftitem("nssb:moranga_ingot", { minetest.register_craftitem("nssb:moranga_ingot", {
description = "Moranga Ingot", description = "Moranga Ingot",
image = "moranga_ingot.png", image = "moranga_ingot.png"
}) })
minetest.register_node("nssb:morvalar_block", { minetest.register_node("nssb:morvalar_block", {
description = "Morvalar Block", description = "Morvalar Block",
tiles = {"morvalar_block.png"}, tiles = {"morvalar_block.png"},
light_source = 13, light_source = 13
}) })
minetest.register_node("nssb:dis_morvalar_block", { minetest.register_node("nssb:dis_morvalar_block", {
description = "Disactivated Morvalar Block", description = "Disactivated Morvalar Block",
tiles = {"dis_morvalar_block.png"}, tiles = {"dis_morvalar_block.png"},
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "nssm:superior_energy_globe" then if puncher:get_wielded_item():get_name() == "nssm:superior_energy_globe" then
minetest.set_node(pos, {name="nssb:morvalar_block"}) minetest.set_node(pos, {name="nssb:morvalar_block"})
end end
end, end
}) })
minetest.register_abm({ minetest.register_abm({
@ -771,6 +744,7 @@ minetest.register_abm({
neighbors = {"nssb:indistructible_morentir"}, neighbors = {"nssb:indistructible_morentir"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node) action = function(pos, node)
minetest.remove_node(pos) minetest.remove_node(pos)
minetest.add_entity(pos, "nssm:morvalar") minetest.add_entity(pos, "nssm:morvalar")

View File

@ -1,9 +1,18 @@
local mm = nssm.multimobs local mm = nssm.multimobs
mobs:spawn_specific("nssm:morbat1", {"air"}, {"nssb:morelentir"}, 0, 20, 100, 20000000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:morbat2", {"air"}, {"nssb:morelentir"}, 0, 20, 100, 20000000/mm, 1, -31000, 0) mobs:spawn_specific("nssm:morbat1", {"air"}, {"nssb:morelentir"},
mobs:spawn_specific("nssm:morbat3", {"air"}, {"nssb:morelentir"}, 0, 20, 100, 20000000/mm, 1, -31000, 0) 0, 20, 100, 20000000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:morvy", {"nssb:morentir"}, {"nssb:morentir"}, 0, 20, 120, 18000000/mm, 1, -31000, -93) mobs:spawn_specific("nssm:morbat2", {"air"}, {"nssb:morelentir"},
mobs:spawn_specific("nssm:morlu", {"nssb:morentir"}, {"nssb:mornen"}, 0, 20, 80, 1200000/mm, 1, -31000, -93) 0, 20, 100, 20000000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:morde", {"nssb:morenrir"}, {"nssb:mornar"}, 0, 20, 50, 350000/mm, 1, -31000, -93) mobs:spawn_specific("nssm:morbat3", {"air"}, {"nssb:morelentir"},
mobs:spawn_specific("nssm:mordain", {"nssb:morentir"}, {"nssb:morentir"}, 0, 20, 90, 15000000/mm, 1, -31000, .93) 0, 20, 100, 20000000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:morgut", {"nssb:morentir"}, {"nssb:morentir"}, 0, 20, 50, 15000000/mm, 1, -31000, -93) mobs:spawn_specific("nssm:morvy", {"nssb:morentir"}, {"nssb:morentir"},
0, 20, 120, 18000000/mm, 1, -31000, -93)
mobs:spawn_specific("nssm:morlu", {"nssb:morentir"}, {"nssb:mornen"},
0, 20, 80, 1200000/mm, 1, -31000, -93)
mobs:spawn_specific("nssm:morde", {"nssb:morenrir"}, {"nssb:mornar"},
0, 20, 50, 350000/mm, 1, -31000, -93)
mobs:spawn_specific("nssm:mordain", {"nssb:morentir"}, {"nssb:morentir"},
0, 20, 90, 15000000/mm, 1, -31000, .93)
mobs:spawn_specific("nssm:morgut", {"nssb:morentir"}, {"nssb:morentir"},
0, 20, 50, 15000000/mm, 1, -31000, -93)