New weapons

master
NPXcoot 2016-10-08 14:50:27 +02:00
parent 5863152917
commit 22c953af6d
23 changed files with 324 additions and 23 deletions

View File

@ -49,6 +49,21 @@ 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')
function nssm_register_eatcraftitems (name, descr, gnam)
@ -190,6 +205,22 @@ minetest.register_node("nssm:ant_dirt", {
groups = {crumbly=3},
})
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 = 15,
})
minetest.register_node("nssm:venomous_gas", {
description = "Venomous Gas",
inventory_image = minetest.inventorycube("venomous_gas.png"),
@ -466,22 +497,6 @@ minetest.register_node("nssm:rope", {
groups = {snappy=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 = 15,
})
minetest.register_tool("nssm:stoneater_pick", {
description = "Stoneater Pickaxe",
inventory_image = "stoneater_pick.png",
@ -522,6 +537,96 @@ minetest.register_tool("nssm:ant_sword", {
},
})
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},
},
})
minetest.register_tool("nssm:gratuitousness_battleaxe", {
description = "Gratuittousness 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},
},
})
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},
},
})
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},
},
})
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},
},
})
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},
},
})
--recipes
minetest.register_craft({
@ -772,6 +877,69 @@ minetest.register_craft({
}
})
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:gratuitnousness_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: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")
--Eggs
function nssm_register_egg (name, descr)
@ -922,10 +1090,12 @@ minetest.register_abm({
})
--Eggs recipes
minetest.register_craft({
output = 'nssm:duck_egg',
recipe = {
{'', 'nssm_duck_beak', ''},
{'', 'nssm:duck_beak', ''},
{'nssm:duck_feather', 'nssm:energy_globe', 'nssm:duck_feather'},
{'nssm:duck_legs', 'nssm:duck_feather', 'nssm:duck_legs'},
}
@ -934,7 +1104,7 @@ minetest.register_craft({
minetest.register_craft({
output = 'nssm:flying_duck_egg',
recipe = {
{'nssm:duck_feather', 'nssm_duck_beak', 'nssm:duck_feather'},
{'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'},
}
@ -943,7 +1113,7 @@ minetest.register_craft({
minetest.register_craft({
output = 'nssm:enderduck_egg',
recipe = {
{'nssm:black_duck_feather', 'nssm_duck_beak', 'nssm:black_duck_feather'},
{'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'},
}
@ -952,7 +1122,7 @@ minetest.register_craft({
minetest.register_craft({
output = 'nssm:swimming_duck_egg',
recipe = {
{'nssm:duck_feather', 'nssm_duck_beak', 'nssm:duck_feather'},
{'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'},
}
@ -961,8 +1131,27 @@ minetest.register_craft({
minetest.register_craft({
output = 'nssm:spiderduck_egg',
recipe = {
{'nssm:duck_legs', 'nssm_duck_beak', 'nssm:duck_legs'},
{'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_egg',
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'},
}
})

View File

@ -5,9 +5,14 @@ function spears_shot (itemstack, player)
local playerpos = player:getpos()
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear)
local dir = player:get_look_dir()
local sp = 16
if spear == "nssm:spear_of_peace_entity" then
sp = 32
gravity = 9.8
else
sp = 16
gravity = 9.8
end
local dr = .3
local gravity = 9.8
obj:setvelocity({x=dir.x*sp, y=dir.y*sp, z=dir.z*sp})
obj:setacceleration({x=-dir.x*dr, y=-gravity, z=-dir.z*dr})
obj:setyaw(player:get_look_yaw()+math.pi)
@ -16,6 +21,7 @@ function spears_shot (itemstack, player)
return true
end
function spears_set_entity(kind, eq, toughness)
local SPEAR_ENTITY={
physical = false,
@ -144,3 +150,109 @@ spears_register_spear('little_ice_tooth', 'Little Ice Tooth', 7, 10, 'nssm:littl
spears_register_spear('duck_beak', 'Duck Beak', 5, 6, 'nssm:duck_beak')
spears_register_spear('felucco_horn', 'Felucco Horn', 7, 9, 'nssm:felucco_horn')
--Spear of peace
minetest.register_tool("nssm:spear_of_peace", {
description = "Spear of Peace",
wield_image = "spear_of_peace.png",
inventory_image = "spear_of_peace.png^[transform4",
wield_scale= {x=4,y=2,z=2},
on_drop = function(itemstack, user, pointed_thing)
spears_shot(itemstack, user)
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
on_place = function(itemstack, user, pointed_thing)
minetest.add_item(pointed_thing.above, itemstack)
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy = {times={[3]=0.2, [2]=0.2, [1]=0.2}, uses=500, maxlevel=1},
},
damage_groups = {fleshy=12},
}
})
function spears_set_sentity(kind, eq, toughness)
local SUPERSPEAR_ENTITY={
physical = false,
timer=0,
visual = "wielditem",
visual_size = {x=0.15, y=0.1},
textures = {"nssm:spear_" .. kind},
lastpos={},
collisionbox = {0,0,0,0,0,0},
on_punch = function(self, puncher)
if puncher then
if puncher:is_player() then
local stack = {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness}
local inv = puncher:get_inventory()
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
self.object:remove()
end
end
end
end,
}
SUPERSPEAR_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:getpos()
local node = minetest.get_node(pos)
if not self.wear then
self.object:remove()
return
end
if self.lastpos.x~=nil then
if node.name ~= "air" and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt')) and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') then
self.object:remove()
if self.wear+65535/toughness < 65535 then
minetest.add_item(self.lastpos, {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness})
end
elseif self.timer>0.2 then
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
local speed = vector.length(self.object:getvelocity())
minetest.chat_send_all(speed)
local damage = (speed + eq)^1.12-20
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=damage},
}, nil)
self.object:remove()
if self.wear+65535/toughness < 65535 then
minetest.add_item(self.lastpos, {name='nssm:spear_' .. kind, wear=self.wear+65535/toughness})
end
end
end
end
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
end
return SUPERSPEAR_ENTITY
end
SUPERSPEAR_ENTITY=spears_set_sentity("of_peace", 10, 500)
minetest.register_entity("nssm:spear_of_peace_entity", SUPERSPEAR_ENTITY)
minetest.register_craft({
output = 'nssm:spear_of_peace',
recipe = {
{'nssm:wrathful_moranga', 'group:wood', 'group:wood'},
}
})

BIN
textures/axe_of_pride.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
textures/death_scythe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
textures/greedy_moranga.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 B

BIN
textures/proud_moranga.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

BIN
textures/spear_of_peace.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

BIN
textures/sword_of_envy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B