forked from nalc/spears
beta1
This commit is contained in:
parent
94e812644f
commit
2c0ebde983
|
@ -1,4 +1,6 @@
|
|||
DISABLE_STONE_SPEAR = false
|
||||
DISABLE_STEEL_SPEAR = false
|
||||
DISABLE_COPPER_SPEAR = false
|
||||
DISABLE_BRONZE_SPEAR = false
|
||||
DISABLE_DIAMOND_SPEAR = false
|
||||
DISABLE_OBSIDIAN_SPEAR = false
|
||||
|
|
|
@ -3,7 +3,7 @@ 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 = 14
|
||||
local sp = 16
|
||||
local dr = .3
|
||||
local gravity = 9.8
|
||||
obj:setvelocity({x=dir.x*sp, y=dir.y*sp, z=dir.z*sp})
|
||||
|
@ -57,7 +57,7 @@ function spears_set_entity(kind, eq, toughness)
|
|||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= "spears:spear_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
local speed = vector.length(self.object:getvelocity())
|
||||
local damage = (speed + eq)^1.12-20
|
||||
local damage = (speed + eq)^1.12-10
|
||||
obj:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=damage},
|
||||
|
|
BIN
textures/spears_spear_bronze.png
Normal file
BIN
textures/spears_spear_bronze.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 247 B |
BIN
textures/spears_spear_copper.png
Normal file
BIN
textures/spears_spear_copper.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 256 B |
11
tools.lua
11
tools.lua
|
@ -2,7 +2,8 @@ function spears_register_spear(kind, desc, eq, toughness, material)
|
|||
|
||||
minetest.register_tool("spears:spear_" .. kind, {
|
||||
description = desc .. " spear",
|
||||
inventory_image = "spears_spear_" .. kind .. ".png",
|
||||
wield_image = "spears_spear_" .. kind .. ".png",
|
||||
inventory_image = "spears_spear_" .. kind .. ".png^[transform4",
|
||||
wield_scale= {x=2,y=1,z=1},
|
||||
on_drop = function(itemstack, user, pointed_thing)
|
||||
spears_shot(itemstack, user)
|
||||
|
@ -55,6 +56,14 @@ if not DISABLE_STEEL_SPEAR then
|
|||
spears_register_spear('steel', 'Steel', 6, 30, 'default:steel_ingot')
|
||||
end
|
||||
|
||||
if not DISABLE_COPPER_SPEAR then
|
||||
spears_register_spear('copper', 'Copper', 5, 35, 'default:copper_ingot')
|
||||
end
|
||||
|
||||
if not DISABLE_BRONZE_SPEAR then
|
||||
spears_register_spear('bronze', 'Bronze', 6, 35, 'default:bronze_ingot')
|
||||
end
|
||||
|
||||
if not DISABLE_OBSIDIAN_SPEAR then
|
||||
spears_register_spear('obsidian', 'Obsidian', 8, 30, 'default:obsidian')
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user