mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-09 20:36:15 +00:00
Make the sniper alot stronger and other changes
This commit is contained in:
parent
43f40c2550
commit
fa83d73135
1 changed files with 19 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ function give_player_items(player)
|
||||||
inv:set_list("main", {})
|
inv:set_list("main", {})
|
||||||
|
|
||||||
if class == "sniper" then
|
if class == "sniper" then
|
||||||
inv:add_item("main", "ctf_ranged:svd_loaded")
|
inv:add_item("main", "ctf_ranged:m200_loaded")
|
||||||
inv:add_item("main", "default:sword_steel")
|
inv:add_item("main", "default:sword_steel")
|
||||||
inv:add_item("main", "ctf_ranged:ammo 100")
|
inv:add_item("main", "ctf_ranged:ammo 100")
|
||||||
elseif class == "assault" then
|
elseif class == "assault" then
|
||||||
|
|
@ -155,6 +155,12 @@ function start_match()
|
||||||
player:set_hp(20)
|
player:set_hp(20)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for i = 10, 1, -1 do -- count down from 10 to 1 (yes you are free to set me on fire for this horrible solution)
|
||||||
|
core.after(20 + i, function()
|
||||||
|
core.chat_send_all(core.colorize("green", "Match starts in " .. (11 - i) .. " seconds."))
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
core.after(30, function()
|
core.after(30, function()
|
||||||
set_match_state("in_progress")
|
set_match_state("in_progress")
|
||||||
core.chat_send_all(core.colorize("green", "Match started!"))
|
core.chat_send_all(core.colorize("green", "Match started!"))
|
||||||
|
|
@ -309,6 +315,18 @@ core.register_on_respawnplayer(function(player)
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
local timer = 0
|
||||||
|
core.register_globalstep(function(dtime)
|
||||||
|
timer = timer + dtime
|
||||||
|
|
||||||
|
if timer >= 10 then
|
||||||
|
timer = 0
|
||||||
|
for _, player in pairs(core.get_connected_players()) do
|
||||||
|
player:set_hp(math.min(player:get_hp() + 2, 20))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
core.register_on_player_receive_fields(function(player, formname, fields)
|
core.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
|
||||||
if match_state ~= "pre_match" then
|
if match_state ~= "pre_match" then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue