continuata pulizia generale
This commit is contained in:
parent
67c01fbc25
commit
53fc1bbbc0
@ -54,15 +54,7 @@ arena_lib.on_start("block_league", function(arena)
|
|||||||
player:set_armor_groups({immortal = nil})
|
player:set_armor_groups({immortal = nil})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se è TD, forza chunk entità e la aggiunge nel mondo
|
block_league.round_start(arena)
|
||||||
if arena.mod == 1 then
|
|
||||||
local pos1 = {x = arena.ball_spawn.x - 1, y = arena.ball_spawn.y - 1, z = arena.ball_spawn.z - 1}
|
|
||||||
local pos2 = {x = arena.ball_spawn.x + 1, y = arena.ball_spawn.y + 1, z = arena.ball_spawn.z + 1}
|
|
||||||
minetest.forceload_block(pos1, pos2)
|
|
||||||
|
|
||||||
local ent = minetest.add_entity(arena.ball_spawn,"block_league:prototipo",arena.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
block_league.energy_refill(arena)
|
block_league.energy_refill(arena)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
-- for any override of arena_lib's properties
|
|
@ -1,9 +1,9 @@
|
|||||||
local S = minetest.get_translator("block_league")
|
local S = minetest.get_translator("block_league")
|
||||||
|
|
||||||
local function cast_entity_ray() end
|
local function cast_entity_ray() end
|
||||||
|
local function announce_ball_possession_change() end
|
||||||
local function check_for_touchdown() end
|
local function check_for_touchdown() end
|
||||||
local function add_point() end
|
local function add_point() end
|
||||||
local function announce_ball_possession_change() end
|
|
||||||
|
|
||||||
|
|
||||||
-- entità
|
-- entità
|
||||||
@ -249,7 +249,7 @@ function ball:reset()
|
|||||||
end
|
end
|
||||||
|
|
||||||
self:_destroy()
|
self:_destroy()
|
||||||
minetest.add_entity(arena.ball_spawn,"block_league:prototipo",arena.name)
|
minetest.add_entity(arena.ball_spawn,"block_league:ball",arena.name)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -288,24 +288,12 @@ function check_for_touchdown(id, arena, ball, wielder, w_pos, goal)
|
|||||||
w_pos.y <= goal.y + 3 then
|
w_pos.y <= goal.y + 3 then
|
||||||
|
|
||||||
add_point(wielder:get_player_name(), arena)
|
add_point(wielder:get_player_name(), arena)
|
||||||
|
|
||||||
wielder:set_physics_override({
|
|
||||||
speed = block_league.SPEED,
|
|
||||||
jump = 1.5
|
|
||||||
})
|
|
||||||
wielder:get_meta():set_int("blockleague_has_ball", 0)
|
wielder:get_meta():set_int("blockleague_has_ball", 0)
|
||||||
|
|
||||||
local arena = arena
|
|
||||||
arena.weapons_disabled = true
|
arena.weapons_disabled = true
|
||||||
|
|
||||||
minetest.after(5, function()
|
minetest.after(5, function()
|
||||||
teleport_players(arena)
|
block_league.round_start(arena)
|
||||||
local pos1 = {x = arena.ball_spawn.x - 1, y = arena.ball_spawn.y - 1, z = arena.ball_spawn.z - 1}
|
|
||||||
local pos2 = {x = arena.ball_spawn.x + 1, y = arena.ball_spawn.y + 1, z = arena.ball_spawn.z + 1}
|
|
||||||
--minetest.load_area(pos1, pos2)
|
|
||||||
minetest.forceload_block(pos1, pos2)
|
|
||||||
--minetest.emerge_area(pos1, pos2)
|
|
||||||
minetest.add_entity(arena.ball_spawn,"block_league:prototipo",arena.name)
|
|
||||||
arena.weapons_disabled = false
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ball:_destroy()
|
ball:_destroy()
|
||||||
@ -313,23 +301,6 @@ function check_for_touchdown(id, arena, ball, wielder, w_pos, goal)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function teleport_players(arena)
|
|
||||||
for id, team in pairs(arena.teams) do
|
|
||||||
local players = arena_lib.get_players_in_team(arena, id, true)
|
|
||||||
for index, player in pairs(players) do
|
|
||||||
player:set_hp(20)
|
|
||||||
local p_name = player:get_player_name()
|
|
||||||
arena.players[p_name].energy = 100
|
|
||||||
player:get_meta():set_int("reloading", 0)
|
|
||||||
panel_lib.get_panel(p_name, "bullets_hud"):remove()
|
|
||||||
arena.players[p_name].weapons_reload = {}
|
|
||||||
block_league.weapons_hud_create(p_name)
|
|
||||||
panel_lib.get_panel(p_name, "bullets_hud"):show()
|
|
||||||
block_league.energy_update(arena, p_name)
|
|
||||||
player:set_pos(arena_lib.get_random_spawner(arena, id))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function add_point(w_name, arena)
|
function add_point(w_name, arena)
|
||||||
@ -399,4 +370,4 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_entity("block_league:prototipo", ball)
|
minetest.register_entity("block_league:ball", ball)
|
45
_modes/game_main.lua
Normal file
45
_modes/game_main.lua
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
local function load_ball() end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function block_league.round_start(arena)
|
||||||
|
for p_name, stats in pairs(arena.players) do
|
||||||
|
|
||||||
|
local player = minetest.get_player_by_name(p_name)
|
||||||
|
|
||||||
|
player:set_hp(20)
|
||||||
|
arena.players[p_name].energy = 100
|
||||||
|
|
||||||
|
player:get_meta():set_int("reloading", 0)
|
||||||
|
panel_lib.get_panel(p_name, "bullets_hud"):remove()
|
||||||
|
|
||||||
|
arena.players[p_name].weapons_reload = {}
|
||||||
|
block_league.weapons_hud_create(p_name)
|
||||||
|
panel_lib.get_panel(p_name, "bullets_hud"):show()
|
||||||
|
|
||||||
|
block_league.energy_update(arena, p_name)
|
||||||
|
player:set_pos(arena_lib.get_random_spawner(arena, stats.teamID))
|
||||||
|
end
|
||||||
|
|
||||||
|
if arena.mod == 1 then
|
||||||
|
load_ball(arena)
|
||||||
|
end
|
||||||
|
|
||||||
|
arena.weapons_disabled = false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------------------------
|
||||||
|
---------------FUNZIONI LOCALI----------------
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
function load_ball(arena)
|
||||||
|
local pos1 = {x = arena.ball_spawn.x - 1, y = arena.ball_spawn.y - 1, z = arena.ball_spawn.z - 1}
|
||||||
|
local pos2 = {x = arena.ball_spawn.x + 1, y = arena.ball_spawn.y + 1, z = arena.ball_spawn.z + 1}
|
||||||
|
|
||||||
|
minetest.forceload_block(pos1, pos2)
|
||||||
|
minetest.add_entity(arena.ball_spawn,"block_league:ball",arena.name)
|
||||||
|
end
|
@ -11,6 +11,7 @@ block_league.register_weapon("block_league:sword", {
|
|||||||
type = 3,
|
type = 3,
|
||||||
weap_damage = 7,
|
weap_damage = 7,
|
||||||
knockback = 40,
|
knockback = 40,
|
||||||
|
|
||||||
on_right_click = function(arena, name, def, itemstack, user, pointed_thing)
|
on_right_click = function(arena, name, def, itemstack, user, pointed_thing)
|
||||||
|
|
||||||
local dir = user:get_look_dir()
|
local dir = user:get_look_dir()
|
||||||
|
5
init.lua
5
init.lua
@ -67,7 +67,6 @@ dofile(minetest.get_modpath("block_league") .. "/utils.lua")
|
|||||||
|
|
||||||
-- arena_lib
|
-- arena_lib
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_arena_lib/arena_manager.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_arena_lib/arena_manager.lua")
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_arena_lib/arena_properties.lua")
|
|
||||||
-- HUD
|
-- HUD
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_HUD/hud_achievements.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_HUD/hud_achievements.lua")
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_HUD/hud_broadcast.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_HUD/hud_broadcast.lua")
|
||||||
@ -90,8 +89,10 @@ dofile(minetest.get_modpath("block_league") .. "/_weapons/rocket_launcher.lua")
|
|||||||
dofile(minetest.get_modpath("block_league") .. "/_weapons/sword.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_weapons/sword.lua")
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_weapons/smg.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_weapons/smg.lua")
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_weapons/smg_bullet.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_weapons/smg_bullet.lua")
|
||||||
|
-- modes
|
||||||
|
dofile(minetest.get_modpath("block_league") .. "/_modes/game_main.lua")
|
||||||
|
dofile(minetest.get_modpath("block_league") .. "/_modes/TD/ball.lua")
|
||||||
-- misc
|
-- misc
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_misc/ball.lua")
|
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_misc/energy.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_misc/energy.lua")
|
||||||
dofile(minetest.get_modpath("block_league") .. "/_misc/immunity.lua")
|
dofile(minetest.get_modpath("block_league") .. "/_misc/immunity.lua")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user