Skip to content

Commit

Permalink
Merge pull request #5 from rafraser/gamemode-prototypes
Browse files Browse the repository at this point in the history
Merge new features into master
  • Loading branch information
Robert Fraser authored Nov 29, 2018
2 parents 9bd9d02 + e3b88b9 commit 21e7719
Show file tree
Hide file tree
Showing 43 changed files with 622 additions and 82 deletions.
7 changes: 7 additions & 0 deletions fluffy_balloons/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'Balloons'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Shoot the balloons and earn points!
Regular balloons: 1 point
Heart balloons: 5 points
Star balloons: 10 points
]]

GM.TeamBased = false -- Is the gamemode FFA or Teams?
GM.RoundNumber = 7 -- How many rounds?
Expand Down
8 changes: 7 additions & 1 deletion fluffy_balls/gamemode/shared.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
DeriveGamemode('fluffy_mg_base')

GM.Name = 'Balls Test'
GM.Name = 'Ballz'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Collect as many balls as you can!
When you die, you drop all of your balls (plus some extra)
Collect the balls of dead players and grow
]]

GM.TeamBased = false -- Is the gamemode FFA or Teams?
GM.Elimination = false
Expand Down
10 changes: 10 additions & 0 deletions fluffy_bombtag/entities/weapons/bt_punch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,13 @@ function SWEP:ShootBullets( damage, numbullets, aimcone )
self.Owner:FireBullets( bullet )
self.Owner:SetAnimation( PLAYER_ATTACK1 )
end

function SWEP:DoImpactEffect( tr, nDamageType )
if (tr.HitSky) then return end

local effectdata = EffectData()
effectdata:SetOrigin(tr.HitPos + tr.HitNormal)
effectdata:SetNormal(tr.HitNormal)
util.Effect("AR2Impact", effectdata)
return true
end
23 changes: 22 additions & 1 deletion fluffy_bombtag/gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ function GM:GetAlivePlayers()
return tbl
end

-- Timing based on active players
function GM:GetNewBombTime()
local amount = player.GetCount()
if amount < 4 then
return math.random(16, 30)
elseif amount < 8 then
return math.random(12, 20)
else
return math.random(10, 15)
end
end

-- Select a bomber at random
function GM:PickBomber()
for k,v in pairs( player.GetAll() ) do
Expand All @@ -32,7 +44,7 @@ function GM:PickBomber()
-- Give the bomb & set the time randomly
local newply = table.Random( GAMEMODE:GetAlivePlayers() )
newply:SetCarrier( true )
newply:SetTime(math.random(15, 30))
newply:SetTime(GAMEMODE:GetNewBombTime())
newply:StripWeapons()
newply:Give('bt_bomb')
end
Expand All @@ -56,6 +68,15 @@ hook.Add('RoundEnd', 'RemoveSpareBombs', function()
end
end )

-- Check disconnected players for bombs
-- This should help ensure there is always a bomb in play
hook.Add('PlayerDisconnected', 'DisconnectBombCheck', function(ply)
if ply:IsCarrier() then
timer.Simple(1, function() GAMEMODE:PickBomber() end)
ply:KillSilent()
end
end)

-- Track survived rounds
function GM:StatsRoundWin(winners)
for k,v in pairs(player.GetAll()) do
Expand Down
10 changes: 10 additions & 0 deletions fluffy_bombtag/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'Bomb Tag'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Try not to die in a firey explosion!
One random player starts with a bomb.
After a few seconds, it will explode - killing anyone nearby.
A new player is selected to have the bomb. The cycle repeats.
If you have the bomb, click to pass it to another player.
If you don't, use your gun to knock players backwards.
]]

