Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gamemode/cl_hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ end
function GM:DrawRoundTimer()

if self:GetGameState() == 1 then
local time = math.ceil(5 - self:GetStateRunningTime())
local time = math.ceil(GetGlobalInt( "mb_time_prep" ) - self:GetStateRunningTime())
if time > 0 then
draw.ShadowText(time, "RobotoHUD-40", ScrW() / 2, ScrH() / 3, color_white, 1, 1)
end
Expand Down
1 change: 0 additions & 1 deletion gamemode/cl_rounds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ net.Receive("gamestate", function (len)
GAMEMODE.GameState = net.ReadUInt(32)
GAMEMODE.StateStart = net.ReadDouble()


if GAMEMODE.GameState == 0 then
GAMEMODE:ScoreboardHide()
elseif GAMEMODE.GameState == 1 then
Expand Down
4 changes: 3 additions & 1 deletion gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ resource.AddFile("materials/melonbomber/skull_license.txt")

GM.MapScale = CreateConVar("mb_map_scale", 20, bit.bor(FCVAR_NOTIFY), "Size of map squared per player (default 20)" )
GM.MapMaxArea = CreateConVar("mb_map_maxarea", 500, bit.bor(FCVAR_NOTIFY), "Max area of map squared" )
GM.PrepTime = CreateConVar("mb_time_prep", 5, bit.bor(FCVAR_REPLICATED), "Time to wait before round starts (default 5)" )
GM.EndTime = CreateConVar("mb_time_end", 10, bit.bor(FCVAR_REPLICATED), "Time to show scoreboard at the end (default 10)" )

function GM:Initialize()
self.DeathRagdolls = {}
Expand Down Expand Up @@ -158,4 +160,4 @@ end
function GM:ShowHelp(ply)
net.Start("mb_openhelpmenu")
net.Send(ply)
end
end
3 changes: 3 additions & 0 deletions gamemode/sv_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ function GM:PlayerInitialSpawn(ply)
ply:SetMoney(10000)

ply:SetTeam(2)

-- ConVar replication doesn't work with gmod currently
SetGlobalInt("mb_time_prep", GetConVarNumber("mb_time_prep"))

if self:GetGameState() != 0 then
timer.Simple(0, function ()
Expand Down
4 changes: 2 additions & 2 deletions gamemode/sv_rounds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ function GM:RoundsThink()
self:SetupRound()
end
elseif self:GetGameState() == 1 then
if self:GetStateRunningTime() > 5 then
if self:GetStateRunningTime() > self.PrepTime:GetInt() then
self:StartRound()
end
elseif self:GetGameState() == 2 then
self:CheckForVictory()
elseif self:GetGameState() == 3 then
if self:GetStateRunningTime() > 10 then
if self:GetStateRunningTime() > self.EndTime:GetInt() then
self:SetupRound()
end
end
Expand Down