This commit is contained in:
Zughy 2023-06-02 23:51:13 +02:00
parent 948c8ec522
commit 23eb745fb6
8 changed files with 62 additions and 2 deletions

View File

@ -115,6 +115,7 @@ dofile(srcpath .. "/game/game_main.lua")
dofile(srcpath .. "/game/input_manager.lua")
dofile(srcpath .. "/game/misc/fall.lua")
dofile(srcpath .. "/game/misc/immunity.lua")
dofile(srcpath .. "/game/misc/rays.lua")
dofile(srcpath .. "/game/misc/stamina.lua")
dofile(srcpath .. "/game/TD/ball.lua")
-- player

View File

@ -54,6 +54,9 @@ Deaths=Morti
Points=Punti
Team=Squadra
# game/misc/rays.lua
Rays=Raggi
# game/TD/ball.lua
Ball reset=Palla ripristinata
NICE POINT!=BEL PUNTO!

View File

@ -54,6 +54,9 @@ Deaths=
Points=
Team=
# game/misc/rays.lua
Rays=
# game/TD/ball.lua
Ball reset=
NICE POINT!=

View File

@ -53,9 +53,7 @@ end
function round_start(arena)
for pl_name, stats in pairs(arena.players) do
local player = minetest.get_player_by_name(pl_name)
if player:get_hp() > 0 then

55
src/game/misc/rays.lua Normal file
View File

@ -0,0 +1,55 @@
local function register_rays(name, texture)
minetest.register_node("block_league:" .. name, {
description = "Rays",
inventory_image = texture,
tiles = {{
name = texture,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5
}}
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
}
},
light_source = 10,
walkable = false,
pointable = false,
groups = {oddly_breakable_by_hand = 3}
})
end
register_rays("rays_orange", "bl_rays_orange.png")
register_rays("rays_blue", "bl_rays_blue.png")
minetest.register_globalstep(function(dtime)
for _, pl_name in pairs(arena_lib.get_players_in_minigame("block_league")) do
if not arena_lib.is_player_spectating(pl_name) then
local player = minetest.get_player_by_name(pl_name)
local p_nodename = minetest.get_node(player:get_pos()).name
local arena = arena_lib.get_arena_by_player(pl_name)
local p_team = arena.players[pl_name].teamID
if p_nodename == "block_league:rays_blue" or p_nodename == "block_league:rays_orange" then
if player:get_meta():get_int("bl_has_ball") == 1 then
block_league.get_ball(player):reset() -- TODO non parla di reset ma di palla persa, sistema
end
if player:get_hp() > 0 and ((p_team == 1 and p_nodename == "block_league:rays_blue") or (p_team == 2 and p_nodename == "block_league:rays_orange")) then
player:set_hp(0)
block_league.HUD_log_update(arena, "bl_log_suicide.png", pl_name, "")
end
end
end
end
end)

BIN
textures/bl_log_rays.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

BIN
textures/bl_rays_blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

BIN
textures/bl_rays_orange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B