GM.TeamBased = false -- Is the gamemode FFA or Teams?
GM.Elimination = true
Expand Down
5 changes: 5 additions & 0 deletions fluffy_btest/fluffy_btest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"minigames"
{
"base" "fluffy_mg_base"
"title" "B TEST"
}
1 change: 1 addition & 0 deletions fluffy_btest/gamemode/cl_init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include('shared.lua')
42 changes: 42 additions & 0 deletions fluffy_btest/gamemode/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
AddCSLuaFile('cl_init.lua')
AddCSLuaFile('shared.lua')
include('shared.lua')

hook.Add('PlayerSpawn', 'CreateBall', function(ply)
local ball = ents.Create('prop_physics')
ball:SetModel('models/hunter/misc/shell2x2.mdl')
ball:SetMaterial('models/debug/debugwhite')
ball:SetRenderMode(RENDERMODE_TRANSALPHA)
ball:SetColor(Color(0, 0, 255, 75))
ball:Spawn()
ball:SetPos(ply:GetPos() + Vector(0, 0, 32))
constraint.NoCollide(ball, ply, 0, 0)
ply.BallEntity = ball

ply:Spectate( OBS_MODE_CHASE )
ply:SpectateEntity( prop )
end)

hook.Add('DoPlayerDeath', 'RemoveBall', function(ply)
if IsValid(ply.BallEntity) then
SafeRemoveEntity(ply.BallEntity)
end
end)

function GM:Move(ply, mv)
if not IsValid(ply.BallEntity) then return end

local speed = 15 * FrameTime()
local phys = ply.BallEntity:GetPhysicsObject()

local ang = mv:GetMoveAngles()
local pos = mv:GetOrigin()
local vel = mv:GetVelocity()

vel = vel + ang:Forward() * mv:GetForwardSpeed() * speed
vel = vel + ang:Right() * mv:GetSideSpeed() * speed
vel = vel + ang:Up() * mv:GetUpSpeed() * speed

phys:ApplyForceCenter(vel)
return true
end
18 changes: 18 additions & 0 deletions fluffy_btest/gamemode/shared.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
DeriveGamemode('fluffy_mg_base')

GM.Name = 'test'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
]]

GM.TeamBased = false -- Is the gamemode FFA or Teams?

GM.RoundNumber = 10 -- How many rounds?
GM.RoundTime = 90 -- Seconds each round lasts for

GM.ThirdpersonEnabled = true

function GM:Initialize()

end
11 changes: 6 additions & 5 deletions fluffy_cratewars/gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ function GM:StartBattlePhase()
end
end

hook.Add('RoundStart', 'PrepareCratePhase', function()
hook.Add('PreRoundStart', 'PrepareCratePhase', function()
for k,v in pairs(player.GetAll()) do
v.SmashedCrates = 0
v:SetNWInt('Crates', 0)
end

GAMEMODE.CratePhase = true
local time = math.random(40, 60)
timer.Simple(time-3, function() GAMEMODE:CountdownAnnouncement(3, "Fight!") end)
timer.Simple(time, function() GAMEMODE:StartBattlePhase() end)
local time = math.random(40, 60)
timer.Simple(time-3, function() GAMEMODE:CountdownAnnouncement(3, "Fight!") end)
timer.Simple(time, function() GAMEMODE:StartBattlePhase() end)
end )

hook.Add('PropBreak', 'TrackBrokenCrates', function(ply, prop)
Expand Down
12 changes: 12 additions & 0 deletions fluffy_cratewars/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'Crate Wars'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Break crates to power up during the final battle!
Each round is divided into two phases:
Crate Breaking
Break as many crates as you can!
More crates = more health
25 Crates = 1 SMG Grenade
Deathmatch
Eliminate all the other players
]]

GM.Elimination = true
GM.WinBySurvival = true
Expand Down
5 changes: 5 additions & 0 deletions fluffy_crossbow_battle/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'CROSSBOW'
GM.Author = 'uno spaghetto'
GM.HelpText = [[
Simply a crossbow deathmatch
Battle to the death!
]]

GM.TeamBased = false
GM.Elimination = false
Expand Down
6 changes: 6 additions & 0 deletions fluffy_dodgeball/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ include('balls.lua')

