Compare commits
2 Commits
85f9d855db
...
915f463b2a
Author | SHA1 | Date |
---|---|---|
Fesiug | 915f463b2a | |
Fesiug | 1286e17447 |
|
@ -35,6 +35,7 @@ function ENT:SetupDataTables()
|
||||||
self:NetworkVar( "Float", "CapturePercent" )
|
self:NetworkVar( "Float", "CapturePercent" )
|
||||||
self:NetworkVar( "Int", "TeamTaking" )
|
self:NetworkVar( "Int", "TeamTaking" )
|
||||||
self:NetworkVar( "Int", "TeamOwned" )
|
self:NetworkVar( "Int", "TeamOwned" )
|
||||||
|
self:NetworkVar( "Bool", "Contested" )
|
||||||
end
|
end
|
||||||
|
|
||||||
function ENT:Think()
|
function ENT:Think()
|
||||||
|
@ -56,6 +57,8 @@ function ENT:Think()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:SetContested( Contested )
|
||||||
|
|
||||||
local BlockPoints = false
|
local BlockPoints = false
|
||||||
local RoundActive = BennyGame:GetState() == BG_STATE_ACTIVE
|
local RoundActive = BennyGame:GetState() == BG_STATE_ACTIVE
|
||||||
|
|
||||||
|
@ -77,27 +80,40 @@ function ENT:Think()
|
||||||
self:EmitSound("buttons/button9.wav", 70, 100, 1)
|
self:EmitSound("buttons/button9.wav", 70, 100, 1)
|
||||||
end
|
end
|
||||||
elseif self:GetTeamOwned() != TeamOnPoint then
|
elseif self:GetTeamOwned() != TeamOnPoint then
|
||||||
-- Enemy or early bird taking this point
|
if self:GetCapturePercent() > 0 and self:GetTeamTaking() != TeamOnPoint then
|
||||||
local COLLECTED = (1/math.max( 1, 6-amtOnPoint )) * FrameTime()
|
-- Clearing the progress of another team on yet another team's point
|
||||||
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 1, COLLECTED ) )
|
local COLLECTED = (1/math.max( 1, 6-amtOnPoint )) * FrameTime()
|
||||||
self:SetTeamTaking( TeamOnPoint )
|
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 0, COLLECTED ) )
|
||||||
|
|
||||||
if self:GetCapturePercent() == 1 then
|
if self:GetCapturePercent() == 0 then
|
||||||
-- Point successfully captured!
|
-- Point successfully cleared
|
||||||
self:SetTeamOwned( TeamOnPoint )
|
self:SetTeamTaking( 0 )
|
||||||
self:SetTeamTaking( 0 )
|
self:EmitSound("buttons/button6.wav", 70, 100, 1)
|
||||||
self:SetCapturePercent( 0 )
|
end
|
||||||
self:EmitSound("buttons/blip1.wav", 70, 100, 1)
|
BlockPoints = true -- Block points for this saboteur
|
||||||
end
|
else
|
||||||
|
-- Enemy or early bird taking this point
|
||||||
|
local COLLECTED = (1/math.max( 1, 6-amtOnPoint )) * FrameTime()
|
||||||
|
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 1, COLLECTED ) )
|
||||||
|
self:SetTeamTaking( TeamOnPoint )
|
||||||
|
|
||||||
BlockPoints = true -- Block points for this saboteur
|
if self:GetCapturePercent() == 1 then
|
||||||
|
-- Point successfully captured!
|
||||||
|
self:SetTeamOwned( TeamOnPoint )
|
||||||
|
self:SetTeamTaking( 0 )
|
||||||
|
self:SetCapturePercent( 0 )
|
||||||
|
self:EmitSound("buttons/blip1.wav", 70, 100, 1)
|
||||||
|
end
|
||||||
|
|
||||||
for ply, edata in pairs(self.Memory) do
|
BlockPoints = true -- Block points for this saboteur
|
||||||
edata.xpcollected = (edata.xpcollected or 0) + (COLLECTED * 200)
|
|
||||||
local sap = math.floor(edata.xpcollected)
|
for ply, edata in pairs(self.Memory) do
|
||||||
if sap >= 10 then
|
edata.xpcollected = (edata.xpcollected or 0) + (COLLECTED * 200)
|
||||||
edata.xpcollected = edata.xpcollected - sap
|
local sap = math.floor(edata.xpcollected)
|
||||||
ply:RewardXP( sap )
|
if sap >= 10 then
|
||||||
|
edata.xpcollected = edata.xpcollected - sap
|
||||||
|
ply:RewardXP( sap )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif self:GetTeamOwned() == TeamOnPoint then
|
elseif self:GetTeamOwned() == TeamOnPoint then
|
||||||
|
@ -111,7 +127,7 @@ function ENT:Think()
|
||||||
if self:GetCapturePercent() == 0 then
|
if self:GetCapturePercent() == 0 then
|
||||||
-- Point successfully cleared
|
-- Point successfully cleared
|
||||||
self:SetTeamTaking( 0 )
|
self:SetTeamTaking( 0 )
|
||||||
self:EmitSound("buttons/button10.wav", 70, 100, 1)
|
self:EmitSound("buttons/bell1.wav", 70, 100, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,6 +46,21 @@ local function dospawn( self )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function doteamselect( self )
|
||||||
|
LocalPlayer():ConCommand( "b-cheat_setteam " .. self.iIndex )
|
||||||
|
self:GetParent():Remove()
|
||||||
|
end
|
||||||
|
|
||||||
|
local function painterly( self, w, h )
|
||||||
|
surface.SetDrawColor( self.iFaction.COLOR_DARK )
|
||||||
|
surface.DrawRect( 0, 0, w, h )
|
||||||
|
surface.SetDrawColor( self.iFaction.COLOR_MAIN )
|
||||||
|
surface.DrawOutlinedRect( 1, 1, w-2, h-2, 1 )
|
||||||
|
draw.SimpleText( l8(self.iData.name), "HUD_24", w/2, 4, self.iFaction.COLOR_MAIN, TEXT_ALIGN_CENTER )
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function OpenDebugMenu()
|
local function OpenDebugMenu()
|
||||||
if IsValid(DebugMenu) then DebugMenu:Remove() end
|
if IsValid(DebugMenu) then DebugMenu:Remove() end
|
||||||
DebugMenu = vgui.Create("DFrame")
|
DebugMenu = vgui.Create("DFrame")
|
||||||
|
@ -81,18 +96,29 @@ local function OpenDebugMenu()
|
||||||
vsplit:SetTop( modeller )
|
vsplit:SetTop( modeller )
|
||||||
modeller:SetModel( "models/weapons/w_pistol.mdl" )
|
modeller:SetModel( "models/weapons/w_pistol.mdl" )
|
||||||
modeller:SetFOV( 5 )
|
modeller:SetFOV( 5 )
|
||||||
local original = Vector( 0, 50, 0 )
|
|
||||||
modeller:SetCamPos( original )
|
modeller:SetCamPos( original )
|
||||||
modeller:SetLookAt( vector_origin )
|
modeller:SetLookAt( vector_origin )
|
||||||
|
modeller:SetPos( vector_origin )
|
||||||
|
modeller.Entity:SetAngles( angle_zero )
|
||||||
|
modeller.Standard = Vector( 0, 100, 0 )
|
||||||
|
modeller.Finalized = Vector()
|
||||||
function modeller:LayoutEntity( ent )
|
function modeller:LayoutEntity( ent )
|
||||||
ent:SetPos( Vector( 0, 0, 0 ) )
|
local the = Vector(modeller.Finalized)
|
||||||
ent:SetAngles( Angle( 0, 0 * RealTime() * 10 % 360, 0 ) )
|
the:Rotate( Angle( 0, (360/4) * RealTime() % 360, 0 ) )
|
||||||
|
modeller:SetCamPos( the )
|
||||||
|
-- ent:SetPos( Vector( 0, 0, 0 ) )
|
||||||
|
--ent:SetAngles( Angle( 0, 10 * RealTime() * 10 % 360, 0 ) )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
modeller:SetAmbientLight( HSLToColor( 0, 0, 1.00 ) )
|
modeller:SetAmbientLight( HSLToColor( 0, 0, 0.00 ) )
|
||||||
modeller:SetDirectionalLight(BOX_TOP, HSLToColor( 0, 0, 1.00 ) )
|
|
||||||
modeller:SetDirectionalLight(BOX_FRONT, HSLToColor( 0, 0, 1.00 ) )
|
modeller:SetDirectionalLight(BOX_TOP, HSLToColor( 0, 0, 0.50 ) )
|
||||||
|
modeller:SetDirectionalLight(BOX_BOTTOM, HSLToColor( 0, 0, 0.50 ) )
|
||||||
|
modeller:SetDirectionalLight(BOX_FRONT, HSLToColor( 0, 0, 0.50 ) )
|
||||||
|
modeller:SetDirectionalLight(BOX_BACK, HSLToColor( 0, 0, 0.50 ) )
|
||||||
|
|
||||||
|
modeller:SetDirectionalLight(BOX_LEFT, HSLToColor( 0, 0, 1.00 ) )
|
||||||
modeller:SetDirectionalLight(BOX_RIGHT, HSLToColor( 0, 0, 1.00 ) )
|
modeller:SetDirectionalLight(BOX_RIGHT, HSLToColor( 0, 0, 1.00 ) )
|
||||||
|
|
||||||
function modeller:Update( mdl )
|
function modeller:Update( mdl )
|
||||||
|
@ -101,15 +127,19 @@ local function OpenDebugMenu()
|
||||||
local worked = self.Entity:PhysicsInit( SOLID_VPHYSICS )
|
local worked = self.Entity:PhysicsInit( SOLID_VPHYSICS )
|
||||||
|
|
||||||
if worked then
|
if worked then
|
||||||
-- Factors the USP's bodygroup suppressor for some reason. Great
|
|
||||||
local mins, maxs = self.Entity:GetCollisionBounds()
|
-- Factors the USP's bodygroup suppressor for some reason. Great -- Not anymore, changed it to Physics Object AABB
|
||||||
|
local mins, maxs = self.Entity:GetPhysicsObject():GetAABB()
|
||||||
local wsc = Vector()
|
local wsc = Vector()
|
||||||
wsc:Add( mins )
|
wsc:Add( mins )
|
||||||
wsc:Add( maxs )
|
wsc:Add( maxs )
|
||||||
wsc:Div( 2 )
|
wsc:Div( 2 )
|
||||||
|
|
||||||
self:SetLookAt( wsc )
|
self.Entity:SetPos( -wsc )
|
||||||
self:SetCamPos( wsc+original )
|
|
||||||
|
self:SetLookAt( vector_origin )
|
||||||
|
modeller.Finalized:Set(modeller.Standard)
|
||||||
|
--self:SetCamPos( modeller.Standard )
|
||||||
|
|
||||||
-- local HFOV = 45-5
|
-- local HFOV = 45-5
|
||||||
-- local hfovRad = HFOV * math.pi / 180
|
-- local hfovRad = HFOV * math.pi / 180
|
||||||
|
@ -120,26 +150,26 @@ local function OpenDebugMenu()
|
||||||
-- scale test
|
-- scale test
|
||||||
if true then for i=1, 50 do
|
if true then for i=1, 50 do
|
||||||
local S1, S2 = false, false
|
local S1, S2 = false, false
|
||||||
local aimVector = (self:GetLookAt() - self:GetCamPos()):GetNormalized()
|
local aimVector = (self:GetLookAt() - modeller.Finalized):GetNormalized()
|
||||||
do -- test 1, mins
|
do -- test 1, mins
|
||||||
local entVector = mins - self:GetCamPos()
|
local entVector = mins - modeller.Finalized
|
||||||
local angCos = aimVector:Dot(entVector) / entVector:Length()
|
local angCos = aimVector:Dot(entVector) / entVector:Length()
|
||||||
S1 = (angCos >= directionAngCos)
|
S1 = (angCos >= directionAngCos)
|
||||||
end
|
end
|
||||||
do -- test 2: maxs
|
do -- test 2: maxs
|
||||||
local entVector = maxs - self:GetCamPos()
|
local entVector = maxs - modeller.Finalized
|
||||||
local angCos = aimVector:Dot(entVector) / entVector:Length()
|
local angCos = aimVector:Dot(entVector) / entVector:Length()
|
||||||
S2 = (angCos >= directionAngCos)
|
S2 = (angCos >= directionAngCos)
|
||||||
end
|
end
|
||||||
if S1 and S2 then
|
if S1 and S2 then
|
||||||
self.indicate = "took " .. i
|
self.indicate = i
|
||||||
self.vCamPos:Add( Vector( 0, 20, 0 ) )
|
--modeller.Finalized:Add( Vector( 0, 20, 0 ) )
|
||||||
--self.vLookatPos:Add( Vector( 0, 0, 0 ) )
|
--self.vLookatPos:Add( Vector( 0, 0, 0 ) )
|
||||||
--self.vLookatPos:Set( (mins+maxs)/2 )
|
--self.vLookatPos:Set( (mins+maxs)/2 )
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
self.indicate = "failed"
|
self.indicate = "failed"
|
||||||
self.vCamPos:Sub( (aimVector*20) )
|
modeller.Finalized:Sub( (aimVector*20) )
|
||||||
end
|
end
|
||||||
end end
|
end end
|
||||||
else
|
else
|
||||||
|
@ -182,12 +212,14 @@ local function OpenDebugMenu()
|
||||||
self:DrawModel()
|
self:DrawModel()
|
||||||
render.MaterialOverride()
|
render.MaterialOverride()
|
||||||
|
|
||||||
local mins, maxs = self.Entity:GetCollisionBounds()
|
if false and self.Entity:GetPhysicsObject():IsValid() then
|
||||||
|
local pos = self.Entity:GetPos()
|
||||||
-- render.SetColorMaterial()
|
local mins, maxs = self.Entity:GetPhysicsObject():GetAABB()
|
||||||
-- render.DrawSphere( mins, .5, 30, 30, Color( 255, 0, 0 ) )
|
render.SetColorMaterial()
|
||||||
-- render.DrawSphere( maxs, .5, 30, 30, Color( 0, 0, 255 ) )
|
render.DrawSphere( pos+mins, .5, 30, 30, Color( 255, 0, 0 ) )
|
||||||
-- render.DrawWireframeBox( vector_origin, angle_zero, mins, maxs, Color( 0, 0, 0, 127 ))
|
render.DrawSphere( pos+maxs, .5, 30, 30, Color( 0, 0, 255 ) )
|
||||||
|
render.DrawWireframeBox( pos, angle_zero, mins, maxs, Color( 0, 0, 0, 127 ))
|
||||||
|
end
|
||||||
|
|
||||||
render.SuppressEngineLighting( false )
|
render.SuppressEngineLighting( false )
|
||||||
cam.End3D()
|
cam.End3D()
|
||||||
|
@ -195,15 +227,15 @@ local function OpenDebugMenu()
|
||||||
self.LastPaint = RealTime()
|
self.LastPaint = RealTime()
|
||||||
end
|
end
|
||||||
function modeller:Paint( w, h )
|
function modeller:Paint( w, h )
|
||||||
surface.SetDrawColor( color_black )
|
surface.SetDrawColor( HSLToColor( 0.9, 0.2, 0 ) )
|
||||||
surface.DrawRect( 0, 0, w, h )
|
surface.DrawRect( 0, 0, w, h )
|
||||||
self:Paint1( w, h )
|
self:Paint1( w, h )
|
||||||
if self.Failed then
|
if self.Failed then
|
||||||
draw.SimpleText("Failed physinit, not cached?", "HUD_36", w/2, h/2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
draw.SimpleText("Failed physinit, not cached?", "HUD_36", w/2, h/2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||||
end
|
end
|
||||||
-- if self.indicate then
|
if self.indicate then
|
||||||
-- draw.SimpleText(self.indicate, "HUD_36", w/2, h/2 + 48, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
draw.SimpleText(self.indicate, "HUD_16", 4, 4, color_white)
|
||||||
-- end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -247,9 +279,40 @@ local function OpenDebugMenu()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function OpenMyTeamMenu()
|
||||||
|
if IsValid(DebugMenu) then DebugMenu:Remove() end
|
||||||
|
DebugMenu = vgui.Create("DFrame")
|
||||||
|
DebugMenu:SetSize( 200, 300 )
|
||||||
|
DebugMenu:MakePopup()
|
||||||
|
DebugMenu:SetKeyboardInputEnabled( false )
|
||||||
|
DebugMenu:SetSizable(false)
|
||||||
|
|
||||||
|
for index, data in ipairs( TEAMS ) do
|
||||||
|
local faction = FACTIONS[ data.factionid ]
|
||||||
|
if !faction then continue end
|
||||||
|
|
||||||
|
local button = DebugMenu:Add("DButton")
|
||||||
|
button:Dock( TOP )
|
||||||
|
button:DockMargin( 0, 0, 0, 5 )
|
||||||
|
button:SetText( l8( data.name ) )
|
||||||
|
button.iIndex = index
|
||||||
|
button.iData = data
|
||||||
|
button.iFaction = faction
|
||||||
|
button:SetTall(28)
|
||||||
|
button.DoClick = doteamselect
|
||||||
|
button.Paint = painterly
|
||||||
|
end
|
||||||
|
|
||||||
|
DebugMenu:InvalidateLayout( true )
|
||||||
|
DebugMenu:SizeToChildren( false, true )
|
||||||
|
DebugMenu:Center()
|
||||||
|
end
|
||||||
|
|
||||||
hook.Add("PlayerButtonDown", "PlayerButtonDown_DebugMenu", function( ply, button )
|
hook.Add("PlayerButtonDown", "PlayerButtonDown_DebugMenu", function( ply, button )
|
||||||
if button == KEY_F1 then
|
if button == KEY_F1 then
|
||||||
OpenDebugMenu()
|
OpenDebugMenu()
|
||||||
|
elseif button == KEY_F2 then
|
||||||
|
OpenMyTeamMenu()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
@ -17,15 +17,21 @@ function BennyGame:GetType()
|
||||||
return cGametype:GetBool() and BG_GTYPE_MP or BG_GTYPE_CAMPAIGN
|
return cGametype:GetBool() and BG_GTYPE_MP or BG_GTYPE_CAMPAIGN
|
||||||
end
|
end
|
||||||
|
|
||||||
GM.TeamBased = BennyGame:GetType() == BG_GTYPE_MP
|
|
||||||
|
|
||||||
function BennyGame:GetMode()
|
function BennyGame:GetMode()
|
||||||
return cGamemode:GetString()
|
return cGamemode:GetString()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BennyGame:GetModeData()
|
||||||
|
return BennyGame.Gamemodes[ BennyGame:GetMode() ]
|
||||||
|
end
|
||||||
|
|
||||||
BennyGame.TeamsInPlay = {
|
BennyGame.TeamsInPlay = {
|
||||||
4,
|
4,
|
||||||
3,
|
3,
|
||||||
|
--2,
|
||||||
|
--1,
|
||||||
|
--5,
|
||||||
|
--6,
|
||||||
}
|
}
|
||||||
BennyGame.TeamCount = #BennyGame.TeamsInPlay
|
BennyGame.TeamCount = #BennyGame.TeamsInPlay
|
||||||
|
|
||||||
|
@ -39,49 +45,51 @@ BennyGame.Gamemodes = {
|
||||||
description = "#Gamemode.tdm.Description",
|
description = "#Gamemode.tdm.Description",
|
||||||
|
|
||||||
scorelimit = CreateConVar("b-g_tdm_scorelimit", 75 ),
|
scorelimit = CreateConVar("b-g_tdm_scorelimit", 75 ),
|
||||||
timelimit = CreateConVar("b-g_tdm_timelimit", 10 ),
|
timelimit = CreateConVar("b-g_tdm_timelimit", 10*60 ),
|
||||||
},
|
},
|
||||||
["ffa"] = {
|
["ffa"] = {
|
||||||
name = "#Gamemode.ffa.Name",
|
name = "#Gamemode.ffa.Name",
|
||||||
description = "#Gamemode.ffa.Description",
|
description = "#Gamemode.ffa.Description",
|
||||||
|
|
||||||
scorelimit = CreateConVar("b-g_ffa_scorelimit", 30 ),
|
scorelimit = CreateConVar("b-g_ffa_scorelimit", 30 ),
|
||||||
timelimit = CreateConVar("b-g_ffa_timelimit", 10 ),
|
timelimit = CreateConVar("b-g_ffa_timelimit", 10*60 ),
|
||||||
},
|
},
|
||||||
["snd"] = {
|
["snd"] = {
|
||||||
name = "#Gamemode.snd.Name",
|
name = "#Gamemode.snd.Name",
|
||||||
description = "#Gamemode.snd.Description",
|
description = "#Gamemode.snd.Description",
|
||||||
|
|
||||||
scorelimit = CreateConVar("b-g_snd_scorelimit", 6 ),
|
scorelimit = CreateConVar("b-g_snd_scorelimit", 6 ),
|
||||||
timelimit = CreateConVar("b-g_snd_timelimit", 2.5 ),
|
timelimit = CreateConVar("b-g_snd_timelimit", 2.5*60 ),
|
||||||
},
|
},
|
||||||
["ctf"] = {
|
["ctf"] = {
|
||||||
name = "#Gamemode.ctf.Name",
|
name = "#Gamemode.ctf.Name",
|
||||||
description = "#Gamemode.ctf.Description",
|
description = "#Gamemode.ctf.Description",
|
||||||
|
|
||||||
scorelimit = CreateConVar("b-g_ctf_scorelimit", 3 ),
|
scorelimit = CreateConVar("b-g_ctf_scorelimit", 3 ),
|
||||||
timelimit = CreateConVar("b-g_ctf_timelimit", 10 ),
|
timelimit = CreateConVar("b-g_ctf_timelimit", 10*60 ),
|
||||||
},
|
},
|
||||||
["dom"] = {
|
["dom"] = {
|
||||||
name = "#Gamemode.dom.Name",
|
name = "#Gamemode.dom.Name",
|
||||||
description = "#Gamemode.dom.Description",
|
description = "#Gamemode.dom.Description",
|
||||||
|
|
||||||
scorelimit = CreateConVar("b-g_dom_scorelimit", 1000 ),
|
scorelimit = CreateConVar("b-g_dom_scorelimit", 1000 ),
|
||||||
timelimit = CreateConVar("b-g_dom_timelimit", 10 ),
|
timelimit = CreateConVar("b-g_dom_timelimit", 10*60 ),
|
||||||
|
roundlimit = CreateConVar("b-g_dom_roundlimit", 1 ),
|
||||||
},
|
},
|
||||||
["dem"] = {
|
["dem"] = {
|
||||||
name = "#Gamemode.dem.Name",
|
name = "#Gamemode.dem.Name",
|
||||||
description = "#Gamemode.dem.Description",
|
description = "#Gamemode.dem.Description",
|
||||||
|
|
||||||
scorelimit = CreateConVar("b-g_dem_scorelimit", 3 ),
|
scorelimit = CreateConVar("b-g_dem_scorelimit", 3 ),
|
||||||
timelimit = CreateConVar("b-g_dem_timelimit", 5 ),
|
timelimit = CreateConVar("b-g_dem_timelimit", 5*60 ),
|
||||||
|
roundlimit = CreateConVar("b-g_dom_roundlimit", 2 ),
|
||||||
},
|
},
|
||||||
["hp"] = {
|
["hp"] = {
|
||||||
name = "#Gamemode.hp.Name",
|
name = "#Gamemode.hp.Name",
|
||||||
description = "#Gamemode.hp.Description",
|
description = "#Gamemode.hp.Description",
|
||||||
|
|
||||||
scorelimit = CreateConVar("b-g_hp_scorelimit", 300 ),
|
scorelimit = CreateConVar("b-g_hp_scorelimit", 300 ),
|
||||||
timelimit = CreateConVar("b-g_hp_timelimit", 10 ),
|
timelimit = CreateConVar("b-g_hp_timelimit", 10*60 ),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +179,11 @@ function BennyGame:GetTimeLimit()
|
||||||
return BennyGame.Gamemodes[BennyGame:GetMode()].timelimit:GetInt() + BennyGame:GetTimeExtension()
|
return BennyGame.Gamemodes[BennyGame:GetMode()].timelimit:GetInt() + BennyGame:GetTimeExtension()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BennyGame:GetRoundLimit()
|
||||||
|
if !BennyGame.Gamemodes[BennyGame:GetMode()].roundlimit then return false end
|
||||||
|
return BennyGame.Gamemodes[BennyGame:GetMode()].roundlimit:GetInt()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function BennyGame:GetPregameTime()
|
function BennyGame:GetPregameTime()
|
||||||
return cPregame:GetInt()
|
return cPregame:GetInt()
|
||||||
|
@ -205,15 +218,16 @@ end
|
||||||
BG_ER_TIMELIMIT = 0
|
BG_ER_TIMELIMIT = 0
|
||||||
BG_ER_SCORELIMIT = 1
|
BG_ER_SCORELIMIT = 1
|
||||||
BG_ER_NUKE = 2
|
BG_ER_NUKE = 2
|
||||||
|
BG_ER_FORCE = 3
|
||||||
|
|
||||||
function BennyGame:StartRound()
|
function BennyGame:StartRound()
|
||||||
PrintMessage(HUD_PRINTCENTER, "Round start!")
|
PrintMessage(HUD_PRINTCENTER, "Round start!")
|
||||||
BennyGame:SetState( BG_STATE_ACTIVE )
|
BennyGame:SetState( BG_STATE_ACTIVE )
|
||||||
BennyGame:SetRoundStartedAt( CurTime() )
|
BennyGame:SetRoundStartedAt( CurTime() )
|
||||||
--game.CleanUpMap()
|
game.CleanUpMap()
|
||||||
--for _, ply in player.Iterator() do
|
for _, ply in player.Iterator() do
|
||||||
-- ply:Spawn()
|
ply:Spawn()
|
||||||
--end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BennyGame:EndRound( reason, forceteam )
|
function BennyGame:EndRound( reason, forceteam )
|
||||||
|
@ -230,7 +244,6 @@ function BennyGame:EndRound( reason, forceteam )
|
||||||
if HighestScore < ThisScore then
|
if HighestScore < ThisScore then
|
||||||
HighestScore = ThisScore
|
HighestScore = ThisScore
|
||||||
HighestTeam = RealTeamID
|
HighestTeam = RealTeamID
|
||||||
print("highest score to do it to em", HighestScore, TEAMS[HighestTeam].name)
|
|
||||||
winningteam = HighestTeam
|
winningteam = HighestTeam
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -239,9 +252,9 @@ function BennyGame:EndRound( reason, forceteam )
|
||||||
local ThisScore = BennyGame:GetScoreForTeam( RealTeamID )
|
local ThisScore = BennyGame:GetScoreForTeam( RealTeamID )
|
||||||
if RealTeamID == HighestTeam then continue end
|
if RealTeamID == HighestTeam then continue end
|
||||||
if HighestScore < ThisScore then
|
if HighestScore < ThisScore then
|
||||||
print("clearly there's been a failure", RealTeamID, ThisScore, HighestTeam, HighestScore)
|
-- print("clearly there's been a failure", RealTeamID, ThisScore, HighestTeam, HighestScore)
|
||||||
elseif HighestScore == ThisScore then
|
elseif HighestScore == ThisScore then
|
||||||
print("this looks like a tie", RealTeamID, HighestTeam)
|
-- print("this looks like a tie", RealTeamID, HighestTeam)
|
||||||
winningteam = 0
|
winningteam = 0
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -260,7 +273,14 @@ function BennyGame:EndRound( reason, forceteam )
|
||||||
PrintMessage(HUD_PRINTCENTER, TheFull)
|
PrintMessage(HUD_PRINTCENTER, TheFull)
|
||||||
|
|
||||||
local roundtime = CurTime() - BennyGame:GetRoundStartedAt()
|
local roundtime = CurTime() - BennyGame:GetRoundStartedAt()
|
||||||
print( "That round lasted " .. math.ceil(roundtime) .. " seconds." )
|
|
||||||
|
local rf = string.FormattedTime( 269 )
|
||||||
|
local nicely = ""
|
||||||
|
if rf.h > 0 then
|
||||||
|
nicely = nicely .. rf.h .. ":"
|
||||||
|
end
|
||||||
|
nicely = nicely .. string.format( "%02i:%02i.", rf.m, rf.s )
|
||||||
|
print( "That round lasted " .. nicely )
|
||||||
end
|
end
|
||||||
|
|
||||||
concommand.Add("b-cheat_scoreset", function( ply, cmd, args )
|
concommand.Add("b-cheat_scoreset", function( ply, cmd, args )
|
||||||
|
@ -303,6 +323,12 @@ end, function( cmd, args )
|
||||||
return BENNY.SimpleAutoComplete( cmd, args, TEAMS_IDs )
|
return BENNY.SimpleAutoComplete( cmd, args, TEAMS_IDs )
|
||||||
end )
|
end )
|
||||||
|
|
||||||
|
concommand.Add("b-cheat_endround", function( ply, cmd, args )
|
||||||
|
BennyGame:EndRound( args[1] or BG_ER_FORCE, args[2] )
|
||||||
|
end, function( cmd, args )
|
||||||
|
return BENNY.SimpleAutoComplete( cmd, args, TEAMS_IDs )
|
||||||
|
end )
|
||||||
|
|
||||||
hook.Add("Think", "Benny_Gamestate_Think", function()
|
hook.Add("Think", "Benny_Gamestate_Think", function()
|
||||||
if SERVER then
|
if SERVER then
|
||||||
local World = Entity(0)
|
local World = Entity(0)
|
||||||
|
@ -340,6 +366,9 @@ hook.Add("Think", "Benny_Gamestate_Think", function()
|
||||||
|
|
||||||
|
|
||||||
if BennyGame:GetRoundFinishedAt() + BennyGame:GetPostgameTime() <= CurTime() then
|
if BennyGame:GetRoundFinishedAt() + BennyGame:GetPostgameTime() <= CurTime() then
|
||||||
|
for TeamID, RealTeamID in ipairs( BennyGame.TeamsInPlay ) do
|
||||||
|
BennyGame:SetScoreForTeam( RealTeamID, 0 )
|
||||||
|
end
|
||||||
BennyGame:SetState( BG_STATE_WAITINGFORPLAYERS )
|
BennyGame:SetState( BG_STATE_WAITINGFORPLAYERS )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ local function regenfonts()
|
||||||
end
|
end
|
||||||
regenfonts()
|
regenfonts()
|
||||||
|
|
||||||
local FACTIONS = {
|
FACTIONS = {
|
||||||
["benny"] = {
|
["benny"] = {
|
||||||
COLOR_MAIN = Color( 255, 238, 169 ),
|
COLOR_MAIN = Color( 255, 238, 169 ),
|
||||||
COLOR_DARK = Color( 54, 44, 39 ),
|
COLOR_DARK = Color( 54, 44, 39 ),
|
||||||
|
@ -428,7 +428,7 @@ function GM:HUDPaint()
|
||||||
|
|
||||||
local wep = handler:GetActiveR()
|
local wep = handler:GetActiveR()
|
||||||
if wep and wep.GetClip then
|
if wep and wep.GetClip then
|
||||||
local Bw, Bh = 328, 160
|
local Bw, Bh = 8+(8+2)*30-2+8, 160
|
||||||
S_Push( w - 20 - Bw, h - 20 - Bh )
|
S_Push( w - 20 - Bw, h - 20 - Bh )
|
||||||
hCol( COLOR_DARK )
|
hCol( COLOR_DARK )
|
||||||
hRect( 0, 0, Bw, Bh )
|
hRect( 0, 0, Bw, Bh )
|
||||||
|
@ -644,7 +644,9 @@ function GM:HUDPaint()
|
||||||
|
|
||||||
local TITLE = "CAPTURING"
|
local TITLE = "CAPTURING"
|
||||||
local PERCENT = obj:GetCapturePercent()
|
local PERCENT = obj:GetCapturePercent()
|
||||||
if obj:GetTeamOwned() == myteam then
|
if obj:GetContested() then
|
||||||
|
TITLE = "CONTESTED"
|
||||||
|
elseif obj:GetTeamOwned() == myteam then
|
||||||
if obj:GetCapturePercent() > 0 then
|
if obj:GetCapturePercent() > 0 then
|
||||||
TITLE = "CLEARING"
|
TITLE = "CLEARING"
|
||||||
else
|
else
|
||||||
|
@ -655,15 +657,18 @@ function GM:HUDPaint()
|
||||||
TITLE = "CLEARING"
|
TITLE = "CLEARING"
|
||||||
end
|
end
|
||||||
|
|
||||||
local BARCOLOR_MAIN = TEAMS[obj:GetTeamOwned()].factionid
|
local BARCOLOR = FACTIONS[ TEAMS[obj:GetTeamOwned()].factionid ]
|
||||||
BARCOLOR_MAIN = FACTIONS[BARCOLOR_MAIN].COLOR_MAIN
|
local TAKCOLOR = FACTIONS[ TEAMS[obj:GetTeamTaking()].factionid ]
|
||||||
local BARCOLOR_DARK = TEAMS[obj:GetTeamOwned()].factionid
|
local CONTOLER = FACTIONS[ "unassigned" ]
|
||||||
BARCOLOR_DARK = FACTIONS[BARCOLOR_DARK].COLOR_DARK
|
|
||||||
|
|
||||||
local TAKCOLOR_MAIN = TEAMS[obj:GetTeamTaking()].factionid
|
BARCOLOR_MAIN = BARCOLOR.COLOR_MAIN
|
||||||
TAKCOLOR_MAIN = FACTIONS[TAKCOLOR_MAIN].COLOR_MAIN
|
BARCOLOR_DARK = BARCOLOR.COLOR_DARK
|
||||||
local TAKCOLOR_DARK = TEAMS[obj:GetTeamTaking()].factionid
|
|
||||||
TAKCOLOR_DARK = FACTIONS[TAKCOLOR_DARK].COLOR_DARK
|
TAKCOLOR_MAIN = TAKCOLOR.COLOR_MAIN
|
||||||
|
TAKCOLOR_DARK = TAKCOLOR.COLOR_DARK
|
||||||
|
|
||||||
|
CONTOLER_MAIN = CONTOLER.COLOR_MAIN
|
||||||
|
CONTOLER_DARK = CONTOLER.COLOR_DARK
|
||||||
|
|
||||||
local BWIDE, BTALL = 180, 16
|
local BWIDE, BTALL = 180, 16
|
||||||
|
|
||||||
|
@ -680,19 +685,19 @@ function GM:HUDPaint()
|
||||||
|
|
||||||
|
|
||||||
local x, y = hXY( 0, TITLE=="SECURE" and 62 or 40 )
|
local x, y = hXY( 0, TITLE=="SECURE" and 62 or 40 )
|
||||||
qt( TITLE, "HUD_24", x, y, COLOR_MAIN, TEXT_ALIGN_CENTER, nil, COLOR_DARK )
|
qt( TITLE, "HUD_24", x, y, obj:GetContested() and CONTOLER_MAIN or COLOR_MAIN, TEXT_ALIGN_CENTER, nil, COLOR_DARK )
|
||||||
|
|
||||||
if TITLE!="SECURE" then
|
if TITLE!="SECURE" then
|
||||||
S_Push( -BWIDE/2, 62 )
|
S_Push( -BWIDE/2, 62 )
|
||||||
hCol( COLOR_DARK )
|
hCol( TAKCOLOR_DARK )
|
||||||
hRect( 0, 0, 180, BTALL )
|
hRect( 0, 0, 180, BTALL )
|
||||||
hCol( COLOR_MAIN )
|
hCol( TAKCOLOR_MAIN )
|
||||||
hORect( 1, 1, 180-2, BTALL-2 )
|
hORect( 1, 1, 180-2, BTALL-2 )
|
||||||
hCol( TITLE=="CLEARING" and TAKCOLOR_MAIN or COLOR_MAIN )
|
hCol( TAKCOLOR_MAIN )
|
||||||
hRect( 3, 3, math.floor((BWIDE-6) * PERCENT), BTALL-6 )
|
hRect( 3, 3, math.floor((BWIDE-6) * PERCENT), BTALL-6 )
|
||||||
S_Pop()
|
S_Pop()
|
||||||
local x, y = hXY( 0, 78 )
|
local x, y = hXY( 0, 78 )
|
||||||
qt( math.floor(PERCENT*100) .. "%", "HUD_36", x, y, COLOR_MAIN, TEXT_ALIGN_CENTER, nil, COLOR_DARK )
|
qt( math.floor(PERCENT*100) .. "%", "HUD_36", x, y, obj:GetContested() and CONTOLER_MAIN or COLOR_MAIN, TEXT_ALIGN_CENTER, nil, obj:GetContested() and CONTOLER_DARK or COLOR_DARK )
|
||||||
end
|
end
|
||||||
S_Pop()
|
S_Pop()
|
||||||
end
|
end
|
||||||
|
|
|
@ -218,7 +218,9 @@ AddItem( "base_firearm", {
|
||||||
p:LagCompensation(false)
|
p:LagCompensation(false)
|
||||||
|
|
||||||
local ply = handler:GetOwner()
|
local ply = handler:GetOwner()
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true )
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true )
|
||||||
|
end
|
||||||
|
|
||||||
ent:PlayAnimation( ent:LookupSequence("fire") )
|
ent:PlayAnimation( ent:LookupSequence("fire") )
|
||||||
end,
|
end,
|
||||||
|
@ -237,14 +239,18 @@ AddItem( "base_firearm", {
|
||||||
handler:EmitSound( class.MagOutSound, 70, 100, 0.4, CHAN_STATIC )
|
handler:EmitSound( class.MagOutSound, 70, 100, 0.4, CHAN_STATIC )
|
||||||
ent:SetLoaded( false )
|
ent:SetLoaded( false )
|
||||||
ent:SetClip( 0 )
|
ent:SetClip( 0 )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true )
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true )
|
||||||
|
end
|
||||||
time = 0.4
|
time = 0.4
|
||||||
ent:PlayAnimation( ent:LookupSequence("magout") )
|
ent:PlayAnimation( ent:LookupSequence("magout") )
|
||||||
else
|
else
|
||||||
handler:EmitSound( class.MagInSound, 70, 100, 0.4, CHAN_STATIC )
|
handler:EmitSound( class.MagInSound, 70, 100, 0.4, CHAN_STATIC )
|
||||||
ent:SetLoaded( true )
|
ent:SetLoaded( true )
|
||||||
ent:SetRefillTime( CurTime() + 0.5 )
|
ent:SetRefillTime( CurTime() + 0.5 )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_insert"][class.HoldType] ), 0, true )
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_insert"][class.HoldType] ), 0, true )
|
||||||
|
end
|
||||||
time = 0.8
|
time = 0.8
|
||||||
ent:PlayAnimation( ent:LookupSequence("magin") )
|
ent:PlayAnimation( ent:LookupSequence("magin") )
|
||||||
end
|
end
|
||||||
|
@ -256,7 +262,9 @@ AddItem( "base_firearm", {
|
||||||
ent:SetDelay( CurTime() + 0.5 )
|
ent:SetDelay( CurTime() + 0.5 )
|
||||||
|
|
||||||
local ply = handler:GetOwner()
|
local ply = handler:GetOwner()
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["deploy"][class.HoldType] ), 0, true )
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["deploy"][class.HoldType] ), 0, true )
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["Holster"] = function( class, ent, handler )
|
["Holster"] = function( class, ent, handler )
|
||||||
|
@ -266,7 +274,9 @@ AddItem( "base_firearm", {
|
||||||
ent:SetDelay( CurTime() + 0.25 )
|
ent:SetDelay( CurTime() + 0.25 )
|
||||||
|
|
||||||
local ply = handler:GetOwner()
|
local ply = handler:GetOwner()
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["holster"][class.HoldType] ), 0, true )
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["holster"][class.HoldType] ), 0, true )
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -658,6 +668,31 @@ do -- Rifles
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
do -- MGs
|
||||||
|
AddItem( "qbb", {
|
||||||
|
PrintName = "#Item.qbb.Name",
|
||||||
|
Description = "#Item.qbb.Description",
|
||||||
|
Category = "machinegun",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/test_qbb.mdl",
|
||||||
|
HoldType = "rifle",
|
||||||
|
|
||||||
|
ClipSize = 75,
|
||||||
|
Delay = (60/750),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/stoner63/01.ogg",
|
||||||
|
"benny/weapons/stoner63/02.ogg",
|
||||||
|
"benny/weapons/stoner63/03.ogg",
|
||||||
|
},
|
||||||
|
|
||||||
|
Accuracy = 1,
|
||||||
|
Accuracy_Add = 0.4,
|
||||||
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 12,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
do -- SMGs
|
do -- SMGs
|
||||||
|
|
||||||
AddItem( "tmp", {
|
AddItem( "tmp", {
|
||||||
|
|
|
@ -32,6 +32,9 @@ L["#Item.fnc.Description"] = "Imported assault rifle"
|
||||||
L["#Item.qbz.Name"] = "QBZ-95"
|
L["#Item.qbz.Name"] = "QBZ-95"
|
||||||
L["#Item.qbz.Description"] = "Low-profile bullpup assault rifle"
|
L["#Item.qbz.Description"] = "Low-profile bullpup assault rifle"
|
||||||
|
|
||||||
|
L["#Item.qbb.Name"] = "QBB-LSW"
|
||||||
|
L["#Item.qbb.Description"] = "Bullpup machine gun"
|
||||||
|
|
||||||
L["#Item.m16a2.Name"] = "M16A2"
|
L["#Item.m16a2.Name"] = "M16A2"
|
||||||
L["#Item.m16a2.Description"] = "Rugged burst rifle"
|
L["#Item.m16a2.Description"] = "Rugged burst rifle"
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,9 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
|
||||||
ply:SetGroundEntity( NULL )
|
ply:SetGroundEntity( NULL )
|
||||||
ply:SetInDive( true )
|
ply:SetInDive( true )
|
||||||
ply:SetDivedAt( CurTime() )
|
ply:SetDivedAt( CurTime() )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_start_handgun" ), 0, true )
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_start_handgun" ), 0, true )
|
||||||
|
end
|
||||||
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
||||||
local rfil = nil
|
local rfil = nil
|
||||||
if SERVER then
|
if SERVER then
|
||||||
|
@ -378,8 +380,6 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
|
||||||
end
|
end
|
||||||
ply:EmitSound("weapons/slam/throw.wav", 70, 100, .25, nil, nil, nil, rfil)
|
ply:EmitSound("weapons/slam/throw.wav", 70, 100, .25, nil, nil, nil, rfil)
|
||||||
end
|
end
|
||||||
ply:SetHull( Vector( -8, -8, 32 ), Vector( 8, 8, 72 ) )
|
|
||||||
ply:SetHullDuck( Vector( -8, -8, 32 ), Vector( 8, 8, 48 ) )
|
|
||||||
end
|
end
|
||||||
if ply:OnGround() and ply:GetInDive() then
|
if ply:OnGround() and ply:GetInDive() then
|
||||||
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
||||||
|
@ -393,12 +393,11 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
|
||||||
end
|
end
|
||||||
ply:SetInDive(false)
|
ply:SetInDive(false)
|
||||||
ply:SetDivedAt( CurTime() )
|
ply:SetDivedAt( CurTime() )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_end_handgun" ), 0, true )
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
||||||
ply:SetHull( Vector( -8, -8, 0 ), Vector( 8, 8, 72 ) )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_end_handgun" ), 0, true )
|
||||||
ply:SetHullDuck( Vector( -8, -8, 0 ), Vector( 8, 8, 48 ) )
|
end
|
||||||
mv:SetVelocity( mv:GetVelocity() + Vector( 0, 0, 120 ) )
|
mv:SetVelocity( mv:GetVelocity() + Vector( 0, 0, 120 ) )
|
||||||
ply:SetGroundEntity( NULL )
|
ply:SetGroundEntity( NULL )
|
||||||
mv:SetOrigin( mv:GetOrigin() + vector_up*32 )
|
|
||||||
end
|
end
|
||||||
--if !ply:OnGround() and ply:GetInDive() then
|
--if !ply:OnGround() and ply:GetInDive() then
|
||||||
-- local da = ply:GetDivedAt()
|
-- local da = ply:GetDivedAt()
|
||||||
|
|
|
@ -9,7 +9,7 @@ concommand.Add("b-cheat_setteam", function( ply, cmd, args )
|
||||||
print( index .. " - " .. data.id )
|
print( index .. " - " .. data.id )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ply:SetTeam( TEAMS_IDorName( args[1] ) )
|
ply:SetTeam( TEAMS_IDorName( tonumber(args[1]) or args[1] ) )
|
||||||
end
|
end
|
||||||
end, function( cmd, args )
|
end, function( cmd, args )
|
||||||
return BENNY.SimpleAutoComplete( cmd, args, TEAMS_IDs )
|
return BENNY.SimpleAutoComplete( cmd, args, TEAMS_IDs )
|
||||||
|
@ -120,10 +120,8 @@ function GM:CreateTeams()
|
||||||
end
|
end
|
||||||
|
|
||||||
function GM:PlayerSelectTeamSpawn( TeamID, ply )
|
function GM:PlayerSelectTeamSpawn( TeamID, ply )
|
||||||
print( TeamID )
|
|
||||||
local SpawnPoints = team.GetSpawnPoints( TeamID )
|
local SpawnPoints = team.GetSpawnPoints( TeamID )
|
||||||
PrintTable( SpawnPoints )
|
if ( !SpawnPoints || table.IsEmpty( SpawnPoints ) ) then return end
|
||||||
if ( !SpawnPoints || table.IsEmpty( SpawnPoints ) ) then print("fail")return end
|
|
||||||
|
|
||||||
local ChosenSpawnPoint = nil
|
local ChosenSpawnPoint = nil
|
||||||
|
|
||||||
|
@ -142,8 +140,7 @@ function GM:PlayerSelectSpawn( ply, transition )
|
||||||
|
|
||||||
if BennyGame:GetType() == BG_GTYPE_MP then
|
if BennyGame:GetType() == BG_GTYPE_MP then
|
||||||
local ent = self:PlayerSelectTeamSpawn( ply:Team(), ply )
|
local ent = self:PlayerSelectTeamSpawn( ply:Team(), ply )
|
||||||
debug.Trace()
|
if IsValid( ent ) then return ent end
|
||||||
if IsValid( ent ) then print("win") return ent end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue