tweak and tidy code, add nyancat check

master
TenPlus1 2018-08-09 11:36:34 +01:00
parent e85b8447b0
commit ca9d00e2ca
9 changed files with 1637 additions and 1650 deletions

191
darts.lua
View File

@ -1,27 +1,5 @@
-- arrow (duck_arrow)
mobs:register_arrow("nssm:duck_father", {
visual = "sprite",
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()
duck_explosion(pos)
end,
hit_mob = function(self, player)
local pos = self.object:get_pos()
duck_explosion(pos)
end,
hit_node = function(self, pos, node)
duck_explosion(pos)
end,
})
function duck_explosion(pos)
local function duck_explosion(pos)
if minetest.is_protected(pos, "") then
return
end
@ -68,6 +46,46 @@ function duck_explosion(pos)
end)
end
-- arrow (duck_arrow)
mobs:register_arrow("nssm:duck_father", {
visual = "sprite",
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()
duck_explosion(pos)
end,
hit_mob = function(self, player)
local pos = self.object:get_pos()
duck_explosion(pos)
end,
hit_node = function(self, pos, node)
duck_explosion(pos)
end,
})
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}
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"})
end
end
end
end
end
-- snow_arrow
mobs:register_arrow("nssm:snow_arrow", {
visual = "sprite",
@ -89,20 +107,6 @@ mobs:register_arrow("nssm:snow_arrow", {
end,
})
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}
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"})
end
end
end
end
end
-- arrow manticore
mobs:register_arrow("nssm:spine", {
@ -126,6 +130,7 @@ mobs:register_arrow("nssm:spine", {
end,
})
--morbat arrow
mobs:register_arrow("nssm:morarrow", {
visual = "sprite",
@ -141,6 +146,32 @@ mobs:register_arrow("nssm:morarrow", {
end,
})
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}
local current = minetest.get_node(p).name
local ontop = minetest.get_node(k).name
if (current ~= "air") and
(current ~= "nssm:web") and
(ontop == "air") and not
minetest.is_protected(p,"") and not
minetest.is_protected(k,"") then
minetest.set_node(k, {name="nssm:web"})
end
end
end
end
end
-- web arrow
mobs:register_arrow("nssm:webball", {
visual = "sprite",
@ -165,34 +196,31 @@ mobs:register_arrow("nssm:webball", {
end
})
function explosion_web(pos)
if minetest.is_protected(pos, "") then
return
end
function explosion_thickweb(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
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
(current ~= "nssm:web") and
(current ~= "nssm:thick_web") and
(ontop == "air") and not
minetest.is_protected(p,"") and not
minetest.is_protected(k,"") then
minetest.set_node(k, {name="nssm:web"})
minetest.set_node(k, {name="nssm:thick_web"})
end
end
end
end
end
-- thick_web arrow
mobs:register_arrow("nssm:thickwebball", {
visual = "sprite",
@ -217,32 +245,6 @@ mobs:register_arrow("nssm:thickwebball", {
end
})
function explosion_thickweb(pos)
if minetest.is_protected(pos, "") then
return
end
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}
local current = minetest.get_node(p).name
local ontop = minetest.get_node(k).name
if (current ~= "air") and
(current ~= "nssm:thick_web") and
(ontop == "air") and not
minetest.is_protected(p,"") and not
minetest.is_protected(k,"") then
minetest.set_node(k, {name="nssm:thick_web"})
end
end
end
end
end
-- arrow=>phoenix arrow
mobs:register_arrow("nssm:phoenix_arrow", {
@ -267,7 +269,8 @@ mobs:register_arrow("nssm:phoenix_arrow", {
self.timer = os.time()
end
if os.time() - self.timer > 5 or minetest.is_protected(pos, "") or ((n~="air") and (n~="nssm:phoenix_fire")) then
if os.time() - self.timer > 5 or minetest.is_protected(pos, "")
or ((n~="air") and (n~="nssm:phoenix_fire")) then
self.object:remove()
end
@ -289,22 +292,6 @@ mobs:register_arrow("nssm:phoenix_arrow", {
end,
})
mobs:register_arrow("nssm:super_gas", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"transparent.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
gas_explosion(p)
end,
hit_node = function(self, pos, node)
gas_explosion(pos)
end
})
function gas_explosion(pos)
if minetest.is_protected(pos, "") then
@ -326,7 +313,23 @@ function gas_explosion(pos)
end
end
--
mobs:register_arrow("nssm:super_gas", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"transparent.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
gas_explosion(p)
end,
hit_node = function(self, pos, node)
gas_explosion(pos)
end
})
mobs:register_arrow("nssm:roar_of_the_dragon", {
visual = "sprite",
visual_size = {x = 1, y = 1},
@ -353,7 +356,8 @@ mobs:register_arrow("nssm:roar_of_the_dragon", {
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
if (not obj:is_player())
and name ~= self.object:get_luaentity().name then
obj:remove()
end
end
@ -391,7 +395,8 @@ mobs:register_arrow("nssm:lava_arrow", {
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" and not minetest.is_protected(p, "") then
if n~="default:lava_flowing"
and not minetest.is_protected(p, "") then
minetest.set_node(p, {name="default:lava_flowing"})
end
end

View File

@ -63,10 +63,18 @@ dofile(path.."/mobs/white_werewolf.lua")
dofile(path.."/mobs/mese_dragon.lua")
--Others
dofile(path.."/rainbow_staff.lua")
dofile(path.."/darts.lua")
dofile(path.."/nssm_materials.lua")
dofile(path.."/nssm_spears.lua")
dofile(path.."/nssm_api.lua")
dofile(path.."/nssm_weapons.lua")
if minetest.registered_nodes["nyancat:nyancat_rainbow"] then
dofile(path.."/rainbow_staff.lua") ; print ("NYAN!!!!!")
end
if minetest.get_modpath("3d_armor") then
dofile(path.."/nssm_armor.lua")
end
print("[MOD] NSSM loaded")

View File

@ -1,6 +1,3 @@
if minetest.get_modpath("3d_armor") then
--Armors
local stats = {
wolf = {name="Werewolf", armor=2.8, heal=0, use=800},
@ -20,6 +17,7 @@ if minetest.get_modpath("3d_armor") then
web = {name="Cobweb String", armor=2.4, heal=0, use=900},
denseweb = {name="Dense Cobweb String", armor=3.5, heal=0, use=400},
}
local materials = {
wolf="nssm:wolf_fur",
whitewolf="nssm:white_wolf_fur",
@ -99,8 +97,10 @@ if minetest.get_modpath("3d_armor") then
},
})
end
--shields
if minetest.get_modpath("shields") then
local stats = {
crab = {name="Crab", armor=4, heal=0, use=500},
ice ={name="Ice Teeth", armor=3.5, heal=0, use=600},
@ -108,6 +108,7 @@ if minetest.get_modpath("3d_armor") then
masticone ={name="Masticone", armor=4.5, use=300},
mantis ={name="Mantis", armor=3, use=500},
}
local materials = {
crab="nssm:crab_carapace_fragment",
ice="nssm:little_ice_tooth",
@ -115,6 +116,7 @@ if minetest.get_modpath("3d_armor") then
masticone="nssm:masticone_skull_fragments",
mantis="nssm:mantis_skin",
}
for k, v in pairs(stats) do
minetest.register_tool("nssm:shield_"..k, {
description = v.name.." Shield",
@ -134,12 +136,8 @@ if minetest.get_modpath("3d_armor") then
})
end
end
end
--Special objects (pumpking helmet, masticone helmet, crowned masticone helmet, crown,)
if minetest.get_modpath("3d_armor") then
local stats = {
pumpking = {name="Pumpking Head", armor=4, heal=0, use=100},
masticone ={name="Masticone Head", armor=4, heal=0, use=100},
@ -163,8 +161,6 @@ local stats = {
})
end
minetest.register_craft({
output = "nssm:chestplate_snake",
recipe = {
@ -189,5 +185,3 @@ local stats = {
{"", "", ""},
},
})
end

View File

@ -1,80 +1,80 @@
--non eatable craftitems
function nssm_register_noneatcraftitems (name, descr)
local function nssm_craftitem (name, descr)
minetest.register_craftitem("nssm:"..name, {
description = descr,
image = name..".png",
})
end
nssm_register_noneatcraftitems ('sky_feather','Sky Feather')
nssm_register_noneatcraftitems ('snake_scute','Snake Scute')
nssm_register_noneatcraftitems ('eyed_tentacle','Eyed Tentacle')
--nssm_register_noneatcraftitems ('king_duck_crown','King Duck Crown')
nssm_register_noneatcraftitems ('great_energy_globe','Great Energy Globe')
nssm_register_noneatcraftitems ('superior_energy_globe','Superior Energy Globe')
nssm_register_noneatcraftitems ('ant_queen_abdomen','Ant Queen Abdomen')
--nssm_register_noneatcraftitems ('masticone_skull','Masticone Skull')
nssm_register_noneatcraftitems ('masticone_skull_fragments','Masticone Skull Fragments')
--nssm_register_noneatcraftitems ('masticone_skull_crowned','Masticone Skull Crowned')
nssm_register_noneatcraftitems ('tentacle_curly','Kraken Tentacle')
nssm_register_noneatcraftitems ('lava_titan_eye','Lava Titan Eye')
nssm_register_noneatcraftitems ('duck_beak','Duck Beak')
nssm_register_noneatcraftitems ('ice_tooth','Ice Tooth')
nssm_register_noneatcraftitems ('little_ice_tooth','Little Ice Tooth')
nssm_register_noneatcraftitems ('digested_sand',"Digested Sand")
nssm_register_noneatcraftitems ('black_ice_tooth','Black Ice Tooth')
nssm_register_noneatcraftitems ('tarantula_chelicerae','Tarantula Chelicerae')
nssm_register_noneatcraftitems ('crab_chela','Crab Chela')
nssm_register_noneatcraftitems ('cursed_pumpkin_seed','Cursed Pumpkin Seed')
nssm_register_noneatcraftitems ('mantis_claw','Mantis Claw')
nssm_register_noneatcraftitems ('manticore_fur','Manticore Fur')
nssm_register_noneatcraftitems ('ant_hard_skin','Ant Hard Skin')
nssm_register_noneatcraftitems ('bloco_skin','Bloco Skin')
nssm_register_noneatcraftitems ('crab_carapace_fragment','Crab Carapace Fragment')
nssm_register_noneatcraftitems ('crocodile_skin','Crocodile Skin')
nssm_register_noneatcraftitems ('manticore_spine','Manticore Spine')
nssm_register_noneatcraftitems ('night_feather','Night Feather')
nssm_register_noneatcraftitems ('sun_feather','Sun Feather')
nssm_register_noneatcraftitems ('duck_feather','Duck Feather')
nssm_register_noneatcraftitems ('black_duck_feather','Black Duck Feather')
nssm_register_noneatcraftitems ('masticone_fang','Masticone Fang')
nssm_register_noneatcraftitems ('white_wolf_fur','White Wolf Fur')
nssm_register_noneatcraftitems ('stoneater_mandible','Stoneater Mandible')
nssm_register_noneatcraftitems ('ant_mandible','Ant Mandible')
nssm_register_noneatcraftitems ('life_energy','Life Energy')
nssm_register_noneatcraftitems ('wolf_fur','Wolf Fur')
nssm_register_noneatcraftitems ('felucco_fur','Felucco Fur')
nssm_register_noneatcraftitems ('felucco_horn','Felucco Horn')
nssm_register_noneatcraftitems ('energy_globe','Energy Globe')
nssm_register_noneatcraftitems ('greedy_soul_fragment','Greedy Soul Fragment')
nssm_register_noneatcraftitems ('lustful_soul_fragment','Lustful Soul Fragment')
nssm_register_noneatcraftitems ('wrathful_soul_fragment','Wrathful Soul Fragment')
nssm_register_noneatcraftitems ('proud_soul_fragment','Proud Soul Fragment')
nssm_register_noneatcraftitems ('slothful_soul_fragment','Slothful Soul Fragment')
nssm_register_noneatcraftitems ('envious_soul_fragment','Envious Soul Fragment')
nssm_register_noneatcraftitems ('gluttonous_soul_fragment','Gluttonous Soul Fragment')
nssm_register_noneatcraftitems ('gluttonous_moranga','Gluttonous Moranga')
nssm_register_noneatcraftitems ('envious_moranga','Envious Moranga')
nssm_register_noneatcraftitems ('proud_moranga','Proud Moranga')
nssm_register_noneatcraftitems ('slothful_moranga','Slothful Moranga')
nssm_register_noneatcraftitems ('lustful_moranga','Lustful Moranga')
nssm_register_noneatcraftitems ('wrathful_moranga','Wrathful Moranga')
nssm_register_noneatcraftitems ('greedy_moranga','Greedy Moranga')
nssm_register_noneatcraftitems ('mantis_skin','Mantis_skin')
nssm_register_noneatcraftitems ('sand_bloco_skin','Sand Bloco Skin')
nssm_register_noneatcraftitems ('sandworm_skin','Sandworm Skin')
nssm_register_noneatcraftitems ('sky_iron','Sky Iron')
nssm_register_noneatcraftitems ('web_string','Cobweb String')
nssm_register_noneatcraftitems ('dense_web_string','Dense Cobweb String')
nssm_register_noneatcraftitems ('black_powder','Black Powder')
nssm_register_noneatcraftitems ('morelentir_dust','Dark Starred Stone Dust')
nssm_register_noneatcraftitems ('empty_evocation_bomb','Empty Evocation Bomb')
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')
function nssm_register_eatcraftitems (name, descr, gnam)
local function nssm_craftitem_eat (name, descr, gnam)
minetest.register_craftitem("nssm:"..name, {
description = descr,
@ -82,52 +82,51 @@ minetest.register_craftitem("nssm:"..name, {
on_use = minetest.item_eat(gnam),
groups = { meat=1, eatable=1 },
})
end
nssm_register_eatcraftitems ('werewolf_leg','Werewolf Leg',3)
nssm_register_eatcraftitems ('felucco_steak','Felucco Steak',3)
nssm_register_eatcraftitems ('roasted_felucco_steak','Roasted Felucco Steak',6)
nssm_register_eatcraftitems ('heron_leg','Moonheron Leg',2)
nssm_register_eatcraftitems ('chichibios_heron_leg',"Chichibio's Moonheron Leg",4)
nssm_register_eatcraftitems ('crocodile_tail','Crocodile Tail',3)
nssm_register_eatcraftitems ('roasted_crocodile_tail','Roasted Crocodile Tail',6)
nssm_register_eatcraftitems ('roasted_werewolf_leg','Roasted_Werewolf Leg',6)
nssm_register_eatcraftitems ('duck_legs','Duck Legs',1)
nssm_register_eatcraftitems ('roasted_duck_legs','Roasted Duck Leg',3)
nssm_register_eatcraftitems ('ant_leg','Ant Leg',-1)
nssm_register_eatcraftitems ('roasted_ant_leg','Roasted Ant Leg',4)
nssm_register_eatcraftitems ('spider_leg','Spider Leg',-1)
nssm_register_eatcraftitems ('roasted_spider_leg','Roasted Spider Leg',4)
--nssm_register_eatcraftitems ('brain','Brain',3)
--nssm_register_eatcraftitems ('roasted_brain','Roasted Brain',8)
nssm_register_eatcraftitems ('tentacle','Tentacle',2)
nssm_register_eatcraftitems ('roasted_tentacle','Roasted Tentacle',5)
nssm_register_eatcraftitems ('worm_flesh','Worm Flesh',-2)
nssm_register_eatcraftitems ('roasted_worm_flesh','Roasted Worm Flesh',4)
nssm_register_eatcraftitems ('amphibian_heart','Amphibian Heart',1)
nssm_register_eatcraftitems ('roasted_amphibian_heart','Roasted Amphibian Heart',8)
nssm_register_eatcraftitems ('raw_scrausics_wing','Raw Scrausics Wing',1)
nssm_register_eatcraftitems ('spicy_scrausics_wing','Spicy Scrausics Wing',6)
nssm_register_eatcraftitems ('phoenix_nuggets','Phoenix Nuggets',20)
nssm_register_eatcraftitems ('phoenix_tear','Phoenix Tear',20)
nssm_register_eatcraftitems ('frosted_amphibian_heart','Frosted Amphibian Heart',-1)
nssm_register_eatcraftitems ('surimi','Surimi',4)
nssm_register_eatcraftitems ('amphibian_ribs','Amphibian Ribs',2)
nssm_register_eatcraftitems ('roasted_amphibian_ribs','Roasted Amphibian Ribs',6)
nssm_register_eatcraftitems ('dolidrosaurus_fin','Dolidrosaurus Fin',-2)
nssm_register_eatcraftitems ('roasted_dolidrosaurus_fin','Roasted Dolidrosaurus Fin',4)
nssm_register_eatcraftitems ('larva_meat','Larva Meat',-1)
nssm_register_eatcraftitems ('larva_juice','Larva Juice',-3)
nssm_register_eatcraftitems ('larva_soup','Larva Soup',10)
nssm_register_eatcraftitems ('mantis_meat','Mantis Meat',1)
nssm_register_eatcraftitems ('roasted_mantis_meat','Roasted Mantis Meat',4)
nssm_register_eatcraftitems ('spider_meat','Spider Meat',-1)
nssm_register_eatcraftitems ('roasted_spider_meat','Roasted Spider Meat',3)
nssm_register_eatcraftitems ('silk_gland','Silk Gland',-1)
nssm_register_eatcraftitems ('roasted_silk_gland','Roasted Silk Gland',3)
nssm_register_eatcraftitems ('super_silk_gland','Super Silk Gland',-8)
nssm_register_eatcraftitems ('roasted_super_silk_gland','Roasted Super Silk Gland',2)
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
@ -141,7 +140,9 @@ minetest.register_ore({
y_min = -115,
y_max = -95,
})
for i=1,9 do
minetest.register_ore({
ore_type = "scatter",
ore = "nssm:ant_dirt",
@ -196,7 +197,8 @@ minetest.register_ore({
y_min = -1000,
y_max = 40,
})
end
end -- END for loop
minetest.register_ore({
ore_type = "scatter",
@ -218,8 +220,7 @@ minetest.register_ore({
clust_size = 5,
y_min = -20,
y_max = 200,
}
)
})
--nodes
@ -256,7 +257,8 @@ minetest.register_node("nssm: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}}
{name="venomous_gas_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
},
paramtype = "light",
walkable = false,
@ -396,6 +398,7 @@ minetest.register_abm({
end
})
--[[ These don't actually do anything
minetest.register_abm({
nodenames = {"nssm:web"},
neighbors = {"default:junglegrass"},
@ -434,6 +437,7 @@ minetest.register_abm({
end
end
})
]]
minetest.register_node("nssm:phoenix_fire", {
description = "Phoenix Fire",
@ -658,25 +662,6 @@ farming.register_hoe(":farming:ant_hoe", {
max_uses = 350,
material = "nssm:ant_mandible"
})
minetest.register_craft({
output = 'nssm:ant_hoe',
recipe = {
{'nssm:ant_mandible', 'nssm:ant_mandible'},
{'', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'nssm:felucco_hoe',
recipe = {
{'nssm:felucco_horn', 'nssm:felucco_horn'},
{'', 'group:stick'},
{'', 'group:stick'},
}
})
end
minetest.register_tool("nssm:ant_sword", {
@ -692,8 +677,6 @@ minetest.register_tool("nssm:ant_sword", {
},
})
minetest.register_tool("nssm:ant_shovel", {
description = "Ant Shovel",
inventory_image = "ant_shovel.png",
@ -1797,9 +1780,10 @@ if minetest.get_modpath("nssb") then
nssm_register_moranga ("envious")
nssm_register_moranga ("proud")
end
--Eggs
function nssm_register_egg (name, descr)
local function nssm_register_egg (name, descr)
minetest.register_craftitem("nssm:".. name, {
description = descr .. " Egg",
image = name.."_egg.png",
@ -1815,7 +1799,7 @@ function nssm_register_egg (name, descr)
})
end
function nssm_register_egg2 (name, descr) --mobs you can't catch
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",
@ -1937,15 +1921,15 @@ minetest.register_node("nssm:morwa_statue", {
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 = 1,
interval = 2,
chance = 1,
action =
function(pos, node)
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
@ -1958,10 +1942,9 @@ minetest.register_abm({
end
end
})
--Eggs recipes
minetest.register_craft({
output = 'nssm:duck',
recipe = {

View File

@ -1,6 +1,7 @@
--function
function spears_shot (itemstack, player)
--functions
local function spears_shot (itemstack, player)
local spear = itemstack:get_name() .. '_entity'
local playerpos = player:get_pos()
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear)
@ -22,7 +23,7 @@ function spears_shot (itemstack, player)
end
function spears_set_entity(kind, eq, toughness)
local function spears_set_entity(kind, eq, toughness)
local SPEAR_ENTITY={
physical = false,
timer=0,
@ -86,7 +87,7 @@ end
--Tools
function spears_register_spear(kind, desc, eq, toughness, material)
local function spears_register_spear(kind, desc, eq, toughness, material)
minetest.register_tool("nssm:spear_" .. kind, {
description = desc .. " Spear",
@ -182,7 +183,7 @@ spears_register_spear('felucco_horn', 'Felucco Horn', 7, 9, 'nssm:felucco_horn')
}
})
function spears_set_sentity(kind, eq, toughness)
local function spears_set_sentity(kind, eq, toughness)
local SUPERSPEAR_ENTITY={
physical = false,
timer=0,
@ -255,4 +256,3 @@ end
{'nssm:wrathful_moranga', 'group:wood', 'group:wood'},
}
})

View File

@ -1,9 +1,5 @@
--Parameters used by some weapons
local default_dir = {
x = 1,
y = 1,
z = 1,
}
local default_dir = {x = 1, y = 1, z = 1}
--Function used to shoot:
local function weapons_shot(itemstack, placer, pointed_thing, velocity, name)
@ -636,7 +632,7 @@ nssm_register_weapon("light_ball", {
description = "Light Ball",
})
]]
function nssm_register_throwitem(name, descr, def)
local function nssm_register_throwitem(name, descr, def)
minetest.register_craftitem("nssm:"..name.."_bomb", {
description = descr,
@ -1184,7 +1180,7 @@ minetest.register_craft({
}
})
function nssm_register_throwegg(name, descr, def)
local function nssm_register_throwegg(name, descr, def)
minetest.register_craftitem("nssm:"..name.."_bomb", {
description = descr,
@ -1218,7 +1214,7 @@ function nssm_register_throwegg(name, descr, def)
})
end
function nssm_register_evocation (evomob, evodescr, numbe)
local function nssm_register_evocation (evomob, evodescr, numbe)
nssm_register_throwegg(evomob, evodescr.." Bomb", {
hit_node = function(self,pos)
@ -1235,14 +1231,12 @@ minetest.register_craft({
output = 'nssm:'..evomob.."_bomb",
type = "shapeless",
recipe = {'nssm:empty_evocation_bomb', 'nssm:'..evomob},
})
minetest.register_craft({
output = 'nssm:duckking_bomb',
type = "shapeless",
recipe = {'nssm:empty_evocation_bomb', 'nssm:duckking_egg'},
})
end

View File

@ -1,4 +1,6 @@
--rainbow!
minetest.register_entity("nssm:rainbow", {
textures = {"transparent.png"},
velocity = 10,

View File

@ -1,4 +1,5 @@
--Before starting a new game write 6 or 7 in order to regulate the spawns (7 works also with flat and fractal).
--Before starting a new game write 6 or 7 in order to regulate the spawns
-- (7 works also with flat and fractal).
local mymapgenis = nssm.mymapgenis
local mm = nssm.multimobs