update doppia kill per bazooka e proiettile direzionato correttamente
commit
95ae1e528b
|
@ -2,6 +2,13 @@
|
||||||
--Metodo che spawna l'entity e la imposta di velocità e simili.
|
--Metodo che spawna l'entity e la imposta di velocità e simili.
|
||||||
--manca il rinculo ma ho problemi più grandi da risolvere.
|
--manca il rinculo ma ho problemi più grandi da risolvere.
|
||||||
|
|
||||||
|
local shooted_players = 0
|
||||||
|
local stored_targets = 0
|
||||||
|
local counter = 0
|
||||||
|
local boolean = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function quake.shoot_bullet(user, pointed_thing, bullet_name, pos_head, dir)
|
function quake.shoot_bullet(user, pointed_thing, bullet_name, pos_head, dir)
|
||||||
local username = user:get_player_name()
|
local username = user:get_player_name()
|
||||||
|
|
||||||
|
@ -98,19 +105,20 @@ function quake.shoot(number_of_players, p_name, pointed_thing, damage, has_knock
|
||||||
shooted_players = 0
|
shooted_players = 0
|
||||||
counter = 0
|
counter = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
shooted_players = shooted_players + 1
|
shooted_players = shooted_players + 1
|
||||||
|
|
||||||
if shooted_players > 1 then
|
if shooted_players > 1 then
|
||||||
-- perchè al momento arriviamo a 5 achievement e quelli dopo sono il sesto che sarà doppia ed il settimo che è tripla.
|
|
||||||
--sarà da risolvere in qualche modo migliore in futuro più astratto ma al momento credo vada bene
|
|
||||||
if shooted_players == 2 then
|
if shooted_players == 2 then
|
||||||
quake.add_achievement(p_name, 6)
|
quake.add_achievement(p_name, 6)
|
||||||
quake.show_achievement(p_name, 6)
|
quake.show_achievement(p_name, 6)
|
||||||
arena_lib.send_message_players_in_arena(arena, "[Quake] " .. minetest.colorize("#eea160", p_name) .. " ha fatto una "..numeri[1].." kill")
|
elseif shooted_players >= 3 then
|
||||||
elseif shooted_players == 3 then
|
|
||||||
quake.add_achievement(p_name, 7)
|
quake.add_achievement(p_name, 7)
|
||||||
quake.show_achievement(p_name, 7)
|
quake.show_achievement(p_name, 7)
|
||||||
arena_lib.send_message_players_in_arena(arena, "[Quake] " .. minetest.colorize("#eea160", p_name) .. " ha fatto una "..numeri[2].." kill")
|
|
||||||
end
|
end
|
||||||
|
arena_lib.send_message_players_in_arena(arena, "[Quake] " .. minetest.colorize("#eea160", p_name) .. " ha ucciso " .. shooted_players " .. giocatori in un colpo!")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- aggiungo la kill
|
-- aggiungo la kill
|
||||||
|
|
|
@ -61,10 +61,9 @@ function quake.register_weapon(name, def)
|
||||||
local target_pointed_thing = get_pointed_players(pos_head, dir, range, username)
|
local target_pointed_thing = get_pointed_players(pos_head, dir, range, username)
|
||||||
if not target_pointed_thing then return end
|
if not target_pointed_thing then return end
|
||||||
|
|
||||||
local i = 0
|
|
||||||
for i = 2,(target_pointed_thing[1])+1 do
|
for i = 2,(target_pointed_thing[1])+1 do
|
||||||
if target_pointed_thing[i] then
|
if target_pointed_thing[i] then
|
||||||
quake.shoot(target_pointed_thing[1], user:get_player_name(), target_pointed_thing[i].ref, def.weap_damage, has_knockback)
|
quake.shoot(user:get_player_name(), target_pointed_thing[i].ref, def.weap_damage, has_knockback, target_pointed_thing[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
2
init.lua
2
init.lua
|
@ -38,7 +38,7 @@ dofile(minetest.get_modpath("quake") .. "/_arena_lib/arena_properties.lua")
|
||||||
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_achievements.lua")
|
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_achievements.lua")
|
||||||
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_ingame_stats.lua")
|
dofile(minetest.get_modpath("quake") .. "/_HUD/hud_ingame_stats.lua")
|
||||||
dofile(minetest.get_modpath("quake") .. "/_HUD/scoreboard.lua")
|
dofile(minetest.get_modpath("quake") .. "/_HUD/scoreboard.lua")
|
||||||
dofile(minetest.get_modpath("quake") .. "/_weapons/bullet.lua")
|
dofile(minetest.get_modpath("quake") .. "/_weapons/bullets.lua")
|
||||||
dofile(minetest.get_modpath("quake") .. "/_weapons/weapons.lua")
|
dofile(minetest.get_modpath("quake") .. "/_weapons/weapons.lua")
|
||||||
dofile(minetest.get_modpath("quake") .. "/_weapons/railgun.lua")
|
dofile(minetest.get_modpath("quake") .. "/_weapons/railgun.lua")
|
||||||
dofile(minetest.get_modpath("quake") .. "/_weapons/shotgun.lua")
|
dofile(minetest.get_modpath("quake") .. "/_weapons/shotgun.lua")
|
||||||
|
|
Loading…
Reference in New Issue