From 48e2b5c92da6cc79d5ca1ced909147b3a56cdf00 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 19:26:33 +1000 Subject: [PATCH 01/27] Add new team/help panel Finally! A better way to explain gamemode rules while providing a visually interesting way to pick the team! --- fluffy_mg_base/gamemode/cl_playerpanel.lua | 89 +++++++++++++++++++--- fluffy_mg_base/gamemode/shared.lua | 4 + 2 files changed, 83 insertions(+), 10 deletions(-) diff --git a/fluffy_mg_base/gamemode/cl_playerpanel.lua b/fluffy_mg_base/gamemode/cl_playerpanel.lua index 15968fd..0e43e8b 100644 --- a/fluffy_mg_base/gamemode/cl_playerpanel.lua +++ b/fluffy_mg_base/gamemode/cl_playerpanel.lua @@ -1,10 +1,79 @@ --- what -function GM:OpenPlayerPanel() - local frame = vgui.Create('DFrame') - local w = ScrW() * 0.8 - local h = ScrH() * 0.8 - frame:SetSize(w, h) - frame:SetCenter() - frame:SetBackgroundBlur(true) - frame:MakePopup() -end \ No newline at end of file +function GM:CreateHelpPanel() + if IsValid(GAMEMODE.MinigamesHelpPanel) then return end + + local f = vgui.Create('DFrame') + f:SetTitle('') + f:SetSize(480, 640) + f:Center() + function f:Paint(w, h) + draw.RoundedBox(0, 0, 0, w, 64, Color(47, 54, 64)) + draw.RoundedBox(0, 0, 64, w, h-64, Color(53, 59, 72)) + draw.SimpleText(GAMEMODE.Name, 'FS_B64', 4, 0, GAMEMODE.FCol1) + end + f:MakePopup() + + local help = vgui.Create('DLabel', f) + help:SetSize(480, 496) + help:SetPos(0, 80) + help:SetText(GAMEMODE.HelpText) + help:SetFont('FS_16') + help:SetTextColor(GAMEMODE.FCol1) + help:SetWrap(true) + help:SetContentAlignment(7) + + local team_panel = vgui.Create('DPanel', f) + team_panel:SetSize(480, 64) + team_panel:SetPos(0, 576) + + local num = #team.GetAllTeams() + if GAMEMODE.TeamBased then + local tw = 480/3 + for id, t in pairs(team.GetAllTeams()) do + if id == TEAM_CONNECTING or id == TEAM_UNASSIGNED then continue end + + local teamp = vgui.Create('DButton', team_panel) + teamp:SetSize(tw, 64) + teamp:Dock(LEFT) + teamp:SetText(team.GetName(id)) + teamp:SetTextColor(GAMEMODE.FCol1) + teamp:SetFont('FS_B40') + local c = team.GetColor(id) + if id == TEAM_SPECTATOR then + c = Color(251, 197, 49) + end + + function teamp:Paint(w, h) + draw.RoundedBox(0, 0, 0, w, h, c) + end + + function teamp:DoClick() + f:Close() + RunConsoleCommand('changeteam', id) + end + + end + else + --local spectate = vgui.Create('DButton', team_panel) + --spectate:SetSize(160, 64) + --spectate:SetPos(0, 0) + + local play = vgui.Create('DButton', team_panel) + play:SetSize(480, 64) + play:SetText('Play!') + play:SetTextColor(GAMEMODE.FCol1) + play:SetFont('FS_B40') + function play:Paint(w, h) + draw.RoundedBox(0, 0, 0, w, h, Color(76, 209, 55)) + end + + function play:DoClick() + f:Close() + end + end + + GAMEMODE.MinigamesHelpPanel = f +end + +concommand.Add('minigames_info', function() + GAMEMODE:CreateHelpPanel() +end) \ No newline at end of file diff --git a/fluffy_mg_base/gamemode/shared.lua b/fluffy_mg_base/gamemode/shared.lua index e5c4921..9a2f42c 100644 --- a/fluffy_mg_base/gamemode/shared.lua +++ b/fluffy_mg_base/gamemode/shared.lua @@ -9,6 +9,10 @@ include('sh_levels.lua') GM.Name = 'Minigames' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + There doesn't appear to be any help text for this gamemode. + Report this to the creator. +]] GM.TeamBased = false -- Is the gamemode team based, or is it FFA? GM.Elimination = false -- Should players stay dead, or should they respawn? From a5844cb42107f3d3b80c174f3811d3646ba052e2 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 19:57:01 +1000 Subject: [PATCH 02/27] Add help text to most gamemodes --- fluffy_balloons/gamemode/shared.lua | 7 +++++++ fluffy_balls/gamemode/shared.lua | 8 +++++++- fluffy_bombtag/gamemode/shared.lua | 10 ++++++++++ fluffy_cratewars/gamemode/shared.lua | 12 ++++++++++++ fluffy_crossbow_battle/gamemode/shared.lua | 5 +++++ fluffy_dodgeball/gamemode/shared.lua | 6 ++++++ fluffy_duckhunt/gamemode/shared.lua | 12 ++++++++++++ fluffy_incoming/gamemode/shared.lua | 7 +++++++ fluffy_laserdance/gamemode/shared.lua | 11 ++++++++++- fluffy_oitc/gamemode/shared.lua | 8 ++++++++ fluffy_pitfall/gamemode/shared.lua | 11 +++++++++++ fluffy_poltergeist/gamemode/shared.lua | 15 +++++++++++++++ fluffy_shootingrange/gamemode/shared.lua | 12 ++++++++++++ fluffy_sniperwars/gamemode/shared.lua | 12 ++++++++++++ fluffy_suicidebarrels/gamemode/shared.lua | 14 ++++++++++++++ 15 files changed, 148 insertions(+), 2 deletions(-) diff --git a/fluffy_balloons/gamemode/shared.lua b/fluffy_balloons/gamemode/shared.lua index ada6440..ba8b980 100644 --- a/fluffy_balloons/gamemode/shared.lua +++ b/fluffy_balloons/gamemode/shared.lua @@ -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? diff --git a/fluffy_balls/gamemode/shared.lua b/fluffy_balls/gamemode/shared.lua index 04c12f3..69cf96d 100644 --- a/fluffy_balls/gamemode/shared.lua +++ b/fluffy_balls/gamemode/shared.lua @@ -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 diff --git a/fluffy_bombtag/gamemode/shared.lua b/fluffy_bombtag/gamemode/shared.lua index 0e0fc98..f903483 100644 --- a/fluffy_bombtag/gamemode/shared.lua +++ b/fluffy_bombtag/gamemode/shared.lua @@ -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 diff --git a/fluffy_cratewars/gamemode/shared.lua b/fluffy_cratewars/gamemode/shared.lua index 82e818a..9a78861 100644 --- a/fluffy_cratewars/gamemode/shared.lua +++ b/fluffy_cratewars/gamemode/shared.lua @@ -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 diff --git a/fluffy_crossbow_battle/gamemode/shared.lua b/fluffy_crossbow_battle/gamemode/shared.lua index e286e32..27a013b 100644 --- a/fluffy_crossbow_battle/gamemode/shared.lua +++ b/fluffy_crossbow_battle/gamemode/shared.lua @@ -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 diff --git a/fluffy_dodgeball/gamemode/shared.lua b/fluffy_dodgeball/gamemode/shared.lua index a0a532a..5929e82 100644 --- a/fluffy_dodgeball/gamemode/shared.lua +++ b/fluffy_dodgeball/gamemode/shared.lua @@ -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 diff --git a/fluffy_duckhunt/gamemode/shared.lua b/fluffy_duckhunt/gamemode/shared.lua index 187c1db..2c74f00 100644 --- a/fluffy_duckhunt/gamemode/shared.lua +++ b/fluffy_duckhunt/gamemode/shared.lua @@ -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 diff --git a/fluffy_incoming/gamemode/shared.lua b/fluffy_incoming/gamemode/shared.lua index 3385b90..fc2f39c 100644 --- a/fluffy_incoming/gamemode/shared.lua +++ b/fluffy_incoming/gamemode/shared.lua @@ -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 diff --git a/fluffy_laserdance/gamemode/shared.lua b/fluffy_laserdance/gamemode/shared.lua index dbf0983..12bf9d6 100644 --- a/fluffy_laserdance/gamemode/shared.lua +++ b/fluffy_laserdance/gamemode/shared.lua @@ -1,7 +1,16 @@ DeriveGamemode('fluffy_mg_base') -GM.Name = 'GTV' +GM.Name = 'Laser Dance' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + Get as many kills as you can! + This is a fast-paced free-for-all deathmatch. + + The laser guns have insane knockback. + Aim underneath you to go flying into the air. + + Just one direct hit is deadly - be cautious. +]] GM.TeamBased = false -- Is the gamemode FFA or Teams? GM.Elimination = false diff --git a/fluffy_oitc/gamemode/shared.lua b/fluffy_oitc/gamemode/shared.lua index e0f58fb..27d390e 100644 --- a/fluffy_oitc/gamemode/shared.lua +++ b/fluffy_oitc/gamemode/shared.lua @@ -2,6 +2,14 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'OITC' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + You only have one bullet - use it wisely. + + Be the last team standing to win the round! + + Every kill will earn you another bullet. + Everything in this gamemode is a one-hit kill. +]] GM.TeamBased = true -- Is the gamemode FFA or Teams? GM.Elimination = true -- Is this gamemode elimination? diff --git a/fluffy_pitfall/gamemode/shared.lua b/fluffy_pitfall/gamemode/shared.lua index 7abda26..cb00500 100644 --- a/fluffy_pitfall/gamemode/shared.lua +++ b/fluffy_pitfall/gamemode/shared.lua @@ -2,6 +2,17 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'Pitfall' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + Try not to fall to your demise! + Knock out the platforms other players are standing on. + + Be the last player alive to win the round! + + Primary fire will damage platforms. + Shoot a platform repeatedly and it will collapse suddenly. + + Secondary fire will send players flying. +]] GM.TeamBased = false -- Is the gamemode FFA or Teams? GM.Elimination = true diff --git a/fluffy_poltergeist/gamemode/shared.lua b/fluffy_poltergeist/gamemode/shared.lua index 2ff61cd..8f64a5b 100644 --- a/fluffy_poltergeist/gamemode/shared.lua +++ b/fluffy_poltergeist/gamemode/shared.lua @@ -2,6 +2,21 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'Poltergeist' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + Angry ghosts are out to kill all humans! + + Humans have to survive until the round ends to win. + Humans that die will join the angry ghosts. + + Poltergeists: + Primary: dash attack. Best with large props. + Reload to change props + Secondary: explosion. Best with smaller props. + + Humans: + Shoot the props to destroy them + Don't get killed +]] GM.TeamBased = true -- Is the gamemode FFA or Teams? GM.TeamSurvival = true diff --git a/fluffy_shootingrange/gamemode/shared.lua b/fluffy_shootingrange/gamemode/shared.lua index 3b8be2d..8e82f1b 100644 --- a/fluffy_shootingrange/gamemode/shared.lua +++ b/fluffy_shootingrange/gamemode/shared.lua @@ -2,6 +2,18 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'Shootingrange' GM.Author = 'unospaghetto' +GM.HelpText = [[ + Try and survive the onslaught! + + Teams are swapped after every round. + + Shooters + Eliminate all the runners. + Weapons are random each round. + + Captives + Run around and try not to die +]] TEAM_RED = 1 TEAM_BLUE = 2 diff --git a/fluffy_sniperwars/gamemode/shared.lua b/fluffy_sniperwars/gamemode/shared.lua index e0df734..5dea674 100644 --- a/fluffy_sniperwars/gamemode/shared.lua +++ b/fluffy_sniperwars/gamemode/shared.lua @@ -2,6 +2,18 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'Sniper Wars' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + It's Sniper vs Sniper in this intense team battle! + + The team with the most kills when time runs out is the winner. + + Each player has a dangerous Utility Device. + These devices will give one of the following buffs: + - Invisibility + - Teleportation + - Speed Boost + - Low Gravity +]] GM.TeamBased = true -- Is the gamemode FFA or Teams? GM.RoundTime = 200 diff --git a/fluffy_suicidebarrels/gamemode/shared.lua b/fluffy_suicidebarrels/gamemode/shared.lua index e65120a..6106fc6 100644 --- a/fluffy_suicidebarrels/gamemode/shared.lua +++ b/fluffy_suicidebarrels/gamemode/shared.lua @@ -8,6 +8,20 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'Suicide Barrels' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + Some explosive barrels have turned sentient. + + When a human is eliminated, they will join the Barrel team. + + Humans: + Try to survive against the onslaught + Shoot a barrel and it will explode instantly + Be cautious! Don't shoot barrels to close to teammates + + Barrels: + Try to eliminate all the humans before time runs out + Left click to explode after a short delay +]] TEAM_RED = 1 TEAM_BLUE = 2 From cb15fbc339a593918cfa3012e1e0f5f52dcaac6c Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 21:23:48 +1000 Subject: [PATCH 03/27] Added GM:ShouldDrawCosmetics Planning ahead for shop support - this stops cosmetics being drawn on certain players. This is super useful - there are definitely situations where cosmetics or trails would give things away and shouldn't be drawn on players. --- fluffy_mg_base/gamemode/shared.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/fluffy_mg_base/gamemode/shared.lua b/fluffy_mg_base/gamemode/shared.lua index 9a2f42c..9d6240a 100644 --- a/fluffy_mg_base/gamemode/shared.lua +++ b/fluffy_mg_base/gamemode/shared.lua @@ -72,4 +72,22 @@ function GM:CreateTeams() team.SetUp( TEAM_SPECTATOR, "Spectators", Color( 255, 255, 80 ), true ) team.SetSpawnPoint(TEAM_SPECTATOR, {"info_player_terrorist", "info_player_combine", "info_player_counterterrorist", "info_player_rebel"}) +end + +-- Function to toggle displaying cosmetics +-- Obviously, cosmetic items shouldn't be displayed on barrels etc. +function GM:ShouldDrawCosmetics(ply) + if GAMEMODE.TeamSurvival then + -- Cosmetics shouldn't show for the Hunter Team (in most cases) + -- Override in some cases + if ply:Team() == GAMEMODE.HunterTeam then + return false + else + return true + end + else + -- Should be okay in most cases + -- Override in others + return true + end end \ No newline at end of file From 3dda32598d1dec496f8dbaa517d8bedda0cb1f2e Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 21:32:51 +1000 Subject: [PATCH 04/27] Camera transitions library --- fluffy_mg_base/gamemode/cl_thirdperson.lua | 52 ++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/fluffy_mg_base/gamemode/cl_thirdperson.lua b/fluffy_mg_base/gamemode/cl_thirdperson.lua index 666fe7b..abc7b58 100644 --- a/fluffy_mg_base/gamemode/cl_thirdperson.lua +++ b/fluffy_mg_base/gamemode/cl_thirdperson.lua @@ -13,9 +13,7 @@ hook.Add("PlayerBindPress", "ThirdpersonToggle", function(ply, bind, pressed) end) -- Dodgy thirdperson code -function GM:CalcView(ply, pos, angles, fov) - if !self.ThirdpersonEnabled and !LocalPlayer():IsSuperAdmin() then return self.BaseClass:CalcView(ply,pos,angles,fov) end -- Check that thirdperson is useable - if ply:IsBot() then return end +function GM:ThirdPersonView(ply, pos, angles, fov) local view = {} -- Get plyayer eye angles @@ -55,4 +53,52 @@ function GM:CalcView(ply, pos, angles, fov) end return view +end + +local camprogress = 0 +-- Functions for starting/stopping cool transition modes +function GM:StartCoolTransition(table) + camprogress = 0 + GAMEMODE.CoolTransition = table +end + +function GM:EndCoolTransition() + camprogress = 0 + GAMEMODE.CoolTransition = nil +end + +-- Cool transitions +function GM:TransitionView(ply, origin, angles, fov) + camprogress = math.min(camprogress + FrameTime(), 1) + local smooth = math.EaseInOut(camprogress, 0.5, 0.5) + + local targetpos = GAMEMODE.CoolTransition.pos + if GAMEMODE.CoolTransition.ent then + targetpos = targetpos + GAMEMODE.CoolTransition.ent:GetPos() + end + + local distance = GAMEMODE.CoolTransition.dist or 80 + + local goalangles = GAMEMODE.CoolTransition.ang or Angle(0, math.fmod(CurTime() * 20, 360, 0)) + local goalpos = targetpos + (goalangles:Forward() * -distance) + local goalfov = GAMEMODE.CoolTransition.fov or fov + + local view = {} + view.origin = origin + (goalpos - origin) * smooth + view.angles = angles + (goalangles - angles) * smooth + view.fov = fov + (goalfov - fov) * smooth + view.drawviewer = true + return view +end + +-- Determine which view drawing to use +function GM:CalcView(ply, pos, angles, fov) + if ply:IsBot() then return end + if GAMEMODE.CoolTransition then + return GAMEMODE:TransitionView(ply, pos, angles, fov) + elseif self.ThirdpersonEnabled then + return GAMEMODE:ThirdPersonView(ply, pos, angles, fov) + else + return self.BaseClass:CalcView(ply,pos,angles,fov) + end end \ No newline at end of file From 3bab75b86a9e17d54bb7856ec54fa3b38cd0bacc Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 21:36:27 +1000 Subject: [PATCH 05/27] Team/help menu actually displays now --- fluffy_mg_base/gamemode/init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fluffy_mg_base/gamemode/init.lua b/fluffy_mg_base/gamemode/init.lua index 0805baa..e469f27 100644 --- a/fluffy_mg_base/gamemode/init.lua +++ b/fluffy_mg_base/gamemode/init.lua @@ -76,12 +76,22 @@ hook.Add('PlayerInitialSpawn', 'DisplayTeamMenu', function(ply) if ply:IsBot() then GAMEMODE:PlayerRequestTeam( ply, team.BestAutoJoinTeam() ) elseif GAMEMODE.TeamBased then - ply:ConCommand( "gm_showteam" ) + ply:ConCommand("minigames_info") else ply:SetTeam( TEAM_UNASSIGNED ) end end) +-- Rebind help menu +function GM:ShowHelp(ply) + ply:ConCommand("minigames_info") +end + +-- Rebind team menu +function GM:ShowTeam(ply) + ply:ConCommand("minigames_info") +end + -- Disable friendly fire function GM:PlayerShouldTakeDamage( victim, ply ) if !GAMEMODE.TeamBased then return true end From ebcddb27a78a7da783c414d45cdde10db16c5a30 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 21:49:58 +1000 Subject: [PATCH 06/27] Add help text to the gamemode prototypes --- fluffy_fortwars/gamemode/shared.lua | 3 +++ fluffy_gungame/gamemode/shared.lua | 6 ++++++ fluffy_infection/gamemode/shared.lua | 7 +++++++ fluffy_kingmaker/gamemode/shared.lua | 10 ++++++++++ 4 files changed, 26 insertions(+) diff --git a/fluffy_fortwars/gamemode/shared.lua b/fluffy_fortwars/gamemode/shared.lua index 88dc71c..9da36bd 100644 --- a/fluffy_fortwars/gamemode/shared.lua +++ b/fluffy_fortwars/gamemode/shared.lua @@ -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 diff --git a/fluffy_gungame/gamemode/shared.lua b/fluffy_gungame/gamemode/shared.lua index d330e44..28c3df6 100644 --- a/fluffy_gungame/gamemode/shared.lua +++ b/fluffy_gungame/gamemode/shared.lua @@ -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 diff --git a/fluffy_infection/gamemode/shared.lua b/fluffy_infection/gamemode/shared.lua index 6005758..6612505 100644 --- a/fluffy_infection/gamemode/shared.lua +++ b/fluffy_infection/gamemode/shared.lua @@ -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 diff --git a/fluffy_kingmaker/gamemode/shared.lua b/fluffy_kingmaker/gamemode/shared.lua index 7e5bc32..bbf96a7 100644 --- a/fluffy_kingmaker/gamemode/shared.lua +++ b/fluffy_kingmaker/gamemode/shared.lua @@ -2,6 +2,16 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'Kingmaker' GM.Author = 'FluffyXVI' +GM.HelpText = [[ + Become the King and defeat everyone! + + As the King, you are more powerful than everyone else + Get kills as the King to earn points + + If you're not the King, work together to defeat the King! + You can kill anyone - but there's no points for it. + Only kills you make while you are the King will give you points. +]] GM.TeamBased = false -- Is the gamemode FFA or Teams? GM.Elimination = false From 6ef7fa61756ecdbe544e9d927a334a20b931464a Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 22:41:52 +1000 Subject: [PATCH 07/27] Fix help menu on non-team gamemodes --- fluffy_mg_base/gamemode/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fluffy_mg_base/gamemode/init.lua b/fluffy_mg_base/gamemode/init.lua index e469f27..32b185c 100644 --- a/fluffy_mg_base/gamemode/init.lua +++ b/fluffy_mg_base/gamemode/init.lua @@ -75,9 +75,11 @@ hook.Add('PlayerInitialSpawn', 'DisplayTeamMenu', function(ply) -- Assign teams if ply:IsBot() then GAMEMODE:PlayerRequestTeam( ply, team.BestAutoJoinTeam() ) - elseif GAMEMODE.TeamBased then - ply:ConCommand("minigames_info") else + ply:ConCommand("minigames_info") + end + + if not GAMEMODE.TeamBased then ply:SetTeam( TEAM_UNASSIGNED ) end end) From fcd918e5ec62913a7efb31bbbd76572356dfda9d Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Sun, 18 Nov 2018 22:42:06 +1000 Subject: [PATCH 08/27] Slight improvements to XP conversion --- fluffy_incoming/gamemode/init.lua | 4 ++++ fluffy_kingmaker/gamemode/init.lua | 5 +++++ fluffy_mg_base/gamemode/sv_levels.lua | 1 + 3 files changed, 10 insertions(+) diff --git a/fluffy_incoming/gamemode/init.lua b/fluffy_incoming/gamemode/init.lua index ea59bbf..15543b9 100644 --- a/fluffy_incoming/gamemode/init.lua +++ b/fluffy_incoming/gamemode/init.lua @@ -165,6 +165,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/" ) diff --git a/fluffy_kingmaker/gamemode/init.lua b/fluffy_kingmaker/gamemode/init.lua index 3bcaacb..68b6d41 100644 --- a/fluffy_kingmaker/gamemode/init.lua +++ b/fluffy_kingmaker/gamemode/init.lua @@ -2,6 +2,11 @@ AddCSLuaFile('cl_init.lua') AddCSLuaFile('shared.lua') include('shared.lua') +hook.Add('Initialize', 'AddKingmakerStatConversions', function() + GAMEMODE:AddStatConversion('KingFrags', 'Kills as King', 0.25) + GAMEMODE:AddStatConversion('KingEliminations', 'Regicide', 1) +end) + function GM:PlayerLoadout(ply) ply:StripAmmo() ply:StripWeapons() diff --git a/fluffy_mg_base/gamemode/sv_levels.lua b/fluffy_mg_base/gamemode/sv_levels.lua index 73e1310..e588fd4 100644 --- a/fluffy_mg_base/gamemode/sv_levels.lua +++ b/fluffy_mg_base/gamemode/sv_levels.lua @@ -108,6 +108,7 @@ hook.Add('Initialize', 'AddBaseStatConversions', function() GAMEMODE:AddStatConversion('RoundWins', 'Rounds Won', 0) GAMEMODE:AddStatConversion('RoundsPlayed', 'Thanks for playing!', 1.5) GAMEMODE:AddStatConversion('kills', 'Kills', 1) + GAMEMODE:AddStatConversions('LastSurvivor', 'Last Survivor', 2) end) -- Convert a stat name & score to a table with XP From b5a8f6a0df9523fd2bbe83699ae92d15a0579ffe Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Mon, 19 Nov 2018 00:32:01 +1000 Subject: [PATCH 09/27] Fix typo in stats --- fluffy_mg_base/gamemode/sv_levels.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluffy_mg_base/gamemode/sv_levels.lua b/fluffy_mg_base/gamemode/sv_levels.lua index e588fd4..d30f69a 100644 --- a/fluffy_mg_base/gamemode/sv_levels.lua +++ b/fluffy_mg_base/gamemode/sv_levels.lua @@ -108,7 +108,7 @@ hook.Add('Initialize', 'AddBaseStatConversions', function() GAMEMODE:AddStatConversion('RoundWins', 'Rounds Won', 0) GAMEMODE:AddStatConversion('RoundsPlayed', 'Thanks for playing!', 1.5) GAMEMODE:AddStatConversion('kills', 'Kills', 1) - GAMEMODE:AddStatConversions('LastSurvivor', 'Last Survivor', 2) + GAMEMODE:AddStatConversion('LastSurvivor', 'Last Survivor', 2) end) -- Convert a stat name & score to a table with XP From 84c2520d77a5c281d39a0df9c86df444c92f6157 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Mon, 19 Nov 2018 01:09:11 +1000 Subject: [PATCH 10/27] Finally update end of round message --- fluffy_mg_base/gamemode/cl_hud.lua | 50 ++++++++++++++++++++++------ fluffy_mg_base/gamemode/sv_round.lua | 1 + 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/fluffy_mg_base/gamemode/cl_hud.lua b/fluffy_mg_base/gamemode/cl_hud.lua index 8aa948a..a83e08e 100644 --- a/fluffy_mg_base/gamemode/cl_hud.lua +++ b/fluffy_mg_base/gamemode/cl_hud.lua @@ -126,14 +126,6 @@ function GM:DrawRoundState() return end - -- Draw message for end of rounds (if applicable) - -- This amazingly hasn't been improved in a while -> consider reworking & making nice - -- 14th November: Slightly improved - if EndGameMessage then - draw.SimpleText( EndGameMessage, "FS_32", ScrW()/2 + 2, 35, GAMEMODE.FColShadow, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) - draw.SimpleText( EndGameMessage, "FS_32", ScrW()/2, 32, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) - end - -- Draw spectating message on bottom (very rare) if LocalPlayer():Team() == TEAM_SPECTATOR then draw.SimpleTextOutlined( 'You are a spectator', "FS_32", ScrW()/2, ScrH() - 32, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color( 0, 0, 0 ) ) @@ -331,12 +323,48 @@ function GM:DrawAmmo() -- Todo: add a check for 'infinite' ammo (I think this is done) end +function GM:CreateRoundEndPanel(message, tagline) + surface.PlaySound( 'friends/friend_join.wav' ) + if IsValid(GAMEMODE.RoundEndPanel) then + GAMEMODE.RoundEndPanel:Remove() + end + + local w = 288 + local h = 64 + local bar_h = 24 + local p = vgui.Create('DPanel') + p:SetSize(w, h) + p:SetPos(ScrW()/2 - w/2, -h) + p.TagLine = tagline or nil + if p.TagLine == '' or p.TagLine == ' ' then p.TagLine = nil end + + p.Message = message + function p:Paint(w, h) + if self.TagLine then + draw.RoundedBoxEx(8, 0, 0, w, h-bar_h, GAMEMODE.FCol2, false, false, false, false) + draw.RoundedBoxEx(8, 0, h-bar_h, w, bar_h, GAMEMODE.FCol3, false, false, true, true) + + draw.SimpleText(self.Message, 'FS_B32', w/2 + 2, 20 + 3, GAMEMODE.FColShadow, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + draw.SimpleText(self.Message, 'FS_B32', w/2, 20, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + draw.SimpleText(self.TagLine, 'FS_16', w/2, h-bar_h+2, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) + else + draw.RoundedBoxEx(8, 0, 0, w, h, GAMEMODE.FCol2, false, false, true, true) + draw.SimpleText(self.Message, 'FS_B32', w/2 + 2, h/2 + 3, GAMEMODE.FColShadow, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + draw.SimpleText(self.Message, 'FS_B32', w/2, h/2, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + end + end + + p:MoveTo(ScrW()/2 - w/2, 0, 1, 0, -1, function(anim, p) + p:MoveTo(ScrW()/2 - w/2, -h, 1, GAMEMODE.RoundCooldown - 1, -1, function(anim, p) p:Remove() end) + end) +end + -- Play a COOL sound when the round ends! -- Also display the EndGameMessage -> update the look of this soon net.Receive( 'EndRound', function() - surface.PlaySound( 'friends/friend_join.wav' ) - EndGameMessage = net.ReadString() - timer.Simple( GAMEMODE.RoundCooldown, function() EndGameMessage = nil end ) + local msg = net.ReadString() + local tagline = net.ReadString() + GAMEMODE:CreateRoundEndPanel(msg, tagline) end ) function GM:ScoringPaneScore(ply) diff --git a/fluffy_mg_base/gamemode/sv_round.lua b/fluffy_mg_base/gamemode/sv_round.lua index 5ddb9e2..44a253c 100644 --- a/fluffy_mg_base/gamemode/sv_round.lua +++ b/fluffy_mg_base/gamemode/sv_round.lua @@ -118,6 +118,7 @@ function GM:EndRound(reason) -- Send the result to the players net.Start('EndRound') net.WriteString( msg ) + net.WriteString('') net.Broadcast() -- STATS: Add round wins From 9e8f828792d8b50c163665ad4ea841c605fcd024 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Wed, 21 Nov 2018 21:27:26 +1000 Subject: [PATCH 11/27] Rotation changes 21st November --- fluffy_mg_base/gamemode/sv_voting.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fluffy_mg_base/gamemode/sv_voting.lua b/fluffy_mg_base/gamemode/sv_voting.lua index 089ec48..da459b5 100644 --- a/fluffy_mg_base/gamemode/sv_voting.lua +++ b/fluffy_mg_base/gamemode/sv_voting.lua @@ -9,20 +9,20 @@ GM.VoteGamemodes = { {'fluffy_poltergeist', 'Poltergeist', 'Hunter vs Hunted'}, {'fluffy_duckhunt', 'Duck Hunt', 'Hunter vs Hunted'}, {'fluffy_suicidebarrels', 'Suicide Barrels', 'Hunter vs Hunted'}, - {'fluffy_dodgeball', 'Dodgeball', 'Team DM'}, - {'fluffy_pitfall', 'Pitfall', 'FFA Elimination'}, + --{'fluffy_dodgeball', 'Dodgeball', 'Team DM'}, + --{'fluffy_pitfall', 'Pitfall', 'FFA Elimination'}, {'fluffy_incoming', 'Incoming!', 'Free For All'}, {'fluffy_bombtag', 'Bomb Tag', 'FFA Elimination'}, {'fluffy_laserdance', 'Laser Dance', 'Free For All'}, {'fluffy_balls', 'Ballz', 'Free For All'}, - {'fluffy_cratewars', 'Crate Wars', 'Free For All'}, + --{'fluffy_cratewars', 'Crate Wars', 'Free For All'}, {'fluffy_oitc', 'One in the Chamber', 'Team DM'}, - {'fluffy_balloons', 'Balloons', 'Free For All'}, - {'fluffy_shootingrange', 'Shooting Range', 'Team DM'}, + --{'fluffy_balloons', 'Balloons', 'Free For All'}, + --{'fluffy_shootingrange', 'Shooting Range', 'Team DM'}, {'fluffy_infection', 'Infection', 'Hunter vs Hunted'}, {'fluffy_gungame', 'Gun Game', 'FFA'}, {'fluffy_kingmaker', 'Kingmaker', 'FFA'}, - {'fluffy_fortwars', 'Fort Wars', 'Team DM'}, + --{'fluffy_fortwars', 'Fort Wars', 'Team DM'}, } -- List of maps in rotation From a4f57c8c6a51c27de1013fbd9dcb9c4f0302cd86 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Wed, 21 Nov 2018 21:56:54 +1000 Subject: [PATCH 12/27] Visual improvements to new end of round screen --- fluffy_mg_base/gamemode/cl_hud.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fluffy_mg_base/gamemode/cl_hud.lua b/fluffy_mg_base/gamemode/cl_hud.lua index a83e08e..9ea942b 100644 --- a/fluffy_mg_base/gamemode/cl_hud.lua +++ b/fluffy_mg_base/gamemode/cl_hud.lua @@ -341,15 +341,15 @@ function GM:CreateRoundEndPanel(message, tagline) p.Message = message function p:Paint(w, h) if self.TagLine then - draw.RoundedBoxEx(8, 0, 0, w, h-bar_h, GAMEMODE.FCol2, false, false, false, false) - draw.RoundedBoxEx(8, 0, h-bar_h, w, bar_h, GAMEMODE.FCol3, false, false, true, true) + draw.RoundedBoxEx(16, 0, 0, w, h-bar_h, GAMEMODE.FCol2, false, false, false, false) + draw.RoundedBoxEx(16, 0, h-bar_h, w, bar_h, GAMEMODE.FCol3, false, false, true, true) - draw.SimpleText(self.Message, 'FS_B32', w/2 + 2, 20 + 3, GAMEMODE.FColShadow, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + draw.SimpleText(self.Message, 'FS_B32', w/2 + 2, 20 + 2, GAMEMODE.FColShadow, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(self.Message, 'FS_B32', w/2, 20, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(self.TagLine, 'FS_16', w/2, h-bar_h+2, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) else - draw.RoundedBoxEx(8, 0, 0, w, h, GAMEMODE.FCol2, false, false, true, true) - draw.SimpleText(self.Message, 'FS_B32', w/2 + 2, h/2 + 3, GAMEMODE.FColShadow, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + draw.RoundedBoxEx(16, 0, 0, w, h, GAMEMODE.FCol2, false, false, true, true) + draw.SimpleText(self.Message, 'FS_B32', w/2 + 2, h/2 + 2, GAMEMODE.FColShadow, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(self.Message, 'FS_B32', w/2, h/2, GAMEMODE.FCol1, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) end end From e16176eb828192d11a4eda969f2a37a2b0c1898d Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Wed, 21 Nov 2018 21:57:13 +1000 Subject: [PATCH 13/27] GM:GetRandomPlayer extended functionality --- fluffy_mg_base/gamemode/init.lua | 40 ++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/fluffy_mg_base/gamemode/init.lua b/fluffy_mg_base/gamemode/init.lua index 32b185c..7da33af 100644 --- a/fluffy_mg_base/gamemode/init.lua +++ b/fluffy_mg_base/gamemode/init.lua @@ -214,14 +214,44 @@ function GM:GetTeamLivingPlayers( t ) return alive end +-- Table shuffle +-- Borrowed from TTT +-- Fisher-Yates implementation +local table = table +function table.Shuffle(t) + local n = #t + + while n > 2 do + -- n is now the last pertinent index + local k = rand(n) -- 1 <= k <= n + -- Quick swap + t[n], t[k] = t[k], t[n] + n = n - 1 + end + + return t +end + -- Pick a random player -function GM:GetRandomPlayer() - local ply = table.Random( player.GetAll() ) - while ply:Team() == TEAM_SPECTATOR do - ply = table.Random( player.GetAll() ) +function GM:GetRandomPlayer(num, forcetable) + num = num or 1 + local players = table.Shuffle(player.GetAll()) + PrintTable(players) + local output = {} + local i = 1 + while #output < num do + if i > #players then break end + local p = players[i] + if p:Team() == TEAM_SPECTATOR then continue end + if p.Spectating then continue end + table.insert(output, p) end - return ply + if num == 1 and not forcetable then + return players[1] -- return entity for compatibility + else + return players -- return table + end end -- This is for rewarding melons at the end of a game From 2eb1b010af95e1fa4d8ea8cd916a27b58fd5c990 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Wed, 21 Nov 2018 22:55:36 +1000 Subject: [PATCH 14/27] Fix get random player with n > 1 --- fluffy_mg_base/gamemode/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fluffy_mg_base/gamemode/init.lua b/fluffy_mg_base/gamemode/init.lua index 7da33af..11f58e3 100644 --- a/fluffy_mg_base/gamemode/init.lua +++ b/fluffy_mg_base/gamemode/init.lua @@ -236,21 +236,21 @@ end function GM:GetRandomPlayer(num, forcetable) num = num or 1 local players = table.Shuffle(player.GetAll()) - PrintTable(players) local output = {} local i = 1 while #output < num do if i > #players then break end local p = players[i] + i = i + 1 if p:Team() == TEAM_SPECTATOR then continue end if p.Spectating then continue end table.insert(output, p) end if num == 1 and not forcetable then - return players[1] -- return entity for compatibility + return output[1] -- return entity for compatibility else - return players -- return table + return output -- return table end end From 22308341920cb8c3a7fc8daa970d78b710273197 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Wed, 21 Nov 2018 22:55:52 +1000 Subject: [PATCH 15/27] Hunter gamemodes now have scaling initial rates --- fluffy_mg_base/gamemode/gametype_hunter.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fluffy_mg_base/gamemode/gametype_hunter.lua b/fluffy_mg_base/gamemode/gametype_hunter.lua index 3b4d3fa..15e25e3 100644 --- a/fluffy_mg_base/gamemode/gametype_hunter.lua +++ b/fluffy_mg_base/gamemode/gametype_hunter.lua @@ -12,11 +12,18 @@ end -- If team survival pick one player to be a hunter hook.Add('PreRoundStart', 'SurvivalPickHunter', function() if GAMEMODE.TeamSurvival then + local num_players = 0 for k,v in pairs( player.GetAll() ) do if v:Team() == TEAM_SPECTATOR then continue end v:SetTeam( GAMEMODE.SurvivorTeam ) + num_players = num_players + 1 + end + + -- Make 20% of players (+1) hunters + local num_hunters = math.floor((num_players-1)/5) + 1 + for k,v in pairs(GAMEMODE:GetRandomPlayer(num_hunters, true)) do + v:SetTeam(GAMEMODE.HunterTeam) end - GAMEMODE:GetRandomPlayer():SetTeam( GAMEMODE.HunterTeam ) end end ) @@ -34,7 +41,6 @@ function GM:GetLastPlayer(exclude_player) for k,v in pairs( player.GetAll() ) do if v:Alive() and v:Team() == GAMEMODE.SurvivorTeam and !v.Spectating then if exclude_player and v == exclude_player then continue end - print(v, exclude_player, 'alive!') if IsValid(last_alive) then return false else From e1d4ebec5f337d25a9dfd7ce4675c0c7b4f9d7c0 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Wed, 21 Nov 2018 22:56:00 +1000 Subject: [PATCH 16/27] SB: Minor gun improvements --- .../weapons/weapon_barrel_killa/shared.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fluffy_suicidebarrels/entities/weapons/weapon_barrel_killa/shared.lua b/fluffy_suicidebarrels/entities/weapons/weapon_barrel_killa/shared.lua index a3c477f..db711f8 100644 --- a/fluffy_suicidebarrels/entities/weapons/weapon_barrel_killa/shared.lua +++ b/fluffy_suicidebarrels/entities/weapons/weapon_barrel_killa/shared.lua @@ -13,13 +13,14 @@ SWEP.Base = "weapon_base" SWEP.HoldType = "pistol" SWEP.Purpose = "Use this to kill those damn barrels." -SWEP.ViewModel = Model("models/weapons/v_pistol.mdl") -SWEP.WorldModel = Model("models/weapons/w_pistol.mdl") +SWEP.ViewModel = Model("models/weapons/c_pistol.mdl") +SWEP.WorldModel = Model("models/weapons/w_pistol.mdl") +SWEP.UseHands = true SWEP.Primary.Sound = Sound( "Weapon_Pistol.Single" ) -SWEP.Primary.Recoil = 3.5 +SWEP.Primary.Recoil = 0 SWEP.Primary.Damage = 1000 -SWEP.Primary.Cone = 0.01 +SWEP.Primary.Cone = 0 SWEP.Primary.Automatic = false SWEP.Primary.ClipSize = 1 SWEP.Primary.Ammo = "pistol"; @@ -36,10 +37,10 @@ end function SWEP:PrimaryAttack() if !self:CanPrimaryAttack() then return end - self.Weapon:EmitSound( self.Primary.Sound ) - self:ShootBullet( self.Primary.Damage, 1, self.Primary.Cone ) - self:TakePrimaryAmmo( 1 ) - self.Owner:ViewPunch( Angle( -self.Primary.Recoil, 0, 0 ) ) + self.Weapon:EmitSound(self.Primary.Sound) + self:ShootBullet(self.Primary.Damage, 1, self.Primary.Cone) + self:TakePrimaryAmmo(1) + self.Owner:ViewPunch(Angle(-self.Primary.Recoil, 0, 0 )) end function SWEP:SecondaryAttack() From f08519674109e44a866b6f5bc2692726774d627f Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 07:56:56 +1000 Subject: [PATCH 17/27] Tracking of initial hunter(s) in Hunter gamemodes --- fluffy_mg_base/gamemode/gametype_hunter.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fluffy_mg_base/gamemode/gametype_hunter.lua b/fluffy_mg_base/gamemode/gametype_hunter.lua index 15e25e3..62a69ec 100644 --- a/fluffy_mg_base/gamemode/gametype_hunter.lua +++ b/fluffy_mg_base/gamemode/gametype_hunter.lua @@ -17,12 +17,14 @@ hook.Add('PreRoundStart', 'SurvivalPickHunter', function() if v:Team() == TEAM_SPECTATOR then continue end v:SetTeam( GAMEMODE.SurvivorTeam ) num_players = num_players + 1 + v.InitialHunter = false end -- Make 20% of players (+1) hunters local num_hunters = math.floor((num_players-1)/5) + 1 for k,v in pairs(GAMEMODE:GetRandomPlayer(num_hunters, true)) do v:SetTeam(GAMEMODE.HunterTeam) + v.InitialHunter = true end end end ) From a68eac52c7cb874288209185f95d153a2bb769dd Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:07:17 +1000 Subject: [PATCH 18/27] Rework Kingmaker Scoring is now based on *Surviving* as King, not for kills made as King. --- fluffy_kingmaker/gamemode/cl_init.lua | 2 +- fluffy_kingmaker/gamemode/init.lua | 49 ++++++++++++++++----------- fluffy_kingmaker/gamemode/shared.lua | 10 +++--- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/fluffy_kingmaker/gamemode/cl_init.lua b/fluffy_kingmaker/gamemode/cl_init.lua index 4b54f5f..f39a697 100644 --- a/fluffy_kingmaker/gamemode/cl_init.lua +++ b/fluffy_kingmaker/gamemode/cl_init.lua @@ -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 diff --git a/fluffy_kingmaker/gamemode/init.lua b/fluffy_kingmaker/gamemode/init.lua index 68b6d41..4264fd8 100644 --- a/fluffy_kingmaker/gamemode/init.lua +++ b/fluffy_kingmaker/gamemode/init.lua @@ -14,17 +14,18 @@ function GM:PlayerLoadout(ply) ply:Give("weapon_shotgun") ply:GiveAmmo(512, "SMG1", true) ply:GiveAmmo(512, "Buckshot", true) - ply:SetRunSpeed(500) - ply:SetWalkSpeed(300) + ply:SetRunSpeed(450) + ply:SetWalkSpeed(350) ply:SetMaxHealth(100) end function GM:MakeKing(ply) - ply:SetMaxHealth(250) - ply:SetHealth(250) - ply:SetJumpPower(500) - ply:SetRunSpeed(1000) - ply:SetWalkSpeed(1000) + ply:StripWeapons() + ply:SetMaxHealth(150) + ply:SetHealth(150) + ply:SetJumpPower(250) + ply:SetRunSpeed(575) + ply:SetWalkSpeed(575) end -- Stop regi-sui-cide? @@ -55,19 +56,13 @@ function GM:DoPlayerDeath(ply, attacker, dmginfo) if !attacker:IsValid() or !attacker:IsPlayer() then return end -- We only care about player kills from here on if attacker == ply then return end -- Suicides aren't important - -- If the attacker is the King - if attacker:GetNWBool('IsKing', false) then - attacker:SetNWInt('KingFrags', attacker:GetNWInt('KingFrags', 0) + 1) - attacker:AddFrags(1) - attacker:AddStatPoints('KingFrags', 1) - end - -- If the deceased is the King if ply:GetNWBool('IsKing', false) then ply:SetNWBool('IsKing', false) attacker:SetNWBool('IsKing', true) - attacker:SetNWInt('KingFrags', attacker:GetNWInt('KingFrags', 0) + 1) - attacker:AddFrags(5) + attacker:SetNWInt('KingPoints', ply:GetNWInt('KingPoints', 0) + 1) + attacker:AddFrags(1) + attacker:AddStatPoints('KingPoints', 1) attacker:AddStatPoints('KingEliminations', 1) GAMEMODE:MakeKing(attacker) GAMEMODE.CurrentKing = attacker @@ -78,9 +73,9 @@ function GM:DoPlayerDeath(ply, attacker, dmginfo) -- Similar to above, any kills with no king become king if not IsValid(GAMEMODE.CurrentKing) then attacker:SetNWBool('IsKing', true) - attacker:SetNWInt('KingFrags', attacker:GetNWInt('KingFrags', 0) + 1) + attacker:SetNWInt('KingPoints', ply:GetNWInt('KingPoints', 0) + 1) attacker:AddFrags(1) - attacker:AddStatPoints('KingFrags', 1) + attacker:AddStatPoints('KingPoints', 1) GAMEMODE:MakeKing(attacker) GAMEMODE.CurrentKing = attacker local name = string.sub(attacker:Nick(), 1, 10) @@ -102,12 +97,26 @@ end hook.Add('PreRoundStart', 'ResetKing', function() for k,v in pairs(player.GetAll()) do - v:SetNWInt("KingFrags", 0) + v:SetNWInt("KingPoints", 0) v:SetNWBool("IsKing", false) end GAMEMODE.CurrentKing = nil end ) +hook.Add('Think', 'KingTimer', function() + if GetGlobalString('RoundState') != 'InRound' then return end + if GAMEMODE.LastKingThink and CurTime() >= GAMEMODE.LastKingThink+1 then + if IsValid(GAMEMODE.CurrentKing) then + GAMEMODE.CurrentKing:AddFrags(1) + GAMEMODE.CurrentKing:SetNWInt('KingPoints', GAMEMODE.CurrentKing:GetNWInt('KingPoints', 0) + 1) + GAMEMODE.CurrentKing:EmitSound("npc/roller/code2.wav") + GAMEMODE.LastKingThink = CurTime() + end + elseif not GAMEMODE.LastKingThink then + GAMEMODE.LastKingThink = CurTime() + end +end) + -- Basic function to get the player with the most frags function GM:GetWinningPlayer() -- Doesn't really make sense in Team gamemodes @@ -117,7 +126,7 @@ function GM:GetWinningPlayer() local bestscore = 0 local bestplayer = nil for k,v in pairs( player.GetAll() ) do - local frags = v:GetNWInt("KingFrags") + local frags = v:GetNWInt("KingPoints") if frags > bestscore then bestscore = frags bestplayer = v diff --git a/fluffy_kingmaker/gamemode/shared.lua b/fluffy_kingmaker/gamemode/shared.lua index bbf96a7..8292f06 100644 --- a/fluffy_kingmaker/gamemode/shared.lua +++ b/fluffy_kingmaker/gamemode/shared.lua @@ -3,14 +3,12 @@ DeriveGamemode('fluffy_mg_base') GM.Name = 'Kingmaker' GM.Author = 'FluffyXVI' GM.HelpText = [[ - Become the King and defeat everyone! + Become the King and survive! - As the King, you are more powerful than everyone else - Get kills as the King to earn points + Whoever is the King will earn a point for every second they survive. + Anyone who kills the King will become the King. - If you're not the King, work together to defeat the King! - You can kill anyone - but there's no points for it. - Only kills you make while you are the King will give you points. + The King is defenseless apart from a slight speed & health boost. ]] GM.TeamBased = false -- Is the gamemode FFA or Teams? From a7f20cd3a454c7690bd9c7558fb7aaa100e4f101 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:07:41 +1000 Subject: [PATCH 19/27] Original infected are slower and stronger --- fluffy_infection/gamemode/init.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fluffy_infection/gamemode/init.lua b/fluffy_infection/gamemode/init.lua index 1a762b4..1d2e470 100644 --- a/fluffy_infection/gamemode/init.lua +++ b/fluffy_infection/gamemode/init.lua @@ -21,9 +21,18 @@ function GM:PlayerLoadout( ply ) ply:SetWalkSpeed(200) elseif ply:Team() == TEAM_RED then -- Infected - ply:Give('weapon_fists') - ply:SetRunSpeed(500) - ply:SetWalkSpeed(300) + -- Initial infected are stronger but slower + 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 From 59bf07e1aaea00294db019b1e4b61d07a0c46d4e Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:07:51 +1000 Subject: [PATCH 20/27] Minor tweak to Create Wars regarding score --- fluffy_cratewars/gamemode/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fluffy_cratewars/gamemode/init.lua b/fluffy_cratewars/gamemode/init.lua index 64ea8f4..e1feebe 100644 --- a/fluffy_cratewars/gamemode/init.lua +++ b/fluffy_cratewars/gamemode/init.lua @@ -31,14 +31,15 @@ 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 - timer.Simple(math.random(40, 60), function() GAMEMODE:StartBattlePhase() end) + timer.Simple(math.random(45, 65), function() GAMEMODE:StartBattlePhase() end) end ) hook.Add('PropBreak', 'TrackBrokenCrates', function(ply, prop) From bbe4a9e5bddae3565dbbe79163424d5dd3227bf2 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:13:44 +1000 Subject: [PATCH 21/27] Bomb Tag scaling based on number of players --- fluffy_bombtag/gamemode/init.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/fluffy_bombtag/gamemode/init.lua b/fluffy_bombtag/gamemode/init.lua index 4e18ee8..6ea816f 100644 --- a/fluffy_bombtag/gamemode/init.lua +++ b/fluffy_bombtag/gamemode/init.lua @@ -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 @@ -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 @@ -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 From a57cd7b0fce9612a7f47af6cb283e3c7f42fc926 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:14:52 +1000 Subject: [PATCH 22/27] Slow barrels during countdown --- fluffy_suicidebarrels/gamemode/sv_player_extension.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/fluffy_suicidebarrels/gamemode/sv_player_extension.lua b/fluffy_suicidebarrels/gamemode/sv_player_extension.lua index 1851329..669d0ba 100644 --- a/fluffy_suicidebarrels/gamemode/sv_player_extension.lua +++ b/fluffy_suicidebarrels/gamemode/sv_player_extension.lua @@ -20,6 +20,7 @@ hook.Add('KeyPress', 'SuicideBarrelBoom', function( ply, key ) if ply.NextBoom and CurTime() >= ply.NextBoom then ply.NextBoom = nil + ply:SetWalkSpeed(175) -- Play blip sounds then explode -- This should probably be improved From 0b3f181301f448e6283b2061dadf073d923da594 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:26:00 +1000 Subject: [PATCH 23/27] Remove bullet holes on laser weapons --- fluffy_bombtag/entities/weapons/bt_punch.lua | 10 ++++++++++ .../entities/weapons/weapon_laserdance.lua | 10 ++++++++++ .../entities/weapons/weapon_propkilla/shared.lua | 9 +++++++++ 3 files changed, 29 insertions(+) diff --git a/fluffy_bombtag/entities/weapons/bt_punch.lua b/fluffy_bombtag/entities/weapons/bt_punch.lua index 5da2910..705e5b5 100644 --- a/fluffy_bombtag/entities/weapons/bt_punch.lua +++ b/fluffy_bombtag/entities/weapons/bt_punch.lua @@ -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 diff --git a/fluffy_laserdance/entities/weapons/weapon_laserdance.lua b/fluffy_laserdance/entities/weapons/weapon_laserdance.lua index 8f7fbdb..4758a10 100644 --- a/fluffy_laserdance/entities/weapons/weapon_laserdance.lua +++ b/fluffy_laserdance/entities/weapons/weapon_laserdance.lua @@ -112,3 +112,13 @@ function SWEP:ShootBullet( damage, num_bullets, aimcone ) self:ShootEffects() 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 diff --git a/fluffy_poltergeist/entities/weapons/weapon_propkilla/shared.lua b/fluffy_poltergeist/entities/weapons/weapon_propkilla/shared.lua index 8afdf1c..867981c 100644 --- a/fluffy_poltergeist/entities/weapons/weapon_propkilla/shared.lua +++ b/fluffy_poltergeist/entities/weapons/weapon_propkilla/shared.lua @@ -150,3 +150,12 @@ function SWEP:ShootBullets( damage, numbullets, aimcone, tracer ) self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) 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 From 3f5528bdd73c47b6753ba1add7b06db8bc752113 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:32:56 +1000 Subject: [PATCH 24/27] Zombies have green blood --- fluffy_infection/gamemode/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fluffy_infection/gamemode/init.lua b/fluffy_infection/gamemode/init.lua index 1d2e470..310118b 100644 --- a/fluffy_infection/gamemode/init.lua +++ b/fluffy_infection/gamemode/init.lua @@ -19,9 +19,11 @@ function GM:PlayerLoadout( ply ) ply:SetRunSpeed(300) ply:SetWalkSpeed(200) + ply:SetBloodColor(BLOOD_COLOR_RED) elseif ply:Team() == TEAM_RED then -- Infected -- Initial infected are stronger but slower + ply:SetBloodColor(BLOOD_COLOR_GREEN) if ply.InitialHunter then ply:SetMaxHealth(200) ply:SetHealth(200) From 3463b34855eca171e09f4f992535d3e765062f5e Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:33:55 +1000 Subject: [PATCH 25/27] Removed blood from barrels --- fluffy_suicidebarrels/gamemode/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fluffy_suicidebarrels/gamemode/init.lua b/fluffy_suicidebarrels/gamemode/init.lua index b431cd8..29bda82 100644 --- a/fluffy_suicidebarrels/gamemode/init.lua +++ b/fluffy_suicidebarrels/gamemode/init.lua @@ -13,8 +13,10 @@ function GM:PlayerLoadout( ply ) ply:SetWalkSpeed( 200 ) ply:SetRunSpeed( 250 ) + ply:SetBloodColor(BLOOD_COLOR_RED) elseif ply:Team() == TEAM_RED then -- Make sure that barrels have no weapons + ply:SetBloodColor(DONT_BLEED) ply:StripWeapons() ply.NextTaunt = CurTime() + 1 ply.NextBoom = CurTime() + 2 From 4cd81b73f3bb9a31f870098d8fa039e8081a4b98 Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 22 Nov 2018 08:43:48 +1000 Subject: [PATCH 26/27] Improvements to TargetID I swear these were done before but I guess they got lost in the process somehow --- fluffy_mg_base/gamemode/cl_hud.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/fluffy_mg_base/gamemode/cl_hud.lua b/fluffy_mg_base/gamemode/cl_hud.lua index 9ea942b..21449ce 100644 --- a/fluffy_mg_base/gamemode/cl_hud.lua +++ b/fluffy_mg_base/gamemode/cl_hud.lua @@ -44,9 +44,9 @@ function GM:HUDPaint() self:DrawCrosshair(x, y) else local tr = LocalPlayer():GetEyeTrace() - if (tr.Entity and not tr.Entity:IsPlayer()) or (!tr.Entity) then + --if (tr.Entity and not tr.Entity:IsPlayer()) or (!tr.Entity) then self:DrawCrosshair(ScrW()/2, ScrH()/2) - end + --end end -- Scoring pane @@ -450,18 +450,26 @@ function GM:GetPlayerInfoPanel(ply) draw.NoTexture() local c = team.GetColor(ply:Team()) + if not GAMEMODE.TeamBased then + local v = ply:GetPlayerColor() + c = Color(v.x * 255, v.y * 255, v.z * 255) + end - local poly = poly or draw.CirclePoly(32, 32, 24, 24) + local poly = poly or draw.CirclePoly(32, 32, 26, 24) surface.SetDrawColor(c) surface.DrawPoly(poly) local ang = (hp/hp_max) * -360 if ang % 2 == 1 then ang = ang - 1 end - draw.Arc(32, 32, 20, 8, math.Round(ang+90), 90, 12, GAMEMODE.FCol1) + draw.Arc(32, 32, 24, 6, math.Round(ang+90), 90, 12, GAMEMODE.FCol1) local name = ply:Nick() - draw.SimpleText(name, "FS_24", 64 + 1, 32 + 1, GAMEMODE.FColShadow, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) - draw.SimpleText(name, "FS_24", 64, 32, c, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) + draw.SimpleText(name, "FS_24", 64 + 1, 24 + 1, GAMEMODE.FColShadow, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) + draw.SimpleText(name, "FS_24", 64, 24, c, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) + + hp = math.floor(hp) + draw.SimpleText(hp .. 'HP', 'FS_24', 64+1, 24+1 + 20, GAMEMODE.FColShadow, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) + draw.SimpleText(hp .. 'HP', 'FS_24', 64, 24 + 20, c, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER) end GAMEMODE.PlayerPanels[ply] = panel From dde854fb3e94828382d1b662f1b8a1b0ef42bbdb Mon Sep 17 00:00:00 2001 From: FluffyXVI Date: Thu, 29 Nov 2018 18:00:37 +1000 Subject: [PATCH 27/27] Super early prototype gamemode --- fluffy_btest/fluffy_btest.txt | 5 ++++ fluffy_btest/gamemode/cl_init.lua | 1 + fluffy_btest/gamemode/init.lua | 42 +++++++++++++++++++++++++++++++ fluffy_btest/gamemode/shared.lua | 18 +++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 fluffy_btest/fluffy_btest.txt create mode 100644 fluffy_btest/gamemode/cl_init.lua create mode 100644 fluffy_btest/gamemode/init.lua create mode 100644 fluffy_btest/gamemode/shared.lua diff --git a/fluffy_btest/fluffy_btest.txt b/fluffy_btest/fluffy_btest.txt new file mode 100644 index 0000000..2b8e154 --- /dev/null +++ b/fluffy_btest/fluffy_btest.txt @@ -0,0 +1,5 @@ +"minigames" +{ + "base" "fluffy_mg_base" + "title" "B TEST" +} \ No newline at end of file diff --git a/fluffy_btest/gamemode/cl_init.lua b/fluffy_btest/gamemode/cl_init.lua new file mode 100644 index 0000000..0580b40 --- /dev/null +++ b/fluffy_btest/gamemode/cl_init.lua @@ -0,0 +1 @@ +include('shared.lua') \ No newline at end of file diff --git a/fluffy_btest/gamemode/init.lua b/fluffy_btest/gamemode/init.lua new file mode 100644 index 0000000..2b9a0f6 --- /dev/null +++ b/fluffy_btest/gamemode/init.lua @@ -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 \ No newline at end of file diff --git a/fluffy_btest/gamemode/shared.lua b/fluffy_btest/gamemode/shared.lua new file mode 100644 index 0000000..27cca10 --- /dev/null +++ b/fluffy_btest/gamemode/shared.lua @@ -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 \ No newline at end of file