remove not needed bows and arrows, add mithril bow and arrow
This commit is contained in:
parent
7353195bb1
commit
ae20422bc1
1
init.lua
1
init.lua
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
bows={
|
bows={
|
||||||
pvp=minetest.setting_getbool("enable_pvp"),
|
pvp=minetest.setting_getbool("enable_pvp"),
|
||||||
tnt=minetest.setting_getbool("enable_tnt") and minetest.get_modpath("tnt"),
|
|
||||||
creative=minetest.setting_getbool("creative_mode"),
|
creative=minetest.setting_getbool("creative_mode"),
|
||||||
mesecons=minetest.get_modpath("mesecons"),
|
mesecons=minetest.get_modpath("mesecons"),
|
||||||
registed_arrows={},
|
registed_arrows={},
|
||||||
|
160
items.lua
160
items.lua
@ -47,19 +47,6 @@ bows.register_bow("bow_wood",{
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
bows.register_bow("bow_stone",{
|
|
||||||
description="Stone bow",
|
|
||||||
texture="bows_bow_stone.png",
|
|
||||||
texture_loaded="bows_bow_loaded_stone.png",
|
|
||||||
uses=70,
|
|
||||||
level=4,
|
|
||||||
craft={
|
|
||||||
{"","group:stone","farming:cotton"},
|
|
||||||
{"group:stone","","farming:cotton"},
|
|
||||||
{"","group:stone","farming:cotton"}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
bows.register_bow("bow_steel",{
|
bows.register_bow("bow_steel",{
|
||||||
description="Steel bow",
|
description="Steel bow",
|
||||||
texture="bows_bow_steel.png",
|
texture="bows_bow_steel.png",
|
||||||
@ -73,73 +60,21 @@ bows.register_bow("bow_steel",{
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
bows.register_bow("bow_bronze",{
|
bows.register_bow("bow_mithril",{
|
||||||
description="Bronze bow",
|
description="Mithril bow",
|
||||||
texture="bows_bow_bronze.png",
|
texture="bows_bow_mithril.png",
|
||||||
texture_loaded="bows_bow_loaded_bronze.png",
|
texture_loaded="bows_bow_loaded_mithril.png",
|
||||||
uses=280,
|
uses=910,
|
||||||
level=10,
|
|
||||||
craft={
|
|
||||||
{"","default:bronze_ingot","farming:cotton"},
|
|
||||||
{"default:bronze_ingot","","farming:cotton"},
|
|
||||||
{"","default:bronze_ingot","farming:cotton"}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
bows.register_bow("bow_obsidian",{
|
|
||||||
description="Obsidian bow",
|
|
||||||
texture="bows_bow_ob.png",
|
|
||||||
texture_loaded="bows_bow_loaded_ob.png",
|
|
||||||
uses=400,
|
|
||||||
level=11,
|
|
||||||
craft={
|
|
||||||
{"","default:obsidian","farming:cotton"},
|
|
||||||
{"default:obsidian","","farming:cotton"},
|
|
||||||
{"","default:obsidian","farming:cotton"}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
bows.register_bow("bow_mese",{
|
|
||||||
description="Mese bow",
|
|
||||||
texture="bows_bow_mese.png",
|
|
||||||
texture_loaded="bows_bow_loaded_mese.png",
|
|
||||||
uses=500,
|
|
||||||
level=13,
|
|
||||||
craft={
|
|
||||||
{"","default:mese_crystal","farming:cotton"},
|
|
||||||
{"default:mese_crystal","","farming:cotton"},
|
|
||||||
{"","default:mese_crystal","farming:cotton"}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
bows.register_bow("bow_diamond",{
|
|
||||||
description="Diamond bow",
|
|
||||||
texture="bows_bow_diamond.png",
|
|
||||||
texture_loaded="bows_bow_loaded_diamond.png",
|
|
||||||
uses=800,
|
|
||||||
level=19,
|
level=19,
|
||||||
craft={
|
craft={
|
||||||
{"","default:diamond","farming:cotton"},
|
{"","moreores:mithril_ingot","farming:cotton"},
|
||||||
{"default:diamond","","farming:cotton"},
|
{"moreores:mithril_ingot","","farming:cotton"},
|
||||||
{"","default:diamond","farming:cotton"}
|
{"","moreores:mithril_ingot","farming:cotton"}
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
bows.register_bow("bow_rainbow",{
|
|
||||||
description="Rainbow bow",
|
|
||||||
texture="bows_bow_rain.png",
|
|
||||||
texture_loaded="bows_bow_loaded_rain.png",
|
|
||||||
uses=1100,
|
|
||||||
level=19,
|
|
||||||
craft={
|
|
||||||
{"","default:nyancat_rainbow","farming:cotton"},
|
|
||||||
{"default:nyancat_rainbow","","farming:cotton"},
|
|
||||||
{"","default:nyancat_rainbow","farming:cotton"}
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
bows.register_bow("bow_admin",{
|
bows.register_bow("bow_admin",{
|
||||||
description="Admin bow (admin arrows = bows:arrow_admin)",
|
description="Admin bow",
|
||||||
texture="bows_bow_admin.png",
|
texture="bows_bow_admin.png",
|
||||||
texture_loaded="bows_bow_loaded_admin.png",
|
texture_loaded="bows_bow_loaded_admin.png",
|
||||||
level=39,
|
level=39,
|
||||||
@ -213,6 +148,17 @@ bows.register_arrow("arrow_diamond",{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
bows.register_arrow("arrow_mithril",{
|
||||||
|
description="Mithril arrow",
|
||||||
|
texture="bows_arrow_wood.png^[colorize:#3957A2cc",
|
||||||
|
damage=15,
|
||||||
|
craft_count=8,
|
||||||
|
craft={
|
||||||
|
{"group:arrow","group:arrow","group:arrow"},
|
||||||
|
{"group:arrow","default:diamond","group:arrow"},
|
||||||
|
{"group:arrow","group:arrow","group:arrow"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
bows.register_arrow("arrow_fire",{
|
bows.register_arrow("arrow_fire",{
|
||||||
description="Fire arrow",
|
description="Fire arrow",
|
||||||
@ -226,32 +172,6 @@ bows.register_arrow("arrow_fire",{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
bows.register_arrow("arrow_build",{
|
|
||||||
description="Build arrow",
|
|
||||||
texture="bows_arrow_wood.png^[colorize:#33336677",
|
|
||||||
on_hit_node=bows.arrow_build,
|
|
||||||
craft_count=8,
|
|
||||||
damage=8,
|
|
||||||
craft={
|
|
||||||
{"group:arrow","group:arrow","group:arrow"},
|
|
||||||
{"group:arrow","default:obsidian_shard","group:arrow"},
|
|
||||||
{"group:arrow","group:arrow","group:arrow"}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
bows.register_arrow("arrow_dig",{
|
|
||||||
description="Dig arrow",
|
|
||||||
texture="bows_arrow_wood.png^[colorize:#333333aa",
|
|
||||||
on_hit_node=bows.arrow_dig,
|
|
||||||
craft_count=16,
|
|
||||||
damage=8,
|
|
||||||
craft={
|
|
||||||
{"group:arrow","group:arrow","group:arrow"},
|
|
||||||
{"group:arrow","default:pick_steel","group:arrow"},
|
|
||||||
{"group:arrow","group:arrow","group:arrow"}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
bows.register_arrow("arrow_toxic",{
|
bows.register_arrow("arrow_toxic",{
|
||||||
description="Toxic arrow",
|
description="Toxic arrow",
|
||||||
texture="bows_arrow_wood.png^[colorize:#66aa11aa",
|
texture="bows_arrow_wood.png^[colorize:#66aa11aa",
|
||||||
@ -262,43 +182,3 @@ bows.register_arrow("arrow_toxic",{
|
|||||||
{"group:arrow","default:papyrus"},
|
{"group:arrow","default:papyrus"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
bows.register_arrow("arrow_Tetanus",{
|
|
||||||
description="Tetanus arrow",
|
|
||||||
texture="bows_arrow_wood.png^[colorize:#aa5500aa",
|
|
||||||
on_hit_object=bows.arrow_tetanus,
|
|
||||||
craft_count=4,
|
|
||||||
damage=2,
|
|
||||||
craft={
|
|
||||||
{"","group:arrow",""},
|
|
||||||
{"group:arrow","bucket:bucket_water","group:arrow"},
|
|
||||||
{"","group:arrow",""}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
if bows.tnt then
|
|
||||||
bows.register_arrow("arrow_tnt",{
|
|
||||||
description="TNT arrow",
|
|
||||||
texture="bows_arrow_wood.png^[colorize:#aa0000aa",
|
|
||||||
on_hit_object=bows.arrow_tnt_object,
|
|
||||||
on_hit_node=bows.arrow_tnt_node,
|
|
||||||
craft_count=1,
|
|
||||||
damage=25,
|
|
||||||
craft={{"tnt:tnt","group:arrow"}}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
bows.register_arrow("arrow_rainbow",{
|
|
||||||
description="Rainbow arrow",
|
|
||||||
texture="bows_arrow_wood.png^bows_rainbow.png",
|
|
||||||
craft_count=8,
|
|
||||||
damage=11,
|
|
||||||
craft={
|
|
||||||
{"group:arrow","group:arrow","group:arrow"},
|
|
||||||
{"group:arrow","default:nyancat_rainbow","group:arrow"},
|
|
||||||
{"group:arrow","group:arrow","group:arrow"}
|
|
||||||
},
|
|
||||||
on_step=bows.arrow_rainbow_step,
|
|
||||||
on_hit_object=bows.arrow_rainbow_object
|
|
||||||
})
|
|
@ -1,11 +1,3 @@
|
|||||||
|
|
||||||
bows.arrow_dig=function(self,pos,user,lastpos)
|
|
||||||
minetest.node_dig(pos, minetest.get_node(pos), user)
|
|
||||||
bows.arrow_remove(self)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
bows.arrow_fire_object=function(self,target,hp,user,lastpos)
|
bows.arrow_fire_object=function(self,target,hp,user,lastpos)
|
||||||
bows.arrow_fire(self,lastpos,user,target:getpos())
|
bows.arrow_fire(self,lastpos,user,target:getpos())
|
||||||
return self
|
return self
|
||||||
@ -23,25 +15,6 @@ bows.arrow_fire=function(self,pos,user,lastpos)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
bows.arrow_build=function(self,pos,user,lastpos)
|
|
||||||
local name=user:get_player_name()
|
|
||||||
local node=minetest.get_node(lastpos).name
|
|
||||||
local index=user:get_wield_index()+1
|
|
||||||
local inv=user:get_inventory()
|
|
||||||
local stack=inv:get_stack("main", index)
|
|
||||||
if minetest.is_protected(lastpos, name) then
|
|
||||||
minetest.chat_send_player(name, minetest.pos_to_string(lastpos) .." is protected")
|
|
||||||
elseif minetest.registered_nodes[node].buildable_to
|
|
||||||
and minetest.registered_nodes[stack:get_name()] then
|
|
||||||
minetest.set_node(lastpos,{name=stack:get_name()})
|
|
||||||
if bows.creative==false then
|
|
||||||
inv:set_stack("main",index,ItemStack(stack:get_name() .. " " .. (stack:get_count()-1)))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
bows.arrow_remove(self)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
bows.arrow_toxic=function(self,target,hp,user,lastpos)
|
bows.arrow_toxic=function(self,target,hp,user,lastpos)
|
||||||
if self.object==nil or user==nil or target==nil or target:get_properties()==nil then
|
if self.object==nil or user==nil or target==nil or target:get_properties()==nil then
|
||||||
bows.arrow_remove(self)
|
bows.arrow_remove(self)
|
||||||
@ -58,43 +31,6 @@ bows.arrow_toxic=function(self,target,hp,user,lastpos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
bows.arrow_tetanus=function(self,target,hp,user,lastpos)
|
|
||||||
if self.object==nil or user==nil or target==nil or target:get_properties()==nil then
|
|
||||||
bows.arrow_remove(self)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
if target:get_attach()==nil then
|
|
||||||
self.object:set_detach()
|
|
||||||
local col=target:get_properties().collisionbox
|
|
||||||
self.object:set_properties({
|
|
||||||
collisionbox=col,
|
|
||||||
physical=true,
|
|
||||||
visual_size={x=1,y=1},
|
|
||||||
visual="sprite",
|
|
||||||
textures={"bows_hidden.png"}
|
|
||||||
})
|
|
||||||
self.object:setpos(target:getpos())
|
|
||||||
target:set_attach(self.object, "", {x=0,y=0,z=0},{x=0,y=0,z=0})
|
|
||||||
self.target=target
|
|
||||||
self.hp=self.object:get_hp()
|
|
||||||
self.object:setvelocity({x=0, y=-3, z=0})
|
|
||||||
self.object:setacceleration({x=0, y=-3, z=0})
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
local rnd=math.random(1,10)
|
|
||||||
if rnd~=4 and target:get_hp()>0 then
|
|
||||||
minetest.after(math.random(4), function(self,target,hp,user,lastpos)
|
|
||||||
bows.arrow_tetanus(self,target,hp,user,lastpos)
|
|
||||||
end, self,target,hp,user,lastpos)
|
|
||||||
else
|
|
||||||
target:set_detach()
|
|
||||||
target:setvelocity({x=0, y=4, z=0})
|
|
||||||
target:setacceleration({x=0, y=-10, z=0})
|
|
||||||
bows.arrow_remove(self)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
bows.arrow_admin_object=function(self,target,hp,user,lastpos)
|
bows.arrow_admin_object=function(self,target,hp,user,lastpos)
|
||||||
target:set_hp(0)
|
target:set_hp(0)
|
||||||
target:punch(self.object, {full_punch_interval=1.0,damage_groups={fleshy=4}}, "default:sword_wood", nil)
|
target:punch(self.object, {full_punch_interval=1.0,damage_groups={fleshy=4}}, "default:sword_wood", nil)
|
||||||
@ -106,74 +42,3 @@ bows.arrow_admin_node=function(self,pos,user,lastpos)
|
|||||||
bows.arrow_remove(self)
|
bows.arrow_remove(self)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
bows.arrow_tnt_object=function(self,target,hp,user,lastpos)
|
|
||||||
local name=user:get_player_name()
|
|
||||||
local node=minetest.get_node(lastpos).name
|
|
||||||
if minetest.is_protected(lastpos, name) then
|
|
||||||
minetest.chat_send_player(name, minetest.pos_to_string(lastpos) .." is protected")
|
|
||||||
elseif minetest.registered_nodes[node].buildable_to then
|
|
||||||
tnt.boom(lastpos, {damage_radius=5,radius=3,ignore_protection=false})
|
|
||||||
end
|
|
||||||
bows.arrow_remove(self)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
bows.arrow_tnt_node=function(self,pos,user,lastpos)
|
|
||||||
local name=user:get_player_name()
|
|
||||||
local node=minetest.get_node(lastpos).name
|
|
||||||
if minetest.is_protected(lastpos, name) then
|
|
||||||
minetest.chat_send_player(name, minetest.pos_to_string(lastpos) .." is protected")
|
|
||||||
elseif minetest.registered_nodes[node].buildable_to then
|
|
||||||
tnt.boom(pos, {damage_radius=5,radius=3,ignore_protection=false})
|
|
||||||
end
|
|
||||||
bows.arrow_remove(self)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
bows.arrow_rainbow_step=function(self,dtime,user,pos,lastpos)
|
|
||||||
minetest.add_particlespawner({
|
|
||||||
amount = 90,
|
|
||||||
time =0.5,
|
|
||||||
minpos = pos,
|
|
||||||
maxpos =pos,
|
|
||||||
minvel = {x=-1, y=-1, z=-1},
|
|
||||||
maxvel = {x=1, y=-0.5, z=1},
|
|
||||||
minacc = {x=0, y=0, z=0},
|
|
||||||
maxacc = {x=0, y=0, z=0},
|
|
||||||
minexptime = 1.0,
|
|
||||||
maxexptime = 1.5,
|
|
||||||
minsize = 2.6,
|
|
||||||
maxsize = 1.2,
|
|
||||||
texture = "bows_rainbow.png",
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
bows.arrow_rainbow_object=function(self,target,hp,user,lastpos)
|
|
||||||
local pos=target:getpos()
|
|
||||||
minetest.add_particle({
|
|
||||||
pos = pos,
|
|
||||||
velocity = vector.new(),
|
|
||||||
acceleration = vector.new(),
|
|
||||||
expirationtime = 0.4,
|
|
||||||
size = 20,
|
|
||||||
collisiondetection = false,
|
|
||||||
vertical = false,
|
|
||||||
texture = "bows_rainbow.png",
|
|
||||||
})
|
|
||||||
minetest.add_particlespawner({
|
|
||||||
amount = 100,
|
|
||||||
time = 0.5,
|
|
||||||
minpos = vector.subtract(pos, 3),
|
|
||||||
maxpos = vector.add(pos, 3),
|
|
||||||
minvel = {x = -10, y = -10, z = -10},
|
|
||||||
maxvel = {x = 10, y = 10, z = 10},
|
|
||||||
minacc = vector.new(),
|
|
||||||
maxacc = vector.new(),
|
|
||||||
minexptime = 1,
|
|
||||||
maxexptime = 2.5,
|
|
||||||
minsize = 3,
|
|
||||||
maxsize = 9,
|
|
||||||
texture = "bows_rainbow.png",
|
|
||||||
})
|
|
||||||
end
|
|
Binary file not shown.
Before Width: | Height: | Size: 282 B |
Binary file not shown.
Before Width: | Height: | Size: 396 B |
Loading…
x
Reference in New Issue
Block a user