mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-12-21 17:15:32 +01:00
Removed whitespaces
This commit is contained in:
@@ -3,7 +3,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
description = desc .. " arrow",
|
||||
inventory_image = "throwing_arrow_" .. kind .. ".png",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("throwing:arrow_" .. kind .. "_box", {
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
@@ -19,7 +19,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
{7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17},
|
||||
{7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17},
|
||||
{6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17},
|
||||
|
||||
|
||||
{7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17},
|
||||
{8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17},
|
||||
{8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17},
|
||||
@@ -29,7 +29,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
tiles = {"throwing_arrow_" .. kind .. ".png", "throwing_arrow_" .. kind .. ".png", "throwing_arrow_" .. kind .. "_back.png", "throwing_arrow_" .. kind .. "_front.png", "throwing_arrow_" .. kind .. "_2.png", "throwing_arrow_" .. kind .. ".png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
physical = false,
|
||||
timer=0,
|
||||
@@ -39,19 +39,19 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
lastpos={},
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
}
|
||||
|
||||
|
||||
THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
self.timer=self.timer+dtime
|
||||
local pos = self.object:getpos()
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
|
||||
if self.timer>0.2 then
|
||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= "throwing:arrow_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
local speed = vector.length(self.object:getvelocity())
|
||||
local damage = ((speed + eq)^1.2)/10
|
||||
local damage = ((speed + eq)^1.2)/10
|
||||
obj:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=damage},
|
||||
@@ -66,7 +66,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if self.lastpos.x~=nil then
|
||||
if node.name ~= "air" and not string.find(node.name, 'default:grass') and not string.find(node.name, 'default:junglegrass') and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') then
|
||||
self.object:remove()
|
||||
@@ -79,16 +79,16 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
end
|
||||
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
|
||||
end
|
||||
|
||||
|
||||
minetest.register_entity("throwing:arrow_" .. kind .. "_entity", THROWING_ARROW_ENTITY)
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_' .. kind .. ' 16',
|
||||
recipe = {
|
||||
{'default:stick', 'default:stick', craft},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_' .. kind .. ' 16',
|
||||
recipe = {
|
||||
|
||||
Reference in New Issue
Block a user