summaryrefslogtreecommitdiff
path: root/gamemode/events
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/events')
-rw-r--r--gamemode/events/antidote_shortage.lua28
-rw-r--r--gamemode/events/fallout.lua58
-rw-r--r--gamemode/events/radio_blackout.lua18
-rw-r--r--gamemode/events/radioblackout.lua18
-rw-r--r--gamemode/events/scientist.lua14
-rw-r--r--gamemode/events/supply_crate.lua16
-rw-r--r--gamemode/events/supplycrate.lua16
-rw-r--r--gamemode/events/weather_event.lua10
8 files changed, 89 insertions, 89 deletions
diff --git a/gamemode/events/antidote_shortage.lua b/gamemode/events/antidote_shortage.lua
index 829709b..c88a99e 100644
--- a/gamemode/events/antidote_shortage.lua
+++ b/gamemode/events/antidote_shortage.lua
@@ -3,37 +3,37 @@ local EVENT = {}
EVENT.Chance = 0.75
EVENT.Type = EVENT_BAD
-EVENT.TimeText = { "1 minute", "2 minutes", "3 minutes" }
-EVENT.Times = { 60, 120, 180 }
+EVENT.TimeText = { "1 minute", "2 minutes", "3 minutes" }
+EVENT.Times = { 60, 120, 180 }
function EVENT:Start()
-
+
local num = math.random(1,3)
-
+
EVENT.EndTime = CurTime() + EVENT.Times[ num ]
EVENT.ThinkTime = 0
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "Antidote supplies will be low for " .. EVENT.TimeText[ num ], GAMEMODE.Colors.Red, 5 )
v:Notice( "The antidote shortage has ended", GAMEMODE.Colors.White, 5, EVENT.Times[ num ] )
-
+
end
-
+
end
-
+
function EVENT:Think()
if EVENT.ThinkTime < CurTime() then
-
+
EVENT.ThinkTime = CurTime() + 3
-
+
if IsValid( GAMEMODE.Antidote ) and GAMEMODE.Antidote:CuresLeft() > 1 then
-
+
GAMEMODE.Antidote:SetCures( 1 )
-
+
end
-
+
end
end
diff --git a/gamemode/events/fallout.lua b/gamemode/events/fallout.lua
index b316523..2d31118 100644
--- a/gamemode/events/fallout.lua
+++ b/gamemode/events/fallout.lua
@@ -3,75 +3,75 @@ local EVENT = {}
EVENT.Chance = 0.50
EVENT.Type = EVENT_BAD
-EVENT.TimeText = { "30 seconds", "1 minute" }
-EVENT.Times = { 30, 60 }
+EVENT.TimeText = { "30 seconds", "1 minute" }
+EVENT.Times = { 30, 60 }
function EVENT:Start()
-
+
local num = math.random(1,2)
-
+
EVENT.Delay = CurTime() + 15
EVENT.RadTime = CurTime() + EVENT.Times[ num ] + 15
EVENT.RadDelay = 0
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "Nuclear fallout contamination is imminent", GAMEMODE.Colors.White, 7 )
v:Notice( "Enter a building to avoid radiation poisoning", GAMEMODE.Colors.White, 7, 2 )
v:Notice( "The atmospheric fallout will subside in " .. EVENT.TimeText[ num ], GAMEMODE.Colors.White, 7, 15 )
v:Notice( "Atmospheric radioactivity levels are now safe", GAMEMODE.Colors.White, 7, EVENT.Times[ num ] + 15 )
-
+
end
-
+
timer.Simple( 15, function() SetGlobalBool( "Radiation", true ) end )
-
+
end
-
+
function EVENT:Think()
if EVENT.Delay < CurTime() then
-
+
if EVENT.RadDelay < CurTime() then
-
+
EVENT.RadDelay = CurTime() + 1
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
if not v:IsIndoors() then
-
+
if math.random(1,2) == 1 then
v:EmitSound( table.Random( GAMEMODE.Geiger ), 100, math.random(90,110) )
-
- end
-
+
+ end
+
if math.random(1,5) == 1 then
-
+
v:AddRadiation( 1 )
-
+
end
-
+
else
-
+
if math.random(1,6) == 1 then
v:EmitSound( table.Random( GAMEMODE.Geiger ), 100, math.random(120,140) )
-
- end
-
+
+ end
+
end
-
+
end
-
+
end
-
+
end
end
function EVENT:EndThink()
- return EVENT.RadTime < CurTime()
+ return EVENT.RadTime < CurTime()
end
diff --git a/gamemode/events/radio_blackout.lua b/gamemode/events/radio_blackout.lua
index 27c5344..024037f 100644
--- a/gamemode/events/radio_blackout.lua
+++ b/gamemode/events/radio_blackout.lua
@@ -3,24 +3,24 @@ local EVENT = {}
EVENT.Chance = 0.75
EVENT.Type = EVENT_BAD
-EVENT.TimeText = { "30 seconds", "1 minute", "90 seconds" }
-EVENT.Times = { 30, 60, 90 }
+EVENT.TimeText = { "30 seconds", "1 minute", "90 seconds" }
+EVENT.Times = { 30, 60, 90 }
function EVENT:Start()
-
+
local num = math.random(1,3)
-
+
GAMEMODE.RadioBlock = CurTime() + EVENT.Times[ num ]
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "Radio communications will be down for " .. EVENT.TimeText[ num ], GAMEMODE.Colors.Red, 5 )
v:Notice( "Radio communications are back online", GAMEMODE.Colors.White, 5, EVENT.Times[ num ] )
-
+
end
-
+
end
-
+
function EVENT:Think()
end
diff --git a/gamemode/events/radioblackout.lua b/gamemode/events/radioblackout.lua
index 27c5344..024037f 100644
--- a/gamemode/events/radioblackout.lua
+++ b/gamemode/events/radioblackout.lua
@@ -3,24 +3,24 @@ local EVENT = {}
EVENT.Chance = 0.75
EVENT.Type = EVENT_BAD
-EVENT.TimeText = { "30 seconds", "1 minute", "90 seconds" }
-EVENT.Times = { 30, 60, 90 }
+EVENT.TimeText = { "30 seconds", "1 minute", "90 seconds" }
+EVENT.Times = { 30, 60, 90 }
function EVENT:Start()
-
+
local num = math.random(1,3)
-
+
GAMEMODE.RadioBlock = CurTime() + EVENT.Times[ num ]
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "Radio communications will be down for " .. EVENT.TimeText[ num ], GAMEMODE.Colors.Red, 5 )
v:Notice( "Radio communications are back online", GAMEMODE.Colors.White, 5, EVENT.Times[ num ] )
-
+
end
-
+
end
-
+
function EVENT:Think()
end
diff --git a/gamemode/events/scientist.lua b/gamemode/events/scientist.lua
index ce58fdf..3bbe6c3 100644
--- a/gamemode/events/scientist.lua
+++ b/gamemode/events/scientist.lua
@@ -5,22 +5,22 @@ EVENT.Chance = 0.75
EVENT.Type = EVENT_BONUS
function EVENT:Start()
-
+
local spawns = ents.FindByClass( "info_evac" )
local evac = table.Random( spawns )
-
+
local ent = ents.Create( "npc_scientist" )
ent:SetPos( evac:GetPos() + Vector(0,0,10) )
ent:Spawn()
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "A surviving field researcher has been sighted", GAMEMODE.Colors.White, 5 )
-
+
end
-
+
end
-
+
function EVENT:Think()
end
diff --git a/gamemode/events/supply_crate.lua b/gamemode/events/supply_crate.lua
index 35ca974..6de809f 100644
--- a/gamemode/events/supply_crate.lua
+++ b/gamemode/events/supply_crate.lua
@@ -5,24 +5,24 @@ EVENT.Chance = 0.95
EVENT.Type = EVENT_BONUS
function EVENT:Start()
-
+
local spawns = ents.FindByClass( "info_lootspawn" )
local loot = table.Random( spawns )
-
+
if not IsValid( loot ) then MsgN( "ERROR: Unable to locate loot spawns. Map not configured?" ) return end
-
+
local ent = ents.Create( "sent_bonuscrate" )
ent:SetPos( loot:GetPos() + Vector(0,0,10) )
ent:Spawn()
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "Keep an eye out for a civilian weapon cache", GAMEMODE.Colors.White, 5 )
-
+
end
-
+
end
-
+
function EVENT:Think()
end
diff --git a/gamemode/events/supplycrate.lua b/gamemode/events/supplycrate.lua
index 35ca974..6de809f 100644
--- a/gamemode/events/supplycrate.lua
+++ b/gamemode/events/supplycrate.lua
@@ -5,24 +5,24 @@ EVENT.Chance = 0.95
EVENT.Type = EVENT_BONUS
function EVENT:Start()
-
+
local spawns = ents.FindByClass( "info_lootspawn" )
local loot = table.Random( spawns )
-
+
if not IsValid( loot ) then MsgN( "ERROR: Unable to locate loot spawns. Map not configured?" ) return end
-
+
local ent = ents.Create( "sent_bonuscrate" )
ent:SetPos( loot:GetPos() + Vector(0,0,10) )
ent:Spawn()
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "Keep an eye out for a civilian weapon cache", GAMEMODE.Colors.White, 5 )
-
+
end
-
+
end
-
+
function EVENT:Think()
end
diff --git a/gamemode/events/weather_event.lua b/gamemode/events/weather_event.lua
index f7640fe..ab79299 100644
--- a/gamemode/events/weather_event.lua
+++ b/gamemode/events/weather_event.lua
@@ -13,15 +13,15 @@ EVENT.Types[4] = "strong winds"
function EVENT:Start()
GAMEMODE:RandomizeWeather( true )
-
+
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
-
+
v:Notice( "The weather conditions are worsening", GAMEMODE.Colors.White, 5 )
-
+
end
-
+
end
-
+
function EVENT:Think()
end