La calma prima della tempesta (di proiettili, da rifare)

master
Zughy 2020-10-30 12:01:58 +01:00
parent 85e5e97d60
commit 676a00e8f7
4 changed files with 23 additions and 33 deletions

View File

@ -19,6 +19,7 @@
stack_max = def.stack_max,
on_drop = function() end,
on_place = function(itemstack, user, pointed_thing)
if def.throwable_by_hand then
local inv = user:get_inventory()
@ -28,12 +29,7 @@
user:set_armor_groups({immortal = nil})
end
local p_name = user:get_player_name()
-- Check if the player is in the arena and is fighting, if not it exits
if not arena_lib.is_player_in_arena(p_name) then return end
local arena = arena_lib.get_arena_by_player(p_name)
if not arena or not arena.in_game or user:get_hp() <= 0 or arena.weapons_disabled then return end
@ -57,10 +53,6 @@
end
local p_name = user:get_player_name()
-- Check if the player is in the arena and is fighting, if not it exits
if not arena_lib.is_player_in_arena(p_name) then return end
local arena = arena_lib.get_arena_by_player(p_name)
if not arena or not arena.in_game or user:get_hp() <= 0 or arena.weapons_disabled then return end
@ -84,6 +76,8 @@
end
end
function bullet_set_entity(name, def)
local bullet_entity = {
initial_properties = {
@ -239,8 +233,6 @@ function bullet_set_entity(name, def)
end
else
if moveresult.collides and moveresult.collisions[1] and not vector.equals(moveresult.collisions[1].old_velocity, velocity) and vector.distance(moveresult.collisions[1].old_velocity, velocity) > 4 then
@ -306,7 +298,8 @@ function bullet_set_entity(name, def)
end
-- Aggiunge le particelle dell'esplosione
function spawn_particles_sphere(pos, particle_texture)
if not pos then return end
minetest.add_particlespawner({

View File

@ -18,8 +18,5 @@ block_league.register_bullet("block_league:smg_bullet", {
glow = 0,
interval = 5,
amount = 5,
},
}
})

View File

@ -222,18 +222,18 @@ function block_league.get_pointed_players(head_pos, dir, range, user, particle,
if #players > 0 then
if particle ~= nil and particle ~= false then
if not has_piercing then
local dist3 = get_dist(head_pos, players[1]:get_pos())
draw_particles(particle, dir, p1, range, dist3)
local impact_dist = get_dist(head_pos, players[1]:get_pos())
draw_particles(particle, dir, p1, range, impact_dist)
else
local dist3 = get_dist(head_pos, hit.intersection_point)
draw_particles(particle, dir, p1, range, dist3)
local impact_dist = get_dist(head_pos, hit.intersection_point)
draw_particles(particle, dir, p1, range, impact_dist)
end
end
return players
else
if particle ~= nil and particle ~= false then
local dist3 = get_dist(head_pos, hit.intersection_point)
draw_particles(particle, dir, p1, range, dist3)
local impact_dist = get_dist(head_pos, hit.intersection_point)
draw_particles(particle, dir, p1, range, impact_dist)
end
return nil
end
@ -248,8 +248,8 @@ function block_league.get_pointed_players(head_pos, dir, range, user, particle,
draw_particles(particle, dir, p1, range, 120)
return players
else
local dist3 = get_dist(head_pos, players[1]:get_pos())
draw_particles(particle, dir, p1, range, dist3)
local impact_dist = get_dist(head_pos, players[1]:get_pos())
draw_particles(particle, dir, p1, range, impact_dist)
return {players[1]}
end
end
@ -343,16 +343,16 @@ end
function draw_particles(particle, dir, p1, dist2, dist3)
function draw_particles(particle, dir, origin, range, impact_dist)
minetest.add_particlespawner({
amount = particle.amount,
time = 0.3,
minpos = p1,
maxpos = p1,
minvel = vector.multiply(dir, dist2),
maxvel = vector.multiply(dir, dist2),
minexptime = dist3/(dist2 * 1.5),
maxexptime = dist3/(dist2 * 1.5),
minpos = origin,
maxpos = origin,
minvel = vector.multiply(dir, range),
maxvel = vector.multiply(dir, range),
minexptime = impact_dist/(range * 1.5),
maxexptime = impact_dist/(range * 1.5),
size = 2,
collisiondetection = false,
vertical = false,

View File

@ -35,7 +35,7 @@ arena_lib.register_minigame("block_league", {
goal_red = {},
goal_blue = {},
ball_spawn = {},
min_y = 0,
min_y = 0
},
temp_properties = {
weapons_disabled = true,
@ -47,7 +47,7 @@ arena_lib.register_minigame("block_league", {
},
player_properties = {
energy = 100,
weapons_magazine = {},
weapons_magazine = {}
}
})