GM.Name = 'Dodgeball'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Team based deathmatch with dodgeballs!
Every kill will level up your weapon.
Dying will reset your level.
]]

GM.TeamBased = true -- Is the gamemode FFA or Teams?
GM.RoundTime = 90
Expand Down
12 changes: 12 additions & 0 deletions fluffy_duckhunt/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'Duck Hunt'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Runners have to make it to the end before getting sniped!
Runners that die will become Snipers.
Runners
Run! Make it to the end of the course as fast as you can!
Try and dodge all the bullets flying at you.
Snipers
Shoot the Runners before they make it to the end
]]

TEAM_RED = 1
TEAM_BLUE = 2
Expand Down
3 changes: 3 additions & 0 deletions fluffy_fortwars/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ include('prop_list.lua')

GM.Name = 'Fortwars'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Build forts and then compete for the flag!
]]

GM.TeamBased = true -- Is the gamemode FFA or Teams?
GM.RoundTime = 240
Expand Down
6 changes: 6 additions & 0 deletions fluffy_gungame/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'Gun Game'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Free for all deathmatch with constantly changing weapons
Every 2 kills you get a new weapon!
First person to complete every weapon wins the round
]]

GM.TeamBased = false -- Is the gamemode FFA or Teams?
GM.Elimination = false
Expand Down
4 changes: 4 additions & 0 deletions fluffy_incoming/gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ function IncludeResFolder( dir )
end
end

hook.Add('Initialize', 'AddIncomingStatConversions', function()
GAMEMODE:AddStatConversion('Distance', 'Slope Distance', 0.01)
end)

IncludeResFolder( "materials/models/clannv/incoming/" )
IncludeResFolder( "models/clannv/incoming/box/" )
IncludeResFolder( "models/clannv/incoming/cone/" )
Expand Down
7 changes: 7 additions & 0 deletions fluffy_incoming/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'Incoming!'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Race to the top of the slope!
Avoid all the falling props!
First person to reach the top wins.
Points are given based on distance travelled.
]]

GM.TeamBased = false -- Is the gamemode FFA or Teams?
GM.Elimination = false
Expand Down
17 changes: 14 additions & 3 deletions fluffy_infection/gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,22 @@ function GM:PlayerLoadout( ply )

ply:SetRunSpeed(300)
ply:SetWalkSpeed(200)
ply:SetBloodColor(BLOOD_COLOR_RED)
elseif ply:Team() == TEAM_RED then
-- Infected
ply:Give('weapon_fists')
ply:SetRunSpeed(400)
ply:SetWalkSpeed(250)
-- Initial infected are stronger but slower
ply:SetBloodColor(BLOOD_COLOR_GREEN)
if ply.InitialHunter then
ply:SetMaxHealth(200)
ply:SetHealth(200)
ply:Give('weapon_fists')
ply:SetRunSpeed(400)
ply:SetWalkSpeed(200)
else
ply:Give('weapon_fists')
ply:SetRunSpeed(500)
ply:SetWalkSpeed(300)
end
end
end

Expand Down
7 changes: 7 additions & 0 deletions fluffy_infection/gamemode/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ DeriveGamemode('fluffy_mg_base')

GM.Name = 'Infection'
GM.Author = 'FluffyXVI'
GM.HelpText = [[
Oh no! A generic zombie outbreak!
Zombies have to eliminate all the humans.
Humans have to stay alive until the round ends.
When a human dies, they will become a zombie.
]]

TEAM_RED = 1
TEAM_BLUE = 2
Expand Down
2 changes: 1 addition & 1 deletion fluffy_kingmaker/gamemode/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include('shared.lua')
GM.ScoringPaneEnabled = true

function GM:ScoringPaneScore(ply)
return ply:GetNWInt("KingFrags", 0)
return ply:GetNWInt("KingPoints", 0)
end

-- Draw BIG label above the King
Expand Down
Loading

0 comments on commit 21e7719

Please sign in to comment.