mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-06-28 14:16:06 +02:00
Removed whitespaces
This commit is contained in:
@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_build_box", {
|
||||
{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},
|
||||
|
@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_dig_box", {
|
||||
{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},
|
||||
|
@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_fire_box", {
|
||||
{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},
|
||||
|
@ -3,7 +3,7 @@ local function throwing_register_fireworks(color, desc)
|
||||
description = desc .. "fireworks arrow",
|
||||
inventory_image = "throwing_arrow_fireworks_" .. color .. ".png",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("throwing:arrow_fireworks_" .. color .. "_box", {
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
@ -19,7 +19,7 @@ local function throwing_register_fireworks(color, desc)
|
||||
{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 @@ local function throwing_register_fireworks(color, desc)
|
||||
tiles = {"throwing_arrow_fireworks_" .. color .. ".png", "throwing_arrow_fireworks_" .. color .. ".png", "throwing_arrow_fireworks_" .. color .. "_back.png", "throwing_arrow_fireworks_" .. color .. "_front.png", "throwing_arrow_fireworks_" .. color .. "_2.png", "throwing_arrow_fireworks_" .. color .. ".png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
physical = false,
|
||||
timer=0,
|
||||
@ -39,9 +39,9 @@ local function throwing_register_fireworks(color, desc)
|
||||
lastpos={},
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
}
|
||||
|
||||
|
||||
local radius = 0.5
|
||||
|
||||
|
||||
local function add_effects(pos, radius)
|
||||
minetest.add_particlespawner({
|
||||
amount = 256,
|
||||
@ -59,8 +59,8 @@ local function throwing_register_fireworks(color, desc)
|
||||
texture = "throwing_sparkle_" .. color .. ".png",
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
local function boom(pos)
|
||||
minetest.sound_play("throwing_firework_boom", {pos=pos, gain=1, max_hear_distance=2*64})
|
||||
if minetest.get_node(pos).name == 'air' or minetest.get_node(pos).name == 'throwing:firework_trail' then
|
||||
@ -69,9 +69,9 @@ local function throwing_register_fireworks(color, desc)
|
||||
end
|
||||
add_effects(pos, radius)
|
||||
end
|
||||
|
||||
|
||||
-- Back to the arrow
|
||||
|
||||
|
||||
THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
self.timer=self.timer+dtime
|
||||
local pos = self.object:getpos()
|
||||
@ -126,16 +126,16 @@ local function throwing_register_fireworks(color, desc)
|
||||
end
|
||||
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
|
||||
end
|
||||
|
||||
|
||||
minetest.register_entity("throwing:arrow_fireworks_" .. color .. "_entity", THROWING_ARROW_ENTITY)
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_fireworks_' .. color .. ' 8',
|
||||
recipe = {
|
||||
{'default:stick', 'tnt:gunpowder', 'dye:' .. color},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:arrow_fireworks_' .. color .. ' 8',
|
||||
recipe = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--~
|
||||
--~
|
||||
--~ Shot and reload system
|
||||
--~
|
||||
--~
|
||||
|
||||
local players = {}
|
||||
|
||||
@ -80,7 +80,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough
|
||||
description = desc,
|
||||
inventory_image = "throwing_" .. name .. ".png",
|
||||
wield_scale = scale,
|
||||
stack_max = 1,
|
||||
stack_max = 1,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
local pos = user:getpos()
|
||||
local playerName = user:get_player_name()
|
||||
@ -91,7 +91,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_tool("throwing:" .. name .. "_loaded", {
|
||||
description = desc,
|
||||
inventory_image = "throwing_" .. name .. "_loaded.png",
|
||||
@ -104,7 +104,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough
|
||||
end
|
||||
local unloaded = "throwing:" .. name
|
||||
throwing_shoot_arrow(itemstack, user, stiffness, is_cross)
|
||||
minetest.after(0, throwing_unload, itemstack, user, unloaded, wear)
|
||||
minetest.after(0, throwing_unload, itemstack, user, unloaded, wear)
|
||||
return itemstack
|
||||
end,
|
||||
on_drop = function(itemstack, dropper, pointed_thing)
|
||||
@ -114,7 +114,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough
|
||||
end,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'throwing:' .. name,
|
||||
recipe = craft
|
||||
|
@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_shell_box", {
|
||||
{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},
|
||||
|
@ -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 = {
|
||||
|
@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_teleport_box", {
|
||||
{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},
|
||||
|
@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_tnt_box", {
|
||||
{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},
|
||||
|
@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_torch_box", {
|
||||
{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},
|
||||
|
Reference in New Issue
Block a user