From 9348a169fce18408023abd1bd00a6ddae531fc05 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sun, 26 Jul 2020 19:42:13 +0100 Subject: [PATCH] code tweak/tidy, fixed bugs, spawn on 5.x nodes --- changelog.txt | 5 + darts.lua | 170 +- init.lua | 9 +- mobs/ant_queen.lua | 72 +- mobs/ant_soldier.lua | 37 +- mobs/ant_worker.lua | 35 +- mobs/black_widow.lua | 37 +- mobs/bloco.lua | 41 +- mobs/crab.lua | 38 +- mobs/crocodile.lua | 32 +- mobs/daddy_long_legs.lua | 32 +- mobs/dolidrosaurus.lua | 28 +- mobs/duck.lua | 36 +- mobs/duckking.lua | 44 +- mobs/echidna.lua | 29 +- mobs/enderduck.lua | 41 +- mobs/felucco.lua | 37 +- mobs/flying_duck.lua | 35 +- mobs/giant_sandworm.lua | 35 +- mobs/icelamander.lua | 44 +- mobs/icesnake.lua | 37 +- mobs/kraken.lua | 31 +- mobs/larva.lua | 44 +- mobs/lava_titan.lua | 34 +- mobs/manticore.lua | 32 +- mobs/mantis.lua | 38 +- mobs/mantis_beast.lua | 38 +- mobs/masticone.lua | 94 +- mobs/mese_dragon.lua | 60 +- mobs/moonheron.lua | 25 +- mobs/mordain.lua | 108 +- mobs/morde.lua | 81 +- mobs/morgre.lua | 27 +- mobs/morgut.lua | 169 +- mobs/morlu.lua | 108 +- mobs/morvalar.lua | 99 +- mobs/morvy.lua | 109 +- mobs/morwa.lua | 36 +- mobs/night_master.lua | 50 +- mobs/octopus.lua | 50 +- mobs/phoenix.lua | 33 +- mobs/pumpboom.lua | 81 +- mobs/pumpking.lua | 69 +- mobs/sand_bloco.lua | 30 +- mobs/sandworm.lua | 34 +- mobs/scrausics.lua | 25 +- mobs/signosigno.lua | 26 +- mobs/snow_biter.lua | 38 +- mobs/spiderduck.lua | 42 +- mobs/stone_eater.lua | 41 +- mobs/swimming_duck.lua | 37 +- mobs/tarantula.lua | 60 +- mobs/uloboros.lua | 37 +- mobs/werewolf.lua | 32 +- mobs/white_werewolf.lua | 32 +- nssm_api.lua | 447 ++--- nssm_armor.lua | 13 + nssm_materials.lua | 4067 +++++++++++++++++++------------------- spawn.lua | 330 +++- 59 files changed, 3834 insertions(+), 3747 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9452911..e7c5c03 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +v3.02 (26th Jul 2020): + - Tweaked and tidied code + - Fixed bugs and used latest mobs redo api functions + - Changed spawning to use new minetest 5.x dirt types + v3.01 (8th Aug 2018): - Fixed missing functions so that nssm uses mobs redo's global functions; - Fixed performance issue thanks to Ihofhansl diff --git a/darts.lua b/darts.lua index 473b0f7..a1982dc 100644 --- a/darts.lua +++ b/darts.lua @@ -1,9 +1,11 @@ - local function duck_explosion(pos) + if minetest.is_protected(pos, "") then return end - pos.y = pos.y+1; + + pos.y = pos.y + 1 + minetest.add_particlespawner({ amount = 10, time = 0.2, @@ -21,9 +23,13 @@ local function duck_explosion(pos) vertical = false, texture = "duck_egg_fragments.png", }) + core.after(0.4, function() - for dx = -1,1 do - pos = {x = pos.x+dx, y=pos.y; z=pos.z+dx} + + for dx = -1, 1 do + + pos = {x = pos.x + dx, y = pos.y, z = pos.z + dx} + minetest.add_particlespawner({ amount = 100, time = 0.2, @@ -41,6 +47,7 @@ local function duck_explosion(pos) vertical = false, texture = "tnt_smoke.png", }) + minetest.add_entity(pos, "nssm:duck") end end) @@ -52,6 +59,7 @@ mobs:register_arrow("nssm:duck_father", { visual_size = {x = 1, y = 1}, textures = {"duck_egg.png"}, velocity = 8, + -- direct hit hit_player = function(self, player) local pos = self.object:get_pos() @@ -70,16 +78,21 @@ mobs:register_arrow("nssm:duck_father", { local function ice_explosion(pos) - for i=pos.x-math.random(0, 1), pos.x+math.random(0, 1), 1 do - for j=pos.y-1, pos.y+4, 1 do - for k=pos.z-math.random(0, 1), pos.z+math.random(0, 1), 1 do - local p = {x=i, y=j, z=k} + + for i = pos.x - math.random(0, 1), pos.x + math.random(0, 1), 1 do + + for j = pos.y - 1, pos.y + 4, 1 do + + for k = pos.z-math.random(0, 1), pos.z + math.random(0, 1), 1 do + + local p = {x = i, y = j, z = k} local n = minetest.get_node(p).name + if minetest.get_item_group(n, "unbreakable") == 1 or minetest.is_protected(p, "") or (n == "bones:bones" and not nssm:affectbones(self)) then else - minetest.set_node({x=i, y=j, z=k}, {name="default:ice"}) + minetest.set_node({x = i, y = j, z = k}, {name = "default:ice"}) end end end @@ -92,6 +105,7 @@ mobs:register_arrow("nssm:snow_arrow", { visual_size = {x = 1, y = 1}, textures = {"transparent.png"}, velocity =20, + -- direct hit hit_player = function(self, player) local pos = self.object:get_pos() @@ -102,6 +116,7 @@ mobs:register_arrow("nssm:snow_arrow", { local pos = self.object:get_pos() ice_explosion(pos) end, + hit_node = function(self, pos, node) ice_explosion(pos) end, @@ -114,6 +129,7 @@ mobs:register_arrow("nssm:spine", { visual_size = {x = 1, y = 1}, textures = {"manticore_spine_flying.png"}, velocity = 10, + -- direct hit hit_player = function(self, player) player:punch(self.object, 1.0, { @@ -154,18 +170,23 @@ mobs:register_arrow("nssm:morarrow", { local function explosion_web(pos) + pos.y = round(pos.y) + if minetest.is_protected(pos, "") then return end - for i=pos.x-1, pos.x+1, 1 do - for j=pos.y-3, pos.y, 1 do - for k=pos.z-1, pos.z+1, 1 do - local p = {x=i,y=j,z=k} - local k = {x=i,y=j+1,z=k} + + for i = pos.x - 1, pos.x + 1, 1 do + for j = pos.y - 3, pos.y, 1 do + for k = pos.z - 1, pos.z + 1, 1 do + + local p = {x = i, y = j, z = k} + local k = {x = i, y = j + 1, z = k} local current = minetest.get_node(p).name local ontop = minetest.get_node(k).name - if (current ~= "air") and + + if (current ~= "air") and (current ~= "nssm:web") and (ontop == "air") and not minetest.is_protected(p,"") and not @@ -184,6 +205,7 @@ mobs:register_arrow("nssm:webball", { visual_size = {x = 1, y = 1}, textures = {"web_ball.png"}, velocity = 8, + -- direct hit hit_player = function(self, player) local p = player:get_pos() @@ -204,18 +226,23 @@ mobs:register_arrow("nssm:webball", { function explosion_thickweb(pos) + pos.y = round(pos.y) + if minetest.is_protected(pos, "") then return end - for i=pos.x+0, pos.x+0, 1 do - for j=pos.y-2, pos.y, 1 do - for k=pos.z+0, pos.z+0, 1 do - local p = {x=i,y=j,z=k} - local k = {x=i,y=j+1,z=k} + + for i = pos.x + 0, pos.x + 0, 1 do + for j = pos.y - 2, pos.y, 1 do + for k = pos.z + 0, pos.z + 0, 1 do + + local p = {x = i, y = j, z = k} + local k = {x = i, y = j + 1, z = k} local current = minetest.get_node(p).name local ontop = minetest.get_node(k).name - if (current ~= "air") and + + if (current ~= "air") and (current ~= "nssm:thick_web") and (ontop == "air") and not minetest.is_protected(p,"") and not @@ -233,6 +260,7 @@ mobs:register_arrow("nssm:thickwebball", { visual_size = {x = 2, y = 2}, textures = {"thick_web_ball.png"}, velocity = 8, + -- direct hit hit_player = function(self, player) local p = player:get_pos() @@ -258,6 +286,7 @@ mobs:register_arrow("nssm:phoenix_arrow", { visual_size = {x = 1, y = 1}, textures = {"transparent.png"}, velocity = 8, + -- direct hit hit_player = function(self, player) end, @@ -265,6 +294,7 @@ mobs:register_arrow("nssm:phoenix_arrow", { on_step = function(self, dtime) local pos = self.object:get_pos() + if minetest.is_protected(pos, "") then return end @@ -276,43 +306,52 @@ mobs:register_arrow("nssm:phoenix_arrow", { end if os.time() - self.timer > 5 or minetest.is_protected(pos, "") - or ((n~="air") and (n~="nssm:phoenix_fire")) then + or ((n ~= "air") and (n ~= "nssm:phoenix_fire")) then self.object:remove() end - if math.random(1,2)==2 then - minetest.set_node(pos, {name="nssm:phoenix_fire"}) + if math.random(1, 2) == 2 then + minetest.set_node(pos, {name = "nssm:phoenix_fire"}) end - if math.random(1,6)==1 then - dx = math.random(-1,1) - dy = math.random(-1,1) - dz = math.random(-1,1) - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + if math.random(1, 6) == 1 then + + local p = { + x = pos.x + math.random(-1, 1), + y = pos.y + math.random(-1, 1), + z = pos.z + math.random(-1, 1) + } + local n = minetest.get_node(p).name - if n=="air" then - minetest.set_node(p, {name="nssm:phoenix_fire"}) + + if n == "air" then + minetest.set_node(p, {name = "nssm:phoenix_fire"}) end end - end, }) function gas_explosion(pos) + if minetest.is_protected(pos, "") then return end - for dx=-2,2 do - for dy=-1,4 do - for dz=-2,2 do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + + for dx = -2, 2 do + for dy = -1, 4 do + for dz = -2, 2 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:venomous_gas"}) + + if n == "air" then + minetest.set_node(p, {name = "nssm:venomous_gas"}) end end end @@ -322,9 +361,9 @@ end mobs:register_arrow("nssm:super_gas", { visual = "sprite", visual_size = {x = 1, y = 1}, --- textures = {"transparent.png"}, textures = {"tnt_smoke.png^[colorize:green:170"}, velocity = 8, + -- direct hit hit_player = function(self, player) local p = player:get_pos() @@ -358,11 +397,18 @@ mobs:register_arrow("nssm:roar_of_the_dragon", { end local objects = minetest.get_objects_inside_radius(pos, 1) + for _,obj in ipairs(objects) do + local name = obj:get_entity_name() - if name~="nssm:roar_of_the_dragon" and name ~= "nssm:mese_dragon" then - obj:set_hp(obj:get_hp()-0.05) - if (obj:get_hp() <= 0) then + + if name ~= "nssm:roar_of_the_dragon" + and name ~= "nssm:mese_dragon" then + + obj:set_hp(obj:get_hp() - 0.05) + + if obj:get_hp() <= 0 then + if (not obj:is_player()) and name ~= self.object:get_luaentity().name then obj:remove() @@ -371,16 +417,19 @@ mobs:register_arrow("nssm:roar_of_the_dragon", { end end - minetest.set_node(pos, {name="air"}) - if math.random(1,2)==1 then - dx = math.random(-1,1) - dy = math.random(-1,1) - dz = math.random(-1,1) - if minetest.is_protected(p, "") then - return + minetest.set_node(pos, {name = "air"}) + + if math.random(1, 2) == 1 then + + local p = { + x = pos.x + math.random(-1, 1), + y = pos.y + math.random(-1, 1), + z = pos.z + math.random(-1, 1) + } + + if not minetest.is_protected(p, "") then + minetest.set_node(p, {name = "air"}) end - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - minetest.set_node(p, {name="air"}) end end }) @@ -391,25 +440,32 @@ mobs:register_arrow("nssm:lava_arrow", { visual_size = {x = 1, y = 1}, textures = {"transparent.png"}, velocity = 10, + -- direct hit hit_player = function(self, player) + local pos = self.object:get_pos() + if minetest.is_protected(pos, "") then return end - for dy=-1, 6, 1 do - for dx=-1, 1, 2 do - for dz=-1, 1, 2 do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + + for dy = -1, 6, 1 do + for dx = -1, 1, 2 do + for dz = -1, 1, 2 do + + local p = {x = pos.x + dx, y = pos.y + dy, z = pos.z + dz} local n = minetest.get_node(p).name - if n~="default:lava_flowing" + + if n ~= "default:lava_flowing" and not minetest.is_protected(p, "") then - minetest.set_node(p, {name="default:lava_flowing"}) + minetest.set_node(p, {name = "default:lava_flowing"}) end end end end end, + hit_node = function(self, pos, node) end }) diff --git a/init.lua b/init.lua index eaa34a6..7d798cf 100644 --- a/init.lua +++ b/init.lua @@ -1,12 +1,13 @@ local path = minetest.get_modpath("nssm") -nssm = {} -nssm.mymapgenis = tonumber(minetest.setting_get('mymapgenis')) or 7 -nssm.multimobs = tonumber(minetest.setting_get('multimobs')) or 1000 +nssm = { + mymapgenis = tonumber(minetest.setting_get('mymapgenis')) or 7, + multimobs = tonumber(minetest.setting_get('multimobs')) or 1000 +} dofile(path.."/spawn.lua") ---Mobs +-- Mobs dofile(path.."/mobs/ant_queen.lua") dofile(path.."/mobs/ant_soldier.lua") dofile(path.."/mobs/ant_worker.lua") diff --git a/mobs/ant_queen.lua b/mobs/ant_queen.lua index 7606151..2fcc820 100644 --- a/mobs/ant_queen.lua +++ b/mobs/ant_queen.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:ant_queen", { collisionbox = {-0.6, 0.00, -0.6, 0.6, 1, 0.6}, visual = "mesh", mesh = "ant_queen.x", - textures = {{"ant_queen.png"}}, - visual_size = {x=6, y=6}, + textures = { + {"ant_queen.png"} + }, + visual_size = {x = 6, y = 6}, makes_footstep_sound = true, view_range = 30, fear_height = 5, @@ -21,22 +23,10 @@ mobs:register_mob("nssm:ant_queen", { damage = 4, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 5, - max = 7,}, - {name = "nssm:ant_queen_abdomen", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:ant_leg", - chance = 2, - min = 1, - max = 6,}, - {name = "nssm:ant_mandible", - chance = 3, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 5, max = 7}, + {name = "nssm:ant_queen_abdomen", chance = 1, min = 1, max = 1}, + {name = "nssm:ant_leg", chance = 2, min = 1, max = 6}, + {name = "nssm:ant_mandible", chance = 3, min = 1, max = 2}, }, reach = 8, armor = 40, @@ -44,12 +34,11 @@ mobs:register_mob("nssm:ant_queen", { water_damage = 2, lava_damage = 7, light_damage = 0, - blood_texture="nssm_blood_blue.png", - blood_amount=50, - stepheight=2.1, - knock_back=0, - jump_height=12, - on_rightclick = nil, + blood_texture = "nssm_blood_blue.png", + blood_amount = 50, + stepheight = 2.1, + knock_back = 0, + jump_height = 12, attack_type = "dogfight", animation = { speed_normal = 20, @@ -65,39 +54,52 @@ mobs:register_mob("nssm:ant_queen", { }, custom_attack = function(self) - self.ant_queen_counter = (self.ant_queen_counter or 0) + 1 - if self.ant_queen_counter == 4 then - self.ant_queen_counter = 0 - local counter = 0 + self.ant_queen_counter = (self.ant_queen_counter or 0) + 1 + + if self.ant_queen_counter == 4 then + + self.ant_queen_counter = 0 + + local counter = 0 local s = self.object:get_pos() local p = self.attack:get_pos() p.y = p.y + 1.5 s.y = s.y + 1.5 + if mobs:line_of_sight(self, p, s) == true then -- play attack sound if self.sounds.attack then minetest.sound_play(self.sounds.attack, { - object = self.object, - max_hear_distance = self.sounds.distance + object = self.object, + max_hear_distance = self.sounds.distance }) end - local pos1 = {x=s.x+math.random(-3,3), y=s.y-1, z=s.z+math.random(-3,3)} + + local pos1 = { + x = s.x + math.random(-3, 3), + y = s.y - 1, + z = s.z + math.random(-3, 3) + } local objects = minetest.get_objects_inside_radius(s, 10) + for _,obj in ipairs(objects) do - if (obj:get_luaentity() and obj:get_luaentity().name == "nssm:ant_soldier") then + + if (obj:get_luaentity() + and obj:get_luaentity().name == "nssm:ant_soldier") then counter = counter + 1 end end - if ((pos1.x~=s.x) and (pos1.z~=s.z)) + if ((pos1.x~=s.x) and (pos1.z~=s.z)) and (minetest.get_node(pos1).name == "air") - and (counter < 4) - then + and (counter < 4) then + explosion_particles(pos1, 1) + minetest.add_entity(pos1, "nssm:ant_soldier") end end diff --git a/mobs/ant_soldier.lua b/mobs/ant_soldier.lua index e0afbe2..45c0d91 100644 --- a/mobs/ant_soldier.lua +++ b/mobs/ant_soldier.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:ant_soldier", { collisionbox = {-0.49, 0.00, -0.49, 0.49, 0.9, 0.49}, visual = "mesh", mesh = "ant_soldier.x", - textures = {{"ant_soldier.png"}}, - visual_size = {x=3, y=3}, + textures = { + {"ant_soldier.png"} + }, + visual_size = {x = 3, y = 3}, makes_footstep_sound = true, view_range = 20, fear_height = 4, @@ -19,22 +21,10 @@ mobs:register_mob("nssm:ant_soldier", { damage = 6, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:ant_leg", - chance = 2, - min = 1, - max = 6,}, - {name = "nssm:ant_mandible", - chance = 3, - min = 1, - max = 2,}, - {name = "nssm:ant_hard_skin", - chance = 3, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:ant_leg", chance = 2, min = 1, max = 6}, + {name = "nssm:ant_mandible", chance = 3, min = 1, max = 2}, + {name = "nssm:ant_hard_skin", chance = 3, min = 1, max = 2}, }, reach = 2, armor = 70, @@ -42,12 +32,11 @@ mobs:register_mob("nssm:ant_soldier", { water_damage = 2, lava_damage = 7, light_damage = 0, - on_rightclick = nil, - group_attack=true, - attack_animals=false, - knock_back=2, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, + group_attack = true, + attack_animals = false, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/ant_worker.lua b/mobs/ant_worker.lua index 9ecd8c4..9a0c568 100644 --- a/mobs/ant_worker.lua +++ b/mobs/ant_worker.lua @@ -6,8 +6,10 @@ mobs:register_mob("nssm:ant_worker", { collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.5, 0.4}, visual = "mesh", mesh = "ant_worker.x", - textures = {{"ant_worker.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"ant_worker.png"} + }, + visual_size = {x = 2, y = 2}, makes_footstep_sound = true, view_range = 20, fear_height = 4, @@ -21,33 +23,20 @@ mobs:register_mob("nssm:ant_worker", { reach = 2, jump = true, drops = { - {name = "nssm:life_energy", - chance = 2, - min = 1, - max = 1,}, - {name = "nssm:ant_leg", - chance = 2, - min = 1, - max = 6,}, - {name = "nssm:ant_mandible", - chance = 3, - min = 1, - max = 2,}, - {name = "nssm:ant_hard_skin", - chance = 3, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 2, min = 1, max = 1}, + {name = "nssm:ant_leg", chance = 2, min = 1, max = 6}, + {name = "nssm:ant_mandible", chance = 3, min = 1, max = 2}, + {name = "nssm:ant_hard_skin", chance = 3, min = 1, max = 2}, }, armor = 70, drawtype = "front", water_damage = 2, lava_damage = 7, light_damage = 0, - on_rightclick = nil, - group_attack=true, - knock_back=4, - attack_animals=false, - blood_texture="nssm_blood_blue.png", + group_attack = true, + knock_back = 4, + attack_animals = false, + blood_texture = "nssm_blood_blue.png", attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/black_widow.lua b/mobs/black_widow.lua index 853b2eb..19c5165 100644 --- a/mobs/black_widow.lua +++ b/mobs/black_widow.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:black_widow", { collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.8, 0.4}, visual = "mesh", mesh = "black_widow.x", - textures = {{"black_widow.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"black_widow.png"} + }, + visual_size = {x = 2, y = 2}, makes_footstep_sound = true, view_range = 15, fear_height = 4, @@ -20,34 +22,21 @@ mobs:register_mob("nssm:black_widow", { reach = 2, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:spider_leg", - chance = 3, - min = 1, - max = 8,}, - {name = "nssm:silk_gland", - chance = 4, - min = 1, - max = 3,}, - {name = "nssm:spider_meat", - chance = 4, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:spider_leg", chance = 3, min = 1, max = 8}, + {name = "nssm:silk_gland", chance = 4, min = 1, max = 3}, + {name = "nssm:spider_meat", chance = 4, min = 1, max = 2}, }, armor = 70, drawtype = "front", water_damage = 1, lava_damage = 7, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, light_damage = 0, - on_rightclick = nil, attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/bloco.lua b/mobs/bloco.lua index c53a607..8cc9b23 100644 --- a/mobs/bloco.lua +++ b/mobs/bloco.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:bloco", { collisionbox = {-0.56, -0.2, -0.56, 0.56, 1.2, 0.56}, visual = "mesh", mesh = "bloco.x", - textures = {{"bloco.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"bloco.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 8, fear_height = 4, @@ -20,31 +22,28 @@ mobs:register_mob("nssm:bloco", { reach = 2, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 1,}, - {name = "default:stone", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:bloco_skin", - chance = 3, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 1}, + {name = "default:stone", chance = 1, min = 2, max = 3}, + {name = "nssm:bloco_skin", chance = 3, min = 1, max = 2}, }, armor = 40, drawtype = "front", water_damage = 3, lava_damage = 1, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=0, - blood_texture="stone_blood.png", - immune_to={{'default:sword_stone', -2},{'default:stone', -2}, {'default:cobble', -2}, {'default:axe_stone', -2}, {'default:shovel_stone', -2}, {'default:pick_stone', -2}}, - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 0, + blood_texture = "stone_blood.png", + immune_to = { + {'default:sword_stone', -2}, + {'default:stone', -2}, + {'default:cobble', -2}, + {'default:axe_stone', -2}, + {'default:shovel_stone', -2}, + {'default:pick_stone', -2} + }, + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/crab.lua b/mobs/crab.lua index c37ca2a..552c5cd 100644 --- a/mobs/crab.lua +++ b/mobs/crab.lua @@ -5,11 +5,14 @@ mobs:register_mob("nssm:crab", { collisionbox = {-0.5, 0, -0.5, 0.5, 0.55, 0.5}, visual = "mesh", mesh = "crab.x", - textures = {{"crab1.png"},{"crab2.png"}}, + textures = { + {"crab1.png"}, + {"crab2.png"} + }, sounds = { random = "crab", }, - visual_size = {x=3, y=3}, + visual_size = {x = 3, y = 3}, makes_footstep_sound = true, view_range = 7, rotate = 270, @@ -21,34 +24,21 @@ mobs:register_mob("nssm:crab", { floats = 0, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:surimi", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:crab_chela", - chance = 4, - min = 1, - max = 2,}, - {name = "nssm:crab_carapace_fragment", - chance = 4, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:surimi", chance = 1, min = 1, max = 2}, + {name = "nssm:crab_chela", chance = 4, min = 1, max = 2}, + {name = "nssm:crab_carapace_fragment", chance = 4, min = 1, max = 1}, }, armor = 40, drawtype = "front", water_damage = 0, lava_damage = 10, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 25, diff --git a/mobs/crocodile.lua b/mobs/crocodile.lua index 725ee04..848e2b6 100644 --- a/mobs/crocodile.lua +++ b/mobs/crocodile.lua @@ -5,11 +5,13 @@ mobs:register_mob("nssm:crocodile", { collisionbox = {-0.45, -0.30, -0.45, 0.45, 0.3, 0.45}, visual = "mesh", mesh = "crocodile.x", - textures = {{"croco.png"}}, + textures = { + {"croco.png"} + }, sounds = { random = "crocod", }, - visual_size = {x=4, y=4}, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 15, walk_velocity = 1, @@ -18,18 +20,9 @@ mobs:register_mob("nssm:crocodile", { floats = 1, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:crocodile_tail", - chance = 2, - min = 1, - max = 1,}, - {name = "nssm:crocodile_skin", - chance = 3, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:crocodile_tail", chance = 2, min = 1, max = 1}, + {name = "nssm:crocodile_skin", chance = 3, min = 1, max = 1}, }, armor = 60, drawtype = "front", @@ -37,12 +30,11 @@ mobs:register_mob("nssm:crocodile", { water_damage = 0, lava_damage = 10, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=3, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 3, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 25, diff --git a/mobs/daddy_long_legs.lua b/mobs/daddy_long_legs.lua index 98866f3..d7278e6 100644 --- a/mobs/daddy_long_legs.lua +++ b/mobs/daddy_long_legs.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:daddy_long_legs", { collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.6, 0.4}, visual = "mesh", mesh = "daddy_long_legs.x", - textures = {{"daddy_long_legs.png"}}, - visual_size = {x=8, y=8}, + textures = { + {"daddy_long_legs.png"} + }, + visual_size = {x = 8, y = 8}, makes_footstep_sound = true, view_range = 12, walk_velocity = 0.7, @@ -19,30 +21,20 @@ mobs:register_mob("nssm:daddy_long_legs", { damage = 3, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:spider_leg", - chance = 3, - min = 1, - max = 8,}, - {name = "nssm:spider_meat", - chance = 4, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:spider_leg", chance = 3, min = 1, max = 8}, + {name = "nssm:spider_meat", chance = 4, min = 1, max = 2}, }, armor = 70, drawtype = "front", water_damage = 1, lava_damage = 7, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/dolidrosaurus.lua b/mobs/dolidrosaurus.lua index d760fc1..80fe8b8 100644 --- a/mobs/dolidrosaurus.lua +++ b/mobs/dolidrosaurus.lua @@ -5,8 +5,14 @@ mobs:register_mob("nssm:dolidrosaurus", { collisionbox = {-0.5, 0, -0.5, 0.5, 0.52, 0.5}, visual = "mesh", mesh = "dolidrosaurus.x", - textures = {{"dolidrosaurus1.png"},{"dolidrosaurus2.png"},{"dolidrosaurus3.png"},{"dolidrosaurus4.png"},{"dolidrosaurus5.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"dolidrosaurus1.png"}, + {"dolidrosaurus2.png"}, + {"dolidrosaurus3.png"}, + {"dolidrosaurus4.png"}, + {"dolidrosaurus5.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 30, fly = true, @@ -23,24 +29,18 @@ mobs:register_mob("nssm:dolidrosaurus", { random = "crocod", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 3,}, - {name = "nssm:dolidrosaurus_fin", - chance = 2, - min = 1, - max = 3,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 3}, + {name = "nssm:dolidrosaurus_fin", chance = 2, min = 1, max = 3}, }, armor = 60, drawtype = "front", water_damage = 0, lava_damage = 10, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=3, - blood_texture="nssm_blood.png", + group_attack = true, + attack_animals = true, + knock_back = 3, + blood_texture = "nssm_blood.png", on_rightclick = nil, attack_type = "dogfight", animation = { diff --git a/mobs/duck.lua b/mobs/duck.lua index 93878b4..ae3b15f 100644 --- a/mobs/duck.lua +++ b/mobs/duck.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:duck", { collisionbox = {-0.3, 0.00, -0.3, 0.3, 0.95, 0.3}, visual = "mesh", mesh = "duck.x", - textures = {{"duck.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"duck.png"} + }, + visual_size = {x = 2, y = 2}, makes_footstep_sound = true, view_range = 13, walk_velocity = 1, @@ -18,22 +20,10 @@ mobs:register_mob("nssm:duck", { random = "duck", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:duck_legs", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:duck_beak", - chance = 5, - min = 1, - max = 1,}, - {name = "nssm:duck_feather", - chance = 3, - min = 2, - max = 4,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 1}, + {name = "nssm:duck_legs", chance = 1, min = 1, max = 2}, + {name = "nssm:duck_beak", chance = 5, min = 1, max = 1}, + {name = "nssm:duck_feather", chance = 3, min = 2, max = 4}, }, armor = 100, drawtype = "front", @@ -42,11 +32,10 @@ mobs:register_mob("nssm:duck", { floats = 1, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=5, - blood_texture="nssm_blood.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 5, + blood_texture = "nssm_blood.png", attack_type = "dogfight", animation = { speed_normal = 15, @@ -60,5 +49,4 @@ mobs:register_mob("nssm:duck", { punch_start = 40, punch_end = 60, } - --pathfinding = 1, }) diff --git a/mobs/duckking.lua b/mobs/duckking.lua index e2d2b2d..b2f4121 100644 --- a/mobs/duckking.lua +++ b/mobs/duckking.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:duckking", { collisionbox = {-1.2, -0.25, -1.2, 1.2, 4, 1.2}, visual = "mesh", mesh = "king_duck.x", - textures = {{"king_duck.png"}}, - visual_size = {x=10, y=10}, + textures = { + {"king_duck.png"} + }, + visual_size = {x = 10, y = 10}, lifetimer = 300, makes_footstep_sound = true, view_range = 30, @@ -22,26 +24,11 @@ mobs:register_mob("nssm:duckking", { attack = "duckking", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 7, - max = 8,}, - {name = "nssm:duck_legs", - chance = 1, - min = 40, - max = 50,}, - {name = "nssm:helmet_crown", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:duck_beak", - chance = 4, - min = 10, - max = 20,}, - {name = "nssm:duck_feather", - chance = 3, - min = 20, - max = 40,}, + {name = "nssm:life_energy", chance = 1, min = 7, max = 8}, + {name = "nssm:duck_legs", chance = 1, min = 40, max = 50}, + {name = "nssm:helmet_crown", chance = 1, min = 1, max = 1}, + {name = "nssm:duck_beak", chance = 4, min = 10, max = 20}, + {name = "nssm:duck_feather", chance = 3, min = 20, max = 40}, }, armor = 50, drawtype = "front", @@ -49,18 +36,17 @@ mobs:register_mob("nssm:duckking", { floats = 1, lava_damage = 5, light_damage = 0, - on_rightclick = nil, attack_type = "dogshoot", dogshoot_switch = true, dogshoot_count_max = 9, blood_texture="nssm_blood.png", - blood_amount=50, - stepheight=2.1, - knock_back=0, - jump_height=12, + blood_amount = 50, + stepheight = 2.1, + knock_back = 0, + jump_height = 12, arrow = "nssm:duck_father", - shoot_interval=3, - shoot_offset =-1, + shoot_interval = 3, + shoot_offset = -1, animation = { speed_normal = 15, speed_run = 25, diff --git a/mobs/echidna.lua b/mobs/echidna.lua index 7c8fe4a..a7993d3 100644 --- a/mobs/echidna.lua +++ b/mobs/echidna.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:echidna", { collisionbox = {-0.6, 0.00, -0.6, 0.6, 2, 0.6}, visual = "mesh", mesh = "echidna.x", - textures = {{"echidnapes.png"}}, - visual_size = {x=6, y=6}, + textures = { + {"echidnapes.png"} + }, + visual_size = {x = 6, y = 6}, makes_footstep_sound = true, view_range = 30, rotate = 270, @@ -20,14 +22,8 @@ mobs:register_mob("nssm:echidna", { random = "echidna", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 6, - max = 7,}, - {name = "nssm:snake_scute", - chance = 1, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 6, max = 7}, + {name = "nssm:snake_scute", chance = 1, min = 1, max = 1}, }, armor = 40, drawtype = "front", @@ -35,17 +31,16 @@ mobs:register_mob("nssm:echidna", { floats = 1, lava_damage = 0, light_damage = 0, - blood_texture="nssm_blood.png", - blood_amount=10, - stepheight=1.1, - knock_back=0, - jump_height=8, - on_rightclick = nil, + blood_texture = "nssm_blood.png", + blood_amount = 10, + stepheight = 1.1, + knock_back = 0, + jump_height = 8, attack_type = "dogshoot", dogshoot_switch = true, arrow = "nssm:super_gas"; reach = 5, - shoot_interval=3, + shoot_interval = 3, animation = { speed_normal = 15, speed_run = 25, diff --git a/mobs/enderduck.lua b/mobs/enderduck.lua index 10bebf7..3110df2 100644 --- a/mobs/enderduck.lua +++ b/mobs/enderduck.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:enderduck", { collisionbox = {-0.28, 0.00, -0.28, 0.28, 1.8, 0.28}, visual = "mesh", mesh = "enderduck.x", - textures = {{"enderduck.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"enderduck.png"} + }, + visual_size = {x = 2, y = 2}, makes_footstep_sound = true, view_range = 25, walk_velocity = 3, @@ -20,36 +22,23 @@ mobs:register_mob("nssm:enderduck", { reach = 2, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2}, - {name = "nssm:duck_legs", - chance = 1, - min = 1, - max = 2}, - {name = "nssm:black_duck_feather", - chance = 3, - min = 1, - max = 4,}, - {name = "nssm:duck_beak", - chance = 5, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:duck_legs", chance = 1, min = 1, max = 2}, + {name = "nssm:black_duck_feather", chance = 3, min = 1, max = 4}, + {name = "nssm:duck_beak", chance = 5, min = 1, max = 1}, }, armor = 80, drawtype = "front", water_damage = 1, - floats=1, + floats = 1, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=4, - blood_texture="nssm_blood.png", - jump_height=12, - stepheight=2.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 4, + blood_texture = "nssm_blood.png", + jump_height = 12, + stepheight = 2.1, attack_type = "dogfight", animation = { speed_normal = 15, diff --git a/mobs/felucco.lua b/mobs/felucco.lua index 896d7b4..2c11983 100644 --- a/mobs/felucco.lua +++ b/mobs/felucco.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:felucco", { collisionbox = {-0.5, 0, -0.5, 0.5, 1.2, 0.5}, visual = "mesh", mesh = "felucco.x", - textures = {{"felucco.png"}}, - visual_size = {x=7, y=7}, + textures = { + {"felucco.png"} + }, + visual_size = {x = 7, y = 7}, makes_footstep_sound = true, view_range = 30, walk_velocity = 1, @@ -18,34 +20,21 @@ mobs:register_mob("nssm:felucco", { damage = 5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4}, - {name = "nssm:felucco_steak", - chance = 2, - min = 1, - max = 2}, - {name = "nssm:felucco_fur", - chance = 2, - min = 1, - max = 1}, - {name = "nssm:felucco_horn", - chance = 3, - min = 1, - max = 2}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:felucco_steak", chance = 2, min = 1, max = 2}, + {name = "nssm:felucco_fur", chance = 2, min = 1, max = 1}, + {name = "nssm:felucco_horn", chance = 3, min = 1, max = 2}, }, armor = 70, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, diff --git a/mobs/flying_duck.lua b/mobs/flying_duck.lua index 7e4fc50..0e9d804 100644 --- a/mobs/flying_duck.lua +++ b/mobs/flying_duck.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:flying_duck", { collisionbox = {-0.3, -0.2, -0.3, 0.3, 0.2, 0.3}, visual = "mesh", mesh = "nathan_petrelli.x", - textures = {{"nathan_petrelli.png"}}, - visual_size = {x=1, y=1}, + textures = { + {"nathan_petrelli.png"} + }, + visual_size = {x = 1, y = 1}, view_range = 30, walk_velocity = 2, run_velocity = 2.5, @@ -19,33 +21,20 @@ mobs:register_mob("nssm:flying_duck", { reach = 2, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:duck_legs", - chance = 2, - min = 1, - max = 2,}, - {name = "nssm:duck_beak", - chance = 5, - min = 1, - max = 1,}, - {name = "nssm:duck_feather", - chance = 2, - min = 4, - max = 8,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:duck_legs", chance = 2, min = 1, max = 2}, + {name = "nssm:duck_beak", chance = 5, min = 1, max = 1}, + {name = "nssm:duck_feather", chance = 2, min = 4, max = 8}, }, armor = 80, drawtype = "front", water_damage = 0, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=5, - blood_texture="nssm_blood.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 5, + blood_texture = "nssm_blood.png", fly = true, attack_type = "dogfight", animation = { diff --git a/mobs/giant_sandworm.lua b/mobs/giant_sandworm.lua index 422f194..54b989d 100644 --- a/mobs/giant_sandworm.lua +++ b/mobs/giant_sandworm.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:giant_sandworm", { collisionbox = {-1.2, 0, -1.2, 1.2, 4.5, 1.2}, visual = "mesh", mesh = "giant_sandworm.x", - textures = {{"sandworm.png"}}, - visual_size = {x=13, y=13}, + textures = { + {"sandworm.png"} + }, + visual_size = {x = 13, y = 13}, makes_footstep_sound = false, view_range = 9, rotate = 270, @@ -16,33 +18,20 @@ mobs:register_mob("nssm:giant_sandworm", { damage = 12, jump = false, drops = { - {name = "nssm:worm_flesh", - chance = 1, - min = 20, - max = 30,}, - {name = "nssm:sandworm_skin", - chance = 2, - min = 3, - max = 12,}, - {name = "nssm:life_energy", - chance = 1, - min = 7, - max = 8,}, - {name = "nssm:digested_sand", - chance = 1, - min = 1, - max = 1,}, + {name = "nssm:worm_flesh", chance = 1, min = 20, max = 30}, + {name = "nssm:sandworm_skin", chance = 2, min = 3, max = 12}, + {name = "nssm:life_energy", chance = 1, min = 7, max = 8}, + {name = "nssm:digested_sand", chance = 1, min = 1, max = 1}, }, armor = 40, drawtype = "front", water_damage = 5, lava_damage = 3, light_damage = 0, - blood_texture="nssm_blood_blue.png", - blood_amount=50, - knock_back=0, - jump_height=0, - on_rightclick = nil, + blood_texture = "nssm_blood_blue.png", + blood_amount = 50, + knock_back = 0, + jump_height = 0, attack_type = "dogfight", animation = { speed_normal = 25, diff --git a/mobs/icelamander.lua b/mobs/icelamander.lua index b26fdc3..52bccab 100644 --- a/mobs/icelamander.lua +++ b/mobs/icelamander.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:icelamander", { collisionbox = {-0.5, 0, -0.5, 0.5, 2.3, 0.5}, visual = "mesh", mesh = "icelamander.x", - textures = {{"icelamander.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"icelamander.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 35, lifetimer = 500, @@ -19,40 +21,24 @@ mobs:register_mob("nssm:icelamander", { damage = 12, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 6, - max = 8}, - {name = "nssm:frosted_amphibian_heart", - chance = 1, - min = 1, - max = 1}, - {name = "nssm:ice_tooth", - chance = 1, - min = 1, - max = 1}, - {name = "nssm:little_ice_tooth", - chance = 1, - min = 0, - max = 20}, - {name = "nssm:amphibian_ribs", - chance = 2, - min = 1, - max = 1}, + {name = "nssm:life_energy", chance = 1, min = 6, max = 8}, + {name = "nssm:frosted_amphibian_heart", chance = 1, min = 1, max = 1}, + {name = "nssm:ice_tooth", chance = 1, min = 1, max = 1}, + {name = "nssm:little_ice_tooth", chance = 1, min = 0, max = 20}, + {name = "nssm:amphibian_ribs", chance = 2, min = 1, max = 1}, }, armor = 40, drawtype = "front", water_damage = 0, lava_damage = 30, light_damage = 0, - on_rightclick = nil, attack_type = "dogshoot", dogshoot_switch = true, - blood_texture="nssm_blood.png", - blood_amount=20, - stepheight=1.1, - knock_back=0, - jump_height=8, + blood_texture = "nssm_blood.png", + blood_amount = 20, + stepheight = 1.1, + knock_back = 0, + jump_height = 8, dogshoot_count_max = 7, arrow = "nssm:snow_arrow", shoot_interval = 2, @@ -71,6 +57,6 @@ mobs:register_mob("nssm:icelamander", { shoot_end = 210, }, do_custom = function(self) - midas_ability(self, "default:ice", self.run_velocity,1, 3) + midas_ability(self, "default:ice", self.run_velocity, 1, 3) end, }) diff --git a/mobs/icesnake.lua b/mobs/icesnake.lua index a44ad7c..e93a1ac 100644 --- a/mobs/icesnake.lua +++ b/mobs/icesnake.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:icesnake", { collisionbox = {-0.7, 0, -0.7, 0.7, 0.50, 0.7}, visual = "mesh", mesh = "icesnake.x", - textures = {{"icesnake.png"}}, - visual_size = {x=7, y=7}, + textures = { + {"icesnake.png"} + }, + visual_size = {x = 7, y = 7}, makes_footstep_sound = false, view_range = 10, rotate = 270, @@ -20,34 +22,21 @@ mobs:register_mob("nssm:icesnake", { reach = 2, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2}, - {name = "nssm:frosted_amphibian_heart", - chance = 2, - min = 1, - max = 1}, - {name = "nssm:little_ice_tooth", - chance = 2, - min = 0, - max = 4}, - {name = "nssm:amphibian_ribs", - chance = 2, - min = 1, - max = 3}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:frosted_amphibian_heart", chance = 2, min = 1, max = 1}, + {name = "nssm:little_ice_tooth", chance = 2, min = 0, max = 4}, + {name = "nssm:amphibian_ribs", chance = 2, min = 1, max = 3}, }, armor = 70, drawtype = "front", water_damage = 0, lava_damage = 20, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, diff --git a/mobs/kraken.lua b/mobs/kraken.lua index 514bc7d..7580100 100644 --- a/mobs/kraken.lua +++ b/mobs/kraken.lua @@ -5,8 +5,11 @@ mobs:register_mob("nssm:kraken", { collisionbox = {-2, 0, -2, 2, 4, 2}, visual = "mesh", mesh = "kraken.x", - textures = {{"kraken.png"}, {"kraken2.png"}}, - visual_size = {x=15, y=15}, + textures = { + {"kraken.png"}, + {"kraken2.png"} + }, + visual_size = {x = 15, y = 15}, lifetimer=500, inker = false, view_range = 50, @@ -24,30 +27,20 @@ mobs:register_mob("nssm:kraken", { random = "kraken", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 6, - max = 7,}, - {name = "nssm:tentacle", - chance = 1, - min = 30, - max = 40,}, - {name = "nssm:tentacle_curly", - chance = 1, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 6, max = 7}, + {name = "nssm:tentacle", chance = 1, min = 30, max = 40}, + {name = "nssm:tentacle_curly", chance = 1, min = 1, max = 1}, }, armor = 50, drawtype = "front", water_damage = 0, lava_damage = 10, light_damage = 0, - blood_texture="nssm_blood_blue.png", - blood_amount=100, - knock_back=0, - on_rightclick = nil, + blood_texture = "nssm_blood_blue.png", + blood_amount = 100, + knock_back = 0, attack_type = "dogfight", - reach=8, + reach = 8, animation = { speed_normal = 20, speed_run = 30, diff --git a/mobs/larva.lua b/mobs/larva.lua index db54bc9..444f1e1 100644 --- a/mobs/larva.lua +++ b/mobs/larva.lua @@ -5,14 +5,16 @@ mobs:register_mob("nssm:larva", { collisionbox = {-0.3, 0, -0.3, 0.3, 0.41, 0.3}, visual = "mesh", mesh = "larva.x", - textures = {{"larva.png"}}, - visual_size = {x=3, y=3}, + textures = { + {"larva.png"} + }, + visual_size = {x = 3, y = 3}, makes_footstep_sound = false, view_range = 10, rotate = 90, jump = false, fear_height = 4, - jump_height =0, + jump_height = 0, walk_velocity = 0.4, run_velocity = 0.4, sounds = { @@ -21,25 +23,18 @@ mobs:register_mob("nssm:larva", { damage = 1, reach = 1, drops = { - {name = "nssm:life_energy", - chance = 3, - min = 1, - max = 1,}, - {name = "nssm:larva_meat", - chance = 2, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 3, min = 1, max = 1}, + {name = "nssm:larva_meat", chance = 2, min = 1, max = 2}, }, armor = 80, drawtype = "front", water_damage = 2, lava_damage = 4, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", attack_type = "dogfight", animation = { speed_normal = 20, @@ -53,13 +48,20 @@ mobs:register_mob("nssm:larva", { punch_start = 180, punch_end = 230, }, + do_custom = function (self) - self.metatimer = (self.metatimer) or os.time() - if os.time() - self.metatimer >20 then + + self.metatimer = self.metatimer or os.time() + + if os.time() - self.metatimer > 20 then + minetest.log("action", "metatimer expired, metamorphosis! ") - local pos=self.object:get_pos() + + local pos = self.object:get_pos() + self.object:remove() + minetest.add_particlespawner( 200, --amount 0.1, --time @@ -76,11 +78,13 @@ mobs:register_mob("nssm:larva", { false, --collisiondetection "tnt_smoke.png" --texture ) - if math.random(1,2)==1 then + + if math.random(1, 2) == 1 then minetest.add_entity(pos, "nssm:mantis") else minetest.add_entity(pos, "nssm:mantis_beast") end + return end end diff --git a/mobs/lava_titan.lua b/mobs/lava_titan.lua index 11b47fe..6f23a0b 100644 --- a/mobs/lava_titan.lua +++ b/mobs/lava_titan.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:lava_titan", { collisionbox = {-0.45, -0.05, -0.45, 0.45, 1.8, 0.45}, visual = "mesh", mesh = "lava_titan.x", - textures = {{"lava_titan.png"}}, - visual_size = {x=2.7, y=2.7}, + textures = { + {"lava_titan.png"} + }, + visual_size = {x = 2.7, y = 2.7}, makes_footstep_sound = true, view_range = 20, fear_height = 4, @@ -19,32 +21,22 @@ mobs:register_mob("nssm:lava_titan", { }, damage = 8, jump = false, - jump_height=0, + jump_height = 0, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 7, - max = 9,}, - {name = "nssm:lava_titan_eye", - chance = 1, - min = 1, - max = 1,}, - {name = "bucket:bucket_lava", - chance = 2, - min = 1, - max = 3,}, + {name = "nssm:life_energy", chance = 1, min = 7, max = 9}, + {name = "nssm:lava_titan_eye", chance = 1, min = 1, max = 1}, + {name = "bucket:bucket_lava", chance = 2, min = 1, max = 3}, }, armor = 20, drawtype = "front", water_damage = 25, - rotate = 270, + rotate = 270, light_damage = 0, lava_damage = 0, - on_rightclick = nil, floats = 0, - blood_texture="stone_blood.png", - blood_amount=50, - knock_back=0, + blood_texture = "stone_blood.png", + blood_amount = 50, + knock_back = 0, attack_type = "dogshoot", dogshoot_switch = true, arrow = "nssm:lava_arrow", @@ -81,7 +73,7 @@ mobs:register_mob("nssm:lava_titan", { shoot_end=400, }, do_custom = function (self) - digging_attack(self, nil, self.run_velocity, {x=0, y=4, z=0}) + digging_attack(self, nil, self.run_velocity, {x = 0, y = 4, z = 0}) --digging_ability(self, nil, self.run_velocity, {x=0, y=5, z=0}) --putting_ability(self, "default:lava_source", self.run_velocity) end, diff --git a/mobs/manticore.lua b/mobs/manticore.lua index 4446938..ca13a4e 100644 --- a/mobs/manticore.lua +++ b/mobs/manticore.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:manticore", { collisionbox = {-0.8, -0.85, -0.8, 0.8, 1.9, 0.8}, visual = "mesh", mesh = "manticore.x", - textures = {{"manticore.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"manticore.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 35, fear_height = 4, @@ -18,18 +20,9 @@ mobs:register_mob("nssm:manticore", { damage = 6, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4,}, - {name = "nssm:manticore_spine", - chance = 3, - min = 2, - max = 5,}, - {name = "nssm:manticore_fur", - chance = 3, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:manticore_spine", chance = 3, min = 2, max = 5}, + {name = "nssm:manticore_fur", chance = 3, min = 1, max = 2}, }, armor = 60, drawtype = "front", @@ -37,16 +30,15 @@ mobs:register_mob("nssm:manticore", { rotate = 270, lava_damage = 5, light_damage = 0, - on_rightclick = nil, attack_type = "dogshoot", dogshoot_switch = true, arrow = "nssm:spine", shoot_interval = 2, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, shoot_offset = 1, animation = { speed_normal = 25, diff --git a/mobs/mantis.lua b/mobs/mantis.lua index b77ab18..4eab711 100644 --- a/mobs/mantis.lua +++ b/mobs/mantis.lua @@ -5,8 +5,11 @@ mobs:register_mob("nssm:mantis", { collisionbox = {-0.5, 0.00, -0.5, 0.5, 2.30, 0.5}, visual = "mesh", mesh = "mantis.x", - textures = {{"mantis.png"}, {"mantis2.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"mantis.png"}, + {"mantis2.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 20, fear_height = 4, @@ -18,34 +21,21 @@ mobs:register_mob("nssm:mantis", { damage = 4, jump = true, drops = { - {name = "nssm:mantis_claw", - chance = 2, - min = 1, - max = 4,}, - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:mantis_skin", - chance = 3, - min = 1, - max = 2,}, - {name = "nssm:mantis_meat", - chance = 2, - min = 1, - max = 2,}, + {name = "nssm:mantis_claw", chance = 2, min = 1, max = 4}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:mantis_skin", chance = 3, min = 1, max = 2}, + {name = "nssm:mantis_meat", chance = 2, min = 1, max = 2}, }, armor = 70, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - on_rightclick = nil, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, double_melee_attack = true, attack_type = "dogfight", animation = { diff --git a/mobs/mantis_beast.lua b/mobs/mantis_beast.lua index 30b77a7..c9e97ea 100644 --- a/mobs/mantis_beast.lua +++ b/mobs/mantis_beast.lua @@ -5,8 +5,11 @@ mobs:register_mob("nssm:mantis_beast", { collisionbox = {-0.65, 0.00, -0.65, 0.65, 1.50, 0.65}, visual = "mesh", mesh = "mantis_beast.x", - textures = {{"mantis_beast.png"}, {"mantis_beast2.png"}}, - visual_size = {x=6, y=6}, + textures = { + {"mantis_beast.png"}, + {"mantis_beast2.png"} + }, + visual_size = {x = 6, y = 6}, makes_footstep_sound = true, view_range = 25, fear_height = 4, @@ -19,34 +22,21 @@ mobs:register_mob("nssm:mantis_beast", { reach = 2, jump = true, drops = { - {name = "nssm:mantis_claw", - chance = 2, - min = 1, - max = 6,}, - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:mantis_skin", - chance = 3, - min = 1, - max = 2,}, - {name = "nssm:mantis_meat", - chance = 2, - min = 1, - max = 2,}, + {name = "nssm:mantis_claw", chance = 2, min = 1, max = 6}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, + {name = "nssm:mantis_skin", chance = 3, min = 1, max = 2}, + {name = "nssm:mantis_meat", chance = 2, min = 1, max = 2}, }, armor = 70, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, diff --git a/mobs/masticone.lua b/mobs/masticone.lua index 9c837e5..7bc6166 100644 --- a/mobs/masticone.lua +++ b/mobs/masticone.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:masticone", { collisionbox = {-0.45, 0.00, -0.45, 0.45, 0.40, 0.45}, visual = "mesh", mesh = "masticone.x", - textures = {{"masticone.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"masticone.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 15, lifetimer = 500, @@ -20,31 +22,21 @@ mobs:register_mob("nssm:masticone", { damage = 5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 7, - max = 8,}, - {name = "nssm:masticone_fang", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:masticone_skull_fragments", - chance = 2, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 7, max = 8}, + {name = "nssm:masticone_fang", chance = 1, min = 1, max = 2}, + {name = "nssm:masticone_skull_fragments", chance = 2, min = 1, max = 2}, }, armor = 60, drawtype = "front", water_damage = 0, - lava_damage = 0, - floats=0, + lava_damage = 10, + floats = 0, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=4, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 4, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, attack_type = "dogfight", reach =1.5, animation = { @@ -60,17 +52,20 @@ mobs:register_mob("nssm:masticone", { punch_end = 180, }, on_die = function(self, pos) + self.object:remove() + core.after(2, function() + minetest.add_particlespawner( 200, --amount 0.1, --time - {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=-0, y=-0, z=-0}, --minvel - {x=1, y=1, z=1}, --maxvel - {x=-0.5,y=5,z=-0.5}, --minacc - {x=0.5,y=5,z=0.5}, --maxacc + {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 = -0, y = -0, z = -0}, --minvel + {x = 1, y = 1, z = 1}, --maxvel + {x = -0.5, y = 5, z = -0.5}, --minacc + {x = 0.5, y = 5, z = 0.5}, --maxacc 0.1, --minexptime 1, --maxexptime 3, --minsize @@ -78,44 +73,21 @@ mobs:register_mob("nssm:masticone", { false, --collisiondetection "tnt_smoke.png" --texture ) - for i = 1,2 do - local pos = {x=pos.x+math.random(-1,1), y=pos.y+0.5, z=pos.z+math.random(-1,1)} + + for i = 1, 2 do + + local pos = { + x = pos.x + math.random(-1, 1), + y = pos.y + 0.5, + z = pos.z + math.random(-1, 1) + } + local n = minetest.get_node(pos).name + if n == "air" then minetest.add_entity(pos, "nssm:masticone") end end end) end, - - do_custom = function (self) - local pos = self.object:get_pos() - local n = minetest.get_node(pos).name - - if n == "default:lava_source" or n == "default:lava_flowing" then - self.object:set_hp(self.object:get_hp()-5) - if self.object:get_hp() <=0 then - - for _,drop in pairs(self.drops) do - - if math.random(1, drop.chance) == 1 then - - obj = minetest.add_item(pos, - ItemStack(drop.name .. " " - .. math.random(drop.min, drop.max))) - - if obj then - - obj:set_velocity({ - x = math.random(-1, 1), - y = 6, - z = math.random(-1, 1) - }) - end - end - end - self.object:remove() - end - end - end, }) diff --git a/mobs/mese_dragon.lua b/mobs/mese_dragon.lua index b9083e9..7fe0362 100644 --- a/mobs/mese_dragon.lua +++ b/mobs/mese_dragon.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:mese_dragon", { collisionbox = {-1, 0, -1, 1, 5, 1}, visual = "mesh", mesh = "mese_dragon.x", - textures = {{"mese_dragon.png"}}, - visual_size = {x=12, y=12}, + textures = { + {"mese_dragon.png"} + }, + visual_size = {x = 12, y = 12}, makes_footstep_sound = true, view_range = 45, rotate = 270, @@ -22,14 +24,8 @@ mobs:register_mob("nssm:mese_dragon", { jump = true, jump_height = 10, drops = { - {name = "nssm:rainbow_staff", - chance = 1, - min = 1, - max = 1}, - {name = "nssm:energy_globe", - chance = 1, - min = 99, - max = 99}, + {name = "nssm:rainbow_staff", chance = 1, min = 1, max = 1}, + {name = "nssm:energy_globe", chance = 1, min = 99, max = 99}, }, armor = 30, drawtype = "front", @@ -39,11 +35,11 @@ mobs:register_mob("nssm:mese_dragon", { on_rightclick = nil, attack_type = "dogshoot", dogshoot_switch = true, - blood_texture="mese_blood.png", - blood_amount=30, - stepheight=3.1, - knock_back=0, - jump_height=12, + blood_texture = "mese_blood.png", + blood_amount = 30, + stepheight = 3.1, + knock_back = 0, + jump_height = 12, dogshoot_count_max = 9, arrow = "nssm:roar_of_the_dragon", reach = 5, @@ -65,25 +61,32 @@ mobs:register_mob("nssm:mese_dragon", { dattack_start = 120, dattack_end = 160, }, + do_custom = function(self) - midas_ability(self, "default:mese_block", self.run_velocity,2, 3) + midas_ability(self, "default:mese_block", self.run_velocity, 2, 3) end, custom_attack = function(self) + if self.timer > 1 then + self.timer = 0 - self.attack_rip = self.attack_rip+1 + + self.attack_rip = (self.attack_rip or 0) + 1 local s = self.object:get_pos() + if minetest.is_protected(s, "") then return end + local p = self.attack:get_pos() p.y = p.y + 1.5 s.y = s.y + 1.5 if minetest.line_of_sight(p, s) == true then + -- play attack sound if self.sounds.attack then minetest.sound_play(self.sounds.attack, { @@ -91,20 +94,27 @@ mobs:register_mob("nssm:mese_dragon", { max_hear_distance = self.sounds.distance }) end + -- punch player self.attack:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups = {fleshy=self.damage} + full_punch_interval = 1.0, + damage_groups = {fleshy = self.damage} }, nil) end - if self.attack_rip>=8 then - self.attack_rip =0 + + if self.attack_rip >= 8 then + + self.attack_rip = 0 + mobs:set_animation("punch1") - for dx = -17,17 do - for dz= -17,17 do - local k = {x = s.x+dx, y=s.y+20, z=s.z+dz} + + for dx = -17, 17 do + for dz = -17, 17 do + + local k = {x = s.x + dx, y = s.y + 20, z = s.z + dz} local n = minetest.get_node(k).name - if n=="air" and math.random(1,23)==1 then + + if n == "air" and math.random(1, 23) == 1 then minetest.set_node(k, {name="nssm:mese_meteor"}) nodeupdate(k) end diff --git a/mobs/moonheron.lua b/mobs/moonheron.lua index 2cf62bd..fcfbc50 100644 --- a/mobs/moonheron.lua +++ b/mobs/moonheron.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:moonheron", { collisionbox = {-0.45, -0.3, -0.45, 0.45, 0.3, 0.45}, visual = "mesh", mesh = "moonheron.x", - textures = {{"moonheron.png"}}, - visual_size = {x=10, y=10}, + textures = { + {"moonheron.png"} + }, + visual_size = {x = 10, y = 10}, view_range = 35, rotate = 270, walk_velocity = 2, @@ -20,25 +22,18 @@ mobs:register_mob("nssm:moonheron", { damage = 5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:heron_leg", - chance = 1, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, + {name = "nssm:heron_leg", chance = 1, min = 1, max = 1}, }, armor = 70, floats = 1, drawtype = "front", water_damage = 5, lava_damage = 5, - group_attack=true, - attack_animals=true, - knock_back=4, - blood_texture="nssm_blood.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 4, + blood_texture = "nssm_blood.png", fly = true, attack_type = "dogfight", animation = { diff --git a/mobs/mordain.lua b/mobs/mordain.lua index 4c1909f..b281872 100644 --- a/mobs/mordain.lua +++ b/mobs/mordain.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:mordain", { collisionbox = {-0.5, -0.3, -0.5, 0.5, 2.7, 0.5}, visual = "mesh", mesh = "mordain.x", - textures = {{"mordain.png"}}, - visual_size = {x=3.5, y=3.5}, + textures = { + {"mordain.png"} + }, + visual_size = {x = 3.5, y = 3.5}, makes_footstep_sound = false, view_range = 30, fear_height = 4, @@ -19,26 +21,19 @@ mobs:register_mob("nssm:mordain", { damage = 6, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:slothful_soul_fragment", - chance = 3, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 1}, + {name = "nssm:slothful_soul_fragment", chance = 3, min = 1, max = 1}, }, armor = 80, drawtype = "front", water_damage = 0, lava_damage = 1, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="morparticle.png", - stepheight=1.1, - --light_damage = 2, - on_rightclick = nil, +-- light_damage = 2, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "morparticle.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, @@ -52,17 +47,24 @@ mobs:register_mob("nssm:mordain", { punch_start = 210, punch_end = 225, }, - --pathfinding = 1, + custom_attack = function(self) - self.mordain_timer = (self.mordain_timer or os.time()) + + self.mordain_timer = self.mordain_timer or os.time() + if (os.time() - self.mordain_timer) > 1 then + self.mordain_timer = os.time() + local s = self.object:get_pos() local p = self.attack:get_pos() mobs:set_animation(self, "punch") - 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 + 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 minetest.sound_play(self.sounds.attack, { @@ -70,52 +72,92 @@ mobs:register_mob("nssm:mordain", { max_hear_distance = self.sounds.distance }) end + -- punch player - self.attack:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups = {fleshy=self.damage} + self.attack:punch(self.object, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = self.damage} }, nil) end minetest.after(1, function() + local ty = s.y local flag = 0 local m = 3 - local v = {x=(p.x-s.x)*m, y = ty, z = (p.z-s.z)*m} - local d = {x=s.x+v.x, y = ty, z = s.z+v.z} + local v = { + x = (p.x - s.x) * m, + y = ty, + z = (p.z - s.z) * m + } - d.y = ty + local d = { + x = s.x + v.x, + y = ty, + z = s.z + v.z + } for j = -3,3 do + ty = d.y + j - local current = minetest.get_node({x = d.x, y = ty, z = d.z}).name - local up = minetest.get_node({x = d.x, y = ty+1, z = d.z}).name + + local current = minetest.get_node({ + x = d.x, + y = ty, + z = d.z}).name + + local up = minetest.get_node({ + x = d.x, + y = ty + 1, + z = d.z}).name + if up == "air" and current ~= "air" then + d.y = d.y + j+1.5 + flag = 1 + break end end while flag ~= 1 do - d.x = p.x + math.random(-m,m) - d.z = p.z + math.random(-m,m) + + d.x = p.x + math.random(-m, m) + d.z = p.z + math.random(-m, m) d.y = p.y + local dist = dist_pos(d, p) - if dist>=2 then + + if dist >= 2 then + for j = -3,3 do + ty = d.y + j - local current = minetest.get_node({x = d.x, y = ty, z = d.z}).name - local up = minetest.get_node({x = d.x, y = ty+1, z = d.z}).name + + local current = minetest.get_node({ + x = d.x, + y = ty, + z = d.z}).name + + local up = minetest.get_node({ + x = d.x, + y = ty + 1, + z = d.z}).name + if up == "air" and current ~= "air" then + d.y = d.y + j+1.5 + flag = 1 + break end end end end + self.object:set_pos(d) end) end diff --git a/mobs/morde.lua b/mobs/morde.lua index 25fb8c1..d347b05 100644 --- a/mobs/morde.lua +++ b/mobs/morde.lua @@ -6,8 +6,10 @@ mobs:register_mob("nssm:morde", { visual = "mesh", rotate= 270, mesh = "morde.x", - textures = {{"morde.png"}}, - visual_size = {x=10, y=10}, + textures = { + {"morde.png"} + }, + visual_size = {x = 10, y = 10}, makes_footstep_sound = true, view_range = 20, walk_velocity = 0.5, @@ -19,14 +21,8 @@ mobs:register_mob("nssm:morde", { random = "morde", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 4,}, - {name = "nssm:proud_soul_fragment", - chance = 3, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 4}, + {name = "nssm:proud_soul_fragment", chance = 3, min = 1, max = 1}, }, armor = 60, drawtype = "front", @@ -35,12 +31,11 @@ mobs:register_mob("nssm:morde", { floats = 1, lava_damage = 0, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="morparticle.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "morparticle.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, @@ -54,9 +49,13 @@ mobs:register_mob("nssm:morde", { punch_start = 130, punch_end = 160, }, + custom_attack = function (self) - self.morde_timer = (self.morde_timer or os.time()) + + self.morde_timer = self.morde_timer or os.time() + if (os.time() - self.morde_timer) > 1 then + self.morde_timer = os.time() local s = self.object:get_pos() @@ -64,10 +63,14 @@ mobs:register_mob("nssm:morde", { mobs:set_animation(self, "punch") - self.health = self.health + (self.damage*2) + self.health = self.health + (self.damage * 2) + local m = 3 - 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 + 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 minetest.sound_play(self.sounds.attack, { @@ -75,10 +78,11 @@ mobs:register_mob("nssm:morde", { max_hear_distance = self.sounds.distance }) end + -- punch player - self.attack:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups = {fleshy=self.damage} + self.attack:punch(self.object, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = self.damage} }, nil) minetest.add_particlespawner( @@ -100,9 +104,13 @@ mobs:register_mob("nssm:morde", { end end end, + on_die = function(self) + local pos = self.object:get_pos() + self.object:remove() + minetest.add_entity(pos, "nssm:mortick") end, }) @@ -114,13 +122,16 @@ minetest.register_entity("nssm:mortick", { armor = 100, visual = "mesh", mesh = "mortick.x", - visual_size = {x=3, y=3}, + visual_size = {x = 3, y = 3}, --lifetime = 10, damage = 1, + on_step = function(self, dtime) + self.mortick_timer = self.mortick_timer or os.time() self.timer = self.timer or 0 - self.timer = self.timer+dtime + self.timer = self.timer + dtime + local s = self.object:get_pos() local s1 = {x=s.x, y = s.y-1, z = s.z} @@ -129,9 +140,12 @@ minetest.register_entity("nssm:mortick", { self.object:remove() end ]] + --The mortick dies when he finds himself in the fire local name = minetest.get_node(s1).name - if name == "fire:basic_flame" then + + if name == "fire:basic_flame" + or name == "fire:permanent_flame" then self.object:remove() end @@ -139,6 +153,7 @@ minetest.register_entity("nssm:mortick", { self.attack = (self.attack or 0) local objects = minetest.get_objects_inside_radius(s, 8) + for _,obj in ipairs(objects) do if (obj:is_player()) then self.attack = obj @@ -147,23 +162,29 @@ minetest.register_entity("nssm:mortick", { --If found a player follow him if self.attack ~= 0 then + local p = self.attack:get_pos() local yawp = self.attack:get_look_yaw() local pi = math.pi p.y = p.y + 1 - p.x = p.x-math.cos(yawp)/2.5 - p.z = p.z-math.sin(yawp)/2.5 + p.x = p.x - math.cos(yawp) / 2.5 + p.z = p.z - math.sin(yawp) / 2.5 + local m = 10 - local v = {x=-(s.x-p.x)*m, y=-(s.y-p.y)*m, z=-(s.z-p.z)*m} - local yaws = yawp +pi + local v = { + x = -(s.x - p.x) * m, + y = -(s.y - p.y) * m, + z = -(s.z - p.z) * m + } + local yaws = yawp + pi --stay attached to players back: self.object:set_velocity(v) self.object:set_yaw(yaws) --damage player every ten seconds: - if (self.timer>10) then + if (self.timer > 10) then self.timer = 0 self.attack:set_hp(self.attack:get_hp() - self.damage) end diff --git a/mobs/morgre.lua b/mobs/morgre.lua index e25c9ab..8e1dac5 100644 --- a/mobs/morgre.lua +++ b/mobs/morgre.lua @@ -6,8 +6,10 @@ mobs:register_mob("nssm:morgre", { visual = "mesh", mesh = "morgre.x", rotate = 270, - textures = {{"morgre.png"}}, - visual_size = {x=5, y=5}, + textures = { + {"morgre.png"} + }, + visual_size = {x = 5, y = 5}, explosion_radius = 4, makes_footstep_sound = true, view_range = 25, @@ -21,26 +23,19 @@ mobs:register_mob("nssm:morgre", { damage = 1, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:greedy_soul_fragment", - chance = 5, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:greedy_soul_fragment", chance = 5, min = 1, max = 1}, }, armor = 60, drawtype = "front", water_damage = 0, lava_damage = 0, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="morparticle.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "morparticle.png", + stepheight = 1.1, attack_type = "explode", animation = { speed_normal = 25, diff --git a/mobs/morgut.lua b/mobs/morgut.lua index 5c1f0ae..182337e 100644 --- a/mobs/morgut.lua +++ b/mobs/morgut.lua @@ -6,8 +6,10 @@ mobs:register_mob("nssm:morgut", { visual = "mesh", rotate= 270, mesh = "morgut.x", - textures = {{"morgut.png"}}, - visual_size = {x=5, y=5}, + textures = { + {"morgut.png"} + }, + visual_size = {x = 5, y = 5}, makes_footstep_sound = true, view_range = 26, walk_velocity = 0.5, @@ -20,14 +22,8 @@ mobs:register_mob("nssm:morgut", { random = "morgut", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 3,}, - {name = "nssm:gluttonous_soul_fragment", - chance = 3, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 3}, + {name = "nssm:gluttonous_soul_fragment", chance = 3, min = 1, max = 1}, }, armor = 70, drawtype = "front", @@ -36,12 +32,11 @@ mobs:register_mob("nssm:morgut", { floats = 1, lava_damage = 0, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="morparticle.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "morparticle.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, @@ -57,21 +52,29 @@ mobs:register_mob("nssm:morgut", { }, do_custom = function (self) + self.flag = (self.flag or 0) if self.inv_flag ~= 1 then + self.inventory = {} - for i=1,32 do - self.inventory[i]={name = '', num = 0} + + for i = 1, 32 do + self.inventory[i] = {name = '', num = 0} end end + self.inv_flag = (self.inv_flag or 1) if self.flag == 1 then + self.state = "" + mobs:set_animation(self, "run") + self.object:set_yaw(self.dir) - set_velocity(self, 4) + + self:set_velocity(4) if os.time() - self.morgut_timer > 3 then self.flag = 0 @@ -80,16 +83,23 @@ mobs:register_mob("nssm:morgut", { end end, + custom_attack = function (self) + self.curr_attack = (self.curr_attack or self.attack) self.morgut_timer = (self.morgut_timer or os.time()) self.dir = (self.dir or 0) + if (os.time() - self.morgut_timer) > 1 then + if self.attack then + local s = self.object:get_pos() local p = self.attack:get_pos() + mobs:set_animation(self, "punch") + local m = 2 minetest.add_particlespawner( @@ -109,71 +119,97 @@ mobs:register_mob("nssm:morgut", { "roasted_duck_legs.png" --texture ) - minetest.after(1, function (self) - if self then - if self.attack:is_player() then - local pname = self.attack:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) + minetest.after(1, function(self) - if player_inv:is_empty('main') then - --minetest.chat_send_all("Inventory empty") - else - for i = 1,32 do - --minetest.chat_send_all("Inventory is not empty") - local items = player_inv:get_stack('main', i) - local n = items:get_name() - if minetest.get_item_group(n, "eatable")==1 then - local index - local found = 0 - for j = 1,32 do - if found == 0 then - if self.inventory[j].num == 0 then - --found an empty place - found = 2 - index = j - else - --found a corrsponding itemstack - if self.inventory[j].name == n then - self.inventory[j].num = self.inventory[j].num +1 - found = 1 - end + if self and self.attack:is_player() then + + local pname = self.attack:get_player_name() + local player_inv = minetest.get_inventory( + {type = 'player', name = pname}) + + if player_inv:is_empty('main') then + --minetest.chat_send_all("Inventory empty") + else + for i = 1, 32 do + --minetest.chat_send_all("Inventory is not empty") + local items = player_inv:get_stack('main', i) + local n = items:get_name() + + if minetest.get_item_group(n, "eatable")==1 then + + local index + local found = 0 + + for j = 1,32 do + + if found == 0 then + + if self.inventory[j].num == 0 then + --found an empty place + found = 2 + index = j + else + --found a corrsponding itemstack + if self.inventory[j].name == n then + + self.inventory[j].num = self.inventory[j].num +1 + + found = 1 end end end - if found == 2 then - self.inventory[index].name = n - self.inventory[index].num = 1 - end - items:take_item() - player_inv:set_stack('main', i, items) end + + if found == 2 then + self.inventory[index].name = n + self.inventory[index].num = 1 + end + + items:take_item() + + player_inv:set_stack('main', i, items) end end - mobs:set_animation(self, "run") - self.flag = 1 - self.morgut_timer = os.time() - self.curr_attack = self.attack - self.state = "" - local pyaw = self.curr_attack: get_look_yaw() - self.dir = pyaw - self.object:set_yaw(pyaw) - if self then - set_velocity(self, 4) - end + end + + mobs:set_animation(self, "run") + + self.flag = 1 + self.morgut_timer = os.time() + self.curr_attack = self.attack + self.state = "" + + local pyaw = self.curr_attack: get_look_yaw() + + self.dir = pyaw + self.object:set_yaw(pyaw) + + if self then + self:set_velocity(4) end end - end,self) + end, self) end end end, + on_die = function(self) + local pos = self.object:get_pos() + if (self.inventory ~= nil) then + local elem + for i = 1,32 do - if self.inventory[i].num~=0 then - local items = ItemStack(self.inventory[i].name.." "..self.inventory[i].num) + + if self.inventory[i].num ~= 0 then + + local items = ItemStack(self.inventory[i].name + .. " " .. self.inventory[i].num) + local obj = minetest.add_item(pos, items) + obj:set_velocity({ x = math.random(-1, 1), y = 6, @@ -182,6 +218,7 @@ mobs:register_mob("nssm:morgut", { end end end + self.object:remove() end, }) diff --git a/mobs/morlu.lua b/mobs/morlu.lua index a84c297..531ff2f 100644 --- a/mobs/morlu.lua +++ b/mobs/morlu.lua @@ -6,8 +6,10 @@ mobs:register_mob("nssm:morlu", { visual = "mesh", rotate= 270, mesh = "morlu.x", - textures = {{"morlu.png"}}, - visual_size = {x=7, y=7}, + textures = { + {"morlu.png"} + }, + visual_size = {x = 7, y = 7}, makes_footstep_sound = true, view_range = 28, walk_velocity = 0.5, @@ -21,14 +23,8 @@ mobs:register_mob("nssm:morlu", { random = "morlu2" }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4,}, - {name = "nssm:lustful_soul_fragment", - chance = 3, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:lustful_soul_fragment", chance = 3, min = 1, max = 1}, }, armor = 40, drawtype = "front", @@ -37,12 +33,11 @@ mobs:register_mob("nssm:morlu", { floats = 1, lava_damage = 0, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="morparticle.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "morparticle.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, @@ -58,22 +53,30 @@ mobs:register_mob("nssm:morlu", { }, do_custom = function (self) + self.flag = (self.flag or 0) if self.inv_flag ~= 1 then + self.inventory = {} self.invnum = 0 - for i=1,6 do - self.inventory[i]={name = ''} + + for i = 1, 6 do + self.inventory[i] = {name = ''} end end + self.inv_flag = (self.inv_flag or 1) if self.flag == 1 then + self.state = "" + mobs:set_animation(self, "run") - self.object:set_yaw(self.dir) - set_velocity(self, 4) + + self:set_yaw(self.dir) + + self:set_velocity(4) if os.time() - self.morlu_timer > 3 then self.flag = 0 @@ -82,24 +85,35 @@ mobs:register_mob("nssm:morlu", { end end, + custom_attack = function (self) + self.curr_attack = (self.curr_attack or self.attack) self.morlu_timer = (self.morlu_timer or os.time()) self.dir = (self.dir or 0) + if (os.time() - self.morlu_timer) > 1 then local s = self.object:get_pos() local p = self.attack:get_pos() + mobs:set_animation(self, "punch") + local m = 1 if self.attack:is_player() then + if minetest.get_modpath("3d_armor") then - local pname, player_inv, armor_inv, ppos = armor:get_valid_player(self.attack, "[set_player_armor]") + + local pname, player_inv, armor_inv, ppos = armor:get_valid_player( + self.attack, "[set_player_armor]") + local pname = self.attack:get_player_name() local player_inv = minetest.get_inventory({type='player', name = pname}) + if player_inv:is_empty('armor') then + -- punch player if he doesn't own an armor self.attack:punch(self.object, 1.0, { full_punch_interval = 1.0, @@ -110,17 +124,21 @@ mobs:register_mob("nssm:morlu", { local armor_num = 0 local steal_pos - for i=1,6 do + for i = 1, 6 do + local armor_stack = player_inv:get_stack("armor", i) local armor_item = armor_stack:get_name() + if armor_stack:get_count() > 0 then - armor_elements[armor_num]={name=armor_item, pos=i} + armor_elements[armor_num] = {name=armor_item, pos=i} armor_num = armor_num + 1 end end + if armor_num > 0 then - steal_pos = math.random(1,armor_num) - steal_pos = steal_pos-1 + + steal_pos = math.random(armor_num) + steal_pos = steal_pos - 1 --[[for i=0,armor_num-1 do minetest.chat_send_all("Posizione: "..armor_elements[i].pos.." Oggetto: "..armor_elements[i].name) end @@ -161,19 +179,19 @@ mobs:register_mob("nssm:morlu", { ) minetest.after(1, function (self) + if self then - local armor_stack = player_inv:get_stack("armor", armor_elements[steal_pos].pos) - armor_stack:take_item() - player_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) + local armor_stack = player_inv:get_stack("armor", armor_elements[steal_pos].pos) + armor_stack:take_item() + player_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) + armor_stack = armor_inv:get_stack("armor", armor_elements[steal_pos].pos) + armor_stack:take_item() + armor_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) - armor_stack = armor_inv:get_stack("armor", armor_elements[steal_pos].pos) - armor_stack:take_item() - armor_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) - - armor:set_player_armor(self.attack, self.attack) + armor:set_player_armor(self.attack, self.attack) --armor:update_armor(self.attack) - armor:update_inventory(self.attack) + armor:update_inventory(self.attack) --armor:update_player_visuals(self.attack) --Update personal inventory of armors: @@ -205,7 +223,10 @@ mobs:register_mob("nssm:morlu", { mobs:set_animation(self, "punch") - 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 + 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 minetest.sound_play(self.sounds.attack, { @@ -213,23 +234,31 @@ mobs:register_mob("nssm:morlu", { max_hear_distance = self.sounds.distance }) end + -- punch player - self.attack:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups = {fleshy=self.damage} + self.attack:punch(self.object, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = self.damage} }, nil) end end end end end, + on_die = function(self) + local pos = self.object:get_pos() + if (self.inventory ~= nil) then + if self.invnum > 0 then - for i=1,self.invnum do + + for i = 1, self.invnum do + local items = ItemStack(self.inventory[i].name.." 1") local obj = minetest.add_item(pos, items) + obj:set_velocity({ x = math.random(-1, 1), y = 6, @@ -238,6 +267,7 @@ mobs:register_mob("nssm:morlu", { end end end + self.object:remove() end, }) diff --git a/mobs/morvalar.lua b/mobs/morvalar.lua index 6988f6b..83b8c2d 100644 --- a/mobs/morvalar.lua +++ b/mobs/morvalar.lua @@ -1,5 +1,5 @@ local time_limit = 120 -posmorvalarblock = {x=827, y=-30094, z=-817} +local posmorvalarblock = {x=827, y=-30094, z=-817} function respawn_block(self) --start a timer if it doesn't exist @@ -28,12 +28,14 @@ mobs:register_mob("nssm:morvalar", { visual = "mesh", --rotate= 270, mesh = "morvalar.x", - textures = {{"morvalar.png"}}, - visual_size = {x=5, y=5}, + textures = { + {"morvalar.png"} + }, + visual_size = {x = 5, y = 5}, makes_footstep_sound = true, view_range = 50, walk_velocity = 1.6, - reach =3, + reach = 3, run_velocity = 3.2, damage = 8, runaway = true, @@ -47,11 +49,10 @@ mobs:register_mob("nssm:morvalar", { fear_height = 4, floats = 1, lava_damage = 0, - blood_texture="morparticle.png", - blood_amount=10, - knock_back=0, + blood_texture = "morparticle.png", + blood_amount = 10, + knock_back = 0, light_damage = 0, - on_rightclick = nil, attack_type = "dogfight", animation = { speed_normal = 15, @@ -71,22 +72,30 @@ mobs:register_mob("nssm:morvalar", { end, custom_attack = function (self) + self.curr_attack = (self.curr_attack or self.attack) self.morvalar_timer = (self.morvalar_timer or os.time()) self.dir = (self.dir or 0) + if (os.time() - self.morvalar_timer) > 2 then local s = self.object:get_pos() local p = self.attack:get_pos() + mobs:set_animation(self, "punch") + local m = 1 if self.attack:is_player() then + if minetest.get_modpath("3d_armor") then - local pname, player_inv, armor_inv, ppos = armor:get_valid_player(self.attack, "[set_player_armor]") - local pname = self.attack:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) + + local pname, player_inv, armor_inv, ppos = armor:get_valid_player( + self.attack, "[set_player_armor]") + local pname = self.attack:get_player_name() + local player_inv = minetest.get_inventory({type='player', name = pname}) + if player_inv:is_empty('armor') then -- punch player if he doesn't own an armor self.attack:punch(self.object, 1.0, { @@ -98,20 +107,25 @@ mobs:register_mob("nssm:morvalar", { local armor_num = 0 local steal_pos - for i=1,6 do + for i = 1, 6 do + local armor_stack = player_inv:get_stack("armor", i) local armor_item = armor_stack:get_name() + if armor_stack:get_count() > 0 then armor_elements[armor_num]={name=armor_item, pos=i} armor_num = armor_num + 1 end end + if armor_num > 0 then + steal_pos = math.random(1,armor_num) steal_pos = steal_pos-1 - local cpos = string.find(armor_elements[steal_pos].name, ":") - local mod_name = string.sub(armor_elements[steal_pos].name, 0, cpos-1) - local nname = string.sub(armor_elements[steal_pos].name, cpos+1) + + local cpos = string.find(armor_elements[steal_pos].name, ":") + local mod_name = string.sub(armor_elements[steal_pos].name, 0, cpos - 1) + local nname = string.sub(armor_elements[steal_pos].name, cpos + 1) if mod_name == "3d_armor" then nname = "3d_armor_inv_"..nname..".png" @@ -140,17 +154,17 @@ mobs:register_mob("nssm:morvalar", { minetest.after(1, function (self) - local armor_stack = player_inv:get_stack("armor", armor_elements[steal_pos].pos) - armor_stack:take_item() - player_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) + local armor_stack = player_inv:get_stack("armor", armor_elements[steal_pos].pos) + armor_stack:take_item() + player_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) - armor_stack = armor_inv:get_stack("armor", armor_elements[steal_pos].pos) - armor_stack:take_item() - armor_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) + armor_stack = armor_inv:get_stack("armor", armor_elements[steal_pos].pos) + armor_stack:take_item() + armor_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack) - armor:set_player_armor(self.attack, self.attack) - armor:update_inventory(self.attack) - end,self) + armor:set_player_armor(self.attack, self.attack) + armor:update_inventory(self.attack) + end, self) end end else @@ -159,7 +173,10 @@ mobs:register_mob("nssm:morvalar", { mobs:set_animation(self, "punch") - 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 + 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 minetest.sound_play(self.sounds.attack, { @@ -168,18 +185,22 @@ mobs:register_mob("nssm:morvalar", { }) end -- punch player - self.attack:punch(self.object, 1.0, { - full_punch_interval=1.0, - damage_groups = {fleshy=self.damage} + self.attack:punch(self.object, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = self.damage} }, nil) end end end end end, + on_die = function(self) + local pos = self.object:get_pos() + self.object:remove() + add_entity_and_particles("nssm:morvalar6", pos, "morparticle.png", 10) end, }) @@ -192,8 +213,10 @@ mobs:register_mob("nssm:morvalar6", { visual = "mesh", --rotate= 270, mesh = "morvalar.x", - textures = {{"morvalar.png"}}, - visual_size = {x=5, y=5}, + textures = { + {"morvalar.png"} + }, + visual_size = {x = 5, y = 5}, makes_footstep_sound = true, view_range = 50, walk_velocity = 1.6, @@ -212,10 +235,9 @@ mobs:register_mob("nssm:morvalar6", { floats = 1, lava_damage = 0, light_damage = 0, - blood_texture="morparticle.png", - blood_amount=10, - knock_back=0, - on_rightclick = nil, + blood_texture = "morparticle.png", + blood_amount = 10, + knock_back = 0, attack_type = "dogfight", animation = { speed_normal = 15, @@ -229,13 +251,17 @@ mobs:register_mob("nssm:morvalar6", { punch_start = 132, punch_end = 162, }, + do_custom = function(self) respawn_block(self) end, + custom_attack = function (self) + self.morvalar6_timer = (self.morvalar6_timer or os.time()) self.dir = (self.dir or 0) + if (os.time() - self.morvalar6_timer) > 1 then local s = self.object:get_pos() @@ -246,7 +272,9 @@ mobs:register_mob("nssm:morvalar6", { minetest.after(1, function (self) + if self.attack:is_player() then + local pname = self.attack:get_player_name() local player_inv = minetest.get_inventory({type='player', name = pname}) @@ -254,7 +282,8 @@ mobs:register_mob("nssm:morvalar6", { --minetest.chat_send_all("Inventory empty") else local imhungry = 0 - for i = 1,32 do + + for i = 1, 32 do --minetest.chat_send_all("Inventory is not empty") local items = player_inv:get_stack('main', i) local n = items:get_name() diff --git a/mobs/morvy.lua b/mobs/morvy.lua index 5d52a8d..2a41c39 100644 --- a/mobs/morvy.lua +++ b/mobs/morvy.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:morvy", { collisionbox = {-0.3, -0.1, -0.3, 0.3, 2.3, 0.3}, visual = "mesh", mesh = "morvy.x", - textures = {{"morvy.png"}}, - visual_size = {x=6, y=6}, + textures = { + {"morvy.png"} + }, + visual_size = {x = 6, y = 6}, makes_footstep_sound = true, view_range = 35, fear_height = 5, @@ -19,14 +21,8 @@ mobs:register_mob("nssm:morvy", { }, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 5, - max = 7,}, - {name = "nssm:envious_soul_fragment", - chance = 3, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 5, max = 7}, + {name = "nssm:envious_soul_fragment", chance = 3, min = 1, max = 1}, }, reach = 8, armor = 60, @@ -34,12 +30,11 @@ mobs:register_mob("nssm:morvy", { water_damage = 0, lava_damage = 0, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="morparticle.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "morparticle.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 20, @@ -55,18 +50,24 @@ mobs:register_mob("nssm:morvy", { }, custom_attack = function(self) - mobs:set_animation(self, "stand") - self.morvy_counter = (self.morvy_counter or 0) + 1 - if self.morvy_counter == 4 then - mobs:set_animation(self, "punch") - self.morvy_counter = 0 - local counter = 0 + mobs:set_animation(self, "stand") + + self.morvy_counter = (self.morvy_counter or 0) + 1 + + if self.morvy_counter == 4 then + + mobs:set_animation(self, "punch") + + self.morvy_counter = 0 + + local counter = 0 local s = self.object:get_pos() local p = self.attack:get_pos() p.y = p.y + 1.5 s.y = s.y + 1.5 + if mobs:line_of_sight(self, p, s) == true then --[[play attack sound if self.sounds.attack then @@ -75,20 +76,31 @@ mobs:register_mob("nssm:morvy", { max_hear_distance = self.sounds.distance }) end]] - local pos1 = {x=s.x+math.random(-0.5,0.5), y=s.y+0.2, z=s.z+math.random(-0.5,0.5)} + + local pos1 = { + x = s.x + math.random(-0.5, 0.5), + y = s.y + 0.2, + z = s.z + math.random(-0.5, 0.5) + } local objects = minetest.get_objects_inside_radius(s, 10) + for _,obj in ipairs(objects) do - if (obj:get_luaentity() and ((obj:get_luaentity().name == "nssm:morbat1") or (obj:get_luaentity().name == "nssm:morbat2") or (obj:get_luaentity().name == "nssm:morbat3"))) then + + if (obj:get_luaentity() + and ((obj:get_luaentity().name == "nssm:morbat1") + or (obj:get_luaentity().name == "nssm:morbat2") + or (obj:get_luaentity().name == "nssm:morbat3"))) then counter = counter + 1 end end - if (minetest.get_node(pos1).name == "air") - and (counter < 5) - then + if minetest.get_node(pos1).name == "air" + and counter < 5 then + local bat local which = math.random(1,3) + if which == 1 then bat = "nssm:morbat1" elseif which == 2 then @@ -96,10 +108,13 @@ mobs:register_mob("nssm:morvy", { elseif which == 3 then bat = "nssm:morbat3" end + if (bat=="nssm:morbat3") then - pos1.y=pos1.y+1.5 + pos1.y = pos1.y + 1.5 end + minetest.add_entity(pos1, bat) + minetest.add_particlespawner( 20, --amount 0.1, --time @@ -132,8 +147,10 @@ mobs:register_mob("nssm:morbat1", { collisionbox = {-0.1, 0.2, -0.1, 0.1, 0.4, 0.1}, visual = "mesh", mesh = "morbat.x", - textures = {{"morbat1.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"morbat1.png"} + }, + visual_size = {x = 2, y = 2}, view_range = 40, walk_velocity = 0.5, run_velocity = 3, @@ -147,10 +164,7 @@ mobs:register_mob("nssm:morbat1", { jump = true, rotate = 270, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, }, armor = 80, drawtype = "front", @@ -158,7 +172,6 @@ mobs:register_mob("nssm:morbat1", { lava_damage = 0, light_damage = 0, blood_texture="morparticle.png", - on_rightclick = nil, fly = true, attack_type = "dogfight", animation = { @@ -182,8 +195,10 @@ mobs:register_mob("nssm:morbat2", { collisionbox = {-0.1, 0.2, -0.1, 0.1, 0.4, 0.1}, visual = "mesh", mesh = "morbat.x", - textures = {{"morbat2.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"morbat2.png"} + }, + visual_size = {x = 2, y = 2}, view_range = 40, walk_velocity = 0.5, run_velocity = 3, @@ -197,10 +212,7 @@ mobs:register_mob("nssm:morbat2", { jump = true, rotate = 270, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, }, armor = 100, drawtype = "front", @@ -208,7 +220,6 @@ mobs:register_mob("nssm:morbat2", { lava_damage = 0, light_damage = 0, blood_texture="morparticle.png", - on_rightclick = nil, fly = true, attack_type = "explode", explosion_radius = 3, @@ -234,8 +245,10 @@ mobs:register_mob("nssm:morbat3", { collisionbox = {-0.1, 0.2, -0.1, 0.1, 0.4, 0.1}, visual = "mesh", mesh = "morbat.x", - textures = {{"morbat3.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"morbat3.png"} + }, + visual_size = {x = 2, y = 2}, view_range = 40, walk_velocity = 0.5, run_velocity = 3, @@ -249,18 +262,14 @@ mobs:register_mob("nssm:morbat3", { jump = true, rotate = 270, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, }, armor = 100, drawtype = "front", water_damage = 0, lava_damage = 0, light_damage = 0, - blood_texture="morparticle.png", - on_rightclick = nil, + blood_texture = "morparticle.png", fly = true, attack_type = "shoot", arrow = "nssm:morarrow", diff --git a/mobs/morwa.lua b/mobs/morwa.lua index 4e17d38..f027118 100644 --- a/mobs/morwa.lua +++ b/mobs/morwa.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:morwa", { collisionbox = {-1, -0.1, -1, 1, 3, 1}, visual = "mesh", mesh = "morwa.x", - textures = {{"morwa.png"}}, - visual_size = {x=10, y=10}, + textures = { + {"morwa.png"} + }, + visual_size = {x = 10, y = 10}, makes_footstep_sound = true, view_range = 25, fear_height = 4, @@ -18,28 +20,21 @@ mobs:register_mob("nssm:morwa", { damage = 8, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4,}, - {name = "nssm:wrathful_soul_fragment", - chance = 3, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:wrathful_soul_fragment", chance = 3, min = 1, max = 1}, }, armor = 50, drawtype = "front", water_damage = 0, - reach =4, + reach = 4, rotate = 270, lava_damage = 0, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=1, - blood_texture="morparticle.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 1, + blood_texture = "morparticle.png", + stepheight = 1.1, attack_type = "dogshoot", dogshoot_switch = true, arrow = "nssm:morarrow", @@ -59,13 +54,16 @@ mobs:register_mob("nssm:morwa", { shoot_start =176, shoot_end=226, }, + do_custom = function (self) + local pos = self.object:get_pos() local light = minetest.get_node_light(pos) + --minetest.chat_send_all("Luce: "..light) - if (light < 8) then + if light < 8 then self.object:remove() - minetest.set_node(pos, {name="nssm:morwa_statue"}) + minetest.set_node(pos, {name = "nssm:morwa_statue"}) end end, }) diff --git a/mobs/night_master.lua b/mobs/night_master.lua index b6f9a63..5e4b08c 100644 --- a/mobs/night_master.lua +++ b/mobs/night_master.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:night_master", { collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65}, visual = "mesh", mesh = "moonherontrio.x", - textures = {{"moonherontrio.png"}}, - visual_size = {x=18, y=18}, + textures = { + {"moonherontrio.png"} + }, + visual_size = {x = 18, y = 18}, view_range = 40, rotate = 270, lifetimer = 500, @@ -26,9 +28,8 @@ mobs:register_mob("nssm:night_master", { water_damage = 0, lava_damage = 5, light_damage = 0, - blood_texture="nssm_blood.png", - blood_amount=50, - on_rightclick = nil, + blood_texture = "nssm_blood.png", + blood_amount = 50, fly = true, attack_type = "dogfight", animation = { @@ -43,7 +44,9 @@ mobs:register_mob("nssm:night_master", { punch_start = 130, punch_end = 160, }, + on_die = function(self, pos) + minetest.add_particlespawner( 200, --amount 0.1, --time @@ -60,7 +63,9 @@ mobs:register_mob("nssm:night_master", { false, --collisiondetection "tnt_smoke.png" --texture ) + self.object:remove() + minetest.add_entity(pos, "nssm:night_master_2") end, }) @@ -72,12 +77,14 @@ mobs:register_mob("nssm:night_master_2", { collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65}, visual = "mesh", mesh = "night_master_2.x", - textures = {{"moonherontrio.png"}}, - visual_size = {x=18, y=18}, + textures = { + {"moonherontrio.png"} + }, + visual_size = {x = 18, y = 18}, view_range = 40, rotate = 270, lifetimer = 500, - floats=1, + floats = 1, walk_velocity = 3, run_velocity = 4, fall_speed = 0, @@ -93,7 +100,6 @@ mobs:register_mob("nssm:night_master_2", { water_damage = 0, lava_damage = 5, light_damage = 0, - on_rightclick = nil, fly = true, attack_type = "dogfight", animation = { @@ -108,7 +114,9 @@ mobs:register_mob("nssm:night_master_2", { punch_start = 130, punch_end = 160, }, + on_die = function(self, pos) + minetest.add_particlespawner( 200, --amount 0.1, --time @@ -125,7 +133,9 @@ mobs:register_mob("nssm:night_master_2", { false, --collisiondetection "tnt_smoke.png" --texture ) + self.object:remove() + minetest.add_entity(pos, "nssm:night_master_1") end, }) @@ -137,8 +147,10 @@ mobs:register_mob("nssm:night_master_1", { collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65}, visual = "mesh", mesh = "night_master_1.x", - textures = {{"moonherontrio.png"}}, - visual_size = {x=18, y=18}, + textures = { + {"moonherontrio.png"} + }, + visual_size = {x = 18, y = 18}, view_range = 40, rotate = 270, lifetimer = 500, @@ -154,25 +166,15 @@ mobs:register_mob("nssm:night_master_1", { damage = 12, jump = false, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 6, - max = 7,}, - {name = "nssm:heron_leg", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:night_feather", - chance = 1, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 6, max = 7}, + {name = "nssm:heron_leg", chance = 1, min = 1, max = 1}, + {name = "nssm:night_feather", chance = 1, min = 1, max = 1}, }, armor = 50, drawtype = "front", water_damage = 0, lava_damage = 5, light_damage = 0, - on_rightclick = nil, fly = true, attack_type = "dogfight", animation = { diff --git a/mobs/octopus.lua b/mobs/octopus.lua index 1e0ebe2..7d346cb 100644 --- a/mobs/octopus.lua +++ b/mobs/octopus.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:octopus", { collisionbox = {-0.9, -0.5, -0.9, 0.9, 0.92, 0.9}, visual = "mesh", mesh = "octopus.x", - textures = {{"octopus.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"octopus.png"} + }, + visual_size = {x = 4, y = 4}, view_range = 25, fly = true, fly_in = "default:water_source", @@ -23,25 +25,18 @@ mobs:register_mob("nssm:octopus", { random = "octopus", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:tentacle", - chance = 1, - min = 1, - max = 8,}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, + {name = "nssm:tentacle", chance = 1, min = 1, max = 8}, }, armor = 70, drawtype = "front", water_damage = 0, lava_damage = 10, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", attack_type = "dogfight", animation = { speed_normal = 25, @@ -64,8 +59,10 @@ mobs:register_mob("nssm:xgaloctopus", { collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, visual = "mesh", mesh = "octopus.x", - textures = {{"xgaloctopus.png"}}, - visual_size = {x=1, y=1}, + textures = { + {"xgaloctopus.png"} + }, + visual_size = {x = 1, y = 1}, view_range = 25, fly = true, fly_in = "default:water_source", @@ -82,25 +79,18 @@ mobs:register_mob("nssm:xgaloctopus", { random = "octopus", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:tentacle", - chance = 1, - min = 1, - max = 8,}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, + {name = "nssm:tentacle", chance = 1, min = 1, max = 8}, }, armor = 60, drawtype = "front", water_damage = 0, lava_damage = 10, light_damage = 0, - on_rightclick = nil, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", attack_type = "dogfight", animation = { speed_normal = 25, diff --git a/mobs/phoenix.lua b/mobs/phoenix.lua index 92e25b4..7bab14d 100644 --- a/mobs/phoenix.lua +++ b/mobs/phoenix.lua @@ -5,11 +5,13 @@ mobs:register_mob("nssm:phoenix", { collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65}, visual = "mesh", mesh = "phoenix.x", - textures = {{"phoenix.png"}}, - visual_size = {x=18, y=18}, + textures = { + {"phoenix.png"} + }, + visual_size = {x = 18, y = 18}, view_range = 40, lifetimer = 500, - floats=1, + floats = 1, rotate = 270, walk_velocity = 2, run_velocity = 2.5, @@ -22,31 +24,18 @@ mobs:register_mob("nssm:phoenix", { damage = 2, jump = false, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 7, - max = 8,}, - {name = "nssm:sun_feather", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:phoenix_tear", - chance = 1, - min = 5, - max = 6,}, - {name = "nssm:phoenix_nuggets", - chance = 6, - min = 10, - max = 20,}, + {name = "nssm:life_energy", chance = 1, min = 7, max = 8}, + {name = "nssm:sun_feather", chance = 1, min = 1, max = 1}, + {name = "nssm:phoenix_tear", chance = 1, min = 5, max = 6}, + {name = "nssm:phoenix_nuggets", chance = 6, min = 10, max = 20}, }, armor = 40, drawtype = "front", water_damage = 5, lava_damage = 0, light_damage = 0, - blood_texture="nssm_blood.png", - blood_amount=50, - on_rightclick = nil, + blood_texture = "nssm_blood.png", + blood_amount = 50, fly = true, attack_type = "shoot", arrow = "nssm:phoenix_arrow", diff --git a/mobs/pumpboom.lua b/mobs/pumpboom.lua index e46b2de..0e524e8 100644 --- a/mobs/pumpboom.lua +++ b/mobs/pumpboom.lua @@ -6,8 +6,10 @@ mobs:register_mob("nssm:pumpboom_small", { visual = "mesh", mesh = "pumpboom.x", rotate = 270, - textures = {{"pumpboom.png"}}, - visual_size = {x=3, y=3}, + textures = { + {"pumpboom.png"} + }, + visual_size = {x = 3, y = 3}, explosion_radius = 4, makes_footstep_sound = true, view_range = 20, @@ -20,26 +22,19 @@ mobs:register_mob("nssm:pumpboom_small", { damage = 1.5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:black_powder", - chance = 2, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:black_powder", chance = 2, min = 1, max = 2}, }, armor = 100, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "explode", animation = { speed_normal = 25, @@ -63,8 +58,10 @@ mobs:register_mob("nssm:pumpboom_medium", { visual = "mesh", mesh = "pumpboom.x", rotate = 270, - textures = {{"pumpboom.png"}}, - visual_size = {x=5, y=5}, + textures = { + {"pumpboom.png"} + }, + visual_size = {x = 5, y = 5}, makes_footstep_sound = true, view_range = 25, walk_velocity = 2, @@ -76,26 +73,19 @@ mobs:register_mob("nssm:pumpboom_medium", { damage = 1.5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:black_powder", - chance = 2, - min = 1, - max = 3,}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, + {name = "nssm:black_powder", chance = 2, min = 1, max = 3}, }, armor = 100, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "explode", animation = { speed_normal = 25, @@ -120,8 +110,10 @@ mobs:register_mob("nssm:pumpboom_large", { mesh = "pumpboom.x", rotate = 270, explosion_radius = 8, - textures = {{"pumpboom.png"}}, - visual_size = {x=8, y=8}, + textures = { + {"pumpboom.png"} + }, + visual_size = {x = 8, y = 8}, makes_footstep_sound = true, view_range = 30, walk_velocity = 2, @@ -132,26 +124,19 @@ mobs:register_mob("nssm:pumpboom_large", { damage = 1.5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4,}, - {name = "nssm:black_powder", - chance = 2, - min = 2, - max = 4,}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:black_powder", chance = 2, min = 2, max = 4}, }, armor = 100, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "explode", animation = { speed_normal = 25, diff --git a/mobs/pumpking.lua b/mobs/pumpking.lua index 29bed76..018ed83 100644 --- a/mobs/pumpking.lua +++ b/mobs/pumpking.lua @@ -5,11 +5,13 @@ mobs:register_mob("nssm:pumpking", { collisionbox = {-0.4, 0.00, -0.4, 0.4, 3.2, 0.4}, visual = "mesh", mesh = "pumpking.x", - textures = {{"pumpking.png"}}, - visual_size = {x=2.5, y=2.5}, + textures = { + {"pumpking.png"} + }, + visual_size = {x = 2.5, y = 2.5}, makes_footstep_sound = true, - lifetimer=500, - rotate=270, + lifetimer = 500, + rotate = 270, fear_height = 4, view_range = 35, walk_velocity = 2, @@ -21,30 +23,20 @@ mobs:register_mob("nssm:pumpking", { damage = 13, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 7, - max = 9,}, - {name = "nssm:cursed_pumpkin_seed", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:black_powder", - chance = 1, - min = 9, - max = 12,}, + {name = "nssm:life_energy", chance = 1, min = 7, max = 9}, + {name = "nssm:cursed_pumpkin_seed", chance = 1, min = 1, max = 1}, + {name = "nssm:black_powder", chance = 1, min = 9, max = 12}, }, - armor =40, + armor = 40, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - blood_texture="nssm_blood.png", - blood_amount=25, - stepheight=2.1, - knock_back=0, - jump_height=12, - on_rightclick = nil, + blood_texture = "nssm_blood.png", + blood_amount = 25, + stepheight = 2.1, + knock_back = 0, + jump_height = 12, attack_type = "dogfight", animation = { stand_start = 165, stand_end = 210, @@ -53,22 +45,34 @@ mobs:register_mob("nssm:pumpking", { punch_start = 300, punch_end = 330, speed_normal = 15, speed_run = 15, }, + on_die=function(self,pos) + self.object:remove() + minetest.after(0.2, function(pos) - tnt.boom(pos, {damage_radius=5,radius=4,ignore_protection=false}) + tnt.boom(pos, {damage_radius = 5, radius = 4, ignore_protection = false}) end, pos) end, + custom_attack = function(self) - self.pumpking_timer = (self.pumpking_timer or os.time()) - if (os.time() - self.pumpking_timer) >3 then + + self.pumpking_timer = self.pumpking_timer or os.time() + + if (os.time() - self.pumpking_timer) > 3 then + mobs:set_animation(self, "punch") + self.pumpking_timer = os.time() + local s = self.object:get_pos() local p = self.attack:get_pos() + p.y = p.y + 1.5 s.y = s.y + 1.5 + if minetest.line_of_sight(p, s) == true then + -- play attack sound if self.sounds.attack then minetest.sound_play(self.sounds.attack, { @@ -76,12 +80,17 @@ mobs:register_mob("nssm:pumpking", { max_hear_distance = self.sounds.distance }) end - local pos1 = {x=s.x+math.random(-1,1), y=s.y-1.5, z=s.z+math.random(-1,1)} + + local pos1 = { + x = s.x + math.random(-1, 1), + y = s.y - 1.5, + z = s.z + math.random(-1, 1) + } + minetest.after(1, function(pos1) - minetest.set_node(pos1, {name="nssm:pumpbomb"}) + minetest.set_node(pos1, {name = "nssm:pumpbomb"}) minetest.get_node_timer(pos1):start(2) - end, - pos1) + end, pos1) end end end diff --git a/mobs/sand_bloco.lua b/mobs/sand_bloco.lua index 75c06a9..e491d9f 100644 --- a/mobs/sand_bloco.lua +++ b/mobs/sand_bloco.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:sand_bloco", { collisionbox = {-0.5, -0.2, -0.5, 0.5, 1.3, 0.5}, visual = "mesh", mesh = "sand_bloco.x", - textures = {{"sand_bloco.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"sand_bloco.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 14, fear_height = 4, @@ -20,29 +22,19 @@ mobs:register_mob("nssm:sand_bloco", { reach = 1.5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 1,}, - {name = "default:sandstone", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:sand_bloco_skin", - chance = 2, - min = 1, - max = 3,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 1}, + {name = "default:sandstone", chance = 1, min = 2, max = 3}, + {name = "nssm:sand_bloco_skin", chance = 2, min = 1, max = 3}, }, armor = 40, drawtype = "front", water_damage = 10, lava_damage = 1, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="stone_blood.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "stone_blood.png", attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/sandworm.lua b/mobs/sandworm.lua index f755485..77a7806 100644 --- a/mobs/sandworm.lua +++ b/mobs/sandworm.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:sandworm", { collisionbox = {-0.4, -0.2, -0.4, 0.4, 1.90, 0.4}, visual = "mesh", mesh = "sandworm.x", - textures = {{"sandworm.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"sandworm.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = false, view_range = 17, rotate = 270, @@ -21,30 +23,20 @@ mobs:register_mob("nssm:sandworm", { }, jump = false, drops = { - {name = "nssm:worm_flesh", - chance = 2, - min = 1, - max = 3,}, - {name = "nssm:sandworm_skin", - chance = 2, - min = 1, - max = 3,}, - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3,}, + {name = "nssm:worm_flesh", chance = 2, min = 1, max = 3}, + {name = "nssm:sandworm_skin", chance = 2, min = 1, max = 3}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, }, armor = 60, drawtype = "front", water_damage = 5, lava_damage = 10, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 25, @@ -59,6 +51,6 @@ mobs:register_mob("nssm:sandworm", { punch_end = 180, }, do_custom = function(self) - digging_attack(self, "sand", self.run_velocity, {x=0, y=3, z=0}) + digging_attack(self, "sand", self.run_velocity, {x = 0, y = 3, z = 0}) end, }) diff --git a/mobs/scrausics.lua b/mobs/scrausics.lua index a34a9bb..88339b0 100644 --- a/mobs/scrausics.lua +++ b/mobs/scrausics.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:scrausics", { collisionbox = {-0.4, -0.3, -0.4, 0.4, 0.3, 0.4}, visual = "mesh", mesh = "scrausics.x", - textures = {{"scrausics.png"}}, - visual_size = {x=10, y=10}, + textures = { + {"scrausics.png"} + }, + visual_size = {x = 10, y = 10}, view_range = 35, rotate = 270, walk_velocity = 2, @@ -21,25 +23,18 @@ mobs:register_mob("nssm:scrausics", { damage = 4, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4,}, - {name = "nssm:raw_scrausics_wing", - chance = 1, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:raw_scrausics_wing", chance = 1, min = 1, max = 2}, }, armor = 80, drawtype = "front", water_damage = 5, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", fly = true, attack_type = "dogfight", animation = { diff --git a/mobs/signosigno.lua b/mobs/signosigno.lua index 6dd6a6b..3efb057 100644 --- a/mobs/signosigno.lua +++ b/mobs/signosigno.lua @@ -5,8 +5,11 @@ mobs:register_mob("nssm:signosigno", { collisionbox = {-0.2, 0.00, -0.2, 0.2, 1.6, 0.2}, visual = "mesh", mesh = "signosigno.x", - textures = {{"signosigno.png"}, {"signosigno2.png"}}, - visual_size = {x=6, y=6}, + textures = { + {"signosigno.png"}, + {"signosigno2.png"} + }, + visual_size = {x = 6, y = 6}, makes_footstep_sound = false, view_range = 15, walk_velocity = 1.5, @@ -17,25 +20,18 @@ mobs:register_mob("nssm:signosigno", { reach = 1.5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:slothful_soul_fragment", - chance = 20, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:slothful_soul_fragment", chance = 20, min = 1, max = 1}, }, armor = 40, drawtype = "front", water_damage = 1, lava_damage = 2, light_damage = 1, - group_attack=true, - attack_animals=true, - knock_back=4, - blood_texture="morparticle.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 4, + blood_texture = "morparticle.png", attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/snow_biter.lua b/mobs/snow_biter.lua index a509017..18737e3 100644 --- a/mobs/snow_biter.lua +++ b/mobs/snow_biter.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:snow_biter", { collisionbox = {-0.5, 0, -0.5, 0.5, 0.60, 0.5}, visual = "mesh", mesh = "snow_biter.x", - textures = {{"snow_biter.png"}}, - visual_size = {x=6, y=6}, + textures = { + {"snow_biter.png"} + }, + visual_size = {x = 6, y = 6}, makes_footstep_sound = true, view_range = 18, rotate = 270, @@ -18,38 +20,24 @@ mobs:register_mob("nssm:snow_biter", { sounds = { random = "snow_biter", }, - --pathfinding = true, damage = 4, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3}, - {name = "nssm:frosted_amphibian_heart", - chance = 2, - min = 1, - max = 1}, - {name = "nssm:amphibian_ribs", - chance = 2, - min = 1, - max = 1}, - {name = "nssm:little_ice_tooth", - chance = 2, - min = 0, - max = 4}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, + {name = "nssm:frosted_amphibian_heart", chance = 2, min = 1, max = 1}, + {name = "nssm:amphibian_ribs", chance = 2, min = 1, max = 1}, + {name = "nssm:little_ice_tooth", chance = 2, min = 0, max = 4}, }, armor = 80, drawtype = "front", water_damage = 0, lava_damage = 30, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=4, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 4, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "dogfight", double_melee_attack = true, animation = { diff --git a/mobs/spiderduck.lua b/mobs/spiderduck.lua index 7a9325d..d527b23 100644 --- a/mobs/spiderduck.lua +++ b/mobs/spiderduck.lua @@ -6,8 +6,10 @@ mobs:register_mob("nssm:spiderduck", { visual = "mesh", rotate = 270, mesh = "spiderduck.x", - textures = {{"spiderduck.png"}}, - visual_size = {x=2, y=2}, + textures = { + {"spiderduck.png"} + }, + visual_size = {x = 2, y = 2}, fear_height = 4, makes_footstep_sound = true, view_range = 24, @@ -19,38 +21,22 @@ mobs:register_mob("nssm:spiderduck", { damage = 6, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:duck_legs", - chance = 1, - min = 1, - max = 8,}, - {name = "nssm:silk_gland", - chance = 2, - min = 1, - max = 2,}, - {name = "nssm:black_duck_feather", - chance = 3, - min = 1, - max = 4,}, - {name = "nssm:duck_beak", - chance = 5, - min = 1, - max = 1,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:duck_legs", chance = 1, min = 1, max = 8}, + {name = "nssm:silk_gland", chance = 2, min = 1, max = 2}, + {name = "nssm:black_duck_feather", chance = 3, min = 1, max = 4}, + {name = "nssm:duck_beak", chance = 5, min = 1, max = 1}, }, armor = 80, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.5, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.5, dogshoot_switch = true, attack_type = "dogshoot", arrow = "nssm:webball", diff --git a/mobs/stone_eater.lua b/mobs/stone_eater.lua index 005f323..cefed5c 100644 --- a/mobs/stone_eater.lua +++ b/mobs/stone_eater.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:stone_eater", { collisionbox = {-0.3, -0.05, -0.3, 0.3, 0.65, 0.3}, visual = "mesh", mesh = "stone_eater.x", - textures = {{"stone_eater.png"}}, - visual_size = {x=10, y=10}, + textures = { + {"stone_eater.png"} + }, + visual_size = {x = 10, y = 10}, makes_footstep_sound = false, view_range = 16, rotate = 270, @@ -18,30 +20,27 @@ mobs:register_mob("nssm:stone_eater", { damage = 5, reach = 1.5, drops = { - {name = "default:stone", - chance = 2, - min = 1, - max = 3,}, - {name = "nssm:life_energy", - chance = 1, - min = 2, - max = 3,}, - {name = "nssm:stoneater_mandible", - chance = 2, - min = 1, - max = 4,}, + {name = "default:stone", chance = 2, min = 1, max = 3}, + {name = "nssm:life_energy", chance = 1, min = 2, max = 3}, + {name = "nssm:stoneater_mandible", chance = 2, min = 1, max = 4}, }, armor = 40, drawtype = "front", water_damage = 1, lava_damage = 1, - group_attack=true, - attack_animals=true, - knock_back=0, - blood_texture="stone_blood.png", - immune_to={{'default:sword_stone', -2},{'default:stone', -2}, {'default:cobble', -2}, {'default:axe_stone', -2}, {'default:shovel_stone', -2}, {'default:pick_stone', -2}}, + group_attack = true, + attack_animals = true, + knock_back = 0, + blood_texture = "stone_blood.png", + immune_to={ + {'default:sword_stone', -2}, + {'default:stone', -2}, + {'default:cobble', -2}, + {'default:axe_stone', -2}, + {'default:shovel_stone', -2}, + {'default:pick_stone', -2} + }, light_damage = 0, - on_rightclick = nil, attack_type = "dogfight", animation = { speed_normal = 20, @@ -57,6 +56,6 @@ mobs:register_mob("nssm:stone_eater", { }, do_custom = function(self) --digging_ability(self, "stone", self.run_velocity, {x=0, y=2, z=0}) - digging_attack(self, "stone", self.run_velocity, {x=0, y=1, z=0}) + digging_attack(self, "stone", self.run_velocity, {x = 0, y = 1, z = 0}) end, }) diff --git a/mobs/swimming_duck.lua b/mobs/swimming_duck.lua index 356709b..483da4c 100644 --- a/mobs/swimming_duck.lua +++ b/mobs/swimming_duck.lua @@ -5,10 +5,12 @@ mobs:register_mob("nssm:swimming_duck", { collisionbox = {-0.35, -0.30, -0.35, 0.35, 0.7, 0.35}, visual = "mesh", mesh = "swimming_duck.x", - textures = {{"swimming_duck.png"}}, - visual_size = {x=1.5, y=1.5}, + textures = { + {"swimming_duck.png"} + }, + visual_size = {x = 1.5, y = 1.5}, view_range = 25, - floats=1, + floats = 1, walk_velocity = 1, run_velocity = 1, damage = 3, @@ -20,33 +22,20 @@ mobs:register_mob("nssm:swimming_duck", { random = "duck", }, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:duck_legs", - chance = 1, - min = 1, - max = 2,}, - {name = "nssm:duck_beak", - chance = 5, - min = 1, - max = 1,}, - {name = "nssm:duck_feather", - chance = 6, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 2}, + {name = "nssm:duck_legs", chance = 1, min = 1, max = 2}, + {name = "nssm:duck_beak", chance = 5, min = 1, max = 1}, + {name = "nssm:duck_feather", chance = 6, min = 1, max = 2}, }, armor = 80, drawtype = "front", water_damage = 0, lava_damage = 10, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=4, - blood_texture="nssm_blood.png", - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 4, + blood_texture = "nssm_blood.png", attack_type = "dogfight", animation = { speed_normal = 25, diff --git a/mobs/tarantula.lua b/mobs/tarantula.lua index d66a66b..d4cbe2c 100644 --- a/mobs/tarantula.lua +++ b/mobs/tarantula.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:tarantula", { collisionbox = {-0.5, 0.00, -0.5, 0.5, 0.9, 0.5}, visual = "mesh", mesh = "tarantula.x", - textures = {{"tarantula.png"}}, - visual_size = {x=8, y=8}, + textures = { + {"tarantula.png"} + }, + visual_size = {x = 8, y = 8}, makes_footstep_sound = true, view_range = 20, lifetimer = 500, @@ -20,21 +22,17 @@ mobs:register_mob("nssm:tarantula", { damage = 8, jump = true, drops = { - {name = "nssm:super_silk_gland", - chance = 1, - min = 3, - max = 5,}, + {name = "nssm:super_silk_gland", chance = 1, min = 3, max = 5}, }, armor = 60, drawtype = "front", water_damage = 1, lava_damage = 7, reach = 3, - knock_back=0, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, + knock_back = 0, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, light_damage = 0, - on_rightclick = nil, dogshoot_switch = true, attack_type = "dogshoot", arrow = "nssm:thickwebball", @@ -54,8 +52,11 @@ mobs:register_mob("nssm:tarantula", { shoot_start = 180, shoot_end = 200, }, + on_die = function(self, pos) + self.object:remove() + minetest.add_particlespawner( 200, --amount 0.1, --time @@ -72,6 +73,7 @@ mobs:register_mob("nssm:tarantula", { false, --collisiondetection "tnt_smoke.png" --texture ) + minetest.add_entity(pos, "nssm:tarantula_propower") end, }) @@ -84,8 +86,10 @@ mobs:register_mob("nssm:tarantula_propower", { collisionbox = {-0.5, 0.00, -0.5, 0.5, 1, 0.5}, visual = "mesh", mesh = "tarantula_propower.x", - textures = {{"tarantula.png"}}, - visual_size = {x=10, y=10}, + textures = { + {"tarantula.png"} + }, + visual_size = {x = 10, y = 10}, makes_footstep_sound = true, view_range = 30, lifetimer = 500, @@ -98,37 +102,21 @@ mobs:register_mob("nssm:tarantula_propower", { damage = 12, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 16, - max = 18,}, - {name = "nssm:spider_leg", - chance = 1, - min = 1, - max = 8,}, - {name = "nssm:tarantula_chelicerae", - chance = 1, - min = 1, - max = 1,}, - {name = "nssm:silk_gland", - chance = 2, - min = 1, - max = 3,}, - {name = "nssm:spider_meat", - chance = 2, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 16, max = 18}, + {name = "nssm:spider_leg", chance = 1, min = 1, max = 8}, + {name = "nssm:tarantula_chelicerae", chance = 1, min = 1, max = 1}, + {name = "nssm:silk_gland", chance = 2, min = 1, max = 3}, + {name = "nssm:spider_meat", chance = 2, min = 1, max = 2}, }, armor = 40, drawtype = "front", water_damage = 1, lava_damage = 3, reach = 4, - knock_back=0, - blood_texture="nssm_blood_blue.png", - stepheight=2.1, + knock_back = 0, + blood_texture = "nssm_blood_blue.png", + stepheight = 2.1, light_damage = 0, - on_rightclick = nil, attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/uloboros.lua b/mobs/uloboros.lua index e05507d..4e6bd9e 100644 --- a/mobs/uloboros.lua +++ b/mobs/uloboros.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:uloboros", { collisionbox = {-0.5, 0.00, -0.5, 0.5, 0.8, 0.5}, visual = "mesh", mesh = "uloboros.x", - textures = {{"uloboros.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"uloboros.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 22, walk_velocity = 1.5, @@ -20,34 +22,21 @@ mobs:register_mob("nssm:uloboros", { reach = 2, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 1, - max = 4,}, - {name = "nssm:spider_leg", - chance = 2, - min = 1, - max = 8,}, - {name = "nssm:silk_gland", - chance = 4, - min = 1, - max = 3,}, - {name = "nssm:spider_meat", - chance = 4, - min = 1, - max = 2,}, + {name = "nssm:life_energy", chance = 1, min = 1, max = 4}, + {name = "nssm:spider_leg", chance = 2, min = 1, max = 8}, + {name = "nssm:silk_gland", chance = 4, min = 1, max = 3}, + {name = "nssm:spider_meat", chance = 4, min = 1, max = 2}, }, armor = 80, drawtype = "front", water_damage = 1, lava_damage = 7, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood_blue.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood_blue.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 20, diff --git a/mobs/werewolf.lua b/mobs/werewolf.lua index 2306fdb..1a436e0 100644 --- a/mobs/werewolf.lua +++ b/mobs/werewolf.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:werewolf", { collisionbox = {-0.85, -0.01, -0.85, 0.85, 3.50, 0.85}, visual = "mesh", mesh = "werewolf.x", - textures = {{"werewolf.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"werewolf.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 30, walk_velocity = 3, @@ -18,30 +20,20 @@ mobs:register_mob("nssm:werewolf", { damage = 5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4}, - {name = "nssm:werewolf_leg", - chance = 2, - min = 1, - max = 2}, - {name = "nssm:wolf_fur", - chance = 2, - min = 1, - max = 1}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:werewolf_leg", chance = 2, min = 1, max = 2}, + {name = "nssm:wolf_fur", chance = 2, min = 1, max = 1}, }, armor = 80, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, diff --git a/mobs/white_werewolf.lua b/mobs/white_werewolf.lua index 69067fc..01c6580 100644 --- a/mobs/white_werewolf.lua +++ b/mobs/white_werewolf.lua @@ -5,8 +5,10 @@ mobs:register_mob("nssm:white_werewolf", { collisionbox = {-0.85, -0.01, -0.85, 0.85, 3.50, 0.85}, visual = "mesh", mesh = "white_werewolf.x", - textures = {{"white_werewolf.png"}}, - visual_size = {x=4, y=4}, + textures = { + {"white_werewolf.png"} + }, + visual_size = {x = 4, y = 4}, makes_footstep_sound = true, view_range = 30, walk_velocity = 3, @@ -18,30 +20,20 @@ mobs:register_mob("nssm:white_werewolf", { damage = 5, jump = true, drops = { - {name = "nssm:life_energy", - chance = 1, - min = 3, - max = 4}, - {name = "nssm:werewolf_leg", - chance = 2, - min = 1, - max = 2}, - {name = "nssm:white_wolf_fur", - chance = 2, - min = 1, - max = 1}, + {name = "nssm:life_energy", chance = 1, min = 3, max = 4}, + {name = "nssm:werewolf_leg", chance = 2, min = 1, max = 2}, + {name = "nssm:white_wolf_fur", chance = 2, min = 1, max = 1}, }, armor = 80, drawtype = "front", water_damage = 2, lava_damage = 5, light_damage = 0, - group_attack=true, - attack_animals=true, - knock_back=2, - blood_texture="nssm_blood.png", - stepheight=1.1, - on_rightclick = nil, + group_attack = true, + attack_animals = true, + knock_back = 2, + blood_texture = "nssm_blood.png", + stepheight = 1.1, attack_type = "dogfight", animation = { speed_normal = 15, diff --git a/nssm_api.lua b/nssm_api.lua index 85fba3b..74e0d59 100644 --- a/nssm_api.lua +++ b/nssm_api.lua @@ -10,18 +10,24 @@ nssm.safebones = minetest.setting_getbool("nssm.safebones") or false nssm.cryosave = minetest.setting_getbool("nssm.cryosave") or false function nssm:virulence(mobe) + if not nssm.lessvirulent then return 0 end + return math.ceil(100 / mobe.hp_max) end + function nssm:affectbones(mobe) -- as function for adaptable heuristic return not nssm.safebones end + function drops(drop) + if drop then + drop:setvelocity({ x = math.random(-10, 10) / 9, y = 5, @@ -30,20 +36,22 @@ function drops(drop) end end + function perpendicular_vector(vec) --returns a vector rotated of 90° in 2D - local ang = math.pi/2 + + local ang = math.pi / 2 local c = math.cos(ang) local s = math.sin(ang) - - local i = vec.x*c - vec.z*s - local k = vec.x*s + vec.z*c + local i = vec.x * c - vec.z * s + local k = vec.x * s + vec.z * c local j = 0 - vec = {x=i, y=j, z=k} - return vec + return {x = i, y = j, z = k} end + function add_entity_and_particles(entity, pos, particles, multiplier) + minetest.add_particlespawner({ amount = 100*multiplier, time = 2, @@ -61,65 +69,90 @@ function add_entity_and_particles(entity, pos, particles, multiplier) vertical = false, texture = particles, }) + minetest.add_entity(pos, entity) end + -- get node but use fallback for nil or unknown function node_ok(pos, fallback) + fallback = fallback or "default:dirt" + local node = minetest.get_node_or_nil(pos) + if not node then return minetest.registered_nodes[fallback] end + if minetest.registered_nodes[node.name] then return node end + return minetest.registered_nodes[fallback] end + function dist_pos(p, s) - local v = {x = math.abs(s.x-p.x), y = math.abs(s.y-p.y), z = math.abs(s.z-p.z)} - local r = math.sqrt(v.x^2+v.y^2+v.z^2) - return r + local v = { + x = math.abs(s.x - p.x), + y = math.abs(s.y - p.y), + z = math.abs(s.z - p.z) + } + + return math.sqrt(v.x ^ 2 + v.y ^ 2 + v.z ^ 2) end + --check_for_death functions customized for monsters who respawns (Masticone) function check_for_death_hydra(self) + local hp = self.object:get_hp() + if hp > 0 then + self.health = hp + if self.sounds.damage ~= nil then minetest.sound_play(self.sounds.damage,{ object = self.object, max_hear_distance = self.sounds.distance }) end + return false end + local pos = self.object:get_pos() local obj = nil + if self.sounds.death ~= nil then minetest.sound_play(self.sounds.death,{ object = self.object, max_hear_distance = self.sounds.distance }) end - self.object:remove() + + self.object:remove() + return true end function round(n) - if (n>0) then + + if (n > 0) then return n % 1 >= 0.5 and math.ceil(n) or math.floor(n) else - n=-n + n = -n local t = n % 1 >= 0.5 and math.ceil(n) or math.floor(n) return -t end end + function explosion_particles(pos, exp_radius) + minetest.add_particlespawner( 100*exp_radius/2, --amount 0.1, --time @@ -137,198 +170,8 @@ function explosion_particles(pos, exp_radius) "tnt_smoke.png" --texture ) end ---[[ -function explosion(pos, exp_radius, fire, kamehameha_bad) - local radius = exp_radius - -- if area protected or near map limits then no blast damage - if minetest.is_protected(pos, "") - or not within_limits(pos, radius) then - return - end - --sound - minetest.sound_play("boom", { - pos = pos, - max_hear_distance = exp_radius*4, - }) - --particles: - explosion_particles(pos, exp_radius) - - --Damages entities around (not the player) - local objects = minetest.get_objects_inside_radius(pos, exp_radius) - for _,obj in ipairs(objects) do - local obj_p = obj:get_pos() - local vec = {x=obj_p.x-pos.x, y=obj_p.y-pos.y, z=obj_p.z-pos.z} - local dist = (vec.x^2+vec.y^2+vec.z^2)^0.5 - local damage = (-exp_radius*dist+exp_radius^2)*2 - if not kamehameha_bad then - if obj:is_player() then - obj:set_hp(obj:get_hp()-damage) - elseif obj:get_luaentity().health then - obj:get_luaentity().health = obj:get_luaentity().health - damage - check_for_death(obj:get_luaentity()) - end - else - if (obj:get_luaentity()) then - local name = obj:get_luaentity().name - if (name~="nssm:morvalar0") and (name~="nssm:morvalar5") then - if obj:is_player() then - obj:set_hp(obj:get_hp()-damage) - elseif obj:get_luaentity().health then - obj:get_luaentity().health = obj.get_luaentity().health - damage - check_for_death(obj:get_luaentity()) - end - end - end - end - end - - --damages blocks around and if necessary put some fire - pos = vector.round(pos) -- voxelmanip doesn't work properly unless pos is rounded ?!?! - local vm = VoxelManip() - local minp, maxp = vm:read_from_map(vector.subtract(pos, radius), vector.add(pos, radius)) - local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) - local data = vm:get_data() - local p = {} - local pr = PseudoRandom(os.time()) - - --remove everything near the center of the explosion - for dz=-radius,radius do - for dy=-radius,radius do - local vi = a:index(pos.x + (-radius), pos.y + dy, pos.z + dz) - for dx=-radius,radius do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - - if (dx * dx) + (dy * dy) + (dz * dz) <= (radius * radius) + pr:next(-radius, radius) - and data[vi] ~= c_air - and data[vi] ~= c_ignore - and data[vi] ~= c_obsidian - and data[vi] ~= c_brick - and data[vi] ~= c_chest then - - local n = node_ok(p).name - local on_blast = minetest.registered_nodes[n].on_blast - - if on_blast then - return on_blast(p) - end - - if minetest.get_item_group(n, "unbreakable") ~= 1 then - - -- if chest then drop items inside - if n == "default:chest" - or n == "3dchest:chest" - or n == "bones:bones" then - - local meta = minetest.get_meta(p) - local inv = meta:get_inventory() - - for i = 1, inv:get_size("main") do - - local m_stack = inv:get_stack("main", i) - local obj = minetest.add_item(p, m_stack) - - if obj then - - obj:set_velocity({ - x = math.random(-2, 2), - y = 7, - z = math.random(-2, 2) - }) - end - end - end - - -- after effects - if fire > 0 - and (minetest.registered_nodes[n].groups.flammable - or math.random(1, 100) <= 3) then - minetest.set_node(p, {name = "fire:basic_flame"}) - else - local dist = round(((pos.x-p.x)^2 + (pos.y-p.y)^2 + (pos.z-p.z)^2)^1/2) - local prob = 2/dist - if math.random(1,100)<=prob*100 then - minetest.remove_node(p) - end - end - end - end - vi = vi+1 - end - end - end -end -]] - --- SPECIAL ABILITIES OF SOME MOBS ---[[function digging_ability( - self, --the entity of the mob - group, --group of the blocks the mob can dig: nil=everything - max_vel, --max velocity of the mob - dim --vector representing the dimensions of the mob - ) - - --if math.random(1,nssm:virulence(self)) ~= 1 then return end - - local v = self.object:get_velocity() - local pos = self.object:get_pos() - - if minetest.is_protected(pos, "") then - return - end - - local h = dim.y - - local max = 0 - --local posmax = 0 -- 1 = x, -1=-x, 2 = z, -2 = -z - local yaw = (self.object:get_yaw() + self.rotate) or 0 - local x = math.sin(yaw)*-1 - local z = math.cos(yaw) - - local i = 1 - local i1 = -1 - local k = 1 - local k1 = -1 - - local multiplier = 2 - - if x>0 then - i = round(x*max_vel)*multiplier - else - i1 = round(x*max_vel)*multiplier - end - - if z>0 then - k = round(z*max_vel)*multiplier - else - k1 = round(z*max_vel)*multiplier - end - - for dx = i1, i do - for dy = 0, h do - for dz = k1, k do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - - local n = minetest.get_node(p).name - --local up = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - if group == nil then - if minetest.get_item_group(n, "unbreakable") == 1 or minetest.is_protected(p, "") or (n == "bones:bones" and not nssm:affectbones(self) ) then - else - --minetest.set_node(p, {name="air"}) - minetest.remove_node(p) - end - else - if (minetest.get_item_group(n, group)==1) and (minetest.get_item_group(n, "unbreakable") ~= 1) and (n == "bones:bones" and not (minetest.is_protected(p, "")) ) then - --minetest.set_node(p, {name="air"}) - minetest.remove_node(p) - end - end - end - end - end -end -]]-- function digging_attack( self, --the entity of the mob group, --group of the blocks the mob can dig: nil=everything @@ -338,49 +181,59 @@ function digging_attack( --if math.random(1,nssm:virulence(self)) ~= 1 then return end if self.attack and self.attack:is_player() then + local s = self.object:get_pos() local p = self.attack:get_pos() local dir = vector.subtract(p,s) - dir = vector.normalize(dir) - local per = perpendicular_vector(dir) + dir = vector.normalize(dir) + + local per = perpendicular_vector(dir) local posp = vector.add(s,dir) --minetest.chat_send_all("La mia posizione:"..minetest.pos_to_string(s)) --minetest.chat_send_all("La posizione davanti:"..minetest.pos_to_string(posp)) posp = vector.subtract(posp,per) - for j = 1,3 do --minetest.chat_send_all("pos1:"..minetest.pos_to_string(posp).." per.y= "..dim.y) if minetest.is_protected(posp, "") then return end + local pos1 = posp - for i = 0,dim.y do + for i = 0, dim.y do --minetest.chat_send_all("pos2:"..minetest.pos_to_string(posp).." per.y= "..per.y) 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 minetest.get_item_group(n, "unbreakable") == 1 or minetest.is_protected(pos1, "") or (n == "bones:bones" and not nssm:affectbones(self) ) then + + if minetest.get_item_group(n, "unbreakable") == 1 + or minetest.is_protected(pos1, "") + or (n == "bones:bones" and not nssm:affectbones(self) ) then else --minetest.set_node(p, {name="air"}) minetest.remove_node(pos1) end else - if ((minetest.get_item_group(n, group)==1) and (minetest.get_item_group(n, "unbreakable") ~= 1) and (n ~= "bones:bones") and not (minetest.is_protected(pos1, "")) ) then + if ((minetest.get_item_group(n, group)==1) + and (minetest.get_item_group(n, "unbreakable") ~= 1) + and (n ~= "bones:bones") + and not (minetest.is_protected(pos1, "")) ) then --minetest.set_node(p, {name="air"}) minetest.remove_node(pos1) end end - pos1.y = pos1.y+1 + + pos1.y = pos1.y + 1 end - posp.y=s.y - posp=vector.add(posp,per) + posp.y = s.y + posp = vector.add(posp,per) --minetest.chat_send_all("pos3:"..minetest.pos_to_string(posp).." per.y= "..per.y) end end @@ -395,7 +248,6 @@ function putting_ability( --puts under the mob the block defined as 'p_block' --if math.random(1,nssm:virulence(self)) ~= 1 then return end local v = self.object:get_velocity() - local dx = 0 local dz = 0 @@ -415,23 +267,44 @@ function putting_ability( --puts under the mob the block defined as 'p_block' local pos = self.object:get_pos() local pos1 - pos.y=pos.y-1 - pos1 = {x = pos.x+dx, y = pos.y, z = pos.z+dz} + + pos.y=pos.y - 1 + + pos1 = {x = pos.x + dx, y = pos.y, z = pos.z + dz} + local n = minetest.get_node(pos).name local n1 = minetest.get_node(pos1).name - local oldmetainf = {minetest.get_meta(pos):to_table(),minetest.get_meta(pos1):to_table() } - if n~=p_block and not minetest.is_protected(pos, "") and (n == "bones:bones" and nssm:affectbones(self) ) and n~="air" then + local oldmetainf = { + minetest.get_meta(pos):to_table(), + minetest.get_meta(pos1):to_table() + } + + if n ~= p_block and not minetest.is_protected(pos, "") + and (n == "bones:bones" + and nssm:affectbones(self) ) + and n ~= "air" then + minetest.set_node(pos, {name=p_block}) + if nssm.cryosave then + local metai = minetest.get_meta(pos) + metai:from_table(oldmetainf[1]) -- this is enough to save the meta - metai:set_string("nssm",n) + metai:set_string("nssm", n) end end - if n1~=p_block and not minetest.is_protected(pos1, "") and (n == "bones:bones" and nssm:affectbones(self) ) and n~="air" then - minetest.set_node(pos1, {name=p_block}) + + if n1 ~= p_block and not minetest.is_protected(pos1, "") + and (n == "bones:bones" and nssm:affectbones(self) ) + and n ~= "air" then + + minetest.set_node(pos1, {name = p_block}) + if nssm.cryosave then + local metai = minetest.get_meta(pos1) + metai:from_table(oldmetainf[2]) -- this is enough to save the meta metai:set_string("nssm",n1) end @@ -445,22 +318,29 @@ function webber_ability( --puts randomly around the block defined as w_block radius --max distance the block can be put ) - if (nssm:virulence(self)~=0) and (math.random(1,nssm:virulence(self)) ~= 1) then return end + if (nssm:virulence(self) ~= 0) + and (math.random(1, nssm:virulence(self)) ~= 1) then return end local pos = self.object:get_pos() - if (math.random(1,55)==1) then - local dx=math.random(1,radius) - local dz=math.random(1,radius) - 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} + + if (math.random(1, 55) == 1) then + + local dx = math.random(1, radius) + local dz = math.random(1, radius) + 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 n = minetest.get_node(p).name local k = minetest.get_node(t).name - if ((n~="air")and(k=="air")) and not minetest.is_protected(t, "") then - minetest.set_node(t, {name=w_block}) + + if ((n ~= "air") + and(k == "air")) + and not minetest.is_protected(t, "") then + minetest.set_node(t, {name = w_block}) end end end + function midas_ability( --ability to transform every blocks it touches in the m_block block self, --the entity of the mob m_block, @@ -479,9 +359,8 @@ function midas_ability( --ability to transform every blocks it touches in the m local max = 0 local yaw = (self.object:get_yaw() + self.rotate) or 0 - local x = math.sin(yaw)*-1 + local x = math.sin(yaw) * -1 local z = math.cos(yaw) - local i = 1 local i1 = -1 local k = 1 @@ -489,22 +368,23 @@ function midas_ability( --ability to transform every blocks it touches in the m local multiplier = mult - if x>0 then - i = round(x*max_vel)*multiplier + if x > 0 then + i = round(x * max_vel) * multiplier else - i1 = round(x*max_vel)*multiplier + i1 = round(x * max_vel) * multiplier end - if z>0 then - k = round(z*max_vel)*multiplier + if z > 0 then + k = round(z * max_vel) * multiplier else - k1 = round(z*max_vel)*multiplier + k1 = round(z * max_vel) * multiplier end for dx = i1, i do for dy = -1, height do for dz = k1, k do - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + + local p = {x = pos.x + dx, y = pos.y + dy, z = pos.z + dz} local n = minetest.get_node(p).name if minetest.get_item_group(n, "unbreakable") == 1 @@ -512,7 +392,7 @@ function midas_ability( --ability to transform every blocks it touches in the m or (n == "bones:bones" and not nssm:affectbones(self)) or n==m_block then else - minetest.set_node(p, {name=m_block}) + minetest.set_node(p, {name = m_block}) end end end @@ -530,9 +410,10 @@ loss_prob["default:cobble"] = 3 loss_prob["default:dirt"] = 4 local tnt_radius = tonumber(minetest.setting_get("tnt_radius") or 3) - local cid_data = {} + minetest.after(0, function() + for name, def in pairs(minetest.registered_nodes) do cid_data[minetest.get_content_id(name)] = { name = name, @@ -543,24 +424,33 @@ minetest.after(0, function() end end) + local function rand_pos(center, pos, radius) + local def local reg_nodes = minetest.registered_nodes local i = 0 + repeat -- Give up and use the center if this takes too long if i > 4 then pos.x, pos.z = center.x, center.z break end + pos.x = center.x + math.random(-radius, radius) pos.z = center.z + math.random(-radius, radius) + def = reg_nodes[minetest.get_node(pos).name] + i = i + 1 + until def and not def.walkable end + local function add_effects(pos, radius, drops) + minetest.add_particle({ pos = pos, velocity = vector.new(), @@ -571,6 +461,7 @@ local function add_effects(pos, radius, drops) vertical = false, texture = "tnt_boom.png", }) + minetest.add_particlespawner({ amount = 64, time = 0.5, @@ -591,11 +482,17 @@ local function add_effects(pos, radius, drops) -- one of them to use as texture local texture = "tnt_blast.png" --fallback texture local most = 0 + for name, stack in pairs(drops) do + local count = stack:get_count() + if count > most then + most = count + local def = minetest.registered_nodes[name] + if def and def.tiles and def.tiles[1] then texture = def.tiles[1] end @@ -620,18 +517,29 @@ local function add_effects(pos, radius, drops) }) end + local function eject_drops(drops, pos, radius) + local drop_pos = vector.new(pos) + for _, item in pairs(drops) do + local count = math.min(item:get_count(), item:get_stack_max()) + while count > 0 do + local take = math.max(1,math.min(radius * radius, count, item:get_stack_max())) + rand_pos(pos, drop_pos, radius) + local dropitem = ItemStack(item) + dropitem:set_count(take) + local obj = minetest.add_item(drop_pos, dropitem) + if obj then obj:get_luaentity().collect = true obj:set_acceleration({x = 0, y = -10, z = 0}) @@ -639,23 +547,28 @@ local function eject_drops(drops, pos, radius) y = math.random(0, 10), z = math.random(-3, 3)}) end + count = count - take end end end + local function calc_velocity(pos1, pos2, old_vel, power) + -- Avoid errors caused by a vector of zero length if vector.equals(pos1, pos2) then return old_vel end local vel = vector.direction(pos1, pos2) + vel = vector.normalize(vel) vel = vector.multiply(vel, power) -- Divide by distance local dist = vector.distance(pos1, pos2) + dist = math.max(dist, 1) vel = vector.divide(vel, dist) @@ -671,19 +584,25 @@ local function calc_velocity(pos1, pos2, old_vel, power) -- Limit to terminal velocity dist = vector.length(vel) + if dist > 250 then vel = vector.divide(vel, dist / 250) end + return vel end + local function entity_physics(pos, radius, drops) + local objs = minetest.get_objects_inside_radius(pos, radius) + for _, obj in pairs(objs) do + local obj_pos = obj:get_pos() local dist = math.max(1, vector.distance(pos, obj_pos)) - local damage = (4 / dist) * radius + if obj:is_player() then -- currently the engine has no method to set -- player velocity. See #2960 @@ -691,7 +610,9 @@ local function entity_physics(pos, radius, drops) local dir = vector.normalize(vector.subtract(obj_pos, pos)) local moveoff = vector.multiply(dir, dist + 1.0) local newpos = vector.add(pos, moveoff) + newpos = vector.add(newpos, {x = 0, y = 0.2, z = 0}) + obj:set_pos(newpos) obj:set_hp(obj:get_hp() - damage) @@ -704,7 +625,10 @@ local function entity_physics(pos, radius, drops) local name = luaobj.name if objdef and objdef.on_blast then - if ((name == "nssm:pumpking") or (name == "nssm:morvalar0") or (name== "nssm:morvalar5")) then + + if ((name == "nssm:pumpking") + or (name == "nssm:morvalar0") + or (name== "nssm:morvalar5")) then do_damage = false do_knockback = false else @@ -713,18 +637,24 @@ local function entity_physics(pos, radius, drops) end if do_knockback then + local obj_vel = obj:get_velocity() + obj:set_velocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10)) end + if do_damage then + if not obj:get_armor_groups().immortal then + obj:punch(obj, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = damage}, }, nil) end end + for _, item in pairs(entity_drops) do add_drop(drops, item) end @@ -732,14 +662,19 @@ local function entity_physics(pos, radius, drops) end end + local function add_drop(drops, item) + item = ItemStack(item) + local name = item:get_name() + if loss_prob[name] ~= nil and math.random(1, loss_prob[name]) == 1 then return end local drop = drops[name] + if drop == nil then drops[name] = item else @@ -747,7 +682,9 @@ 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) + if not ignore_protection and minetest.is_protected(npos, "") then return cid end @@ -770,8 +707,11 @@ local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_p end end + local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) + pos = vector.round(pos) + -- scan for adjacent TNT nodes first, and enlarge the explosion local vm1 = VoxelManip() local p1 = vector.subtract(pos, 2) @@ -787,13 +727,18 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) for z = pos.z - 2, pos.z + 2 do for y = pos.y - 2, pos.y + 2 do + local vi = a:index(pos.x - 2, y, z) + for x = pos.x - 2, pos.x + 2 do + local cid = data[vi] + if cid == c_tnt or cid == c_tnt_boom or cid == c_tnt_burning then count = count + 1 data[vi] = c_air end + vi = vi + 1 end end @@ -808,6 +753,7 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) -- perform the explosion local vm = VoxelManip() local pr = PseudoRandom(os.time()) + p1 = vector.subtract(pos, radius) p2 = vector.add(pos, radius) minp, maxp = vm:read_from_map(p1, p2) @@ -816,22 +762,29 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) local drops = {} local on_blast_queue = {} - local c_fire = minetest.get_content_id("fire:basic_flame") + for z = -radius, radius do for y = -radius, radius do + local vi = a:index(pos.x + (-radius), pos.y + y, pos.z + z) + for x = -radius, radius do + local r = vector.length(vector.new(x, y, z)) + if (radius * radius) / (r * r) >= (pr:next(80, 125) / 100) then + local cid = data[vi] local p = {x = pos.x + x, y = pos.y + y, z = pos.z + z} + if cid ~= c_air then data[vi] = destroy(drops, p, cid, c_air, c_fire, on_blast_queue, ignore_protection, ignore_on_blast) end end + vi = vi + 1 end end @@ -846,9 +799,11 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) for y = -radius * 1.5, radius * 1.5 do for z = -radius * 1.5, radius * 1.5 do for x = -radius * 1.5, radius * 1.5 do + local rad = {x = x, y = y, z = z} local s = vector.add(pos, rad) local r = vector.length(rad) + if r / radius < 1.4 then --nodeupdate_single(s) core.check_single_for_falling(s) @@ -858,10 +813,13 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) end for _, queued_data in pairs(on_blast_queue) do + local dist = math.max(1, vector.distance(queued_data.pos, pos)) local intensity = (radius * radius) / (dist * dist) local node_drops = queued_data.on_blast(queued_data.pos, intensity) + if node_drops then + for _, item in pairs(node_drops) do add_drop(drops, item) end @@ -871,16 +829,23 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) return drops, radius end + function tnt_boom_nssm(pos, def) + minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64}) minetest.set_node(pos, {name = "tnt:boom"}) + local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection, def.ignore_on_blast) + -- append entity drops local damage_radius = (radius / def.radius) * def.damage_radius + entity_physics(pos, damage_radius, drops) + if not def.disable_drops then eject_drops(drops, pos, radius) end + add_effects(pos, radius, drops) end diff --git a/nssm_armor.lua b/nssm_armor.lua index e23cb32..c9fe4c0 100644 --- a/nssm_armor.lua +++ b/nssm_armor.lua @@ -38,24 +38,28 @@ local materials = { } for k, v in pairs(stats) do + minetest.register_tool("nssm:helmet_"..k, { description = v.name.." Helmet", inventory_image ="inv_helmet_"..k..".png", groups = {armor_head=math.floor(4*v.armor), armor_heal=v.heal, armor_use=v.use}, wear = 0, }) + minetest.register_tool("nssm:chestplate_"..k, { description = v.name.." Chestplate", inventory_image ="inv_chestplate_"..k..".png", groups = {armor_torso=math.floor(6*v.armor), armor_heal=v.heal, armor_use=v.use}, wear = 0, }) + minetest.register_tool("nssm:leggings_"..k, { description = v.name.." Leggings", inventory_image = "inv_leggings_"..k..".png", groups = {armor_legs=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use}, wear = 0, }) + minetest.register_tool("nssm:boots_"..k, { description = v.name.." Boots", inventory_image ="inv_boots_"..k..".png", @@ -65,6 +69,7 @@ for k, v in pairs(stats) do end for k, v in pairs(materials) do + minetest.register_craft({ output = "nssm:helmet_"..k, recipe = { @@ -73,6 +78,7 @@ for k, v in pairs(materials) do {"", "", ""}, }, }) + minetest.register_craft({ output = "nssm:chestplate_"..k, recipe = { @@ -81,6 +87,7 @@ for k, v in pairs(materials) do {v, v, v}, }, }) + minetest.register_craft({ output = "nssm:leggings_"..k, recipe = { @@ -89,6 +96,7 @@ for k, v in pairs(materials) do {v, "", v}, }, }) + minetest.register_craft({ output = "nssm:boots_"..k, recipe = { @@ -118,6 +126,7 @@ if minetest.get_modpath("shields") then } for k, v in pairs(stats) do + minetest.register_tool("nssm:shield_"..k, { description = v.name.." Shield", inventory_image ="inv_shield_"..k..".png", @@ -126,6 +135,7 @@ if minetest.get_modpath("shields") then }) local m = materials[k] + minetest.register_craft({ output = "nssm:shield_"..k, recipe = { @@ -146,6 +156,7 @@ local stats = { } for k, v in pairs(stats) do + minetest.register_tool("nssm:helmet_"..k, { description = v.name.." ", inventory_image ="inv_helmet_"..k..".png", @@ -169,6 +180,7 @@ minetest.register_craft({ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, }, }) + minetest.register_craft({ output = "nssm:helmet_masticone", recipe = { @@ -177,6 +189,7 @@ minetest.register_craft({ {"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"}, }, }) + minetest.register_craft({ output = "nssm:helmet_masticone_crowned", recipe = { diff --git a/nssm_materials.lua b/nssm_materials.lua index 02330ff..33fe203 100644 --- a/nssm_materials.lua +++ b/nssm_materials.lua @@ -1,2009 +1,2058 @@ ---non eatable craftitems - - -local function nssm_craftitem (name, descr) - - minetest.register_craftitem("nssm:"..name, { - description = descr, - image = name..".png", - }) -end - -nssm_craftitem ('sky_feather','Sky Feather') -nssm_craftitem ('snake_scute','Snake Scute') -nssm_craftitem ('eyed_tentacle','Eyed Tentacle') ---nssm_craftitem ('king_duck_crown','King Duck Crown') -nssm_craftitem ('great_energy_globe','Great Energy Globe') -nssm_craftitem ('superior_energy_globe','Superior Energy Globe') -nssm_craftitem ('ant_queen_abdomen','Ant Queen Abdomen') ---nssm_craftitem ('masticone_skull','Masticone Skull') -nssm_craftitem ('masticone_skull_fragments','Masticone Skull Fragments') ---nssm_craftitem ('masticone_skull_crowned','Masticone Skull Crowned') -nssm_craftitem ('tentacle_curly','Kraken Tentacle') -nssm_craftitem ('lava_titan_eye','Lava Titan Eye') -nssm_craftitem ('duck_beak','Duck Beak') -nssm_craftitem ('ice_tooth','Ice Tooth') -nssm_craftitem ('little_ice_tooth','Little Ice Tooth') -nssm_craftitem ('digested_sand',"Digested Sand") -nssm_craftitem ('black_ice_tooth','Black Ice Tooth') -nssm_craftitem ('tarantula_chelicerae','Tarantula Chelicerae') -nssm_craftitem ('crab_chela','Crab Chela') -nssm_craftitem ('cursed_pumpkin_seed','Cursed Pumpkin Seed') -nssm_craftitem ('mantis_claw','Mantis Claw') -nssm_craftitem ('manticore_fur','Manticore Fur') -nssm_craftitem ('ant_hard_skin','Ant Hard Skin') -nssm_craftitem ('bloco_skin','Bloco Skin') -nssm_craftitem ('crab_carapace_fragment','Crab Carapace Fragment') -nssm_craftitem ('crocodile_skin','Crocodile Skin') -nssm_craftitem ('manticore_spine','Manticore Spine') -nssm_craftitem ('night_feather','Night Feather') -nssm_craftitem ('sun_feather','Sun Feather') -nssm_craftitem ('duck_feather','Duck Feather') -nssm_craftitem ('black_duck_feather','Black Duck Feather') -nssm_craftitem ('masticone_fang','Masticone Fang') -nssm_craftitem ('white_wolf_fur','White Wolf Fur') -nssm_craftitem ('stoneater_mandible','Stoneater Mandible') -nssm_craftitem ('ant_mandible','Ant Mandible') -nssm_craftitem ('life_energy','Life Energy') -nssm_craftitem ('wolf_fur','Wolf Fur') -nssm_craftitem ('felucco_fur','Felucco Fur') -nssm_craftitem ('felucco_horn','Felucco Horn') -nssm_craftitem ('energy_globe','Energy Globe') -nssm_craftitem ('greedy_soul_fragment','Greedy Soul Fragment') -nssm_craftitem ('lustful_soul_fragment','Lustful Soul Fragment') -nssm_craftitem ('wrathful_soul_fragment','Wrathful Soul Fragment') -nssm_craftitem ('proud_soul_fragment','Proud Soul Fragment') -nssm_craftitem ('slothful_soul_fragment','Slothful Soul Fragment') -nssm_craftitem ('envious_soul_fragment','Envious Soul Fragment') -nssm_craftitem ('gluttonous_soul_fragment','Gluttonous Soul Fragment') -nssm_craftitem ('gluttonous_moranga','Gluttonous Moranga') -nssm_craftitem ('envious_moranga','Envious Moranga') -nssm_craftitem ('proud_moranga','Proud Moranga') -nssm_craftitem ('slothful_moranga','Slothful Moranga') -nssm_craftitem ('lustful_moranga','Lustful Moranga') -nssm_craftitem ('wrathful_moranga','Wrathful Moranga') -nssm_craftitem ('greedy_moranga','Greedy Moranga') -nssm_craftitem ('mantis_skin','Mantis_skin') -nssm_craftitem ('sand_bloco_skin','Sand Bloco Skin') -nssm_craftitem ('sandworm_skin','Sandworm Skin') -nssm_craftitem ('sky_iron','Sky Iron') -nssm_craftitem ('web_string','Cobweb String') -nssm_craftitem ('dense_web_string','Dense Cobweb String') -nssm_craftitem ('black_powder','Black Powder') -nssm_craftitem ('morelentir_dust','Dark Starred Stone Dust') -nssm_craftitem ('empty_evocation_bomb','Empty Evocation Bomb') - - -local function nssm_craftitem_eat (name, descr, gnam) - - minetest.register_craftitem("nssm:"..name, { - description = descr, - image =name..".png", - on_use = minetest.item_eat(gnam), - groups = { meat=1, eatable=1 }, - }) -end - -nssm_craftitem_eat ('werewolf_leg','Werewolf Leg',3) -nssm_craftitem_eat ('felucco_steak','Felucco Steak',3) -nssm_craftitem_eat ('roasted_felucco_steak','Roasted Felucco Steak',6) -nssm_craftitem_eat ('heron_leg','Moonheron Leg',2) -nssm_craftitem_eat ('chichibios_heron_leg',"Chichibio's Moonheron Leg",4) -nssm_craftitem_eat ('crocodile_tail','Crocodile Tail',3) -nssm_craftitem_eat ('roasted_crocodile_tail','Roasted Crocodile Tail',6) -nssm_craftitem_eat ('roasted_werewolf_leg','Roasted_Werewolf Leg',6) -nssm_craftitem_eat ('duck_legs','Duck Legs',1) -nssm_craftitem_eat ('roasted_duck_legs','Roasted Duck Leg',3) -nssm_craftitem_eat ('ant_leg','Ant Leg',-1) -nssm_craftitem_eat ('roasted_ant_leg','Roasted Ant Leg',4) -nssm_craftitem_eat ('spider_leg','Spider Leg',-1) -nssm_craftitem_eat ('roasted_spider_leg','Roasted Spider Leg',4) ---nssm_craftitem_eat ('brain','Brain',3) ---nssm_craftitem_eat ('roasted_brain','Roasted Brain',8) -nssm_craftitem_eat ('tentacle','Tentacle',2) -nssm_craftitem_eat ('roasted_tentacle','Roasted Tentacle',5) -nssm_craftitem_eat ('worm_flesh','Worm Flesh',-2) -nssm_craftitem_eat ('roasted_worm_flesh','Roasted Worm Flesh',4) -nssm_craftitem_eat ('amphibian_heart','Amphibian Heart',1) -nssm_craftitem_eat ('roasted_amphibian_heart','Roasted Amphibian Heart',8) -nssm_craftitem_eat ('raw_scrausics_wing','Raw Scrausics Wing',1) -nssm_craftitem_eat ('spicy_scrausics_wing','Spicy Scrausics Wing',6) -nssm_craftitem_eat ('phoenix_nuggets','Phoenix Nuggets',20) -nssm_craftitem_eat ('phoenix_tear','Phoenix Tear',20) -nssm_craftitem_eat ('frosted_amphibian_heart','Frosted Amphibian Heart',-1) -nssm_craftitem_eat ('surimi','Surimi',4) -nssm_craftitem_eat ('amphibian_ribs','Amphibian Ribs',2) -nssm_craftitem_eat ('roasted_amphibian_ribs','Roasted Amphibian Ribs',6) -nssm_craftitem_eat ('dolidrosaurus_fin','Dolidrosaurus Fin',-2) -nssm_craftitem_eat ('roasted_dolidrosaurus_fin','Roasted Dolidrosaurus Fin',4) -nssm_craftitem_eat ('larva_meat','Larva Meat',-1) -nssm_craftitem_eat ('larva_juice','Larva Juice',-3) -nssm_craftitem_eat ('larva_soup','Larva Soup',10) -nssm_craftitem_eat ('mantis_meat','Mantis Meat',1) -nssm_craftitem_eat ('roasted_mantis_meat','Roasted Mantis Meat',4) -nssm_craftitem_eat ('spider_meat','Spider Meat',-1) -nssm_craftitem_eat ('roasted_spider_meat','Roasted Spider Meat',3) -nssm_craftitem_eat ('silk_gland','Silk Gland',-1) -nssm_craftitem_eat ('roasted_silk_gland','Roasted Silk Gland',3) -nssm_craftitem_eat ('super_silk_gland','Super Silk Gland',-8) -nssm_craftitem_eat ('roasted_super_silk_gland','Roasted Super Silk Gland',2) - ---ore generation - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:modders_block", - wherein = "default:stone", - clust_scarcity = 50*50*50, - clust_num_ores = 1, - clust_size = 1, - y_min = -115, - y_max = -95, -}) - -for i=1,9 do - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:ant_dirt", - wherein = "default:cobble", - clust_scarcity = 1, - clust_num_ores = 1, - clust_size = 1, - y_min = -1, - y_max = 40, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:ant_dirt", - wherein = "default:mossycobble", - clust_scarcity = 1, - clust_num_ores = 1, - clust_size = 1, - y_min = -1000, - y_max = 40, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:ant_dirt", - wherein = "default:sandstonebrick", - clust_scarcity = 1, - clust_num_ores = 1, - clust_size = 1, - y_min = -1000, - y_max = 40, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:ant_dirt", - wherein = "stairs:stair_sandstonebrick", - clust_scarcity = 1, - clust_num_ores = 1, - clust_size = 1, - y_min = -1000, - y_max = 40, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:ant_dirt", - wherein = "stairs:stair_cobble", - clust_scarcity = 1, - clust_num_ores = 1, - clust_size = 1, - y_min = -1000, - y_max = 40, -}) - -end -- END for loop - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:web", - wherein = "default:junglegrass", - clust_scarcity = 2*2*2, - clust_num_ores = 2, - clust_size = 2, - y_min = -20, - y_max = 200, -}) - -minetest.register_ore({ - ore_type = "scatter", - ore = "nssm:web", - wherein = "default:jungleleaves", - clust_scarcity = 4*4*4, - clust_num_ores = 5, - clust_size = 5, - y_min = -20, - y_max = 200, -}) - ---nodes - -minetest.register_node("nssm:ant_dirt", { - description = "Ant Dirt", - tiles = {"ant_dirt.png"}, - groups = {crumbly=3}, -}) - -minetest.register_node("nssm:dead_leaves", { - description = "Dead leaves", - tiles = {"dead_leaves.png"}, - groups = {snappy=3,leaves=1}, -}) - -minetest.register_node("nssm:invisible_light", { - description = "Invisible light source", - tiles = {"transparent.png"}, - paramtype = "light", - drawtype = "airlike", - walkable = false, - sunlight_propagates = true, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - groups = {unbreakable=1}, - drop = "", - light_source = 14, -}) - -minetest.register_node("nssm:venomous_gas", { - description = "Venomous Gas", - inventory_image = minetest.inventorycube("venomous_gas.png"), - drawtype = "airlike", - tiles = { - {name="venomous_gas_animated.png", - animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}} - }, - paramtype = "light", - walkable = false, - sunlight_propagates = true, - pointable = false, - diggable = false, - buildable_to = true, - drop = "", - drowning = 1, - damage_per_second = 1, - post_effect_color = {a=100, r=1, g=100, b=1}, - groups = {flammable = 2}, -}) - -minetest.register_node("nssm:modders_block", { - description = "Modders Block", - tiles = {"modders_block.png"}, - is_ground_content = true, - groups = {crumbly=3, not_in_creative_inventory =1}, -}) - -minetest.register_node("nssm:web", { - description = "Web", - inventory_image = "web.png", - tiles = {"web.png"} , - drawtype = "plantlike", - paramtype = "light", - walkable = false, - pointable = true, - diggable = true, - buildable_to = false, - drop = "", - drowning = 0, - liquid_renewable = false, - liquidtype = "source", - liquid_range= 0, - liquid_alternative_flowing = "nssm:web", - liquid_alternative_source = "nssm:web", - liquid_viscosity = 20, - groups = {flammable=2, snappy=1, liquid=1}, -}) - -minetest.register_node("nssm:thick_web", { - description = "Thick Web", - inventory_image = "thick_web.png", - tiles = {"thick_web.png"} , - drawtype = "firelike", - paramtype = "light", - walkable = false, - pointable = true, - diggable = true, - buildable_to = false, - drop = "", - drowning = 2, - liquid_renewable = false, - liquidtype = "source", - liquid_range= 0, - liquid_alternative_flowing = "nssm:thick_web", - liquid_alternative_source = "nssm:thick_web", - liquid_viscosity = 30, - groups = {flammable=2, liquid=1}, -}) - -minetest.register_node("nssm:ink", { - description = "Ink", - inventory_image = minetest.inventorycube("ink.png"), - drawtype = "liquid", - tiles = { - { - name = "ink_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 2.0, - }, - }, - }, - --alpha = 420, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - liquid_range= 0, - drowning = 1, - liquid_renewable = false, - liquidtype = "source", - liquid_alternative_flowing = "nssm:ink", - liquid_alternative_source = "nssm:ink", - liquid_viscosity = 1, - post_effect_color = {a=2000, r=30, g=30, b=30}, - groups = {water=3, liquid=3, puts_out_fire=1}, -}) - -minetest.register_node("nssm:mese_meteor", { - description = "Mese Meteor", - tiles = {"mese_meteor.png"} , - paramtype = "light", - drop = "", - groups = {crumbly=1, falling_node=1, flammable = 2}, -}) - -minetest.register_node("nssm:pumpbomb", { - tiles = {"pumpbomb_top.png","pumpbomb_bottom.png", "pumpbomb_side.png", "pumpbomb_side.png", "pumpbomb_side.png", "pumpbomb_front.png"}, - light_source = 5, - groups = {not_in_creative_inventory =1}, - drop = "", - on_timer = function(pos, elapsed) - tnt_boom_nssm(pos, {damage_radius=4,radius=3,ignore_protection=false}) - minetest.set_node(pos, {name="air"}) - end, -}) - ---abms - -minetest.register_abm({ - nodenames = {"nssm:mese_meteor"}, - neighbors = {"air"}, - interval = 1, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.is_protected(pos, "") then - return - end - --local under = {x=pos.x, y=pos.y-1, z=pos.z} - --local n = minetest.get_node(under).name - --if n~= "air" then - minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name = "fire:basic_flame"}) - minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name = "fire:basic_flame"}) - minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name = "fire:basic_flame"}) - minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name = "fire:basic_flame"}) - minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "fire:basic_flame"}) - - end -}) - ---[[ These don't actually do anything -minetest.register_abm({ - nodenames = {"nssm:web"}, - neighbors = {"default:junglegrass"}, - interval = 20.0, - chance = 20, - action = function(pos, node, active_object_count, active_object_count_wider) - local n = minetest.get_node(pos).name - if n== "air" then - minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "nssm:web"}) - end - end -}) - -minetest.register_abm({ - nodenames = {"nssm:web"}, - neighbors = {"default:junglegrass"}, - interval = 20.0, - chance = 20, - action = function(pos, node, active_object_count, active_object_count_wider) - local n = minetest.get_node(pos).name - if n== "air" then - minetest.set_node({x = pos.x + 1, y = pos.y, z = pos.z}, {name = "nssm:web"}) - end - end -}) - -minetest.register_abm({ - nodenames = {"nssm:web"}, - neighbors = {"default:junglegrass"}, - interval = 20.0, - chance = 20, - action = function(pos, node, active_object_count, active_object_count_wider) - local n = minetest.get_node(pos).name - if n== "air" then - minetest.set_node({x = pos.x - 1, y = pos.y, z = pos.z}, {name = "nssm:web"}) - end - end -}) -]] - -minetest.register_node("nssm:phoenix_fire", { - description = "Phoenix Fire", - drawtype = "firelike", - tiles = {{ - name = "phoenix_fire_animated.png", - animation = {type = "vertical_frames", - aspect_w = 16, aspect_h = 16, length = 1}, - }}, - inventory_image = "phoenix_fire.png", - light_source = 14, - groups = {igniter = 1, snappy=1}, - drop = '', - walkable = false, - buildable_to = false, - damage_per_second = 4, -}) - -minetest.register_abm({ - nodenames = {"nssm:phoenix_fire"}, - neighbors = {"air"}, - interval = 3, - chance = 2, - action = function(pos, node) - minetest.set_node({x = pos.x, y = pos.y , z = pos.z}, {name = "air"}) - end -}) - -minetest.register_abm({ - nodenames = {"nssm:dead_leaves"}, - neighbors = {"air"}, - interval = 15, - chance = 3, - action = function(pos, node) - minetest.set_node({x = pos.x, y = pos.y , z = pos.z}, {name = "air"}) - end -}) - ---tools - -minetest.register_tool('nssm:sun_sword', { - description = 'Sun Sword', - inventory_image = 'sun_sword.png', - tool_capabilities = { - full_punch_interval = 0.6, - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.80, [2]=0.40, [3]=0.20}, uses=70, maxlevel=1}, - fleshy={times={[2]=0.6, [3]=0.2}, uses=70, maxlevel=1} - }, - damage_groups = {fleshy=10}, - }, - minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) - if puncher:get_wielded_item():get_name() == 'nssm:sun_sword' then - if node.name ~= "air" and not minetest.is_protected(pos, "") then - minetest.add_node(pointed_thing.above, {name = "fire:basic_flame"}) - end - end - end) -}) - -minetest.register_tool("nssm:masticone_fang_sword", { - description = "Masticone Fang Sword", - inventory_image = "masticone_fang_sword.png", - tool_capabilities = { - full_punch_interval =0.7 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=200, maxlevel=1}, - fleshy={times={[2]=0.8, [3]=0.4}, uses=200, maxlevel=1} - }, - damage_groups = {fleshy=8}, - }, -}) - -minetest.register_tool("nssm:night_sword", { - description = "Night Sword", - inventory_image = "night_sword.png", - tool_capabilities = { - full_punch_interval =0.4 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.4, [2]=0.3, [3]=0.2}, uses=300, maxlevel=1}, - fleshy={times={[2]=0.7, [3]=0.3}, uses=300, maxlevel=1} - }, - damage_groups = {fleshy=12}, - }, -}) - -minetest.register_tool("nssm:crab_light_mace", { - description = "Light Crab Mace", - inventory_image = "crab_light_mace.png", - tool_capabilities = { - full_punch_interval =2 , - max_drop_level=1, - groupcaps={ - fleshy={times={[2]=1.4, [3]=1}, uses=20, maxlevel=1} - }, - damage_groups = {fleshy=8}, - }, -}) - -minetest.register_tool("nssm:crab_heavy_mace", { - description = "Heavy Crab Mace", - inventory_image = "crab_heavy_mace.png", - tool_capabilities = { - full_punch_interval =4 , - max_drop_level=1, - groupcaps={ - fleshy={times={[2]=2, [3]=1.4}, uses=20, maxlevel=1} - }, - damage_groups = {fleshy=12}, - }, -}) - -minetest.register_tool("nssm:mantis_battleaxe", { - description = "Mantis Battleaxe", - inventory_image = "mantis_battleaxe.png", - tool_capabilities = { - full_punch_interval =3 , - max_drop_level=1, - groupcaps={ - fleshy={times={[2]=2, [3]=1.4}, uses=20, maxlevel=1} - }, - damage_groups = {fleshy=10}, - }, -}) - -minetest.register_node("nssm:rope", { - description = "Rope", - paramtype = "light", - walkable = false, - climbable = true, - sunlight_propagates = true, - drawtype = "plantlike", - drops = "nssm:rope", - tiles = { "rope.png" }, - groups = {snappy=1}, -}) - -minetest.register_tool("nssm:stoneater_pick", { - description = "Stoneater Pickaxe", - inventory_image = "stoneater_pick.png", - tool_capabilities = { - full_punch_interval = 0.9, - max_drop_level=0, - groupcaps={ - cracky = {times={[3]=0.0}, uses=200, maxlevel=1}, - }, - damage_groups = {fleshy=5}, - }, -}) - -minetest.register_tool("nssm:mantis_sword", { - description = "Mantis Sword", - inventory_image = "mantis_sword.png", - tool_capabilities = { - full_punch_interval =0.7 , - max_drop_level=1, - groupcaps={ - fleshy={times={[2]=1.0, [3]=0.4}, uses=30, maxlevel=1}, - snappy={times={[2]=0.80, [3]=0.3}, uses=40, maxlevel=1}, - }, - damage_groups = {fleshy=7}, - }, -}) - -minetest.register_tool("nssm:little_ice_tooth_knife", { - description = "Little Ice Tooth Knife", - inventory_image = "little_ice_tooth_knife.png", - tool_capabilities = { - full_punch_interval =0.3 , - max_drop_level=1, - groupcaps={ - fleshy={times={[2]=1.0, [3]=0.4}, uses=4, maxlevel=1}, - snappy={times={[2]=0.80, [3]=0.3}, uses=7, maxlevel=1}, - }, - damage_groups = {fleshy=5}, - }, -}) - -minetest.register_tool("nssm:manticore_spine_knife", { - description = "Manticore Spine Knife", - inventory_image = "manticore_spine_knife.png", - tool_capabilities = { - full_punch_interval =0.4 , - max_drop_level=1, - groupcaps={ - fleshy={times={[2]=1.0, [3]=0.4}, uses=6, maxlevel=1}, - snappy={times={[2]=0.80, [3]=0.3}, uses=6, maxlevel=1}, - }, - damage_groups = {fleshy=6}, - }, -}) - -minetest.register_tool("nssm:felucco_knife", { - description = "Felucco Knife", - inventory_image = "felucco_knife.png", - tool_capabilities = { - full_punch_interval =0.4 , - max_drop_level=1, - groupcaps={ - fleshy={times={[2]=1.0, [3]=0.4}, uses=6, maxlevel=1}, - snappy={times={[2]=0.80, [3]=0.3}, uses=6, maxlevel=1}, - }, - damage_groups = {fleshy=6}, - }, -}) - -if minetest.get_modpath("farming") then - - farming.register_hoe(":farming:felucco_hoe", { - description = "Felucco Hoe", - inventory_image = "felucco_hoe.png", - max_uses = 290, - material = "nssm:felucco_horn" - }) - - farming.register_hoe(":farming:ant_hoe", { - description = "Ant Hoe", - inventory_image = "ant_hoe.png", - max_uses = 350, - material = "nssm:ant_mandible" - }) -end - -minetest.register_tool("nssm:ant_sword", { - description = "Ant Sword", - inventory_image = "ant_sword.png", - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level=1, - groupcaps={ - snappy={times={[1]=1.30, [2]=0.90, [3]=0.40}, uses=40, maxlevel=3}, - }, - damage_groups = {fleshy=8}, - }, -}) - -minetest.register_tool("nssm:ant_shovel", { - description = "Ant Shovel", - inventory_image = "ant_shovel.png", - wield_image = "ant_shovel.png^[transformR90", - tool_capabilities = { - full_punch_interval = 1, - max_drop_level=1, - groupcaps={ - crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=35, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, -}) - -minetest.register_tool("nssm:duck_beak_shovel", { - description = "Duck Beak Shovel", - inventory_image = "duck_beak_shovel.png", - wield_image = "duck_beak_shovel.png^[transformR90", - tool_capabilities = { - full_punch_interval = 0.6, - max_drop_level=1, - groupcaps={ - crumbly = {times={[1]=1.10, [2]=0.80, [3]=0.20}, uses=5, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, -}) - -minetest.register_tool("nssm:mantis_axe", { - description = "Mantis Axe", - inventory_image = "mantis_axe.png", - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level=1, - groupcaps={ - choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=30, maxlevel=3}, - }, - damage_groups = {fleshy=5}, - }, -}) - -minetest.register_tool("nssm:ant_billhook", { - description = "Ant Billhook", - inventory_image = "ant_billhook.png", - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level=1, - groupcaps={ - choppy={times={[1]=1.40, [2]=1.00, [3]=0.60}, uses=30, maxlevel=3}, - snappy={times={[1]=1.40, [2]=1.00, [3]=0.60}, uses=30, maxlevel=3}, - }, - damage_groups = {fleshy=6}, - }, -}) - -minetest.register_tool("nssm:duck_beak_pick",{ - description = "Duck Beak Pickaxe", - inventory_image = "duck_beak_pick.png", - tool_capabilities = { - full_punch_interval = 0.6, - max_drop_level=3, - groupcaps={ - cracky = {times={[1]=1.0, [2]=0.8, [3]=0.20}, uses=3, maxlevel=3}, - }, - damage_groups = {fleshy=5}, - }, -}) - -minetest.register_tool("nssm:ant_pick", { - description = "Ant Pickaxe", - inventory_image = "ant_pick.png", - tool_capabilities = { - full_punch_interval = 1.2, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=2.00, [2]=1.20, [3]=0.80}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, -}) - -minetest.register_tool("nssm:mantis_pick", { - description = "Mantis Pickaxe", - inventory_image = "mantis_pick.png", - tool_capabilities = { - full_punch_interval = 1, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=1.6, [2]=1.0, [3]=0.60}, uses=20, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, -}) - -minetest.register_tool("nssm:tarantula_warhammer", { - description = "Tarantula Warhammer", - inventory_image = "tarantula_warhammer.png", - wield_scale= {x=2,y=2,z=1.5}, - tool_capabilities = { - full_punch_interval =1, - max_drop_level=1, - groupcaps={ - cracky={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=80, maxlevel=1}, - fleshy={times={[2]=0.8, [3]=0.4}, uses=200, maxlevel=1} - }, - damage_groups = {fleshy=13}, - }, -}) - -minetest.register_tool("nssm:axe_of_pride", { - description = "Axe of Pride", - inventory_image = "axe_of_pride.png", - wield_scale= {x=2,y=2,z=1.5}, - tool_capabilities = { - full_punch_interval =1.3 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, - fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} - }, - damage_groups = {fleshy=16}, - }, - on_drop = function(itemstack, dropper, pos) - local objects = minetest.get_objects_inside_radius(pos, 10) - local flag = 0 - local part = 0 - for _,obj in ipairs(objects) do - part = 0 - if flag == 0 then - local pname = dropper:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) - - if player_inv:is_empty('main') then - --minetest.chat_send_all("Inventory empty") - else - local found = 0 - for i = 1,32 do - local items = player_inv:get_stack('main', i) - local n = items:get_name() - if n == "nssm:energy_globe" then - found = i - break - end - end - if found == 0 then - minetest.chat_send_player(pname, "You haven't got any Energy Globe!") - return - else - if (obj:is_player()) then - --minetest.chat_send_all("Giocatore") - if (obj:get_player_name()~=dropper:get_player_name()) then - obj:set_hp(obj:get_hp()-10) - dropper:set_hp(dropper:get_hp()+10) - --flag = 1 - - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - part = 1 - end - else - if (obj:get_luaentity().health) then - --minetest.chat_send_all("Entity") - obj:get_luaentity().health = obj:get_luaentity().health -10 --- check_for_death(obj:get_luaentity()) - - dropper:set_hp(dropper:get_hp()+10) - --flag = 1 - - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - part = 1 - end - end - if part == 1 then - local s = dropper:get_pos() - local p = obj:get_pos() - local m = 2 - - minetest.add_particlespawner( - 3, --amount - 0.1, --time - {x=p.x-0.5, y=p.y-0.5, z=p.z-0.5}, --minpos - {x=p.x+0.5, y=p.y+0.5, z=p.z+0.5}, --maxpos - {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --minvel - {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --maxvel - {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --minacc - {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 3, --minsize - 4, --maxsize - false, --collisiondetection - "heart.png" --texture - ) - end - end - end - end - end - end, -}) - -minetest.register_tool("nssm:gratuitousness_battleaxe", { - description = "Gratuitousness Battleaxe", - inventory_image = "gratuitousness_battleaxe.png", - wield_scale= {x=2.2,y=2.2,z=1.5}, - tool_capabilities = { - full_punch_interval =1.6 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, - fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} - }, - damage_groups = {fleshy=18}, - }, - on_drop = function(itemstack, dropper, pos) - local objects = minetest.get_objects_inside_radius(pos, 10) - local flag = 0 - local vec = dropper:get_look_dir() - local pos = dropper:get_pos() - --vec.y = 0 - - for i=1,10 do - pos = vector.add(pos, vec) - end - - local pname = dropper:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) - local found = 0 - for i = 1,32 do - local items = player_inv:get_stack('main', i) - local n = items:get_name() - if n == "nssm:energy_globe" then - found = i - break - end - end - if found == 0 then - minetest.chat_send_player(pname, "You haven't got any Energy Globe!") - return - else - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - tnt.boom(pos, {damage_radius=5,radius=4,ignore_protection=false}) - end - end, -}) - -minetest.register_tool("nssm:sword_of_eagerness", { - description = "Sword of Eagerness", - inventory_image = "sword_of_eagerness.png", - wield_scale= {x=2,y=2,z=1}, - tool_capabilities = { - full_punch_interval =0.7 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, - fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} - }, - damage_groups = {fleshy=14}, - }, - on_drop = function(itemstack, dropper, pos) - local objects = minetest.get_objects_inside_radius(pos, 10) - local flag = 0 - for _,obj in ipairs(objects) do - local part = 0 - if flag == 0 then - local pname = dropper:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) - - if player_inv:is_empty('main') then - --minetest.chat_send_all("Inventory empty") - else - local found = 0 - for i = 1,32 do - local items = player_inv:get_stack('main', i) - local n = items:get_name() - if n == "nssm:energy_globe" then - found = i - break - end - end - if found == 0 then - minetest.chat_send_player(pname, "You haven't got any Energy Globe!") - return - else - local pos = obj:get_pos() - pos.y = pos.y + 15 - if (obj:is_player()) then - if (obj:get_player_name()~=dropper:get_player_name()) then - part=1 - obj:set_pos(pos) - --flag = 1 - - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - end - else - if (obj:get_luaentity().health) then - obj:get_luaentity().old_y = pos.y - obj:set_pos(pos) - part=1 - --flag = 1 - - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - end - end - if part==1 then - local s = pos - s.y = s.y - 15 - minetest.add_particlespawner( - 25, --amount - 0.3, --time - vector.subtract(s, 0.5), --minpos - vector.add(s, 0.5), --maxpos - {x=0, y=10, z=0}, --minvel - {x=0.1, y=11, z=0.1}, --maxvel - {x=0,y=1,z=0}, --minacc - {x=0,y=1,z=0}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "slothful_soul_fragment.png" --texture - ) - end - end - end - end - end - end, -}) - -minetest.register_tool("nssm:falchion_of_eagerness", { - description = "Falchion of Eagerness", - inventory_image = "falchion_of_eagerness.png", - wield_scale= {x=2,y=2,z=1}, - tool_capabilities = { - full_punch_interval =1 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, - fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} - }, - damage_groups = {fleshy=16}, - }, - on_drop = function(itemstack, dropper, pos) - local vec = dropper:get_look_dir() - local pos = dropper:get_pos() - --vec.y = 0 - - for i=1,16 do - pos = vector.add(pos, vec) - end - - local pname = dropper:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) - - if player_inv:is_empty('main') then - --minetest.chat_send_all("Inventory empty") - else - local found = 0 - for i = 1,32 do - local items = player_inv:get_stack('main', i) - local n = items:get_name() - if n == "nssm:life_energy" then - if items:get_count() >= 5 then - found = i - break - end - end - end - if found == 0 then - minetest.chat_send_player(pname, "You haven't got enough life_energy!") - return - else - local s = dropper:get_pos() - minetest.add_particlespawner( - 25, --amount - 0.3, --time - vector.subtract(s, 0.5), --minpos - vector.add(s, 0.5), --maxpos - {x=0, y=10, z=0}, --minvel - {x=0.1, y=11, z=0.1}, --maxvel - {x=0,y=1,z=0}, --minacc - {x=0,y=1,z=0}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "slothful_soul_fragment.png" --texture - ) - minetest.remove_node(pos) - pos.y=pos.y+1 - minetest.remove_node(pos) - pos.y=pos.y-2 - minetest.remove_node(pos) - dropper:set_pos(pos) - s = pos - s.y = s.y+10 - minetest.add_particlespawner( - 25, --amount - 0.3, --time - vector.subtract(s, 0.5), --minpos - vector.add(s, 0.5), --maxpos - {x=0, y=-10, z=0}, --minvel - {x=0.1, y=-11, z=0.1}, --maxvel - {x=0,y=-1,z=0}, --minacc - {x=0,y=-1,z=0}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "slothful_soul_fragment.png" --texture - ) - local items = player_inv:get_stack('main', found) - items:set_count(items:get_count()-5) - player_inv:set_stack('main', found, items) - end - end - end, -}) - -minetest.register_tool("nssm:sword_of_envy", { - description = "Sword of Envy", - inventory_image = "sword_of_envy.png", - wield_scale= {x=2,y=2,z=1}, - tool_capabilities = { - full_punch_interval =0.9 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, - fleshy={times={[2]=0.5, [3]=0.2}, uses=400, maxlevel=1} - }, - damage_groups = {fleshy=14}, - }, - on_drop = function(itemstack, dropper, pos) - local objects = minetest.get_objects_inside_radius(pos, 10) - local flag = 0 - for _,obj in ipairs(objects) do - if flag == 0 then - local pname = dropper:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) - - if player_inv:is_empty('main') then - --minetest.chat_send_all("Inventory empty") - else - local found = 0 - for i = 1,32 do - local items = player_inv:get_stack('main', i) - local n = items:get_name() - if n == "nssm:energy_globe" then - found = i - break - end - end - if found == 0 then - minetest.chat_send_player(pname, "You haven't got any Energy Globe!") - return - else - if (obj:is_player()) then - --minetest.chat_send_all("Giocatore") - if (obj:get_player_name()~=dropper:get_player_name()) then - local hpp = obj:get_hp() - obj:set_hp(dropper:get_hp()) - dropper:set_hp(hpp) - flag = 1 - - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - end - else - if (obj:get_luaentity().health) then - local hpp = obj:get_luaentity().health - obj:get_luaentity().health = dropper:get_hp() - if hpp > 20 then - dropper:set_hp(20) - else - dropper:set_hp(hpp) - end --- check_for_death(obj:get_luaentity()) - flag = 1 - - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - end - end - end - end - end - end - end, -}) - -minetest.register_tool("nssm:sword_of_gluttony", { - description = "Sword of Gluttony", - inventory_image = "sword_of_gluttony.png", - wield_scale= {x=2,y=2,z=1}, - tool_capabilities = { - full_punch_interval =1 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.9, [2]=0.7, [3]=0.4}, uses=100, maxlevel=1}, - fleshy={times={[2]=0.6, [3]=0.2}, uses=400, maxlevel=1} - }, - damage_groups = {fleshy=14}, - }, - on_drop = function(itemstack, dropper, pos) - local objects = minetest.get_objects_inside_radius(pos, 10) - local flag = 0 - for _,obj in ipairs(objects) do - if flag == 0 then - local pname = dropper:get_player_name() - local player_inv = minetest.get_inventory({type='player', name = pname}) - - if player_inv:is_empty('main') then - --minetest.chat_send_all("Inventory empty") - else - local found = 0 - for i = 1,32 do - local items = player_inv:get_stack('main', i) - local n = items:get_name() - if n == "nssm:energy_globe" then - found = i - break - end - end - if found == 0 then - minetest.chat_send_player(pname, "You haven't got any Energy Globe!") - return - else - if (obj:is_player()) then - if (obj:get_player_name()~=dropper:get_player_name()) then - obj:set_hp(obj:get_hp()-10) - --flag = 1 - - --take energy globe from inventory: - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - end - else - if (obj:get_luaentity().health) then - if obj:get_luaentity().health <= 32 then - local pos = obj:get_pos() - obj:remove() - - --check_for_death(obj:get_luaentity()) - --flag = 1 - --take energy globe from inventory: - local items = player_inv:get_stack('main', found) - items:take_item() - player_inv:set_stack('main', found, items) - - for i = 1,math.random(1,4) do - drop = minetest.add_item(pos, "nssm:roasted_duck_legs 1") - drops(drop) - end - - local s = obj:get_pos() - local p = dropper:get_pos() - local m = 3 - - minetest.add_particlespawner( - 10, --amount - 0.1, --time - {x=p.x-0.5, y=p.y-0.5, z=p.z-0.5}, --minpos - {x=p.x+0.5, y=p.y+0.5, z=p.z+0.5}, --maxpos - {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --minvel - {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --maxvel - {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --minacc - {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --maxacc - 0.5, --minexptime - 1, --maxexptime - 1, --minsize - 2, --maxsize - false, --collisiondetection - "gluttonous_soul_fragment.png" --texture - ) - end - end - end - end - end - end - end - end, -}) - -minetest.register_tool("nssm:death_scythe", { - description = "Death Scythe", - wield_scale= {x=3,y=3,z=1.3}, - inventory_image = "death_scythe.png", - tool_capabilities = { - full_punch_interval =0.2 , - max_drop_level=1, - groupcaps={ - snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=28000, maxlevel=1}, - fleshy={times={[2]=0.1, [3]=0.1}, uses=28000, maxlevel=1} - }, - damage_groups = {fleshy=28}, - }, - groups ={not_in_creative_inventory=1}, - on_drop = function(itemstack, dropper, pos) - local objects = minetest.get_objects_inside_radius(pos, 10) - local flag = 0 - dropper:set_hp(dropper:get_hp()-9) - for _,obj in ipairs(objects) do - flag = 0 - if (obj:is_player()) then - if (obj:get_player_name()~=dropper:get_player_name()) then - obj:set_hp(obj:get_hp()-40) - flag = 1 - end - else - if (obj:get_luaentity().health) then - obj:get_luaentity().health = obj:get_luaentity().health -40 --- check_for_death(obj:get_luaentity()) - flag = 1 - end - end - if flag == 1 then - for i = 1,math.random(1,2) do - drop = minetest.add_item(pos, "nssm:energy_globe 1") - - if drop then - drop:set_velocity({ - x = math.random(-10, 10) / 9, - y = 5, - z = math.random(-10, 10) / 9, - }) - end - end - end - end - local pos = dropper:get_pos() - local vec = {x=5,y=5,z=5} - local poslist = minetest.find_nodes_in_area(vector.subtract(pos, vec), vector.add(pos,vec), "default:dirt_with_grass") - for _,v in pairs(poslist) do - --minetest.chat_send_all(minetest.pos_to_string(v)) - minetest.set_node(v, {name="default:dirt_with_dry_grass"}) - if math.random(1,3)==1 then - v.y = v.y +2 - drop = minetest.add_item(v, "nssm:life_energy 1") - drops(drop) - end - end - - local poslist = minetest.find_nodes_in_area_under_air(vector.subtract(pos, vec), vector.add(pos,vec), "group:flora") - for _,v in pairs(poslist) do - --minetest.chat_send_all(minetest.pos_to_string(v)) - minetest.set_node(v, {name="default:dry_shrub"}) - if math.random(1,3)==1 then - v.y = v.y +2 - drop = minetest.add_item(v, "nssm:life_energy 1") - drops(drop) - end - end - - local poslist = minetest.find_nodes_in_area(vector.subtract(pos, vec), vector.add(pos,vec), "group:leaves") - for _,v in pairs(poslist) do - --minetest.chat_send_all(minetest.pos_to_string(v)) - minetest.set_node(v, {name="nssm:dead_leaves"}) - if math.random(1,3)==1 then - v.y = v.y +2 - drop = minetest.add_item(v, "nssm:life_energy 1") - drops(drop) - end - end - end, -}) - ---recipes - -minetest.register_craft({ - output = 'nssm:web_string', - recipe = { - {'nssm:web', 'nssm:web'}, - {'nssm:web', 'nssm:web'}, - } -}) - -minetest.register_craft({ - output = 'nssm:dense_web_string', - recipe = { - {'nssm:web_string', 'nssm:web_string', 'nssm:web_string'}, - {'nssm:web_string', 'nssm:web_string', 'nssm:web_string'}, - {'nssm:web_string', 'nssm:web_string', 'nssm:web_string'}, - } -}) - -minetest.register_craft({ - output = 'nssm:mantis_sword', - recipe = { - {'nssm:mantis_claw'}, - {'nssm:mantis_claw'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:masticone_fang_sword', - recipe = { - {'nssm:masticone_fang', 'nssm:masticone_fang'}, - {'nssm:masticone_fang', ''}, - {'group:stick', ''}, - } -}) - -minetest.register_craft({ - output = 'nssm:black_ice_tooth', - type = "shapeless", - recipe = {'nssm:digested_sand', 'nssm:ice_tooth'}, -}) - -minetest.register_craft({ - output = 'nssm:web 4', - type = "shapeless", - recipe = {'nssm:silk_gland'}, -}) - -minetest.register_craft({ - output = 'nssm:crab_light_mace', - recipe = { - {'nssm:crab_chela'}, - {'group:stick'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:crab_heavy_mace', - recipe = { - {'', 'nssm:crab_chela', ''}, - {'nssm:crab_chela', 'nssm:crab_chela', 'nssm:crab_chela'}, - {'', 'group:stick', ''}, - } -}) - -minetest.register_craft({ - output = 'nssm:energy_globe', - recipe = { - {'nssm:life_energy', 'nssm:life_energy', 'nssm:life_energy'}, - {'nssm:life_energy', 'nssm:life_energy', 'nssm:life_energy'}, - {'nssm:life_energy', 'nssm:life_energy', 'nssm:life_energy'}, - } -}) - -minetest.register_craft({ - output = 'nssm:great_energy_globe', - recipe = { - {'nssm:energy_globe', 'nssm:energy_globe', 'nssm:energy_globe'}, - {'nssm:energy_globe', 'nssm:energy_globe', 'nssm:energy_globe'}, - {'nssm:energy_globe', 'nssm:energy_globe', 'nssm:energy_globe'}, - } -}) - -minetest.register_craft({ - output = 'nssm:superior_energy_globe', - recipe = { - {'nssm:great_energy_globe', 'nssm:great_energy_globe', 'nssm:great_energy_globe'}, - {'nssm:great_energy_globe', 'nssm:great_energy_globe', 'nssm:great_energy_globe'}, - {'nssm:great_energy_globe', 'nssm:great_energy_globe', 'nssm:great_energy_globe'}, - } -}) - -minetest.register_craft({ - output = 'nssm:mese_egg', - type = "shapeless", - recipe = {'nssm:tarantula_chelicerae', 'nssm:helmet_masticone_crowned', 'nssm:eyed_tentacle','nssm:black_ice_tooth', 'nssm:superior_energy_globe', 'nssm:sky_feather','nssm:cursed_pumpkin_seed', 'nssm:ant_queen_abdomen', 'nssm:snake_scute'} -}) - ---[[minetest.register_craft({ - output = 'nssm:masticone_skull_crowned', - recipe = { - {'', 'nssm:king_duck_crown', ''}, - {'', 'nssm:masticone_skull', ''}, - {'', '', ''}, - } -})]] - -minetest.register_craft({ - output = 'nssm:eyed_tentacle', - type = "shapeless", - recipe = {'nssm:lava_titan_eye','nssm:tentacle_curly'} -}) - -minetest.register_craft({ - output = 'nssm:life_energy 9', - type = "shapeless", - recipe = {'nssm:energy_globe'} -}) - -minetest.register_craft({ - output = 'nssm:energy_globe 9', - type = "shapeless", - recipe = {'nssm:great_energy_globe'} -}) - -minetest.register_craft({ - output = 'nssm:great_energy_globe 9', - type = "shapeless", - recipe = {'nssm:superior_energy_globe'} -}) ---[[ -minetest.register_craft({ - output = 'nssm:masticone_skull', - 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'}, - } -})]] - -minetest.register_craft({ - output = 'nssm:rope 12', - recipe = { - {'nssm:web_string'}, - {'nssm:web_string'}, - {'nssm:web_string'}, - } -}) - - -minetest.register_craft({ - output = 'nssm:sky_feather', - type = "shapeless", - recipe = {'nssm:sun_feather','nssm:night_feather'} -}) - -minetest.register_craft({ - output = 'nssm:sun_sword', - recipe = { - {'default:diamond'}, - {'nssm:sun_feather'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:night_sword', - recipe = { - {'default:diamond'}, - {'nssm:night_feather'}, - {'group:stick'}, - } -}) - -function nssm_register_recip (ingredient, dish, tictac) - -minetest.register_craft({ - type = "cooking", - output = "nssm:"..dish, - recipe = "nssm:"..ingredient, - cooktime = tictac, -}) - -end - -nssm_register_recip ('worm_flesh', 'roasted_worm_flesh', 12) -nssm_register_recip ('duck_legs', 'roasted_duck_legs', 6) -nssm_register_recip ('spider_leg', 'roasted_spider_leg', 6) -nssm_register_recip ('felucco_steak', 'roasted_felucco_steak', 10) -nssm_register_recip ('werewolf_leg', 'roasted_werewolf_leg', 10) -nssm_register_recip ('brain', 'roasted_brain', 6) -nssm_register_recip ('amphibian_heart', 'roasted_amphibian_heart', 6) -nssm_register_recip ('tentacle', 'roasted_tentacle', 6) -nssm_register_recip ('frosted_amphibian_heart', 'amphibian_heart', 8) -nssm_register_recip ('heron_leg', 'chichibios_heron_leg', 20) -nssm_register_recip ('raw_scrausics_wing', 'spicy_scrausics_wing', 12) -nssm_register_recip ('ant_leg', 'roasted_ant_leg', 6) -nssm_register_recip ('crocodile_tail', 'roasted_crocodile_tail', 16) -nssm_register_recip ('dolidrosaurus_fin', 'roasted_dolidrosaurus_fin', 8) -nssm_register_recip ('amphibian_ribs', 'roasted_amphibian_ribs', 12) -nssm_register_recip ('mantis_meat', 'roasted_mantis_meat', 6) -nssm_register_recip ('spider_meat', 'roasted_spider_meat', 6) -nssm_register_recip ('silk_gland', 'roasted_silk_gland', 4) -nssm_register_recip ('larva_juice', 'larva_soup', 20) - - - -minetest.register_craft({ - output = 'nssm:larva_juice', - type = "shapeless", - recipe = {'nssm:larva_meat','bucket:bucket_empty'} -}) - -minetest.register_craft({ - output = 'nssm:ant_sword', - recipe = { - {'nssm:ant_mandible'}, - {'nssm:ant_mandible'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:ant_billhook', - recipe = { - {'nssm:ant_mandible', 'nssm:ant_mandible'}, - {'nssm:ant_mandible', 'group:stick'}, - {'', 'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:ant_shovel', - recipe = { - {'nssm:ant_mandible'}, - {'group:stick'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:duck_beak_shovel', - recipe = { - {'nssm:duck_beak'}, - {'group:stick'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:duck_beak_pick', - recipe = { - {'nssm:duck_beak', 'nssm:duck_beak', 'nssm:duck_beak'}, - {'', 'group:stick', ''}, - {'', 'group:stick', ''}, - } -}) - -minetest.register_craft({ - output = 'nssm:sky_iron 30', - recipe = { - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - {'default:steelblock', 'nssm:sky_feather', 'default:steelblock'}, - {'default:steelblock', 'default:steelblock', 'default:steelblock'}, - } -}) - -minetest.register_craft({ - output = 'nssm:stoneater_pick', - recipe = { - {'nssm:stoneater_mandible', 'nssm:stoneater_mandible', 'nssm:stoneater_mandible'}, - {'', 'group:stick', ''}, - {'', 'group:stick', ''}, - } -}) - -minetest.register_craft({ - output = 'nssm:felucco_knife', - recipe = { - {'nssm:felucco_horn'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:little_ice_tooth_knife', - recipe = { - {'nssm:little_ice_tooth'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:manticore_spine_knife', - recipe = { - {'nssm:manticore_spine'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:ant_pick', - recipe = { - {'nssm:ant_mandible', 'nssm:ant_mandible', 'nssm:ant_mandible'}, - {'', 'group:stick', ''}, - {'', 'group:stick', ''}, - } -}) - -minetest.register_craft({ - output = 'nssm:mantis_pick', - recipe = { - {'nssm:mantis_claw', 'nssm:mantis_claw', 'nssm:mantis_claw'}, - {'', 'group:stick', ''}, - {'', 'group:stick', ''}, - } -}) - -minetest.register_craft({ - output = 'nssm:mantis_axe', - recipe = { - {'nssm:mantis_claw', 'nssm:mantis_claw'}, - {'nssm:mantis_claw', 'group:stick'}, - {'', 'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:tarantula_warhammer', - recipe = { - {'nssm:tarantula_chelicerae'}, - {'group:stick'}, - {'group:stick'}, - } -}) - -minetest.register_craft({ - output = 'nssm:mantis_battleaxe', - recipe = { - {'nssm:mantis_claw', 'nssm:mantis_claw', 'nssm:mantis_claw'}, - {'nssm:mantis_claw', 'group:stick', 'nssm:mantis_claw'}, - {'', 'group:stick', ''}, - } -}) - -if minetest.get_modpath("nssb") then - minetest.register_craft({ - output = 'nssm:axe_of_pride', - recipe = { - {'nssm:proud_moranga', 'nssm:proud_moranga', 'nssm:proud_moranga'}, - {'nssm:proud_moranga', 'nssb:moranga_ingot', ''}, - {'', 'nssb:moranga_ingot', ''}, - } - }) - - minetest.register_craft({ - output = 'nssm:gratuitousness_battleaxe', - recipe = { - {'nssm:greedy_moranga', 'nssm:greedy_moranga', 'nssm:greedy_moranga'}, - {'nssm:greedy_moranga', 'nssb:moranga_ingot', 'nssm:greedy_moranga'}, - {'', 'nssb:moranga_ingot', ''}, - } - }) - - minetest.register_craft({ - output = 'nssm:sword_of_envy', - recipe = { - {'nssm:envious_moranga'}, - {'nssm:envious_moranga'}, - {'nssb:moranga_ingot'}, - } - }) - - minetest.register_craft({ - output = 'nssm:sword_of_eagerness', - recipe = { - {'nssm:slothful_moranga'}, - {'nssm:slothful_moranga'}, - {'nssb:moranga_ingot'}, - } - }) - - minetest.register_craft({ - output = 'nssm:falchion_of_eagerness', - recipe = { - {'nssm:slothful_moranga','nssm:slothful_moranga'}, - {'nssm:slothful_moranga', ''}, - {'nssb:moranga_ingot',''}, - } - }) - - minetest.register_craft({ - output = 'nssm:sword_of_gluttony', - recipe = { - {'nssm:gluttonous_moranga', 'nssm:gluttonous_moranga', 'nssm:gluttonous_moranga'}, - {'', 'nssm:gluttonous_moranga', ''}, - {'', 'nssb:moranga_ingot', ''}, - } - }) - - function nssm_register_moranga (viz) - minetest.register_craft({ - output = 'nssm:'.. viz ..'_moranga', - recipe = { - {'nssm:'.. viz ..'_soul_fragment', 'nssb:moranga_ingot', 'nssm:'.. viz ..'_soul_fragment'}, - {'nssb:moranga_ingot', 'nssm:'.. viz ..'_soul_fragment', 'nssb:moranga_ingot'}, - {'nssm:'.. viz ..'_soul_fragment', 'nssb:moranga_ingot', 'nssm:'.. viz ..'_soul_fragment'}, - } - }) - end - nssm_register_moranga ("lustful") - nssm_register_moranga ("greedy") - nssm_register_moranga ("slothful") - nssm_register_moranga ("wrathful") - nssm_register_moranga ("gluttonous") - nssm_register_moranga ("envious") - nssm_register_moranga ("proud") -end - ---Eggs - -local function nssm_register_egg (name, descr) - minetest.register_craftitem("nssm:".. name, { - description = descr .. " Egg", - image = name.."_egg.png", - on_place = function(itemstack, placer, pointed_thing) - local pos1=minetest.get_pointed_thing_position(pointed_thing, true) - pos1.y=pos1.y+1.5 - core.after(0.1, function() - minetest.add_entity(pos1, "nssm:".. name) - end) - itemstack:take_item() - return itemstack - end, - }) -end - -local function nssm_register_egg2 (name, descr) --mobs you can't catch - minetest.register_craftitem("nssm:".. name.."_egg", { - description = descr .. " Egg", - image = name.."_egg.png", - on_place = function(itemstack, placer, pointed_thing) - local pos1=minetest.get_pointed_thing_position(pointed_thing, true) - pos1.y=pos1.y+1.5 - core.after(0.1, function() - minetest.add_entity(pos1, "nssm:".. name) - end) - itemstack:take_item() - return itemstack - end, - }) -end - -nssm_register_egg ('flying_duck', 'Flying Duck') -nssm_register_egg ('stone_eater', 'Stoneater') -nssm_register_egg ('signosigno', 'Signosigno') -nssm_register_egg ('bloco', 'Bloco') -nssm_register_egg ('sand_bloco', 'Sand Bloco') -nssm_register_egg ('swimming_duck', 'Swimming Duck') -nssm_register_egg ('duck', 'Duck') -nssm_register_egg2 ('duckking', 'Duckking') -nssm_register_egg ('enderduck', 'Enderduck') -nssm_register_egg ('spiderduck', 'Spiderduck') -nssm_register_egg2 ('echidna', 'Echidna') -nssm_register_egg ('werewolf', 'Werewolf') -nssm_register_egg ('white_werewolf', 'White Werewolf') -nssm_register_egg ('snow_biter', 'Snow Biter') -nssm_register_egg2 ('icelamander', 'Icelamander') -nssm_register_egg ('icesnake', 'Icesnake') -nssm_register_egg2 ('lava_titan', 'Lava Titan') -nssm_register_egg ('masticone', 'Masticone') -nssm_register_egg ('mantis_beast', 'Mantis Beast') -nssm_register_egg ('mantis', 'Mantis') -nssm_register_egg ('larva', 'Larva') -nssm_register_egg2 ('phoenix', 'Phoenix') -nssm_register_egg2 ('night_master', 'Night Master') -nssm_register_egg ('scrausics', 'Scrausics') -nssm_register_egg ('moonheron', 'Moonheron') -nssm_register_egg ('sandworm', 'Sandworm') -nssm_register_egg2 ('giant_sandworm', 'Giant Sandworm') -nssm_register_egg2 ('ant_queen', 'Ant Queen') -nssm_register_egg ('ant_soldier', 'Ant Soldier') -nssm_register_egg ('ant_worker', 'Ant Worker') -nssm_register_egg ('crocodile', 'Crocodile') -nssm_register_egg ('dolidrosaurus', 'Dolidrosaurus') -nssm_register_egg ('crab', 'Crab') -nssm_register_egg ('octopus', 'Octopus') -nssm_register_egg ('xgaloctopus', 'Xgaloctopus') -nssm_register_egg ('black_widow', 'Black Widow') -nssm_register_egg ('uloboros', 'Uloboros') -nssm_register_egg2 ('tarantula', 'Tarantula') -nssm_register_egg ('daddy_long_legs', 'Daddy Long Legs') -nssm_register_egg2 ('kraken', 'Kraken') -nssm_register_egg2 ('pumpking', 'Pumpking') -nssm_register_egg ('manticore', 'Manticore') -nssm_register_egg ('felucco', 'Felucco') -nssm_register_egg ('pumpboom_large', 'Large Pumpboom') -nssm_register_egg ('pumpboom_small', 'Small Pumpboom') -nssm_register_egg ('pumpboom_medium', 'Medium Pumpboom') -nssm_register_egg2 ('mordain', 'Mordain') -nssm_register_egg2 ('morgre', 'Morgre') -nssm_register_egg2 ('morvy', 'Morvy') -nssm_register_egg2 ('morgut', 'Morgut') -nssm_register_egg2 ('morde', 'Morde') -nssm_register_egg2 ('morlu', 'Morlu') -nssm_register_egg2 ('morwa', 'Morwa') ---nssm_register_egg ('morvalar', 'Morvalar') - -minetest.register_craftitem("nssm:mese_egg", { - description = "Mese Egg", - image = "mese_egg.png", - on_place = function(itemstack, placer, pointed_thing) - local pos1=minetest.get_pointed_thing_position(pointed_thing, true) - pos1.y=pos1.y+1.5 - minetest.add_particlespawner({ - amount = 1000, - time = 0.2, - minpos = {x=pos1.x-1, y=pos1.y-1, z=pos1.z-1}, - maxpos = {x=pos1.x+1, y=pos1.y+4, z=pos1.z+1}, - minvel = {x=0, y=0, z=0}, - maxvel = {x=1, y=5, z=1}, - minacc = {x=-0.5,y=5,z=-0.5}, - maxacc = {x=0.5,y=5,z=0.5}, - minexptime = 1, - maxexptime = 3, - minsize = 2, - maxsize = 4, - collisiondetection = false, - vertical = false, - texture = "tnt_smoke.png", - }) - core.after(0.4, function() - minetest.add_entity(pos1, "nssm:mese_dragon") - end) - itemstack:take_item() - return itemstack - end, -}) - - ---experimental morwa statue -minetest.register_node("nssm:morwa_statue", { - description = 'Morwa Statue', - drawtype = 'mesh', - mesh = 'morwa_statue.b3d', - tiles = {'morwa_statue.png'}, - inventory_image = 'morwa_statue.png', - groups = {not_in_creative_inventory=1}, - paramtype = 'light', - paramtype2 = 'facedir', - selection_box = { - type = 'fixed', - fixed = {-1, -0.5, -1, 1, 3, 1}, -- Right, Bottom, Back, Left, Top, Front - }, - collision_box = { - type = 'fixed', - fixed = {-1, -0.5, -1, 1, 3, 1}, -- Right, Bottom, Back, Left, Top, Front - }, -}) - ---Abm to make the conversion between statue and the entity, caused by light - -minetest.register_abm({ - nodenames = {"nssm:morwa_statue"}, - neighbors = {"air"}, - interval = 2, - chance = 1, - action = function(pos, node) - local pos1 = {x=pos.x, y=pos.y+1, z=pos.z} - local n = minetest.get_node(pos1).name - if n ~= "air" then - return - end - if (minetest.get_node_light(pos1) > 8) - then - minetest.add_entity(pos1, "nssm:morwa") - minetest.remove_node(pos) - end - end -}) - ---Eggs recipes - -minetest.register_craft({ - output = 'nssm:duck', - recipe = { - {'', 'nssm:duck_beak', ''}, - {'nssm:duck_feather', 'nssm:energy_globe', 'nssm:duck_feather'}, - {'nssm:duck_legs', 'nssm:duck_feather', 'nssm:duck_legs'}, - } -}) - -minetest.register_craft({ - output = 'nssm:flying_duck', - recipe = { - {'nssm:duck_feather', 'nssm:duck_beak', 'nssm:duck_feather'}, - {'nssm:duck_feather', 'nssm:energy_globe', 'nssm:duck_feather'}, - {'nssm:duck_legs', 'nssm:duck_feather', 'nssm:duck_legs'}, - } -}) - -minetest.register_craft({ - output = 'nssm:enderduck', - recipe = { - {'nssm:black_duck_feather', 'nssm:duck_beak', 'nssm:black_duck_feather'}, - {'nssm:duck_legs', 'nssm:energy_globe', 'nssm:duck_legs'}, - {'nssm:duck_legs', '', 'nssm:duck_legs'}, - } -}) - -minetest.register_craft({ - output = 'nssm:swimming_duck', - recipe = { - {'nssm:duck_feather', 'nssm:duck_beak', 'nssm:duck_feather'}, - {'nssm:duck_legs', 'nssm:energy_globe', 'nssm:duck_legs'}, - {'nssm:duck_feather', 'nssm:duck_feather', 'nssm:duck_feather'}, - } -}) - -minetest.register_craft({ - output = 'nssm:spiderduck', - recipe = { - {'nssm:duck_legs', 'nssm:duck_beak', 'nssm:duck_legs'}, - {'nssm:black_duck_feather', 'nssm:energy_globe', 'nssm:black_duck_feather'}, - {'nssm:duck_legs', 'nssm:black_duck_feather', 'nssm:duck_legs'}, - } -}) - -minetest.register_craft({ - output = 'nssm:duckking_egg', - recipe = { - {'', 'nssm:helmet_crown', ''}, - {'nssm:duck_feather', 'nssm:duck_beak', 'nssm:duck_feather'}, - {'nssm:duck_legs', 'nssm:superior_energy_globe', 'nssm:duck_legs'}, - } -}) - -minetest.register_craft({ - output = 'nssm:bloco', - recipe = { - {'nssm:bloco_skin', 'nssm:bloco_skin', 'nssm:bloco_skin'}, - {'nssm:bloco_skin', 'nssm:energy_globe', 'nssm:bloco_skin'}, - {'nssm:bloco_skin', 'nssm:bloco_skin', 'nssm:bloco_skin'}, - } -}) +--non eatable craftitems + +local function nssm_craftitem (name, descr) + + minetest.register_craftitem("nssm:"..name, { + description = descr, + image = name..".png", + }) +end + +nssm_craftitem ('sky_feather','Sky Feather') +nssm_craftitem ('snake_scute','Snake Scute') +nssm_craftitem ('eyed_tentacle','Eyed Tentacle') +--nssm_craftitem ('king_duck_crown','King Duck Crown') +nssm_craftitem ('great_energy_globe','Great Energy Globe') +nssm_craftitem ('superior_energy_globe','Superior Energy Globe') +nssm_craftitem ('ant_queen_abdomen','Ant Queen Abdomen') +--nssm_craftitem ('masticone_skull','Masticone Skull') +nssm_craftitem ('masticone_skull_fragments','Masticone Skull Fragments') +--nssm_craftitem ('masticone_skull_crowned','Masticone Skull Crowned') +nssm_craftitem ('tentacle_curly','Kraken Tentacle') +nssm_craftitem ('lava_titan_eye','Lava Titan Eye') +nssm_craftitem ('duck_beak','Duck Beak') +nssm_craftitem ('ice_tooth','Ice Tooth') +nssm_craftitem ('little_ice_tooth','Little Ice Tooth') +nssm_craftitem ('digested_sand',"Digested Sand") +nssm_craftitem ('black_ice_tooth','Black Ice Tooth') +nssm_craftitem ('tarantula_chelicerae','Tarantula Chelicerae') +nssm_craftitem ('crab_chela','Crab Chela') +nssm_craftitem ('cursed_pumpkin_seed','Cursed Pumpkin Seed') +nssm_craftitem ('mantis_claw','Mantis Claw') +nssm_craftitem ('manticore_fur','Manticore Fur') +nssm_craftitem ('ant_hard_skin','Ant Hard Skin') +nssm_craftitem ('bloco_skin','Bloco Skin') +nssm_craftitem ('crab_carapace_fragment','Crab Carapace Fragment') +nssm_craftitem ('crocodile_skin','Crocodile Skin') +nssm_craftitem ('manticore_spine','Manticore Spine') +nssm_craftitem ('night_feather','Night Feather') +nssm_craftitem ('sun_feather','Sun Feather') +nssm_craftitem ('duck_feather','Duck Feather') +nssm_craftitem ('black_duck_feather','Black Duck Feather') +nssm_craftitem ('masticone_fang','Masticone Fang') +nssm_craftitem ('white_wolf_fur','White Wolf Fur') +nssm_craftitem ('stoneater_mandible','Stoneater Mandible') +nssm_craftitem ('ant_mandible','Ant Mandible') +nssm_craftitem ('life_energy','Life Energy') +nssm_craftitem ('wolf_fur','Wolf Fur') +nssm_craftitem ('felucco_fur','Felucco Fur') +nssm_craftitem ('felucco_horn','Felucco Horn') +nssm_craftitem ('energy_globe','Energy Globe') +nssm_craftitem ('greedy_soul_fragment','Greedy Soul Fragment') +nssm_craftitem ('lustful_soul_fragment','Lustful Soul Fragment') +nssm_craftitem ('wrathful_soul_fragment','Wrathful Soul Fragment') +nssm_craftitem ('proud_soul_fragment','Proud Soul Fragment') +nssm_craftitem ('slothful_soul_fragment','Slothful Soul Fragment') +nssm_craftitem ('envious_soul_fragment','Envious Soul Fragment') +nssm_craftitem ('gluttonous_soul_fragment','Gluttonous Soul Fragment') +nssm_craftitem ('gluttonous_moranga','Gluttonous Moranga') +nssm_craftitem ('envious_moranga','Envious Moranga') +nssm_craftitem ('proud_moranga','Proud Moranga') +nssm_craftitem ('slothful_moranga','Slothful Moranga') +nssm_craftitem ('lustful_moranga','Lustful Moranga') +nssm_craftitem ('wrathful_moranga','Wrathful Moranga') +nssm_craftitem ('greedy_moranga','Greedy Moranga') +nssm_craftitem ('mantis_skin','Mantis_skin') +nssm_craftitem ('sand_bloco_skin','Sand Bloco Skin') +nssm_craftitem ('sandworm_skin','Sandworm Skin') +nssm_craftitem ('sky_iron','Sky Iron') +nssm_craftitem ('web_string','Cobweb String') +nssm_craftitem ('dense_web_string','Dense Cobweb String') +nssm_craftitem ('black_powder','Black Powder') +nssm_craftitem ('morelentir_dust','Dark Starred Stone Dust') +nssm_craftitem ('empty_evocation_bomb','Empty Evocation Bomb') + + +local function nssm_craftitem_eat (name, descr, gnam) + + minetest.register_craftitem("nssm:"..name, { + description = descr, + image =name..".png", + on_use = minetest.item_eat(gnam), + groups = { meat=1, eatable=1 }, + }) +end + +nssm_craftitem_eat ('werewolf_leg','Werewolf Leg',3) +nssm_craftitem_eat ('felucco_steak','Felucco Steak',3) +nssm_craftitem_eat ('roasted_felucco_steak','Roasted Felucco Steak',6) +nssm_craftitem_eat ('heron_leg','Moonheron Leg',2) +nssm_craftitem_eat ('chichibios_heron_leg',"Chichibio's Moonheron Leg",4) +nssm_craftitem_eat ('crocodile_tail','Crocodile Tail',3) +nssm_craftitem_eat ('roasted_crocodile_tail','Roasted Crocodile Tail',6) +nssm_craftitem_eat ('roasted_werewolf_leg','Roasted_Werewolf Leg',6) +nssm_craftitem_eat ('duck_legs','Duck Legs',1) +nssm_craftitem_eat ('roasted_duck_legs','Roasted Duck Leg',3) +nssm_craftitem_eat ('ant_leg','Ant Leg',-1) +nssm_craftitem_eat ('roasted_ant_leg','Roasted Ant Leg',4) +nssm_craftitem_eat ('spider_leg','Spider Leg',-1) +nssm_craftitem_eat ('roasted_spider_leg','Roasted Spider Leg',4) +--nssm_craftitem_eat ('brain','Brain',3) +--nssm_craftitem_eat ('roasted_brain','Roasted Brain',8) +nssm_craftitem_eat ('tentacle','Tentacle',2) +nssm_craftitem_eat ('roasted_tentacle','Roasted Tentacle',5) +nssm_craftitem_eat ('worm_flesh','Worm Flesh',-2) +nssm_craftitem_eat ('roasted_worm_flesh','Roasted Worm Flesh',4) +nssm_craftitem_eat ('amphibian_heart','Amphibian Heart',1) +nssm_craftitem_eat ('roasted_amphibian_heart','Roasted Amphibian Heart',8) +nssm_craftitem_eat ('raw_scrausics_wing','Raw Scrausics Wing',1) +nssm_craftitem_eat ('spicy_scrausics_wing','Spicy Scrausics Wing',6) +nssm_craftitem_eat ('phoenix_nuggets','Phoenix Nuggets',20) +nssm_craftitem_eat ('phoenix_tear','Phoenix Tear',20) +nssm_craftitem_eat ('frosted_amphibian_heart','Frosted Amphibian Heart',-1) +nssm_craftitem_eat ('surimi','Surimi',4) +nssm_craftitem_eat ('amphibian_ribs','Amphibian Ribs',2) +nssm_craftitem_eat ('roasted_amphibian_ribs','Roasted Amphibian Ribs',6) +nssm_craftitem_eat ('dolidrosaurus_fin','Dolidrosaurus Fin',-2) +nssm_craftitem_eat ('roasted_dolidrosaurus_fin','Roasted Dolidrosaurus Fin',4) +nssm_craftitem_eat ('larva_meat','Larva Meat',-1) +nssm_craftitem_eat ('larva_juice','Larva Juice',-3) +nssm_craftitem_eat ('larva_soup','Larva Soup',10) +nssm_craftitem_eat ('mantis_meat','Mantis Meat',1) +nssm_craftitem_eat ('roasted_mantis_meat','Roasted Mantis Meat',4) +nssm_craftitem_eat ('spider_meat','Spider Meat',-1) +nssm_craftitem_eat ('roasted_spider_meat','Roasted Spider Meat',3) +nssm_craftitem_eat ('silk_gland','Silk Gland',-1) +nssm_craftitem_eat ('roasted_silk_gland','Roasted Silk Gland',3) +nssm_craftitem_eat ('super_silk_gland','Super Silk Gland',-8) +nssm_craftitem_eat ('roasted_super_silk_gland','Roasted Super Silk Gland',2) + +--ore generation + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:modders_block", + wherein = "default:stone", + clust_scarcity = 50*50*50, + clust_num_ores = 1, + clust_size = 1, + y_min = -115, + y_max = -95, +}) + +for i = 1, 9 do + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:ant_dirt", + wherein = "default:cobble", + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 1, + y_min = -1, + y_max = 40, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:ant_dirt", + wherein = "default:mossycobble", + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 1, + y_min = -1000, + y_max = 40, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:ant_dirt", + wherein = "default:sandstonebrick", + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 1, + y_min = -1000, + y_max = 40, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:ant_dirt", + wherein = "stairs:stair_sandstonebrick", + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 1, + y_min = -1000, + y_max = 40, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:ant_dirt", + wherein = "stairs:stair_cobble", + clust_scarcity = 1, + clust_num_ores = 1, + clust_size = 1, + y_min = -1000, + y_max = 40, +}) + +end -- END for loop + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:web", + wherein = "default:junglegrass", + clust_scarcity = 2*2*2, + clust_num_ores = 2, + clust_size = 2, + y_min = -20, + y_max = 200, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "nssm:web", + wherein = "default:jungleleaves", + clust_scarcity = 4*4*4, + clust_num_ores = 5, + clust_size = 5, + y_min = -20, + y_max = 200, +}) + +--nodes + +minetest.register_node("nssm:ant_dirt", { + description = "Ant Dirt", + tiles = {"ant_dirt.png"}, + groups = {crumbly=3}, +}) + +minetest.register_node("nssm:dead_leaves", { + description = "Dead leaves", + tiles = {"dead_leaves.png"}, + groups = {snappy=3,leaves=1}, +}) + +minetest.register_node("nssm:invisible_light", { + description = "Invisible light source", + tiles = {"transparent.png"}, + paramtype = "light", + drawtype = "airlike", + walkable = false, + sunlight_propagates = true, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + groups = {unbreakable=1}, + drop = "", + light_source = 14, +}) + +minetest.register_node("nssm:venomous_gas", { + description = "Venomous Gas", + inventory_image = minetest.inventorycube("venomous_gas.png"), + drawtype = "airlike", + tiles = { + {name="venomous_gas_animated.png", + animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}} + }, + paramtype = "light", + walkable = false, + sunlight_propagates = true, + pointable = false, + diggable = false, + buildable_to = true, + drop = "", + drowning = 1, + damage_per_second = 1, + post_effect_color = {a=100, r=1, g=100, b=1}, + groups = {flammable = 2}, +}) + +minetest.register_node("nssm:modders_block", { + description = "Modders Block", + tiles = {"modders_block.png"}, + is_ground_content = true, + groups = {crumbly=3, not_in_creative_inventory =1}, +}) + +minetest.register_node("nssm:web", { + description = "Web", + inventory_image = "web.png", + tiles = {"web.png"} , + drawtype = "plantlike", + paramtype = "light", + walkable = false, + pointable = true, + diggable = true, + buildable_to = false, + drop = "", + drowning = 0, + liquid_renewable = false, + liquidtype = "source", + liquid_range= 0, + liquid_alternative_flowing = "nssm:web", + liquid_alternative_source = "nssm:web", + liquid_viscosity = 20, + groups = {flammable=2, snappy=1, liquid=1}, +}) + +minetest.register_node("nssm:thick_web", { + description = "Thick Web", + inventory_image = "thick_web.png", + tiles = {"thick_web.png"} , + drawtype = "firelike", + paramtype = "light", + walkable = false, + pointable = true, + diggable = true, + buildable_to = false, + drop = "", + drowning = 2, + liquid_renewable = false, + liquidtype = "source", + liquid_range= 0, + liquid_alternative_flowing = "nssm:thick_web", + liquid_alternative_source = "nssm:thick_web", + liquid_viscosity = 30, + groups = {flammable=2, liquid=1}, +}) + +minetest.register_node("nssm:ink", { + description = "Ink", + inventory_image = minetest.inventorycube("ink.png"), + drawtype = "liquid", + tiles = { + { + name = "ink_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + }, + }, + --alpha = 420, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + liquid_range= 0, + drowning = 1, + liquid_renewable = false, + liquidtype = "source", + liquid_alternative_flowing = "nssm:ink", + liquid_alternative_source = "nssm:ink", + liquid_viscosity = 1, + post_effect_color = {a=2000, r=30, g=30, b=30}, + groups = {water=3, liquid=3, puts_out_fire=1}, +}) + +minetest.register_node("nssm:mese_meteor", { + description = "Mese Meteor", + tiles = {"mese_meteor.png"} , + paramtype = "light", + drop = "", + groups = {crumbly=1, falling_node=1, flammable = 2}, +}) + +minetest.register_node("nssm:pumpbomb", { + tiles = {"pumpbomb_top.png","pumpbomb_bottom.png", "pumpbomb_side.png", "pumpbomb_side.png", "pumpbomb_side.png", "pumpbomb_front.png"}, + light_source = 5, + groups = {not_in_creative_inventory =1}, + drop = "", + on_timer = function(pos, elapsed) + tnt_boom_nssm(pos, {damage_radius=4,radius=3,ignore_protection=false}) + minetest.set_node(pos, {name="air"}) + end, +}) + +--abms + +minetest.register_abm({ + nodenames = {"nssm:mese_meteor"}, + neighbors = {"air"}, + interval = 2, -- 1 + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + + if minetest.is_protected(pos, "") then + return + end + + minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name = "fire:basic_flame"}) + minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name = "fire:basic_flame"}) + minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name = "fire:basic_flame"}) + minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name = "fire:basic_flame"}) + minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "fire:basic_flame"}) + end +}) + +--[[ These don't actually do anything +minetest.register_abm({ + nodenames = {"nssm:web"}, + neighbors = {"default:junglegrass"}, + interval = 20.0, + chance = 20, + action = function(pos, node, active_object_count, active_object_count_wider) + local n = minetest.get_node(pos).name + if n== "air" then + minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "nssm:web"}) + end + end +}) + +minetest.register_abm({ + nodenames = {"nssm:web"}, + neighbors = {"default:junglegrass"}, + interval = 20.0, + chance = 20, + action = function(pos, node, active_object_count, active_object_count_wider) + local n = minetest.get_node(pos).name + if n== "air" then + minetest.set_node({x = pos.x + 1, y = pos.y, z = pos.z}, {name = "nssm:web"}) + end + end +}) + +minetest.register_abm({ + nodenames = {"nssm:web"}, + neighbors = {"default:junglegrass"}, + interval = 20.0, + chance = 20, + action = function(pos, node, active_object_count, active_object_count_wider) + local n = minetest.get_node(pos).name + if n== "air" then + minetest.set_node({x = pos.x - 1, y = pos.y, z = pos.z}, {name = "nssm:web"}) + end + end +}) +]] + +minetest.register_node("nssm:phoenix_fire", { + description = "Phoenix Fire", + drawtype = "firelike", + tiles = {{ + name = "phoenix_fire_animated.png", + animation = {type = "vertical_frames", + aspect_w = 16, aspect_h = 16, length = 1}, + }}, + inventory_image = "phoenix_fire.png", + light_source = 14, + groups = {igniter = 1, snappy=1}, + drop = '', + walkable = false, + buildable_to = false, + damage_per_second = 4, +}) + +minetest.register_abm({ + nodenames = {"nssm:phoenix_fire"}, + neighbors = {"air"}, + interval = 3, + chance = 2, + action = function(pos, node) + minetest.set_node({x = pos.x, y = pos.y , z = pos.z}, {name = "air"}) + end +}) + +minetest.register_abm({ + nodenames = {"nssm:dead_leaves"}, + neighbors = {"air"}, + interval = 15, + chance = 3, + action = function(pos, node) + minetest.set_node({x = pos.x, y = pos.y , z = pos.z}, {name = "air"}) + end +}) + +--tools + +minetest.register_tool('nssm:sun_sword', { + description = 'Sun Sword', + inventory_image = 'sun_sword.png', + tool_capabilities = { + full_punch_interval = 0.6, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.80, [2]=0.40, [3]=0.20}, uses=70, maxlevel=1}, + fleshy={times={[2]=0.6, [3]=0.2}, uses=70, maxlevel=1} + }, + damage_groups = {fleshy=10}, + }, + minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) + + if puncher:get_wielded_item():get_name() == 'nssm:sun_sword' then + + if node.name ~= "air" and not minetest.is_protected(pos, "") then + minetest.add_node(pointed_thing.above, {name = "fire:basic_flame"}) + end + end + end) +}) + +minetest.register_tool("nssm:masticone_fang_sword", { + description = "Masticone Fang Sword", + inventory_image = "masticone_fang_sword.png", + tool_capabilities = { + full_punch_interval =0.7 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=200, maxlevel=1}, + fleshy={times={[2]=0.8, [3]=0.4}, uses=200, maxlevel=1} + }, + damage_groups = {fleshy=8}, + }, +}) + +minetest.register_tool("nssm:night_sword", { + description = "Night Sword", + inventory_image = "night_sword.png", + tool_capabilities = { + full_punch_interval =0.4 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.4, [2]=0.3, [3]=0.2}, uses=300, maxlevel=1}, + fleshy={times={[2]=0.7, [3]=0.3}, uses=300, maxlevel=1} + }, + damage_groups = {fleshy=12}, + }, +}) + +minetest.register_tool("nssm:crab_light_mace", { + description = "Light Crab Mace", + inventory_image = "crab_light_mace.png", + tool_capabilities = { + full_punch_interval =2 , + max_drop_level=1, + groupcaps={ + fleshy={times={[2]=1.4, [3]=1}, uses=20, maxlevel=1} + }, + damage_groups = {fleshy=8}, + }, +}) + +minetest.register_tool("nssm:crab_heavy_mace", { + description = "Heavy Crab Mace", + inventory_image = "crab_heavy_mace.png", + tool_capabilities = { + full_punch_interval =4 , + max_drop_level=1, + groupcaps={ + fleshy={times={[2]=2, [3]=1.4}, uses=20, maxlevel=1} + }, + damage_groups = {fleshy=12}, + }, +}) + +minetest.register_tool("nssm:mantis_battleaxe", { + description = "Mantis Battleaxe", + inventory_image = "mantis_battleaxe.png", + tool_capabilities = { + full_punch_interval =3 , + max_drop_level=1, + groupcaps={ + fleshy={times={[2]=2, [3]=1.4}, uses=20, maxlevel=1} + }, + damage_groups = {fleshy=10}, + }, +}) + +minetest.register_node("nssm:rope", { + description = "Rope", + paramtype = "light", + walkable = false, + climbable = true, + sunlight_propagates = true, + drawtype = "plantlike", + drops = "nssm:rope", + tiles = { "rope.png" }, + groups = {snappy=1}, +}) + +minetest.register_tool("nssm:stoneater_pick", { + description = "Stoneater Pickaxe", + inventory_image = "stoneater_pick.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=0, + groupcaps={ + cracky = {times={[3]=0.0}, uses=200, maxlevel=1}, + }, + damage_groups = {fleshy=5}, + }, +}) + +minetest.register_tool("nssm:mantis_sword", { + description = "Mantis Sword", + inventory_image = "mantis_sword.png", + tool_capabilities = { + full_punch_interval =0.7 , + max_drop_level=1, + groupcaps={ + fleshy={times={[2]=1.0, [3]=0.4}, uses=30, maxlevel=1}, + snappy={times={[2]=0.80, [3]=0.3}, uses=40, maxlevel=1}, + }, + damage_groups = {fleshy=7}, + }, +}) + +minetest.register_tool("nssm:little_ice_tooth_knife", { + description = "Little Ice Tooth Knife", + inventory_image = "little_ice_tooth_knife.png", + tool_capabilities = { + full_punch_interval =0.3 , + max_drop_level=1, + groupcaps={ + fleshy={times={[2]=1.0, [3]=0.4}, uses=4, maxlevel=1}, + snappy={times={[2]=0.80, [3]=0.3}, uses=7, maxlevel=1}, + }, + damage_groups = {fleshy=5}, + }, +}) + +minetest.register_tool("nssm:manticore_spine_knife", { + description = "Manticore Spine Knife", + inventory_image = "manticore_spine_knife.png", + tool_capabilities = { + full_punch_interval =0.4 , + max_drop_level=1, + groupcaps={ + fleshy={times={[2]=1.0, [3]=0.4}, uses=6, maxlevel=1}, + snappy={times={[2]=0.80, [3]=0.3}, uses=6, maxlevel=1}, + }, + damage_groups = {fleshy=6}, + }, +}) + +minetest.register_tool("nssm:felucco_knife", { + description = "Felucco Knife", + inventory_image = "felucco_knife.png", + tool_capabilities = { + full_punch_interval =0.4 , + max_drop_level=1, + groupcaps={ + fleshy={times={[2]=1.0, [3]=0.4}, uses=6, maxlevel=1}, + snappy={times={[2]=0.80, [3]=0.3}, uses=6, maxlevel=1}, + }, + damage_groups = {fleshy=6}, + }, +}) + +if minetest.get_modpath("farming") then + + farming.register_hoe(":farming:felucco_hoe", { + description = "Felucco Hoe", + inventory_image = "felucco_hoe.png", + max_uses = 290, + material = "nssm:felucco_horn" + }) + + farming.register_hoe(":farming:ant_hoe", { + description = "Ant Hoe", + inventory_image = "ant_hoe.png", + max_uses = 350, + material = "nssm:ant_mandible" + }) +end + +minetest.register_tool("nssm:ant_sword", { + description = "Ant Sword", + inventory_image = "ant_sword.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.30, [2]=0.90, [3]=0.40}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=8}, + }, +}) + +minetest.register_tool("nssm:ant_shovel", { + description = "Ant Shovel", + inventory_image = "ant_shovel.png", + wield_image = "ant_shovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=35, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) + +minetest.register_tool("nssm:duck_beak_shovel", { + description = "Duck Beak Shovel", + inventory_image = "duck_beak_shovel.png", + wield_image = "duck_beak_shovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 0.6, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.10, [2]=0.80, [3]=0.20}, uses=5, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) + +minetest.register_tool("nssm:mantis_axe", { + description = "Mantis Axe", + inventory_image = "mantis_axe.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) + +minetest.register_tool("nssm:ant_billhook", { + description = "Ant Billhook", + inventory_image = "ant_billhook.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=1.40, [2]=1.00, [3]=0.60}, uses=30, maxlevel=3}, + snappy={times={[1]=1.40, [2]=1.00, [3]=0.60}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=6}, + }, +}) + +minetest.register_tool("nssm:duck_beak_pick",{ + description = "Duck Beak Pickaxe", + inventory_image = "duck_beak_pick.png", + tool_capabilities = { + full_punch_interval = 0.6, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=1.0, [2]=0.8, [3]=0.20}, uses=3, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) + +minetest.register_tool("nssm:ant_pick", { + description = "Ant Pickaxe", + inventory_image = "ant_pick.png", + tool_capabilities = { + full_punch_interval = 1.2, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=2.00, [2]=1.20, [3]=0.80}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) + +minetest.register_tool("nssm:mantis_pick", { + description = "Mantis Pickaxe", + inventory_image = "mantis_pick.png", + tool_capabilities = { + full_punch_interval = 1, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=1.6, [2]=1.0, [3]=0.60}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) + +minetest.register_tool("nssm:tarantula_warhammer", { + description = "Tarantula Warhammer", + inventory_image = "tarantula_warhammer.png", + wield_scale= {x=2,y=2,z=1.5}, + tool_capabilities = { + full_punch_interval =1, + max_drop_level=1, + groupcaps={ + cracky={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=80, maxlevel=1}, + fleshy={times={[2]=0.8, [3]=0.4}, uses=200, maxlevel=1} + }, + damage_groups = {fleshy=13}, + }, +}) + +minetest.register_tool("nssm:axe_of_pride", { + description = "Axe of Pride", + inventory_image = "axe_of_pride.png", + wield_scale= {x=2,y=2,z=1.5}, + tool_capabilities = { + full_punch_interval =1.3 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, + fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} + }, + damage_groups = {fleshy=16}, + }, + on_drop = function(itemstack, dropper, pos) + + local objects = minetest.get_objects_inside_radius(pos, 10) + local flag = 0 + local part = 0 + + for _,obj in ipairs(objects) do + + part = 0 + + if flag == 0 then + + local pname = dropper:get_player_name() + local player_inv = minetest.get_inventory({type='player', name = pname}) + + if player_inv:is_empty('main') then + --minetest.chat_send_all("Inventory empty") + else + local found = 0 + + for i = 1,32 do + + local items = player_inv:get_stack('main', i) + local n = items:get_name() + + if n == "nssm:energy_globe" then + found = i + break + end + end + + if found == 0 then + + minetest.chat_send_player(pname, "You haven't got any Energy Globe!") + + return + else + if (obj:is_player()) then + + --minetest.chat_send_all("Giocatore") + if (obj:get_player_name()~=dropper:get_player_name()) then + + obj:set_hp(obj:get_hp() - 10) + + dropper:set_hp(dropper:get_hp() + 10) + --flag = 1 + + local items = player_inv:get_stack('main', found) + + items:take_item() + + player_inv:set_stack('main', found, items) + + part = 1 + end + else + if (obj:get_luaentity().health) then + + --minetest.chat_send_all("Entity") + obj:get_luaentity().health = obj:get_luaentity().health -10 +-- check_for_death(obj:get_luaentity()) + + dropper:set_hp(dropper:get_hp()+10) + --flag = 1 + + local items = player_inv:get_stack('main', found) + + items:take_item() + + player_inv:set_stack('main', found, items) + + part = 1 + end + end + + if part == 1 then + + local s = dropper:get_pos() + local p = obj:get_pos() + local m = 2 + + minetest.add_particlespawner( + 3, --amount + 0.1, --time + {x=p.x-0.5, y=p.y-0.5, z=p.z-0.5}, --minpos + {x=p.x+0.5, y=p.y+0.5, z=p.z+0.5}, --maxpos + {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --minvel + {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --maxvel + {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --minacc + {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --maxacc + 0.5, --minexptime + 1, --maxexptime + 3, --minsize + 4, --maxsize + false, --collisiondetection + "heart.png" --texture + ) + end + end + end + end + end + end, +}) + +minetest.register_tool("nssm:gratuitousness_battleaxe", { + description = "Gratuitousness Battleaxe", + inventory_image = "gratuitousness_battleaxe.png", + wield_scale= {x=2.2,y=2.2,z=1.5}, + tool_capabilities = { + full_punch_interval =1.6 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, + fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} + }, + damage_groups = {fleshy=18}, + }, + on_drop = function(itemstack, dropper, pos) + + local objects = minetest.get_objects_inside_radius(pos, 10) + local flag = 0 + local vec = dropper:get_look_dir() + local pos = dropper:get_pos() + --vec.y = 0 + + for i = 1, 10 do + pos = vector.add(pos, vec) + end + + local pname = dropper:get_player_name() + local player_inv = minetest.get_inventory({type='player', name = pname}) + local found = 0 + + for i = 1, 32 do + local items = player_inv:get_stack('main', i) + local n = items:get_name() + + if n == "nssm:energy_globe" then + found = i + break + end + end + + if found == 0 then + minetest.chat_send_player(pname, "You haven't got any Energy Globe!") + return + else + local items = player_inv:get_stack('main', found) + + items:take_item() + + player_inv:set_stack('main', found, items) + + tnt.boom(pos, {damage_radius=5,radius=4,ignore_protection=false}) + end + end, +}) + +minetest.register_tool("nssm:sword_of_eagerness", { + description = "Sword of Eagerness", + inventory_image = "sword_of_eagerness.png", + wield_scale= {x=2,y=2,z=1}, + tool_capabilities = { + full_punch_interval =0.7 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, + fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} + }, + damage_groups = {fleshy=14}, + }, + on_drop = function(itemstack, dropper, pos) + + local objects = minetest.get_objects_inside_radius(pos, 10) + local flag = 0 + + for _,obj in ipairs(objects) do + + local part = 0 + + if flag == 0 then + + local pname = dropper:get_player_name() + local player_inv = minetest.get_inventory({type='player', name = pname}) + + if player_inv:is_empty('main') then + --minetest.chat_send_all("Inventory empty") + else + local found = 0 + + for i = 1,32 do + + local items = player_inv:get_stack('main', i) + local n = items:get_name() + + if n == "nssm:energy_globe" then + found = i + break + end + end + + if found == 0 then + minetest.chat_send_player(pname, "You haven't got any Energy Globe!") + return + else + local pos = obj:get_pos() + + pos.y = pos.y + 15 + + if (obj:is_player()) then + + if (obj:get_player_name()~=dropper:get_player_name()) then + + part=1 + + obj:set_pos(pos) + --flag = 1 + + local items = player_inv:get_stack('main', found) + items:take_item() + player_inv:set_stack('main', found, items) + end + else + if (obj:get_luaentity().health) then + obj:get_luaentity().old_y = pos.y + obj:set_pos(pos) + part=1 + --flag = 1 + + local items = player_inv:get_stack('main', found) + + items:take_item() + + player_inv:set_stack('main', found, items) + end + end + + if part==1 then + + local s = pos + + s.y = s.y - 15 + + minetest.add_particlespawner( + 25, --amount + 0.3, --time + vector.subtract(s, 0.5), --minpos + vector.add(s, 0.5), --maxpos + {x=0, y=10, z=0}, --minvel + {x=0.1, y=11, z=0.1}, --maxvel + {x=0,y=1,z=0}, --minacc + {x=0,y=1,z=0}, --maxacc + 0.5, --minexptime + 1, --maxexptime + 1, --minsize + 2, --maxsize + false, --collisiondetection + "slothful_soul_fragment.png" --texture + ) + end + end + end + end + end + end, +}) + +minetest.register_tool("nssm:falchion_of_eagerness", { + description = "Falchion of Eagerness", + inventory_image = "falchion_of_eagerness.png", + wield_scale= {x=2,y=2,z=1}, + tool_capabilities = { + full_punch_interval =1 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, + fleshy={times={[2]=0.8, [3]=0.4}, uses=400, maxlevel=1} + }, + damage_groups = {fleshy=16}, + }, + on_drop = function(itemstack, dropper, pos) + local vec = dropper:get_look_dir() + local pos = dropper:get_pos() + --vec.y = 0 + + for i=1,16 do + pos = vector.add(pos, vec) + end + + local pname = dropper:get_player_name() + local player_inv = minetest.get_inventory({type='player', name = pname}) + + if player_inv:is_empty('main') then + --minetest.chat_send_all("Inventory empty") + else + local found = 0 + for i = 1,32 do + local items = player_inv:get_stack('main', i) + local n = items:get_name() + if n == "nssm:life_energy" then + if items:get_count() >= 5 then + found = i + break + end + end + end + if found == 0 then + minetest.chat_send_player(pname, "You haven't got enough life_energy!") + return + else + local s = dropper:get_pos() + minetest.add_particlespawner( + 25, --amount + 0.3, --time + vector.subtract(s, 0.5), --minpos + vector.add(s, 0.5), --maxpos + {x=0, y=10, z=0}, --minvel + {x=0.1, y=11, z=0.1}, --maxvel + {x=0,y=1,z=0}, --minacc + {x=0,y=1,z=0}, --maxacc + 0.5, --minexptime + 1, --maxexptime + 1, --minsize + 2, --maxsize + false, --collisiondetection + "slothful_soul_fragment.png" --texture + ) + minetest.remove_node(pos) + pos.y=pos.y+1 + minetest.remove_node(pos) + pos.y=pos.y-2 + minetest.remove_node(pos) + dropper:set_pos(pos) + s = pos + s.y = s.y+10 + minetest.add_particlespawner( + 25, --amount + 0.3, --time + vector.subtract(s, 0.5), --minpos + vector.add(s, 0.5), --maxpos + {x=0, y=-10, z=0}, --minvel + {x=0.1, y=-11, z=0.1}, --maxvel + {x=0,y=-1,z=0}, --minacc + {x=0,y=-1,z=0}, --maxacc + 0.5, --minexptime + 1, --maxexptime + 1, --minsize + 2, --maxsize + false, --collisiondetection + "slothful_soul_fragment.png" --texture + ) + local items = player_inv:get_stack('main', found) + items:set_count(items:get_count()-5) + player_inv:set_stack('main', found, items) + end + end + end, +}) + +minetest.register_tool("nssm:sword_of_envy", { + description = "Sword of Envy", + inventory_image = "sword_of_envy.png", + wield_scale= {x=2,y=2,z=1}, + tool_capabilities = { + full_punch_interval =0.9 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.6, [2]=0.5, [3]=0.4}, uses=100, maxlevel=1}, + fleshy={times={[2]=0.5, [3]=0.2}, uses=400, maxlevel=1} + }, + damage_groups = {fleshy=14}, + }, + on_drop = function(itemstack, dropper, pos) + local objects = minetest.get_objects_inside_radius(pos, 10) + local flag = 0 + for _,obj in ipairs(objects) do + if flag == 0 then + local pname = dropper:get_player_name() + local player_inv = minetest.get_inventory({type='player', name = pname}) + + if player_inv:is_empty('main') then + --minetest.chat_send_all("Inventory empty") + else + local found = 0 + for i = 1,32 do + local items = player_inv:get_stack('main', i) + local n = items:get_name() + if n == "nssm:energy_globe" then + found = i + break + end + end + if found == 0 then + minetest.chat_send_player(pname, "You haven't got any Energy Globe!") + return + else + if (obj:is_player()) then + --minetest.chat_send_all("Giocatore") + if (obj:get_player_name()~=dropper:get_player_name()) then + local hpp = obj:get_hp() + obj:set_hp(dropper:get_hp()) + dropper:set_hp(hpp) + flag = 1 + + local items = player_inv:get_stack('main', found) + items:take_item() + player_inv:set_stack('main', found, items) + end + else + if (obj:get_luaentity().health) then + local hpp = obj:get_luaentity().health + obj:get_luaentity().health = dropper:get_hp() + if hpp > 20 then + dropper:set_hp(20) + else + dropper:set_hp(hpp) + end +-- check_for_death(obj:get_luaentity()) + flag = 1 + + local items = player_inv:get_stack('main', found) + items:take_item() + player_inv:set_stack('main', found, items) + end + end + end + end + end + end + end, +}) + +minetest.register_tool("nssm:sword_of_gluttony", { + description = "Sword of Gluttony", + inventory_image = "sword_of_gluttony.png", + wield_scale= {x=2,y=2,z=1}, + tool_capabilities = { + full_punch_interval =1 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.9, [2]=0.7, [3]=0.4}, uses=100, maxlevel=1}, + fleshy={times={[2]=0.6, [3]=0.2}, uses=400, maxlevel=1} + }, + damage_groups = {fleshy=14}, + }, + on_drop = function(itemstack, dropper, pos) + local objects = minetest.get_objects_inside_radius(pos, 10) + local flag = 0 + for _,obj in ipairs(objects) do + if flag == 0 then + local pname = dropper:get_player_name() + local player_inv = minetest.get_inventory({type='player', name = pname}) + + if player_inv:is_empty('main') then + --minetest.chat_send_all("Inventory empty") + else + local found = 0 + for i = 1,32 do + local items = player_inv:get_stack('main', i) + local n = items:get_name() + if n == "nssm:energy_globe" then + found = i + break + end + end + if found == 0 then + minetest.chat_send_player(pname, "You haven't got any Energy Globe!") + return + else + if (obj:is_player()) then + if (obj:get_player_name()~=dropper:get_player_name()) then + obj:set_hp(obj:get_hp()-10) + --flag = 1 + + --take energy globe from inventory: + local items = player_inv:get_stack('main', found) + items:take_item() + player_inv:set_stack('main', found, items) + end + else + if (obj:get_luaentity().health) then + if obj:get_luaentity().health <= 32 then + local pos = obj:get_pos() + obj:remove() + + --check_for_death(obj:get_luaentity()) + --flag = 1 + --take energy globe from inventory: + local items = player_inv:get_stack('main', found) + items:take_item() + player_inv:set_stack('main', found, items) + + for i = 1,math.random(1,4) do + drop = minetest.add_item(pos, "nssm:roasted_duck_legs 1") + drops(drop) + end + + local s = obj:get_pos() + local p = dropper:get_pos() + local m = 3 + + minetest.add_particlespawner( + 10, --amount + 0.1, --time + {x=p.x-0.5, y=p.y-0.5, z=p.z-0.5}, --minpos + {x=p.x+0.5, y=p.y+0.5, z=p.z+0.5}, --maxpos + {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --minvel + {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m}, --maxvel + {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --minacc + {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}, --maxacc + 0.5, --minexptime + 1, --maxexptime + 1, --minsize + 2, --maxsize + false, --collisiondetection + "gluttonous_soul_fragment.png" --texture + ) + end + end + end + end + end + end + end + end, +}) + +minetest.register_tool("nssm:death_scythe", { + description = "Death Scythe", + wield_scale= {x=3,y=3,z=1.3}, + inventory_image = "death_scythe.png", + tool_capabilities = { + full_punch_interval =0.2 , + max_drop_level=1, + groupcaps={ + snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=28000, maxlevel=1}, + fleshy={times={[2]=0.1, [3]=0.1}, uses=28000, maxlevel=1} + }, + damage_groups = {fleshy=28}, + }, + groups ={not_in_creative_inventory=1}, + on_drop = function(itemstack, dropper, pos) + local objects = minetest.get_objects_inside_radius(pos, 10) + local flag = 0 + dropper:set_hp(dropper:get_hp()-9) + for _,obj in ipairs(objects) do + flag = 0 + if (obj:is_player()) then + if (obj:get_player_name()~=dropper:get_player_name()) then + obj:set_hp(obj:get_hp()-40) + flag = 1 + end + else + if (obj:get_luaentity().health) then + obj:get_luaentity().health = obj:get_luaentity().health -40 +-- check_for_death(obj:get_luaentity()) + flag = 1 + end + end + if flag == 1 then + for i = 1,math.random(1,2) do + drop = minetest.add_item(pos, "nssm:energy_globe 1") + + if drop then + drop:set_velocity({ + x = math.random(-10, 10) / 9, + y = 5, + z = math.random(-10, 10) / 9, + }) + end + end + end + end + local pos = dropper:get_pos() + local vec = {x=5,y=5,z=5} + local poslist = minetest.find_nodes_in_area(vector.subtract(pos, vec), vector.add(pos,vec), "default:dirt_with_grass") + for _,v in pairs(poslist) do + --minetest.chat_send_all(minetest.pos_to_string(v)) + minetest.set_node(v, {name="default:dirt_with_dry_grass"}) + if math.random(1,3)==1 then + v.y = v.y +2 + drop = minetest.add_item(v, "nssm:life_energy 1") + drops(drop) + end + end + + local poslist = minetest.find_nodes_in_area_under_air(vector.subtract(pos, vec), vector.add(pos,vec), "group:flora") + for _,v in pairs(poslist) do + --minetest.chat_send_all(minetest.pos_to_string(v)) + minetest.set_node(v, {name="default:dry_shrub"}) + if math.random(1,3)==1 then + v.y = v.y +2 + drop = minetest.add_item(v, "nssm:life_energy 1") + drops(drop) + end + end + + local poslist = minetest.find_nodes_in_area(vector.subtract(pos, vec), vector.add(pos,vec), "group:leaves") + for _,v in pairs(poslist) do + --minetest.chat_send_all(minetest.pos_to_string(v)) + minetest.set_node(v, {name="nssm:dead_leaves"}) + if math.random(1,3)==1 then + v.y = v.y +2 + drop = minetest.add_item(v, "nssm:life_energy 1") + drops(drop) + end + end + end, +}) + +--recipes + +minetest.register_craft({ + output = 'nssm:web_string', + recipe = { + {'nssm:web', 'nssm:web'}, + {'nssm:web', 'nssm:web'}, + } +}) + +minetest.register_craft({ + output = 'nssm:dense_web_string', + recipe = { + {'nssm:web_string', 'nssm:web_string', 'nssm:web_string'}, + {'nssm:web_string', 'nssm:web_string', 'nssm:web_string'}, + {'nssm:web_string', 'nssm:web_string', 'nssm:web_string'}, + } +}) + +minetest.register_craft({ + output = 'nssm:mantis_sword', + recipe = { + {'nssm:mantis_claw'}, + {'nssm:mantis_claw'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:masticone_fang_sword', + recipe = { + {'nssm:masticone_fang', 'nssm:masticone_fang'}, + {'nssm:masticone_fang', ''}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'nssm:black_ice_tooth', + type = "shapeless", + recipe = {'nssm:digested_sand', 'nssm:ice_tooth'}, +}) + +minetest.register_craft({ + output = 'nssm:web 4', + type = "shapeless", + recipe = {'nssm:silk_gland'}, +}) + +minetest.register_craft({ + output = 'nssm:crab_light_mace', + recipe = { + {'nssm:crab_chela'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:crab_heavy_mace', + recipe = { + {'', 'nssm:crab_chela', ''}, + {'nssm:crab_chela', 'nssm:crab_chela', 'nssm:crab_chela'}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'nssm:energy_globe', + recipe = { + {'nssm:life_energy', 'nssm:life_energy', 'nssm:life_energy'}, + {'nssm:life_energy', 'nssm:life_energy', 'nssm:life_energy'}, + {'nssm:life_energy', 'nssm:life_energy', 'nssm:life_energy'}, + } +}) + +minetest.register_craft({ + output = 'nssm:great_energy_globe', + recipe = { + {'nssm:energy_globe', 'nssm:energy_globe', 'nssm:energy_globe'}, + {'nssm:energy_globe', 'nssm:energy_globe', 'nssm:energy_globe'}, + {'nssm:energy_globe', 'nssm:energy_globe', 'nssm:energy_globe'}, + } +}) + +minetest.register_craft({ + output = 'nssm:superior_energy_globe', + recipe = { + {'nssm:great_energy_globe', 'nssm:great_energy_globe', 'nssm:great_energy_globe'}, + {'nssm:great_energy_globe', 'nssm:great_energy_globe', 'nssm:great_energy_globe'}, + {'nssm:great_energy_globe', 'nssm:great_energy_globe', 'nssm:great_energy_globe'}, + } +}) + +minetest.register_craft({ + output = 'nssm:mese_egg', + type = "shapeless", + recipe = {'nssm:tarantula_chelicerae', 'nssm:helmet_masticone_crowned', 'nssm:eyed_tentacle','nssm:black_ice_tooth', 'nssm:superior_energy_globe', 'nssm:sky_feather','nssm:cursed_pumpkin_seed', 'nssm:ant_queen_abdomen', 'nssm:snake_scute'} +}) + +--[[minetest.register_craft({ + output = 'nssm:masticone_skull_crowned', + recipe = { + {'', 'nssm:king_duck_crown', ''}, + {'', 'nssm:masticone_skull', ''}, + {'', '', ''}, + } +})]] + +minetest.register_craft({ + output = 'nssm:eyed_tentacle', + type = "shapeless", + recipe = {'nssm:lava_titan_eye','nssm:tentacle_curly'} +}) + +minetest.register_craft({ + output = 'nssm:life_energy 9', + type = "shapeless", + recipe = {'nssm:energy_globe'} +}) + +minetest.register_craft({ + output = 'nssm:energy_globe 9', + type = "shapeless", + recipe = {'nssm:great_energy_globe'} +}) + +minetest.register_craft({ + output = 'nssm:great_energy_globe 9', + type = "shapeless", + recipe = {'nssm:superior_energy_globe'} +}) +--[[ +minetest.register_craft({ + output = 'nssm:masticone_skull', + 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'}, + } +})]] + +minetest.register_craft({ + output = 'nssm:rope 12', + recipe = { + {'nssm:web_string'}, + {'nssm:web_string'}, + {'nssm:web_string'}, + } +}) + + +minetest.register_craft({ + output = 'nssm:sky_feather', + type = "shapeless", + recipe = {'nssm:sun_feather','nssm:night_feather'} +}) + +minetest.register_craft({ + output = 'nssm:sun_sword', + recipe = { + {'default:diamond'}, + {'nssm:sun_feather'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:night_sword', + recipe = { + {'default:diamond'}, + {'nssm:night_feather'}, + {'group:stick'}, + } +}) + +function nssm_register_recip (ingredient, dish, tictac) + +minetest.register_craft({ + type = "cooking", + output = "nssm:"..dish, + recipe = "nssm:"..ingredient, + cooktime = tictac, +}) + +end + +nssm_register_recip ('worm_flesh', 'roasted_worm_flesh', 12) +nssm_register_recip ('duck_legs', 'roasted_duck_legs', 6) +nssm_register_recip ('spider_leg', 'roasted_spider_leg', 6) +nssm_register_recip ('felucco_steak', 'roasted_felucco_steak', 10) +nssm_register_recip ('werewolf_leg', 'roasted_werewolf_leg', 10) +nssm_register_recip ('brain', 'roasted_brain', 6) +nssm_register_recip ('amphibian_heart', 'roasted_amphibian_heart', 6) +nssm_register_recip ('tentacle', 'roasted_tentacle', 6) +nssm_register_recip ('frosted_amphibian_heart', 'amphibian_heart', 8) +nssm_register_recip ('heron_leg', 'chichibios_heron_leg', 20) +nssm_register_recip ('raw_scrausics_wing', 'spicy_scrausics_wing', 12) +nssm_register_recip ('ant_leg', 'roasted_ant_leg', 6) +nssm_register_recip ('crocodile_tail', 'roasted_crocodile_tail', 16) +nssm_register_recip ('dolidrosaurus_fin', 'roasted_dolidrosaurus_fin', 8) +nssm_register_recip ('amphibian_ribs', 'roasted_amphibian_ribs', 12) +nssm_register_recip ('mantis_meat', 'roasted_mantis_meat', 6) +nssm_register_recip ('spider_meat', 'roasted_spider_meat', 6) +nssm_register_recip ('silk_gland', 'roasted_silk_gland', 4) +nssm_register_recip ('larva_juice', 'larva_soup', 20) + + + +minetest.register_craft({ + output = 'nssm:larva_juice', + type = "shapeless", + recipe = {'nssm:larva_meat','bucket:bucket_empty'} +}) + +minetest.register_craft({ + output = 'nssm:ant_sword', + recipe = { + {'nssm:ant_mandible'}, + {'nssm:ant_mandible'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:ant_billhook', + recipe = { + {'nssm:ant_mandible', 'nssm:ant_mandible'}, + {'nssm:ant_mandible', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:ant_shovel', + recipe = { + {'nssm:ant_mandible'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:duck_beak_shovel', + recipe = { + {'nssm:duck_beak'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:duck_beak_pick', + recipe = { + {'nssm:duck_beak', 'nssm:duck_beak', 'nssm:duck_beak'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'nssm:sky_iron 30', + recipe = { + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + {'default:steelblock', 'nssm:sky_feather', 'default:steelblock'}, + {'default:steelblock', 'default:steelblock', 'default:steelblock'}, + } +}) + +minetest.register_craft({ + output = 'nssm:stoneater_pick', + recipe = { + {'nssm:stoneater_mandible', 'nssm:stoneater_mandible', 'nssm:stoneater_mandible'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'nssm:felucco_knife', + recipe = { + {'nssm:felucco_horn'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:little_ice_tooth_knife', + recipe = { + {'nssm:little_ice_tooth'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:manticore_spine_knife', + recipe = { + {'nssm:manticore_spine'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:ant_pick', + recipe = { + {'nssm:ant_mandible', 'nssm:ant_mandible', 'nssm:ant_mandible'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'nssm:mantis_pick', + recipe = { + {'nssm:mantis_claw', 'nssm:mantis_claw', 'nssm:mantis_claw'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'nssm:mantis_axe', + recipe = { + {'nssm:mantis_claw', 'nssm:mantis_claw'}, + {'nssm:mantis_claw', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:tarantula_warhammer', + recipe = { + {'nssm:tarantula_chelicerae'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'nssm:mantis_battleaxe', + recipe = { + {'nssm:mantis_claw', 'nssm:mantis_claw', 'nssm:mantis_claw'}, + {'nssm:mantis_claw', 'group:stick', 'nssm:mantis_claw'}, + {'', 'group:stick', ''}, + } +}) + +if minetest.get_modpath("nssb") then + minetest.register_craft({ + output = 'nssm:axe_of_pride', + recipe = { + {'nssm:proud_moranga', 'nssm:proud_moranga', 'nssm:proud_moranga'}, + {'nssm:proud_moranga', 'nssb:moranga_ingot', ''}, + {'', 'nssb:moranga_ingot', ''}, + } + }) + + minetest.register_craft({ + output = 'nssm:gratuitousness_battleaxe', + recipe = { + {'nssm:greedy_moranga', 'nssm:greedy_moranga', 'nssm:greedy_moranga'}, + {'nssm:greedy_moranga', 'nssb:moranga_ingot', 'nssm:greedy_moranga'}, + {'', 'nssb:moranga_ingot', ''}, + } + }) + + minetest.register_craft({ + output = 'nssm:sword_of_envy', + recipe = { + {'nssm:envious_moranga'}, + {'nssm:envious_moranga'}, + {'nssb:moranga_ingot'}, + } + }) + + minetest.register_craft({ + output = 'nssm:sword_of_eagerness', + recipe = { + {'nssm:slothful_moranga'}, + {'nssm:slothful_moranga'}, + {'nssb:moranga_ingot'}, + } + }) + + minetest.register_craft({ + output = 'nssm:falchion_of_eagerness', + recipe = { + {'nssm:slothful_moranga','nssm:slothful_moranga'}, + {'nssm:slothful_moranga', ''}, + {'nssb:moranga_ingot',''}, + } + }) + + minetest.register_craft({ + output = 'nssm:sword_of_gluttony', + recipe = { + {'nssm:gluttonous_moranga', 'nssm:gluttonous_moranga', 'nssm:gluttonous_moranga'}, + {'', 'nssm:gluttonous_moranga', ''}, + {'', 'nssb:moranga_ingot', ''}, + } + }) + + function nssm_register_moranga (viz) + minetest.register_craft({ + output = 'nssm:'.. viz ..'_moranga', + recipe = { + {'nssm:'.. viz ..'_soul_fragment', 'nssb:moranga_ingot', 'nssm:'.. viz ..'_soul_fragment'}, + {'nssb:moranga_ingot', 'nssm:'.. viz ..'_soul_fragment', 'nssb:moranga_ingot'}, + {'nssm:'.. viz ..'_soul_fragment', 'nssb:moranga_ingot', 'nssm:'.. viz ..'_soul_fragment'}, + } + }) + end + nssm_register_moranga ("lustful") + nssm_register_moranga ("greedy") + nssm_register_moranga ("slothful") + nssm_register_moranga ("wrathful") + nssm_register_moranga ("gluttonous") + nssm_register_moranga ("envious") + nssm_register_moranga ("proud") +end + +--Eggs + +local function nssm_register_egg (name, descr) + minetest.register_craftitem("nssm:".. name, { + description = descr .. " Egg", + image = name.."_egg.png", + on_place = function(itemstack, placer, pointed_thing) + local pos1=minetest.get_pointed_thing_position(pointed_thing, true) + pos1.y=pos1.y+1.5 + core.after(0.1, function() + minetest.add_entity(pos1, "nssm:".. name) + end) + itemstack:take_item() + return itemstack + end, + }) +end + +local function nssm_register_egg2 (name, descr) --mobs you can't catch + minetest.register_craftitem("nssm:".. name.."_egg", { + description = descr .. " Egg", + image = name.."_egg.png", + on_place = function(itemstack, placer, pointed_thing) + local pos1=minetest.get_pointed_thing_position(pointed_thing, true) + pos1.y=pos1.y+1.5 + core.after(0.1, function() + minetest.add_entity(pos1, "nssm:".. name) + end) + itemstack:take_item() + return itemstack + end, + }) +end + +nssm_register_egg ('flying_duck', 'Flying Duck') +nssm_register_egg ('stone_eater', 'Stoneater') +nssm_register_egg ('signosigno', 'Signosigno') +nssm_register_egg ('bloco', 'Bloco') +nssm_register_egg ('sand_bloco', 'Sand Bloco') +nssm_register_egg ('swimming_duck', 'Swimming Duck') +nssm_register_egg ('duck', 'Duck') +nssm_register_egg2 ('duckking', 'Duckking') +nssm_register_egg ('enderduck', 'Enderduck') +nssm_register_egg ('spiderduck', 'Spiderduck') +nssm_register_egg2 ('echidna', 'Echidna') +nssm_register_egg ('werewolf', 'Werewolf') +nssm_register_egg ('white_werewolf', 'White Werewolf') +nssm_register_egg ('snow_biter', 'Snow Biter') +nssm_register_egg2 ('icelamander', 'Icelamander') +nssm_register_egg ('icesnake', 'Icesnake') +nssm_register_egg2 ('lava_titan', 'Lava Titan') +nssm_register_egg ('masticone', 'Masticone') +nssm_register_egg ('mantis_beast', 'Mantis Beast') +nssm_register_egg ('mantis', 'Mantis') +nssm_register_egg ('larva', 'Larva') +nssm_register_egg2 ('phoenix', 'Phoenix') +nssm_register_egg2 ('night_master', 'Night Master') +nssm_register_egg ('scrausics', 'Scrausics') +nssm_register_egg ('moonheron', 'Moonheron') +nssm_register_egg ('sandworm', 'Sandworm') +nssm_register_egg2 ('giant_sandworm', 'Giant Sandworm') +nssm_register_egg2 ('ant_queen', 'Ant Queen') +nssm_register_egg ('ant_soldier', 'Ant Soldier') +nssm_register_egg ('ant_worker', 'Ant Worker') +nssm_register_egg ('crocodile', 'Crocodile') +nssm_register_egg ('dolidrosaurus', 'Dolidrosaurus') +nssm_register_egg ('crab', 'Crab') +nssm_register_egg ('octopus', 'Octopus') +nssm_register_egg ('xgaloctopus', 'Xgaloctopus') +nssm_register_egg ('black_widow', 'Black Widow') +nssm_register_egg ('uloboros', 'Uloboros') +nssm_register_egg2 ('tarantula', 'Tarantula') +nssm_register_egg ('daddy_long_legs', 'Daddy Long Legs') +nssm_register_egg2 ('kraken', 'Kraken') +nssm_register_egg2 ('pumpking', 'Pumpking') +nssm_register_egg ('manticore', 'Manticore') +nssm_register_egg ('felucco', 'Felucco') +nssm_register_egg ('pumpboom_large', 'Large Pumpboom') +nssm_register_egg ('pumpboom_small', 'Small Pumpboom') +nssm_register_egg ('pumpboom_medium', 'Medium Pumpboom') +nssm_register_egg2 ('mordain', 'Mordain') +nssm_register_egg2 ('morgre', 'Morgre') +nssm_register_egg2 ('morvy', 'Morvy') +nssm_register_egg2 ('morgut', 'Morgut') +nssm_register_egg2 ('morde', 'Morde') +nssm_register_egg2 ('morlu', 'Morlu') +nssm_register_egg2 ('morwa', 'Morwa') +--nssm_register_egg ('morvalar', 'Morvalar') + +minetest.register_craftitem("nssm:mese_egg", { + description = "Mese Egg", + image = "mese_egg.png", + on_place = function(itemstack, placer, pointed_thing) + local pos1=minetest.get_pointed_thing_position(pointed_thing, true) + pos1.y=pos1.y+1.5 + minetest.add_particlespawner({ + amount = 1000, + time = 0.2, + minpos = {x=pos1.x-1, y=pos1.y-1, z=pos1.z-1}, + maxpos = {x=pos1.x+1, y=pos1.y+4, z=pos1.z+1}, + minvel = {x=0, y=0, z=0}, + maxvel = {x=1, y=5, z=1}, + minacc = {x=-0.5,y=5,z=-0.5}, + maxacc = {x=0.5,y=5,z=0.5}, + minexptime = 1, + maxexptime = 3, + minsize = 2, + maxsize = 4, + collisiondetection = false, + vertical = false, + texture = "tnt_smoke.png", + }) + core.after(0.4, function() + minetest.add_entity(pos1, "nssm:mese_dragon") + end) + itemstack:take_item() + return itemstack + end, +}) + + +--experimental morwa statue +minetest.register_node("nssm:morwa_statue", { + description = 'Morwa Statue', + drawtype = 'mesh', + mesh = 'morwa_statue.b3d', + tiles = {'morwa_statue.png'}, + inventory_image = 'morwa_statue.png', + groups = {not_in_creative_inventory=1}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-1, -0.5, -1, 1, 3, 1}, -- Right, Bottom, Back, Left, Top, Front + }, + collision_box = { + type = 'fixed', + fixed = {-1, -0.5, -1, 1, 3, 1}, -- Right, Bottom, Back, Left, Top, Front + }, +}) + +--Abm to make the conversion between statue and the entity, caused by light + +minetest.register_abm({ + nodenames = {"nssm:morwa_statue"}, + neighbors = {"air"}, + interval = 2, + chance = 1, + action = function(pos, node) + local pos1 = {x=pos.x, y=pos.y+1, z=pos.z} + local n = minetest.get_node(pos1).name + if n ~= "air" then + return + end + if (minetest.get_node_light(pos1) > 8) + then + minetest.add_entity(pos1, "nssm:morwa") + minetest.remove_node(pos) + end + end +}) + +--Eggs recipes + +minetest.register_craft({ + output = 'nssm:duck', + recipe = { + {'', 'nssm:duck_beak', ''}, + {'nssm:duck_feather', 'nssm:energy_globe', 'nssm:duck_feather'}, + {'nssm:duck_legs', 'nssm:duck_feather', 'nssm:duck_legs'}, + } +}) + +minetest.register_craft({ + output = 'nssm:flying_duck', + recipe = { + {'nssm:duck_feather', 'nssm:duck_beak', 'nssm:duck_feather'}, + {'nssm:duck_feather', 'nssm:energy_globe', 'nssm:duck_feather'}, + {'nssm:duck_legs', 'nssm:duck_feather', 'nssm:duck_legs'}, + } +}) + +minetest.register_craft({ + output = 'nssm:enderduck', + recipe = { + {'nssm:black_duck_feather', 'nssm:duck_beak', 'nssm:black_duck_feather'}, + {'nssm:duck_legs', 'nssm:energy_globe', 'nssm:duck_legs'}, + {'nssm:duck_legs', '', 'nssm:duck_legs'}, + } +}) + +minetest.register_craft({ + output = 'nssm:swimming_duck', + recipe = { + {'nssm:duck_feather', 'nssm:duck_beak', 'nssm:duck_feather'}, + {'nssm:duck_legs', 'nssm:energy_globe', 'nssm:duck_legs'}, + {'nssm:duck_feather', 'nssm:duck_feather', 'nssm:duck_feather'}, + } +}) + +minetest.register_craft({ + output = 'nssm:spiderduck', + recipe = { + {'nssm:duck_legs', 'nssm:duck_beak', 'nssm:duck_legs'}, + {'nssm:black_duck_feather', 'nssm:energy_globe', 'nssm:black_duck_feather'}, + {'nssm:duck_legs', 'nssm:black_duck_feather', 'nssm:duck_legs'}, + } +}) + +minetest.register_craft({ + output = 'nssm:duckking_egg', + recipe = { + {'', 'nssm:helmet_crown', ''}, + {'nssm:duck_feather', 'nssm:duck_beak', 'nssm:duck_feather'}, + {'nssm:duck_legs', 'nssm:superior_energy_globe', 'nssm:duck_legs'}, + } +}) + +minetest.register_craft({ + output = 'nssm:bloco', + recipe = { + {'nssm:bloco_skin', 'nssm:bloco_skin', 'nssm:bloco_skin'}, + {'nssm:bloco_skin', 'nssm:energy_globe', 'nssm:bloco_skin'}, + {'nssm:bloco_skin', 'nssm:bloco_skin', 'nssm:bloco_skin'}, + } +}) diff --git a/spawn.lua b/spawn.lua index 0c04adf..31745ff 100644 --- a/spawn.lua +++ b/spawn.lua @@ -4,127 +4,311 @@ local mymapgenis = nssm.mymapgenis local mm = nssm.multimobs -if (mymapgenis~=6) and (mymapgenis~=7) then +if (mymapgenis ~= 6) and (mymapgenis ~= 7) then mymapgenis = 7 end + -- Spawning parameters if mm ~= 0 then + if mymapgenis == 6 then -- ANTS - mobs:spawn_specific("nssm:ant_queen", {"nssm:ant_dirt"}, {"air"}, 0, 20, 60, 200000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:ant_soldier", {"nssm:ant_dirt"}, {"air"}, 0, 20, 7, 30000/mm, 4, -31000, 31000) - mobs:spawn_specific("nssm:ant_worker", {"nssm:ant_dirt"}, {"air"}, 0, 20, 5, 10000/mm, 5, -31000, 31000) + + mobs:spawn_specific("nssm:ant_queen", + {"nssm:ant_dirt"}, {"air"}, 0, 20, 60, 200000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:ant_soldier", + {"nssm:ant_dirt"}, {"air"}, 0, 20, 7, 30000/mm, 4, -31000, 31000) + + mobs:spawn_specific("nssm:ant_worker", + {"nssm:ant_dirt"}, {"air"}, 0, 20, 5, 10000/mm, 5, -31000, 31000) -- SPIDERS - mobs:spawn_specific("nssm:black_widow", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 20, 1200000/mm, 2, -31000, 31000) - mobs:spawn_specific("nssm:daddy_long_legs", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 10, 1200000/mm, 2, -31000, 31000) - mobs:spawn_specific("nssm:tarantula", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 14, 120, 5000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:uloboros", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 20, 1200000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:black_widow", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 20, 20, 1200000/mm, 2, -31000, 31000) + + mobs:spawn_specific("nssm:daddy_long_legs", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 20, 10, 1200000/mm, 2, -31000, 31000) + + mobs:spawn_specific("nssm:tarantula", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 14, 120, 5000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:uloboros", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 20, 20, 1200000/mm, 1, -31000, 31000) -- DUCKS - mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 20, 350000/mm, 1, -31000, 20) - mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 300, 5000000/mm, 1, -31000, 20) - mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 45, 900000/mm, 1, -31000, 20) - mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:leaves"}, 10, 20, 120, 24000000/mm, 1, 1, 25) - mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:flora"}, 10, 20, 120, 6000000/mm, 1, 1, 25) - mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 45, 850000/mm, 1, -31000, 20) - mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"}, {"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 20) + + mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"}, + {"group:flora"}, 10, 20, 20, 350000/mm, 1, -31000, 20) + + mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"}, + {"group:flora"}, 10, 20, 300, 5000000/mm, 1, -31000, 20) + + mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"}, + {"group:flora"}, 0, 10, 45, 900000/mm, 1, -31000, 20) + + mobs:spawn_specific("nssm:flying_duck", {"air"}, + {"group:leaves"}, 10, 20, 120, 24000000/mm, 1, 1, 25) + + mobs:spawn_specific("nssm:flying_duck", {"air"}, + {"group:flora"}, 10, 20, 120, 6000000/mm, 1, 1, 25) + + mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"}, + {"group:flora"}, 0, 10, 45, 850000/mm, 1, -31000, 20) + + mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"}, + {"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 20) -- MOUNTAINS - mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 22, 31000) - mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 10, 20, 60, 12000000/mm, 1, 20, 31000) - mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 10, 60, 12000000/mm, 1, 20, 31000) + + mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"}, + {"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 22, 31000) + + mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"}, + {"default:dirt_with_grass"}, 10, 20, 60, 12000000/mm, 1, 20, 31000) + + mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"}, + {"default:dirt_with_grass"}, 0, 10, 60, 12000000/mm, 1, 20, 31000) -- ICE - mobs:spawn_specific("nssm:icelamander", {"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"}, 0, 20, 120, 25000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:icesnake", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 30, 6000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:white_werewolf", {"default:dirt_with_snow","default:snowblock"}, {"air"}, 0, 20, 60, 9000000/mm, 1, 20, 31000) - mobs:spawn_specific("nssm:snow_biter", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 30, 6000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:icelamander", + {"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"}, + 0, 20, 120, 25000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:icesnake", + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + 0, 20, 30, 6000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:white_werewolf", + {"default:dirt_with_snow","default:snowblock"}, + {"air"}, 0, 20, 60, 9000000/mm, 1, 20, 31000) + + mobs:spawn_specific("nssm:snow_biter", + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + 0, 20, 30, 6000000/mm, 1, -31000, 31000) -- FOREST - mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 40, 200000/mm, 1, -31000, 140) - mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 120, 5000000/mm, 2, -31000, 140) + + mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"}, + {"default:tree","default:aspen_tree"}, 0, 20, 40, 200000/mm, 1, -31000, 140) + + mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"}, + {"default:tree","default:aspen_tree"}, 0, 20, 120, 5000000/mm, 2, -31000, 140) -- PINE FOREST - mobs:spawn_specific("nssm:pumpboom_small", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 30, 600000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:pumpboom_medium", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 30, 800000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:pumpboom_large", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 30, 1000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:pumpking", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_needles", "default:pine_tree"}, 0, 12, 120, 8000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpboom_small", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_tree"}, + 0, 20, 30, 600000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpboom_medium", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_tree"}, + 0, 20, 30, 800000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpboom_large", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_tree"}, + 0, 20, 30, 1000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpking", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_needles", "default:pine_tree"}, + 0, 12, 120, 8000000/mm, 1, -31000, 31000) else -- SPIDERS - mobs:spawn_specific("nssm:black_widow", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 30, 4400000/mm, 2, -31000, 31000) - mobs:spawn_specific("nssm:daddy_long_legs", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 30, 10, 4400000/mm, 2, -31000, 31000) - mobs:spawn_specific("nssm:tarantula", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 14, 120, 50000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:uloboros", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 30, 4400000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:black_widow", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 20, 30, 4400000/mm, 2, -31000, 31000) + + mobs:spawn_specific("nssm:daddy_long_legs", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 30, 10, 4400000/mm, 2, -31000, 31000) + + mobs:spawn_specific("nssm:tarantula", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 14, 120, 50000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:uloboros", + {"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" }, + {"air"}, 0, 20, 30, 4400000/mm, 1, -31000, 31000) -- DUCKS - mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 50, 1500000/mm, 1, -31000, 40) - mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 400, 120000000/mm, 1, -31000, 40) - mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 40) - mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:leaves"}, 10, 20, 120, 8000000/mm, 1, 1, 40) - mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:flora"}, 10, 20, 120, 25000000/mm, 1, 1, 40) - mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 45) - mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"}, {"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 40) - mobs:spawn_specific("nssm:swimming_duck", {"default:river_water_source"}, {"default:sand","default:river_water_source"}, 0, 20, 60, 3000000/mm, 1, -31000, 300) + + mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"}, + {"group:flora"}, 10, 20, 50, 1500000/mm, 1, -31000, 40) + + mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"}, + {"group:flora"}, 10, 20, 400, 120000000/mm, 1, -31000, 40) + + mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"}, + {"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 40) + + mobs:spawn_specific("nssm:flying_duck", {"air"}, + {"group:leaves"}, 10, 20, 120, 8000000/mm, 1, 1, 40) + + mobs:spawn_specific("nssm:flying_duck", {"air"}, + {"group:flora"}, 10, 20, 120, 25000000/mm, 1, 1, 40) + + mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"}, + {"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 45) + + mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"}, + {"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 40) + + mobs:spawn_specific("nssm:swimming_duck", {"default:river_water_source"}, + {"default:sand","default:river_water_source"}, + 0, 20, 60, 3000000/mm, 1, -31000, 300) -- MOUNTAINS - mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 50, 31000) - mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 10, 20, 60, 13000000/mm, 1, 40, 31000) - mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 10, 60, 13000000/mm, 1, 40, 31000) + + mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"}, + {"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 50, 31000) + + mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"}, + {"default:dirt_with_grass"}, 10, 20, 60, 13000000/mm, 1, 40, 31000) + + mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"}, + {"default:dirt_with_grass"}, 0, 10, 60, 13000000/mm, 1, 40, 31000) -- ICE - mobs:spawn_specific("nssm:icelamander", {"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"}, 0, 20, 180, 120000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:icesnake", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 40, 20000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:white_werewolf", {"default:dirt_with_snow","default:snowblock"}, {"air"}, 0, 20, 35, 22000000/mm, 1, 50, 31000) - mobs:spawn_specific("nssm:snow_biter", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 40, 20000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:icelamander", + {"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"}, + 0, 20, 180, 120000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:icesnake", + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + 0, 20, 40, 20000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:white_werewolf", + {"default:dirt_with_snow","default:snowblock"}, + {"air"}, 0, 20, 35, 22000000/mm, 1, 50, 31000) + + mobs:spawn_specific("nssm:snow_biter", + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + {"default:snowblock", "default:ice", "default:dirt_with_snow"}, + 0, 20, 40, 20000000/mm, 1, -31000, 31000) -- FOREST - mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 40, 800000/mm, 1, -31000, 140) - mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 180, 6000000/mm, 2, -31000, 140) + + mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"}, + {"default:tree","default:aspen_tree"}, 0, 20, 40, 800000/mm, 1, -31000, 140) + + mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"}, + {"default:tree","default:aspen_tree"}, 0, 20, 180, 6000000/mm, 2, -31000, 140) -- PINE FOREST - mobs:spawn_specific("nssm:pumpboom_small", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 80, 1400000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:pumpboom_medium", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 80, 1600000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:pumpboom_large", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 80, 1800000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:pumpking", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_needles", "default:pine_tree"}, 0, 12, 120, 8000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpboom_small", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_tree"}, + 0, 20, 80, 1400000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpboom_medium", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_tree"}, + 0, 20, 80, 1600000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpboom_large", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_tree"}, + 0, 20, 80, 1800000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:pumpking", + {"default:dirt_with_coniferous_litter", "default:dirt_with_snow", + "default:snowblock"}, {"default:pine_needles", "default:pine_tree"}, + 0, 12, 120, 8000000/mm, 1, -31000, 31000) -- SAVANNA - mobs:spawn_specific("nssm:felucco", {"default:dirt_with_dry_grass"}, {"default:dirt_with_dry_grass"}, 0, 20, 80, 20000000/mm, 1, -200, 31000) + mobs:spawn_specific("nssm:felucco", {"default:dirt_with_dry_grass", + "default:dry_dirt_with_dry_grass"}, {"default:dirt_with_dry_grass"}, + 0, 20, 80, 20000000/mm, 1, -200, 31000) end -- NSSB SPECIAL + if minetest.get_modpath("nssb") then - mobs:spawn_specific("nssm:xgaloctopus", {"default:water_source"}, {"nssb:marine_brick"}, 0, 20, 20, 800000/mm, 1, -31000, 0) + + mobs:spawn_specific("nssm:xgaloctopus", {"default:water_source"}, + {"nssb:marine_brick"}, 0, 20, 20, 800000/mm, 1, -31000, 0) end -- CAVES - mobs:spawn_specific("nssm:bloco", {"default:stone", "default:desert_stone"}, {"default:stone", "default:desert_stone"}, 0, 20, 30, 500000/mm, 3, -31000, -20) - mobs:spawn_specific("nssm:lava_titan", {"default:stone", "default:desert_stone"}, {"air"}, 0, 120, 12, 22000000/mm, 1, -31000, -100) - mobs:spawn_specific("nssm:stone_eater", {"default:stone", "default:desert_stone"}, {"default:stone", "default:desert_stone"}, 0, 20, 40, 700000/mm, 2, -31000, -20) - mobs:spawn_specific("nssm:signosigno", {"default:stone", "default:desert_stone"}, {"default:stone", "default:desert_stone"}, 0, 10, 20, 400000/mm, 2, -31000, -20) - mobs:spawn_specific("nssm:signosigno", {"bones:bones"}, {"air"}, 0, 15, 20, 5000/mm, 5, -31000, 31000) + + mobs:spawn_specific("nssm:bloco", {"default:stone", "default:desert_stone"}, + {"default:stone", "default:desert_stone"}, 0, 20, 30, 500000/mm, 3, -31000, -20) + + mobs:spawn_specific("nssm:lava_titan", {"default:stone", "default:desert_stone"}, + {"air"}, 0, 120, 12, 22000000/mm, 1, -31000, -100) + + mobs:spawn_specific("nssm:stone_eater", {"default:stone", "default:desert_stone"}, + {"default:stone", "default:desert_stone"}, 0, 20, 40, 700000/mm, 2, -31000, -20) + + mobs:spawn_specific("nssm:signosigno", {"default:stone", "default:desert_stone"}, + {"default:stone", "default:desert_stone"}, 0, 10, 20, 400000/mm, 2, -31000, -20) + + mobs:spawn_specific("nssm:signosigno", {"bones:bones"}, + {"air"}, 0, 15, 20, 5000/mm, 5, -31000, 31000) -- SEA - mobs:spawn_specific("nssm:crab", {"default:sand"}, {"default:water_source"}, 0, 20, 60, 4000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:crocodile", {"default:sand","default:water_source"}, {"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:crocodile", {"default:sand","default:river_water_source"}, {"default:river_water_source"}, 0, 20, 60, 12000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:dolidrosaurus", {"default:water_source"}, {"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, -1) - mobs:spawn_specific("nssm:kraken", {"default:water_source"}, {"default:water_source"}, 0, 20, 400, 500000000/mm, 1, -31000, 0) - mobs:spawn_specific("nssm:octopus", {"default:water_source"}, {"default:water_source"}, 0, 20, 80, 38000000/mm, 1, -31000, 0) + + mobs:spawn_specific("nssm:crab", {"default:sand"}, + {"default:water_source"}, 0, 20, 60, 4000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:crocodile", {"default:sand","default:water_source"}, + {"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:crocodile", {"default:sand","default:river_water_source"}, + {"default:river_water_source"}, 0, 20, 60, 12000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:dolidrosaurus", {"default:water_source"}, + {"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, -1) + + mobs:spawn_specific("nssm:kraken", {"default:water_source"}, + {"default:water_source"}, 0, 20, 400, 500000000/mm, 1, -31000, 0) + + mobs:spawn_specific("nssm:octopus", {"default:water_source"}, + {"default:water_source"}, 0, 20, 80, 38000000/mm, 1, -31000, 0) -- DESERT - mobs:spawn_specific("nssm:sandworm", {"default:desert_sand", "default:desert_stone"}, {"air"}, 0, 20, 100, 28000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:giant_sandworm", {"default:desert_sand", "default:desert_stone"}, {"air"}, 0, 20, 400, 600000000/mm, 1, -31000, 31000) - mobs:spawn_specific("nssm:sand_bloco", {"default:desert_sand", "default:desert_stone"}, {"air"}, 0, 20, 90, 20000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:sandworm", {"default:desert_sand", "default:desert_stone"}, + {"air"}, 0, 20, 100, 28000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:giant_sandworm", {"default:desert_sand", + "default:desert_stone"}, {"air"}, 0, 20, 400, 600000000/mm, 1, -31000, 31000) + + mobs:spawn_specific("nssm:sand_bloco", {"default:desert_sand", + "default:desert_stone"}, {"air"}, 0, 20, 90, 20000000/mm, 1, -31000, 31000) -- SKY - mobs:spawn_specific("nssm:moonheron", {"air"}, {"air"}, 0, 10, 110, 950000000/mm, 1, 10, 180) - mobs:spawn_specific("nssm:night_master", {"air"}, {"air"}, 0, 7, 400, 4500000000/mm, 2, 10, 180) - mobs:spawn_specific("nssm:phoenix", {"air"}, {"air"}, 10, 20, 400, 10000000000/mm, 1, 10, 180) - mobs:spawn_specific("nssm:scrausics", {"air"}, {"air"}, 10, 20, 110, 950000000/mm, 1, 10, 180) + + mobs:spawn_specific("nssm:moonheron", {"air"}, {"air"}, + 0, 10, 110, 950000000/mm, 1, 10, 180) + + mobs:spawn_specific("nssm:night_master", {"air"}, {"air"}, + 0, 7, 400, 4500000000/mm, 2, 10, 180) + + mobs:spawn_specific("nssm:phoenix", {"air"}, {"air"}, + 10, 20, 400, 10000000000/mm, 1, 10, 180) + + mobs:spawn_specific("nssm:scrausics", {"air"}, {"air"}, + 10, 20, 110, 950000000/mm, 1, 10, 180) end