Weapons can animate. Beginning of team-based stuff, domination
This commit is contained in:
parent
8fae4bd63e
commit
a0fcb33642
39
benny.fgd
39
benny.fgd
|
@ -6,30 +6,31 @@
|
||||||
|
|
||||||
@include "base.fgd"
|
@include "base.fgd"
|
||||||
|
|
||||||
@PointClass base(Targetname, Angles, Origin) lightprop("models/editor/spot.mdl") halfgridsnap frustum(lightfov,1,100) = benny_camera : "Benny - Camera"
|
@PointClass base(PlayerClass, Angles) color(255 100 100) studio("models/editor/playerstart.mdl") = benny_playerstart_team1
|
||||||
[
|
[
|
||||||
camera_type(choices) : "Type" : "standard" : "Style of camera" =
|
|
||||||
[
|
|
||||||
"standard" : "Standard"
|
|
||||||
"field" : "Field"
|
|
||||||
]
|
|
||||||
lightfov(float) : "FOV" : "90.0" : "FOV"
|
|
||||||
target(target_destination) : "Camera Target" : : "Bounds that trigger the camera to activate"
|
|
||||||
lerp0_target(target_destination) : "Lerp 0" : : "Starting point of the lerp for the camera"
|
|
||||||
lerp1_target(target_destination) : "Lerp 1" : : "Ending point of the lerp for the camera"
|
|
||||||
lerp1_fov(float) : "End FOV" : : "Ending FOV for the lerp"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@PointClass base(Targetname, Angles, Origin) lightprop("models/editor/axis_helper_thick.mdl") halfgridsnap = benny_camera : "Benny - Camera Lerp Point"
|
@PointClass base(PlayerClass, Angles) color(100 100 255) studio("models/editor/playerstart.mdl") = benny_playerstart_team2
|
||||||
[
|
[
|
||||||
camera_type(choices) : "Type" : "standard" : "Style of camera" =
|
|
||||||
[
|
|
||||||
"standard" : "Standard"
|
|
||||||
"field" : "Field"
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@SolidClass base(Targetname) = benny_camerabounds : "Benny - Camera Bounds"
|
@PointClass base(PlayerClass, Angles) color(100 255 100) studio("models/editor/playerstart.mdl") = benny_playerstart_team3
|
||||||
[
|
[
|
||||||
target(target_destination) : "Camera Target" : : "Bounds that trigger the camera to activate"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@PointClass base(PlayerClass, Angles) color(255 255 100) studio("models/editor/playerstart.mdl") = benny_playerstart_team4
|
||||||
|
[
|
||||||
|
]
|
||||||
|
|
||||||
|
@PointClass base(PlayerClass, Angles) color(255 200 200) studio("models/editor/playerstart.mdl") = benny_playerstart_team5
|
||||||
|
[
|
||||||
|
]
|
||||||
|
|
||||||
|
@PointClass base(PlayerClass, Angles) color(255 200 255) studio("models/editor/playerstart.mdl") = benny_playerstart_team6
|
||||||
|
[
|
||||||
|
]
|
||||||
|
|
||||||
|
@PointClass base(Origin, Angles) studio("models/editor/axis_helper_thick.mdl") = benny_domflag
|
||||||
|
[
|
||||||
|
]
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ AddCSLuaFile()
|
||||||
ENT.Type = "anim"
|
ENT.Type = "anim"
|
||||||
ENT.Base = "base_anim"
|
ENT.Base = "base_anim"
|
||||||
ENT.BennyItem = true
|
ENT.BennyItem = true
|
||||||
|
ENT.AutomaticFrameAdvance = true
|
||||||
|
|
||||||
function ENT:Initialize()
|
function ENT:Initialize()
|
||||||
self:SetModel( self.Class.Model or "models/weapons/w_357.mdl" )
|
self:SetModel( self.Class.Model or "models/weapons/w_357.mdl" )
|
||||||
|
@ -18,21 +19,8 @@ function ENT:Initialize()
|
||||||
end
|
end
|
||||||
|
|
||||||
self.Class:Initialize( self )
|
self.Class:Initialize( self )
|
||||||
end
|
|
||||||
|
|
||||||
local function recurse( modify, includer )
|
--self:UseClientSideAnimation()
|
||||||
local basevars = ITEMS[includer].BaseClass
|
|
||||||
if ITEMS[includer].BaseClass then
|
|
||||||
recurse( modify, ITEMS[includer].Base )
|
|
||||||
end
|
|
||||||
|
|
||||||
local localvars = ITEMS[includer]:GetRaw("Vars")
|
|
||||||
if localvars then
|
|
||||||
for i, v in pairs( localvars ) do
|
|
||||||
if !modify[i] then modify[i] = {} end
|
|
||||||
table.Add( modify[i], v )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if SERVER then
|
if SERVER then
|
||||||
|
@ -48,8 +36,28 @@ else
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ENT:PlayAnimation( seqid, speed )
|
||||||
|
local time = self:SequenceDuration( seqid )
|
||||||
|
speed = speed or 1
|
||||||
|
self.AnimStartTime = ( UnPredictedCurTime() )
|
||||||
|
self.AnimEndTime = ( UnPredictedCurTime() + time )
|
||||||
|
self:SetAnimStartTime( self.AnimStartTime )
|
||||||
|
self:SetAnimEndTime( self.AnimEndTime )
|
||||||
|
self:ResetSequence( seqid )
|
||||||
|
end
|
||||||
|
|
||||||
function ENT:Think()
|
function ENT:Think()
|
||||||
if CLIENT then return end
|
self:NextThink( CurTime()-5 )
|
||||||
|
if CLIENT then
|
||||||
|
self:SetNextClientThink( CurTime()-5 )
|
||||||
|
-- Smooth interpolated shooting on local player
|
||||||
|
if self:GetOwner() == LocalPlayer() then
|
||||||
|
local cycle = math.Remap( UnPredictedCurTime(), self.AnimStartTime or 0, self.AnimEndTime or 0, 0, 1 )
|
||||||
|
self:SetCycle( cycle )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if CLIENT then return true end
|
||||||
self.BAsleep = self.BAsleep or false
|
self.BAsleep = self.BAsleep or false
|
||||||
|
|
||||||
local ph = self:GetPhysicsObject()
|
local ph = self:GetPhysicsObject()
|
||||||
|
@ -70,16 +78,33 @@ function ENT:Think()
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function recurse( modify, includer )
|
||||||
|
local basevars = ITEMS[includer].BaseClass
|
||||||
|
if ITEMS[includer].BaseClass then
|
||||||
|
recurse( modify, ITEMS[includer].Base )
|
||||||
|
end
|
||||||
|
|
||||||
|
local localvars = ITEMS[includer]:GetRaw("Vars")
|
||||||
|
if localvars then
|
||||||
|
for i, v in pairs( localvars ) do
|
||||||
|
if !modify[i] then modify[i] = {} end
|
||||||
|
table.Add( modify[i], v )
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ENT:SetupDataTables()
|
function ENT:SetupDataTables()
|
||||||
local NWVars = {}
|
local NWVars = { ["Float"] = { "AnimStartTime", "AnimEndTime" } }
|
||||||
recurse( NWVars, self.ID )
|
recurse( NWVars, self.ID )
|
||||||
for varname, varlist in pairs(NWVars) do
|
for varname, varlist in pairs(NWVars) do
|
||||||
local numba = 0
|
--local numba = 0
|
||||||
for keyind, keyname in ipairs(varlist) do
|
for keyind, keyname in ipairs(varlist) do
|
||||||
self:NetworkVar( varname, numba, keyname )
|
self:NetworkVar( varname, keyname )
|
||||||
numba = numba + 1
|
--numba = numba + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,115 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
ENT.Type = "anim"
|
||||||
|
ENT.Base = "base_anim"
|
||||||
|
|
||||||
|
ENT.DomFlag = true
|
||||||
|
|
||||||
|
function ENT:Initialize()
|
||||||
|
self:SetModel("models/hunter/blocks/cube025x025x025.mdl")
|
||||||
|
|
||||||
|
self:SetMoveType( MOVETYPE_NONE )
|
||||||
|
|
||||||
|
if SERVER then
|
||||||
|
self:SetTrigger( true )
|
||||||
|
end
|
||||||
|
self:AddSolidFlags( bit.bor( FSOLID_TRIGGER, FSOLID_USE_TRIGGER_BOUNDS ) )
|
||||||
|
|
||||||
|
local radius, tall = 100, 80
|
||||||
|
|
||||||
|
self:SetCollisionBounds( Vector( -radius, -radius, 0 ), Vector( radius, radius, tall ))
|
||||||
|
|
||||||
|
self.Memory = {}
|
||||||
|
|
||||||
|
self:SetTeamTaking( 0 )
|
||||||
|
self:SetTeamOwned( 0 )
|
||||||
|
end
|
||||||
|
|
||||||
|
function ENT:SetupDataTables()
|
||||||
|
self:NetworkVar( "Float", "CapturePercent" )
|
||||||
|
self:NetworkVar( "Int", "TeamTaking" )
|
||||||
|
self:NetworkVar( "Int", "TeamOwned" )
|
||||||
|
end
|
||||||
|
|
||||||
|
-- indev:
|
||||||
|
-- 0 - unassigned
|
||||||
|
-- 1 - me
|
||||||
|
-- 2 - my enemeis
|
||||||
|
|
||||||
|
function ENT:Think()
|
||||||
|
if CLIENT then return end
|
||||||
|
local onthis = 0
|
||||||
|
for ply, edata in pairs(self.Memory) do
|
||||||
|
if edata.time+0.1 < CurTime() then
|
||||||
|
--self.Memory[ply] = nil
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
onthis = onthis + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if onthis > 0 then -- Someones capturing
|
||||||
|
if self:GetCapturePercent() != 1 and self:GetTeamOwned() != 1 then -- if its not full progress
|
||||||
|
local COLLECTED = (1/(6-onthis)) * FrameTime()
|
||||||
|
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 1, COLLECTED ) )
|
||||||
|
self:SetTeamTaking( 1 )
|
||||||
|
|
||||||
|
if self:GetCapturePercent() == 1 then
|
||||||
|
self:SetTeamOwned( self:GetTeamTaking() )
|
||||||
|
self:SetTeamTaking( 0 )
|
||||||
|
self:SetCapturePercent( 0 )
|
||||||
|
end
|
||||||
|
|
||||||
|
-- rewards
|
||||||
|
for ply, edata in pairs(self.Memory) do
|
||||||
|
edata.xpcollected = (edata.xpcollected or 0) + (COLLECTED * 200)
|
||||||
|
local sap = math.floor(edata.xpcollected)
|
||||||
|
if sap >= 1 then
|
||||||
|
edata.xpcollected = edata.xpcollected - sap
|
||||||
|
ply:RewardXP( sap )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
self.LastCaptureTime = CurTime()
|
||||||
|
elseif (self.LastCaptureTime or 0)+3 < CurTime() and self:GetTeamOwned() != 2 then
|
||||||
|
self:SetTeamTaking( 2 )
|
||||||
|
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 1, (1/5) * FrameTime() ) )
|
||||||
|
|
||||||
|
if self:GetCapturePercent() == 1 then
|
||||||
|
self:SetTeamOwned( self:GetTeamTaking() )
|
||||||
|
self:SetTeamTaking( 0 )
|
||||||
|
self:SetCapturePercent( 0 )
|
||||||
|
end
|
||||||
|
elseif (self.LastCaptureTime or 0)+3 < CurTime() and self:GetCapturePercent() > 0 and false then
|
||||||
|
self:SetCapturePercent( math.Approach( self:GetCapturePercent(), 0, (1/10) * FrameTime() ) )
|
||||||
|
|
||||||
|
if self:GetCapturePercent() == 0 then
|
||||||
|
self:SetTeamTaking( 0 )
|
||||||
|
self:SetCapturePercent( 0 )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local per = self:GetCapturePercent()
|
||||||
|
|
||||||
|
self:NextThink( CurTime()-1 )
|
||||||
|
local aa, bb = self:GetCollisionBounds()
|
||||||
|
debugoverlay.Box( self:GetPos(), aa, bb, 0, Color( 255, 255*(1-per), 255*(1-per), 0 ))
|
||||||
|
debugoverlay.Text( self:GetPos(), math.floor(self:GetCapturePercent()*100), 0 )
|
||||||
|
debugoverlay.Text( self:GetPos()-vector_up*8, self:GetTeamOwned(), 0 )
|
||||||
|
debugoverlay.Text( self:GetPos()-vector_up*16, self:GetTeamTaking(), 0 )
|
||||||
|
return true
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function ENT:Touch( ent )
|
||||||
|
if ent:IsPlayer() then
|
||||||
|
--print( ent, CurTime() )
|
||||||
|
ent:SetTouchedObjective( self )
|
||||||
|
ent:SetTouchedObjectiveTime( CurTime() )
|
||||||
|
if !self.Memory[ent] then
|
||||||
|
self.Memory[ent] = {}
|
||||||
|
end
|
||||||
|
self.Memory[ent].time = CurTime()
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
ENT.Type = "point"
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
ENT.Type = "point"
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
ENT.Type = "point"
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
ENT.Type = "point"
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
ENT.Type = "point"
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
ENT.Type = "point"
|
|
@ -48,7 +48,6 @@ function GM:CalcView( ply, pos, ang, fov )
|
||||||
|
|
||||||
local magic = math.Remap( ply:GetLayerCycle( GESTURE_SLOT_JUMP ), 0.6, 0.8, 0, 1 )
|
local magic = math.Remap( ply:GetLayerCycle( GESTURE_SLOT_JUMP ), 0.6, 0.8, 0, 1 )
|
||||||
magic = math.Clamp( magic, 0, 1 )
|
magic = math.Clamp( magic, 0, 1 )
|
||||||
print(magic)
|
|
||||||
angles.p = Lerp( magic, angles.r-90, ang.p )
|
angles.p = Lerp( magic, angles.r-90, ang.p )
|
||||||
angles.r = 0
|
angles.r = 0
|
||||||
view.angles = angles
|
view.angles = angles
|
||||||
|
|
|
@ -9,8 +9,31 @@ if SERVER then
|
||||||
net.Receive( "Benny_DebugMenuSpawn", function( len, ply )
|
net.Receive( "Benny_DebugMenuSpawn", function( len, ply )
|
||||||
if !ply:IsAdmin() then return end
|
if !ply:IsAdmin() then return end
|
||||||
local ent = ents.Create( "b-item_" .. net.ReadString() )
|
local ent = ents.Create( "b-item_" .. net.ReadString() )
|
||||||
ent:SetPos( ply:GetEyeTrace().HitPos )
|
|
||||||
ent:Spawn()
|
ent:Spawn()
|
||||||
|
|
||||||
|
local TRACE = ply:GetEyeTrace()
|
||||||
|
local thespawnpos = TRACE.HitPos
|
||||||
|
thespawnpos:Add( TRACE.HitNormal * 16 )
|
||||||
|
local WORLDAA, WORLDBB = ent:GetCollisionBounds()
|
||||||
|
|
||||||
|
local tr = util.TraceHull( {
|
||||||
|
start = thespawnpos,
|
||||||
|
endpos = thespawnpos - (vector_up*32),
|
||||||
|
mins = WORLDAA,
|
||||||
|
maxs = WORLDBB,
|
||||||
|
collisiongroup = COLLISION_GROUP_WEAPON,
|
||||||
|
})
|
||||||
|
thespawnpos:Set( tr.HitPos )
|
||||||
|
ent:SetPos( thespawnpos )
|
||||||
|
--[[local WORLDAA, WORLDBB = ent:GetCollisionBounds()
|
||||||
|
local WORLDC = ent:WorldSpaceCenter()
|
||||||
|
local TRACE = ply:GetEyeTrace()
|
||||||
|
local thespawnpos = TRACE.HitPos
|
||||||
|
thespawnpos:Add( WORLDC/2 )
|
||||||
|
thespawnpos:Add( ((WORLDBB * TRACE.HitNormal) - (WORLDAA * TRACE.HitNormal)) )
|
||||||
|
ent:SetPos( thespawnpos )]]
|
||||||
|
|
||||||
|
debugoverlay.Box( thespawnpos, WORLDAA, WORLDBB, 4, Color( 255, 255, 255, 0) )
|
||||||
end)
|
end)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -26,17 +49,168 @@ 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")
|
||||||
DebugMenu:SetSize( 200, 500 )
|
DebugMenu:SetSize( 600, 500 )
|
||||||
DebugMenu:Center()
|
DebugMenu:Center()
|
||||||
DebugMenu:MakePopup()
|
DebugMenu:MakePopup()
|
||||||
DebugMenu:SetKeyboardInputEnabled( false )
|
DebugMenu:SetKeyboardInputEnabled( false )
|
||||||
|
DebugMenu:SetSizable(true)
|
||||||
|
|
||||||
|
local splitter = DebugMenu:Add("DHorizontalDivider")
|
||||||
|
splitter:Dock( FILL )
|
||||||
|
splitter:SetLeftWidth(200)
|
||||||
|
|
||||||
|
|
||||||
local opt = DebugMenu:Add("DScrollPanel")
|
local opt = DebugMenu:Add("DScrollPanel")
|
||||||
opt:Dock( FILL )
|
--opt:Dock( FILL )
|
||||||
|
splitter:SetLeft( opt )
|
||||||
|
|
||||||
|
local vsplit = DebugMenu:Add("DVerticalDivider")
|
||||||
|
splitter:SetRight( vsplit )
|
||||||
|
vsplit:SetTopHeight( 500/2 )
|
||||||
|
|
||||||
|
local texter = DebugMenu:Add("DTextEntry")
|
||||||
|
texter:SetFont( "HUD_24" )
|
||||||
|
texter:SetMultiline( true )
|
||||||
|
vsplit:SetBottom( texter )
|
||||||
|
|
||||||
|
|
||||||
|
local matColor = Material( "models/debug/debugwhite" )
|
||||||
|
|
||||||
|
local modeller = DebugMenu:Add("DModelPanel")
|
||||||
|
do
|
||||||
|
vsplit:SetTop( modeller )
|
||||||
|
modeller:SetModel( "models/weapons/w_pistol.mdl" )
|
||||||
|
modeller:SetFOV( 5 )
|
||||||
|
local original = Vector( 0, 50, 0 )
|
||||||
|
modeller:SetCamPos( original )
|
||||||
|
modeller:SetLookAt( vector_origin )
|
||||||
|
function modeller:LayoutEntity( ent )
|
||||||
|
ent:SetPos( Vector( 0, 0, 0 ) )
|
||||||
|
ent:SetAngles( Angle( 0, 0 * RealTime() * 10 % 360, 0 ) )
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
modeller:SetAmbientLight( HSLToColor( 0, 0, 1.00 ) )
|
||||||
|
modeller:SetDirectionalLight(BOX_TOP, HSLToColor( 0, 0, 1.00 ) )
|
||||||
|
modeller:SetDirectionalLight(BOX_FRONT, HSLToColor( 0, 0, 1.00 ) )
|
||||||
|
modeller:SetDirectionalLight(BOX_RIGHT, HSLToColor( 0, 0, 1.00 ) )
|
||||||
|
|
||||||
|
function modeller:Update( mdl )
|
||||||
|
if self.Entity:GetModel() == mdl then return end
|
||||||
|
self.Entity:SetModel( mdl )
|
||||||
|
local worked = self.Entity:PhysicsInit( SOLID_VPHYSICS )
|
||||||
|
|
||||||
|
if worked then
|
||||||
|
-- Factors the USP's bodygroup suppressor for some reason. Great
|
||||||
|
local mins, maxs = self.Entity:GetCollisionBounds()
|
||||||
|
local wsc = Vector()
|
||||||
|
wsc:Add( mins )
|
||||||
|
wsc:Add( maxs )
|
||||||
|
wsc:Div( 2 )
|
||||||
|
|
||||||
|
self:SetLookAt( wsc )
|
||||||
|
self:SetCamPos( wsc+original )
|
||||||
|
|
||||||
|
-- local HFOV = 45-5
|
||||||
|
-- local hfovRad = HFOV * math.pi / 180
|
||||||
|
-- local vfovRad = 2*math.atan(math.tan(hfovRad/2)*(self:GetTall()/self:GetWide()))
|
||||||
|
-- local VFOV = math.ceil(vfovRad* 180 / math.pi)
|
||||||
|
|
||||||
|
local directionAngCos = math.cos( math.rad(5/2) )
|
||||||
|
-- scale test
|
||||||
|
if true then for i=1, 50 do
|
||||||
|
local S1, S2 = false, false
|
||||||
|
local aimVector = (self:GetLookAt() - self:GetCamPos()):GetNormalized()
|
||||||
|
do -- test 1, mins
|
||||||
|
local entVector = mins - self:GetCamPos()
|
||||||
|
local angCos = aimVector:Dot(entVector) / entVector:Length()
|
||||||
|
S1 = (angCos >= directionAngCos)
|
||||||
|
end
|
||||||
|
do -- test 2: maxs
|
||||||
|
local entVector = maxs - self:GetCamPos()
|
||||||
|
local angCos = aimVector:Dot(entVector) / entVector:Length()
|
||||||
|
S2 = (angCos >= directionAngCos)
|
||||||
|
end
|
||||||
|
if S1 and S2 then
|
||||||
|
self.indicate = "took " .. i
|
||||||
|
self.vCamPos:Add( Vector( 0, 20, 0 ) )
|
||||||
|
--self.vLookatPos:Add( Vector( 0, 0, 0 ) )
|
||||||
|
--self.vLookatPos:Set( (mins+maxs)/2 )
|
||||||
|
break
|
||||||
|
else
|
||||||
|
self.indicate = "failed"
|
||||||
|
self.vCamPos:Sub( (aimVector*20) )
|
||||||
|
end
|
||||||
|
end end
|
||||||
|
else
|
||||||
|
self.indicate = false
|
||||||
|
self:SetLookAt( vector_origin )
|
||||||
|
self:SetCamPos( original )
|
||||||
|
end
|
||||||
|
self.Failed = !worked
|
||||||
|
end
|
||||||
|
|
||||||
|
local material = Material( "sprites/splodesprite" )
|
||||||
|
function modeller:Paint1( w, h )
|
||||||
|
if ( !IsValid( self.Entity ) ) then return end
|
||||||
|
|
||||||
|
local x, y = self:LocalToScreen( 0, 0 )
|
||||||
|
|
||||||
|
self:LayoutEntity( self.Entity )
|
||||||
|
|
||||||
|
local ang = self.aLookAngle
|
||||||
|
if ( !ang ) then
|
||||||
|
ang = ( self.vLookatPos - self.vCamPos ):Angle()
|
||||||
|
end
|
||||||
|
|
||||||
|
cam.Start3D( self.vCamPos, ang, self.fFOV, x, y, w, h, 5, self.FarZ )
|
||||||
|
|
||||||
|
render.SuppressEngineLighting( true )
|
||||||
|
render.SetLightingOrigin( vector_origin )
|
||||||
|
render.ResetModelLighting( self.colAmbientLight.r / 255, self.colAmbientLight.g / 255, self.colAmbientLight.b / 255 )
|
||||||
|
render.SetColorModulation( self.colColor.r / 255, self.colColor.g / 255, self.colColor.b / 255 )
|
||||||
|
render.SetBlend( ( self:GetAlpha() / 255 ) * ( self.colColor.a / 255 ) ) -- * surface.GetAlphaMultiplier()
|
||||||
|
|
||||||
|
for i = 0, 6 do
|
||||||
|
local col = self.DirectionalLight[ i ]
|
||||||
|
if ( col ) then
|
||||||
|
render.SetModelLighting( i, col.r / 255, col.g / 255, col.b / 255 )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
render.MaterialOverride(matColor)
|
||||||
|
self:DrawModel()
|
||||||
|
render.MaterialOverride()
|
||||||
|
|
||||||
|
local mins, maxs = self.Entity:GetCollisionBounds()
|
||||||
|
|
||||||
|
-- render.SetColorMaterial()
|
||||||
|
-- render.DrawSphere( mins, .5, 30, 30, Color( 255, 0, 0 ) )
|
||||||
|
-- render.DrawSphere( maxs, .5, 30, 30, Color( 0, 0, 255 ) )
|
||||||
|
-- render.DrawWireframeBox( vector_origin, angle_zero, mins, maxs, Color( 0, 0, 0, 127 ))
|
||||||
|
|
||||||
|
render.SuppressEngineLighting( false )
|
||||||
|
cam.End3D()
|
||||||
|
|
||||||
|
self.LastPaint = RealTime()
|
||||||
|
end
|
||||||
|
function modeller:Paint( w, h )
|
||||||
|
surface.SetDrawColor( color_black )
|
||||||
|
surface.DrawRect( 0, 0, w, h )
|
||||||
|
self:Paint1( w, h )
|
||||||
|
if self.Failed then
|
||||||
|
draw.SimpleText("Failed physinit, not cached?", "HUD_36", w/2, h/2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||||
|
end
|
||||||
|
-- if self.indicate then
|
||||||
|
-- draw.SimpleText(self.indicate, "HUD_36", w/2, h/2 + 48, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local categories = {}
|
local categories = {}
|
||||||
|
|
||||||
for iname, idata in SortedPairs( ITEMS ) do
|
for iname, idata in SortedPairs( ITEMS ) do
|
||||||
|
if idata.Category == "base" then continue end
|
||||||
if !categories[idata.Category] then
|
if !categories[idata.Category] then
|
||||||
local cate = opt:Add("DCollapsibleCategory")
|
local cate = opt:Add("DCollapsibleCategory")
|
||||||
cate:Dock(TOP)
|
cate:Dock(TOP)
|
||||||
|
@ -50,9 +224,17 @@ local function OpenDebugMenu()
|
||||||
button:Dock( TOP )
|
button:Dock( TOP )
|
||||||
button:DockMargin( 0, 0, 0, 0 )
|
button:DockMargin( 0, 0, 0, 0 )
|
||||||
button:SetText( l8( idata.PrintName ) )
|
button:SetText( l8( idata.PrintName ) )
|
||||||
|
button:SetTall(32)
|
||||||
button.iName = iname
|
button.iName = iname
|
||||||
button.iData = idata
|
button.iData = idata
|
||||||
button.DoClick = dospawn
|
button.DoClick = dospawn
|
||||||
|
|
||||||
|
function button:Think()
|
||||||
|
if self:IsHovered() then
|
||||||
|
texter:SetText( l8(idata.Description) .. "\n\nClipsize: " .. (idata.ClipSize or "?") )
|
||||||
|
modeller:Update( idata.Model )
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local button = DebugMenu:Add("DButton")
|
local button = DebugMenu:Add("DButton")
|
||||||
|
|
|
@ -9,13 +9,33 @@ function BennyGame:GetType()
|
||||||
return BG_GTYPE_MP
|
return BG_GTYPE_MP
|
||||||
end
|
end
|
||||||
|
|
||||||
|
BennyGame.TeamsInPlay = {
|
||||||
|
[4] = 1,
|
||||||
|
[3] = 2,
|
||||||
|
}
|
||||||
|
BennyGame.TeamToFaction = table.Flip( BennyGame.TeamsInPlay )
|
||||||
|
BennyGame.TeamCount = table.Count(BennyGame.TeamsInPlay)
|
||||||
|
|
||||||
BG_GMODE_TDM = 0
|
BG_GMODE_TDM = 0
|
||||||
BG_GMODE_FFA = 1
|
BG_GMODE_FFA = 1
|
||||||
BG_GMODE_DOMINATION = 2
|
BG_GMODE_DOMINATION = 2
|
||||||
BG_GMODE_CTF = 3
|
BG_GMODE_CTF = 3
|
||||||
BG_GMODE_BOMB = 4
|
BG_GMODE_BOMB = 4
|
||||||
BG_GMODE_HARDPOINT = 5
|
BG_GMODE_HARDPOINT = 5
|
||||||
|
BG_GMODE_DEMOLITION = 6
|
||||||
|
|
||||||
function BennyGame:GetMode()
|
function BennyGame:GetMode()
|
||||||
return BG_GMODE_TDM
|
return BG_GMODE_TDM
|
||||||
end
|
end
|
||||||
|
|
||||||
|
hook.Add("Initialize", "Benny_Initialize", function()
|
||||||
|
-- local mapscript = "benny_maps/" .. game.GetMap() .. "_init.lua"
|
||||||
|
-- AddCSLuaFile(mapscript)
|
||||||
|
-- include(mapscript)
|
||||||
|
end)
|
||||||
|
|
||||||
|
hook.Add("InitPostEntity", "Benny_InitPostEntity", function()
|
||||||
|
-- local mapscript = "benny_maps/" .. game.GetMap() .. "_initpostentity.lua"
|
||||||
|
-- AddCSLuaFile(mapscript)
|
||||||
|
-- include(mapscript)
|
||||||
|
end)
|
|
@ -142,34 +142,39 @@ local FACTIONS = {
|
||||||
},
|
},
|
||||||
-- MP
|
-- MP
|
||||||
["mp_cia"] = {
|
["mp_cia"] = {
|
||||||
COLOR_MAIN = Color( 228, 228, 245 ),
|
COLOR_MAIN = Color( 255, 255, 255),
|
||||||
COLOR_DARK = Color( 25, 23, 47 ),
|
COLOR_DARK = Color( 25, 23, 47 ),
|
||||||
CHARNAME = "CIA",
|
CHARNAME = "CIA",
|
||||||
},
|
},
|
||||||
|
["mp_halo"] = {
|
||||||
|
COLOR_MAIN = Color( 130, 255, 255 ),
|
||||||
|
COLOR_DARK = Color( 40, 40, 58 ),
|
||||||
|
CHARNAME = "HALO",
|
||||||
|
},
|
||||||
["mp_plasof"] = {
|
["mp_plasof"] = {
|
||||||
COLOR_MAIN = Color( 255, 153, 153 ),
|
COLOR_MAIN = Color( 255, 153, 153 ),
|
||||||
COLOR_DARK = Color( 45, 10, 10 ),
|
COLOR_DARK = Color( 45, 10, 10 ),
|
||||||
CHARNAME = "PLASOF",
|
CHARNAME = "PLASOF",
|
||||||
},
|
},
|
||||||
["mp_militia"] = {
|
|
||||||
COLOR_MAIN = Color( 255, 219, 153 ),
|
|
||||||
COLOR_DARK = Color( 33, 18, 18 ),
|
|
||||||
CHARNAME = "MILITIA",
|
|
||||||
},
|
|
||||||
["mp_arng"] = {
|
["mp_arng"] = {
|
||||||
COLOR_MAIN = Color( 198, 255, 192 ),
|
COLOR_MAIN = Color( 198, 255, 192 ),
|
||||||
COLOR_DARK = Color( 23, 32, 23 ),
|
COLOR_DARK = Color( 23, 32, 23 ),
|
||||||
CHARNAME = "NATGUARD",
|
CHARNAME = "NATGUARD",
|
||||||
},
|
},
|
||||||
|
["mp_militia"] = {
|
||||||
|
COLOR_MAIN = Color( 255, 219, 153 ),
|
||||||
|
COLOR_DARK = Color( 33, 18, 18 ),
|
||||||
|
CHARNAME = "MILITIA",
|
||||||
|
},
|
||||||
["mp_viper"] = {
|
["mp_viper"] = {
|
||||||
COLOR_MAIN = Color( 255, 230, 245 ),
|
COLOR_MAIN = Color( 248, 191, 225 ),
|
||||||
COLOR_DARK = Color( 40, 20, 30 ),
|
COLOR_DARK = Color( 50, 20, 50 ),
|
||||||
CHARNAME = "VIPER",
|
CHARNAME = "VIPER",
|
||||||
},
|
},
|
||||||
["mp_halo"] = {
|
["unassigned"] = {
|
||||||
COLOR_MAIN = Color( 200, 255, 246 ),
|
COLOR_MAIN = Color( 220, 220, 220 ),
|
||||||
COLOR_DARK = Color( 30, 40, 38 ),
|
COLOR_DARK = Color( 40, 40, 40),
|
||||||
CHARNAME = "HALO",
|
CHARNAME = "Unassigned...",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,42 +182,13 @@ local CURRCHAR = "mp_arng"
|
||||||
local COLOR_MAIN = FACTIONS[CURRCHAR].COLOR_MAIN
|
local COLOR_MAIN = FACTIONS[CURRCHAR].COLOR_MAIN
|
||||||
local COLOR_DARK = FACTIONS[CURRCHAR].COLOR_DARK
|
local COLOR_DARK = FACTIONS[CURRCHAR].COLOR_DARK
|
||||||
local CHARNAME = FACTIONS[CURRCHAR].CHARNAME
|
local CHARNAME = FACTIONS[CURRCHAR].CHARNAME
|
||||||
|
|
||||||
|
local E_CURRCHAR = "mp_plasof"
|
||||||
|
local E_COLOR_MAIN = FACTIONS[E_CURRCHAR].COLOR_MAIN
|
||||||
|
local E_COLOR_DARK = FACTIONS[E_CURRCHAR].COLOR_DARK
|
||||||
|
local E_CHARNAME = FACTIONS[E_CURRCHAR].CHARNAME
|
||||||
local COLOR_BRIGHT = Color( 94, 94, 94 )
|
local COLOR_BRIGHT = Color( 94, 94, 94 )
|
||||||
|
|
||||||
--[[
|
|
||||||
BENNY
|
|
||||||
Color( 255, 238, 169 )
|
|
||||||
Color( 54, 44, 39 )
|
|
||||||
NIKKI
|
|
||||||
Color( 255, 174, 210 )
|
|
||||||
Color(37, 12, 40 )
|
|
||||||
IGOR
|
|
||||||
Color( 253, 208, 207 )
|
|
||||||
Color( 32, 14, 12 )
|
|
||||||
YANG-HAO
|
|
||||||
Color( 157, 187, 253 )
|
|
||||||
Color( 19, 21, 28 )
|
|
||||||
|
|
||||||
CIA
|
|
||||||
Color( 93, 118, 215 )
|
|
||||||
Color( 25, 23, 47 )
|
|
||||||
PLASOF
|
|
||||||
Color( 255, 103, 103 )
|
|
||||||
Color( 35, 25, 20 )
|
|
||||||
MILITIA
|
|
||||||
Color( 255, 199, 133 )
|
|
||||||
Color( 33, 18, 18 )
|
|
||||||
ARNG
|
|
||||||
Color( 208, 226, 132 )
|
|
||||||
Color( 23, 25, 23 )
|
|
||||||
VIPER
|
|
||||||
Color( 255, 230, 245 )
|
|
||||||
Color( 40, 30, 30 )
|
|
||||||
HALO
|
|
||||||
Color( 200, 255, 246 )
|
|
||||||
Color( 30, 40, 38 )
|
|
||||||
]]
|
|
||||||
|
|
||||||
local show_letters = {
|
local show_letters = {
|
||||||
{ "q", "w", "e", "r", "t", "y" },
|
{ "q", "w", "e", "r", "t", "y" },
|
||||||
{ "a", "s", "d", "f", "g", "h" },
|
{ "a", "s", "d", "f", "g", "h" },
|
||||||
|
@ -231,6 +207,8 @@ local translate_letters = {
|
||||||
["shift"] = "speed",
|
["shift"] = "speed",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local alphabet = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
|
||||||
|
|
||||||
local xhair_dot = Material( "benny/hud/xhair/dotx.png", "mips smooth" )
|
local xhair_dot = Material( "benny/hud/xhair/dotx.png", "mips smooth" )
|
||||||
local xhair_dot_shadow = Material( "benny/hud/xhair/dot_s.png", "mips smooth" )
|
local xhair_dot_shadow = Material( "benny/hud/xhair/dot_s.png", "mips smooth" )
|
||||||
|
|
||||||
|
@ -262,6 +240,65 @@ local fmlookup = {
|
||||||
[math.huge] = "AUTO",
|
[math.huge] = "AUTO",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
local function QuickDrawBar( BARWIDE, BARTALL, faction_index, way )
|
||||||
|
--local faction_index = "mp_cia"
|
||||||
|
local faction_info = FACTIONS[faction_index]
|
||||||
|
hCol( faction_info.COLOR_DARK )
|
||||||
|
hRect( 0, 0, BARWIDE, BARTALL )
|
||||||
|
hCol( faction_info.COLOR_MAIN )
|
||||||
|
hORect( 1, 1, BARWIDE-2, BARTALL-2, 1 )
|
||||||
|
|
||||||
|
local count = 6
|
||||||
|
|
||||||
|
local perc = 6/count--0.23
|
||||||
|
local width = math.ceil( (BARWIDE-6)*perc )
|
||||||
|
if way then
|
||||||
|
hRect( BARWIDE - 3 - width, 3, width, BARTALL-6 )
|
||||||
|
else
|
||||||
|
hRect( 3, 3, width, BARTALL-6 )
|
||||||
|
end
|
||||||
|
|
||||||
|
for i=1, count-1 do
|
||||||
|
local bleh
|
||||||
|
if way then
|
||||||
|
bleh = (i/count)<(1-perc)
|
||||||
|
else
|
||||||
|
bleh = (i/count)>perc
|
||||||
|
end
|
||||||
|
hCol( bleh and faction_info.COLOR_MAIN or faction_info.COLOR_DARK )
|
||||||
|
hRect( 3 + (BARWIDE-7)*(i/count), 4, 1, BARTALL-8 )
|
||||||
|
end
|
||||||
|
|
||||||
|
if way then
|
||||||
|
local x, y = hXY( BARWIDE - 5, 0 )
|
||||||
|
qt( faction_info.CHARNAME, "HUD_36", x, y, faction_info.COLOR_DARK, TEXT_ALIGN_RIGHT, nil, faction_info.COLOR_MAIN )
|
||||||
|
else
|
||||||
|
local x, y = hXY( 5, 0 )
|
||||||
|
qt( faction_info.CHARNAME, "HUD_36", x, y, faction_info.COLOR_DARK, nil, nil, faction_info.COLOR_MAIN )
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Players alive
|
||||||
|
if false then
|
||||||
|
for i=1, 6 do
|
||||||
|
local o = i-1
|
||||||
|
local lol = i>=3
|
||||||
|
if way then
|
||||||
|
S_Push( BARWIDE - i*(16+2), BARTALL + 2 )
|
||||||
|
else
|
||||||
|
S_Push( o*(16+2), BARTALL + 2 )
|
||||||
|
end
|
||||||
|
hCol( lol and faction_info.COLOR_DARK or faction_info.COLOR_MAIN )
|
||||||
|
hRect( 0, 0, 16, 16 )
|
||||||
|
hCol( lol and faction_info.COLOR_MAIN or faction_info.COLOR_DARK )
|
||||||
|
hORect( 1, 1, 16-2, 16-2, 1 )
|
||||||
|
S_Pop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local ROUNDEND = CurTime() + 62
|
||||||
|
|
||||||
-- Drawing
|
-- Drawing
|
||||||
function GM:HUDPaint()
|
function GM:HUDPaint()
|
||||||
local p = LocalPlayer()
|
local p = LocalPlayer()
|
||||||
|
@ -269,6 +306,18 @@ function GM:HUDPaint()
|
||||||
local handler = p:HandlerCheck()
|
local handler = p:HandlerCheck()
|
||||||
stack = util.Stack()
|
stack = util.Stack()
|
||||||
|
|
||||||
|
local CURRCHAR = TEAMS[p:Team()].factionid
|
||||||
|
local COLOR_MAIN = FACTIONS[CURRCHAR].COLOR_MAIN
|
||||||
|
local COLOR_DARK = FACTIONS[CURRCHAR].COLOR_DARK
|
||||||
|
local CHARNAME = FACTIONS[CURRCHAR].CHARNAME
|
||||||
|
|
||||||
|
local E_CURRCHAR = TEAMS[4].factionid
|
||||||
|
local E_COLOR_MAIN = FACTIONS[E_CURRCHAR].COLOR_MAIN
|
||||||
|
local E_COLOR_DARK = FACTIONS[E_CURRCHAR].COLOR_DARK
|
||||||
|
local E_CHARNAME = FACTIONS[E_CURRCHAR].CHARNAME
|
||||||
|
|
||||||
|
local MP = BennyGame:GetType() == BG_GTYPE_MP
|
||||||
|
|
||||||
-- S_Push( math.random( -4, 4 ), math.random( -4, 4 ) )
|
-- S_Push( math.random( -4, 4 ), math.random( -4, 4 ) )
|
||||||
|
|
||||||
S_Push( 20, h - 20 - 65 )
|
S_Push( 20, h - 20 - 65 )
|
||||||
|
@ -279,7 +328,7 @@ function GM:HUDPaint()
|
||||||
qt( CHARNAME, "HUD_48", x, y, COLOR_DARK, nil, nil, COLOR_MAIN )
|
qt( CHARNAME, "HUD_48", x, y, COLOR_DARK, nil, nil, COLOR_MAIN )
|
||||||
|
|
||||||
local HEALTHPER = p:GetHealth_Blood()/1000
|
local HEALTHPER = p:GetHealth_Blood()/1000
|
||||||
-- HEALTHPER = 11/100
|
--HEALTHPER = 11/100
|
||||||
|
|
||||||
hCol( COLOR_MAIN )
|
hCol( COLOR_MAIN )
|
||||||
hRect( 8, 8, (320-4-4) * HEALTHPER, 41-4-4 )
|
hRect( 8, 8, (320-4-4) * HEALTHPER, 41-4-4 )
|
||||||
|
@ -306,7 +355,7 @@ function GM:HUDPaint()
|
||||||
hORect( 8+1 + (slen*0.25+4)*2, 45+1, slen*0.25 - 2, 12-2, 1 )
|
hORect( 8+1 + (slen*0.25+4)*2, 45+1, slen*0.25 - 2, 12-2, 1 )
|
||||||
hORect( 8+1 + (slen*0.25+4)*3, 45+1, slen*0.25 - 2, 12-2, 1 )
|
hORect( 8+1 + (slen*0.25+4)*3, 45+1, slen*0.25 - 2, 12-2, 1 )
|
||||||
|
|
||||||
if true then -- MP
|
if MP then -- MP
|
||||||
S_Push( 0, -8 - 2 )
|
S_Push( 0, -8 - 2 )
|
||||||
local targetlength = 328
|
local targetlength = 328
|
||||||
local segments = 10
|
local segments = 10
|
||||||
|
@ -317,7 +366,7 @@ function GM:HUDPaint()
|
||||||
for i=1, segments do
|
for i=1, segments do
|
||||||
local z = i-1
|
local z = i-1
|
||||||
local chunk0, chunk1 = chunk*z, chunk*i
|
local chunk0, chunk1 = chunk*z, chunk*i
|
||||||
local filled = math.Remap( 0.727, chunk0, chunk1, 0, 1 )
|
local filled = math.Remap( p:GetLevel_XP()/15000, chunk0, chunk1, 0, 1 )
|
||||||
filled = math.Clamp( filled, 0, 1 )
|
filled = math.Clamp( filled, 0, 1 )
|
||||||
local a1, a2, a3, a4 = ( (targetlength/segments) * z ) + (gap*z), 0, (targetlength/segments), 8
|
local a1, a2, a3, a4 = ( (targetlength/segments) * z ) + (gap*z), 0, (targetlength/segments), 8
|
||||||
if i == segments then a3 = math.ceil(a3) end
|
if i == segments then a3 = math.ceil(a3) end
|
||||||
|
@ -340,7 +389,7 @@ function GM:HUDPaint()
|
||||||
end
|
end
|
||||||
|
|
||||||
local x, y = hXY( 0, -14 )
|
local x, y = hXY( 0, -14 )
|
||||||
qt( "10000 / 15000", "HUD_16", x, y, COLOR_MAIN, nil, nil, COLOR_DARK )
|
qt( p:GetLevel_XP() .. " / 15000", "HUD_16", x, y, COLOR_MAIN, nil, nil, COLOR_DARK )
|
||||||
--qt( "", "HUD_24", x+328, y, COLOR_MAIN, TEXT_ALIGN_RIGHT, nil, COLOR_DARK )
|
--qt( "", "HUD_24", x+328, y, COLOR_MAIN, TEXT_ALIGN_RIGHT, nil, COLOR_DARK )
|
||||||
|
|
||||||
S_Pop()
|
S_Pop()
|
||||||
|
@ -378,15 +427,17 @@ function GM:HUDPaint()
|
||||||
hCol( COLOR_DARK )
|
hCol( COLOR_DARK )
|
||||||
hRect( 0, 0, Bw, Bh )
|
hRect( 0, 0, Bw, Bh )
|
||||||
|
|
||||||
hCol( COLOR_MAIN )
|
S_Push( 0, 0 )
|
||||||
local leng = Bw-8-8
|
hCol( COLOR_MAIN )
|
||||||
hRect( 8, 8, leng-70, 26 )
|
local leng = Bw-8-8
|
||||||
hRect( 8 + leng - 70 + 4, 8, leng-(leng-70)-4, 26 )
|
hRect( 8, 8, leng-70, 26 )
|
||||||
local x, y = hXY( 12, 6 )
|
hRect( 8 + leng - 70 + 4, 8, leng-(leng-70)-4, 26 )
|
||||||
draw.SimpleText( l8( wep.Class.PrintName ), "HUD_36", x, y, COLOR_DARK )
|
local x, y = hXY( 12, 6 )
|
||||||
local x, y = hXY( 10 + (leng - 70) + 70/2, 11 )
|
draw.SimpleText( l8( wep.Class.PrintName ), "HUD_36", x, y, COLOR_DARK )
|
||||||
local bc = wep.Class.BurstCount
|
local x, y = hXY( 10 + (leng - 70) + 70/2, 11 )
|
||||||
draw.SimpleText( fmlookup[bc] or bc .. "RND", "HUD_24", x, y, COLOR_DARK, TEXT_ALIGN_CENTER )
|
local bc = wep.Class.BurstCount
|
||||||
|
draw.SimpleText( fmlookup[bc] or bc .. "RND", "HUD_24", x, y, COLOR_DARK, TEXT_ALIGN_CENTER )
|
||||||
|
S_Pop()
|
||||||
|
|
||||||
S_Push( Bw - 8 - 8, Bh - 18 - 8 )
|
S_Push( Bw - 8 - 8, Bh - 18 - 8 )
|
||||||
for i=0, wep.Class.ClipSize-1 do
|
for i=0, wep.Class.ClipSize-1 do
|
||||||
|
@ -423,6 +474,181 @@ function GM:HUDPaint()
|
||||||
S_Pop()
|
S_Pop()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if MP then S_Push( w/2, 20 )
|
||||||
|
local BARWIDE, BARTALL, GAP = 240, 30, 100
|
||||||
|
--hCol( Color( 255, 0, 0 ) )
|
||||||
|
--hRect( 0, 0, 1, 60 )
|
||||||
|
|
||||||
|
-- Score
|
||||||
|
for i=1, BennyGame.TeamCount do
|
||||||
|
local o = i-1
|
||||||
|
local lor =
|
||||||
|
S_Push( i%2==1 and (-BARWIDE - 1 - GAP) or (0 + 1 + GAP), (BARTALL+2+16+2)*math.floor(o/2) )
|
||||||
|
QuickDrawBar( BARWIDE, BARTALL, TEAMS[BennyGame.TeamToFaction[i]].factionid )
|
||||||
|
S_Pop()
|
||||||
|
end
|
||||||
|
|
||||||
|
--S_Push( 0 + 1 + GAP, 0 )
|
||||||
|
-- QuickDrawBar( BARWIDE, BARTALL, E_CURRCHAR, true )
|
||||||
|
--S_Pop()
|
||||||
|
|
||||||
|
--S_Push( -BARWIDE - 1 - GAP, BARTALL+2+16+2 )
|
||||||
|
-- QuickDrawBar( BARWIDE, BARTALL, "mp_arng" )
|
||||||
|
--S_Pop()
|
||||||
|
|
||||||
|
--S_Push( 0 + 1 + GAP, BARTALL+2+16+2 )
|
||||||
|
-- QuickDrawBar( BARWIDE, BARTALL, "mp_militia", true )
|
||||||
|
--S_Pop()
|
||||||
|
|
||||||
|
--S_Push( -BARWIDE - 1 - GAP, (BARTALL+2+16+2)*2 )
|
||||||
|
-- QuickDrawBar( BARWIDE, BARTALL, "mp_plasof" )
|
||||||
|
--S_Pop()
|
||||||
|
|
||||||
|
--S_Push( 0 + 1 + GAP, (BARTALL+2+16+2)*2 )
|
||||||
|
-- QuickDrawBar( BARWIDE, BARTALL, "mp_viper", true )
|
||||||
|
--S_Pop()
|
||||||
|
|
||||||
|
-- Timer
|
||||||
|
local DISPLAYWIDE, DISPLAYTALL = 150, 48
|
||||||
|
S_Push( -DISPLAYWIDE/2, 0 )
|
||||||
|
hCol( COLOR_DARK )
|
||||||
|
hRect( 0, 0, DISPLAYWIDE, DISPLAYTALL )
|
||||||
|
hCol( COLOR_MAIN )
|
||||||
|
hORect( 2, 2, DISPLAYWIDE-4, DISPLAYTALL-4, 1 )
|
||||||
|
|
||||||
|
local d1, d2
|
||||||
|
local tt = string.FormattedTime( math.max( ROUNDEND-CurTime(), 0 ) )
|
||||||
|
if tt.m > 0 then
|
||||||
|
d1 = string.format( "%01i:%02i", tt.m, tt.s )
|
||||||
|
d2 = false--tt.s
|
||||||
|
if tt.h > 0 then
|
||||||
|
d1 = tt.h .. ":" .. d1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
d1 = string.format( "%02i", tt.s )
|
||||||
|
d2 = string.format( ".%02i", tt.ms )
|
||||||
|
end
|
||||||
|
|
||||||
|
surface.SetFont("HUD_48")
|
||||||
|
local twid = surface.GetTextSize(d1)
|
||||||
|
if d2 then
|
||||||
|
surface.SetFont("HUD_36")
|
||||||
|
twid = twid + surface.GetTextSize(".00")
|
||||||
|
end
|
||||||
|
|
||||||
|
local x, y = hXY( DISPLAYWIDE/2 + 0 - twid/2, 4 )
|
||||||
|
draw.SimpleText( d1, "HUD_48", x, y, COLOR_MAIN )
|
||||||
|
local twid2 = surface.GetTextSize(d1)
|
||||||
|
if d2 then
|
||||||
|
local x, y = hXY( DISPLAYWIDE/2 + twid2 - twid/2, 11 )
|
||||||
|
draw.SimpleText( d2, "HUD_36", x, y, COLOR_MAIN )
|
||||||
|
end
|
||||||
|
|
||||||
|
if false then
|
||||||
|
local myteamwins = 2
|
||||||
|
local enemywins = 3
|
||||||
|
local count = 7
|
||||||
|
-- Round counter
|
||||||
|
local wideness = (20+2)*count-2
|
||||||
|
for i=1, count do
|
||||||
|
local o = i-1
|
||||||
|
S_Push( DISPLAYWIDE/2 - wideness/2 + o*(20+2), DISPLAYTALL+4 )
|
||||||
|
local COLOR_DARK = COLOR_DARK
|
||||||
|
local COLOR_MAIN = COLOR_MAIN
|
||||||
|
local filled = false
|
||||||
|
if i<=myteamwins then
|
||||||
|
filled = true
|
||||||
|
elseif (count-o)<=enemywins then
|
||||||
|
COLOR_DARK = E_COLOR_DARK
|
||||||
|
COLOR_MAIN = E_COLOR_MAIN
|
||||||
|
filled = true
|
||||||
|
else
|
||||||
|
COLOR_DARK = Color( 040, 040, 040 )
|
||||||
|
COLOR_MAIN = Color( 080, 080, 080 )
|
||||||
|
filled = true
|
||||||
|
end
|
||||||
|
hCol( filled and COLOR_MAIN or COLOR_DARK )
|
||||||
|
hRect( 0, 0, 20, 8 )
|
||||||
|
hCol( filled and COLOR_DARK or COLOR_MAIN )
|
||||||
|
hORect( 1, 1, 20-2, 8-2, 1 )
|
||||||
|
S_Pop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Domination flag status
|
||||||
|
if true then
|
||||||
|
local AllFlags = ents.FindByClass("benny_domflag")
|
||||||
|
S_Push( 0, 0 )
|
||||||
|
local count = #AllFlags
|
||||||
|
|
||||||
|
local wideness = (48+2)*count-2
|
||||||
|
for i, ent in ipairs( AllFlags ) do--for i=1, count do
|
||||||
|
local o = i-1
|
||||||
|
|
||||||
|
local faction_name = (ent:GetTeamOwned()==2 and E_CURRCHAR or ent:GetTeamOwned()==1 and CURRCHAR or "unassigned")
|
||||||
|
local faction_info = FACTIONS[faction_name]
|
||||||
|
|
||||||
|
local taking_faction_name = (ent:GetTeamTaking()==2 and E_CURRCHAR or ent:GetTeamTaking()==1 and CURRCHAR or "unassigned")
|
||||||
|
local taking_faction_info = FACTIONS[taking_faction_name]
|
||||||
|
|
||||||
|
local capturepercent = ent:GetCapturePercent()--math.Remap( CurTime()%4, 0, 3, 0, 1 )
|
||||||
|
--capturepercent = math.Clamp(capturepercent, 0, 1)
|
||||||
|
|
||||||
|
local mine, enemy = false, true
|
||||||
|
|
||||||
|
--if i==3 then mine = !mine enemy = !enemy end
|
||||||
|
|
||||||
|
if (capturepercent>=1) then
|
||||||
|
mine = !mine
|
||||||
|
enemy = !enemy
|
||||||
|
end
|
||||||
|
|
||||||
|
S_Push( DISPLAYWIDE/2 - wideness/2 + o*(48+2), DISPLAYTALL+4 )
|
||||||
|
hCol( faction_info.COLOR_DARK )
|
||||||
|
hRect( 0, 0, 48, 48 )
|
||||||
|
hCol( faction_info.COLOR_MAIN )
|
||||||
|
hRect( 1, 1, 48-2, 48-2, 1 )
|
||||||
|
|
||||||
|
if capturepercent<1 then
|
||||||
|
hCol( taking_faction_info.COLOR_MAIN )
|
||||||
|
hORect( 1, 1, 48-2, 48-2, math.floor(23 * capturepercent) )
|
||||||
|
end
|
||||||
|
|
||||||
|
local x, y = hXY( 48/2, 9 )
|
||||||
|
qt( alphabet[i] or i, "HUD_36", x, y, faction_info.COLOR_MAIN, TEXT_ALIGN_CENTER, nil, faction_info.COLOR_DARK )
|
||||||
|
S_Pop()
|
||||||
|
end
|
||||||
|
S_Pop()
|
||||||
|
end
|
||||||
|
S_Pop()
|
||||||
|
|
||||||
|
do
|
||||||
|
local AllFlags = ents.FindByClass("benny_domflag")
|
||||||
|
local AllFlagFlip = table.Flip(AllFlags)
|
||||||
|
|
||||||
|
-- Current Objective
|
||||||
|
local obj = p:GetTouchedObjective()
|
||||||
|
if obj:IsValid() then
|
||||||
|
S_Push( 0, 200 )
|
||||||
|
local BWIDE, BTALL = 180, 16
|
||||||
|
local x, y = hXY( -BWIDE/2, -2 )
|
||||||
|
qt( "CAPTURING", "HUD_24", x, y, COLOR_MAIN, TEXT_ALIGN_LEFT, nil, COLOR_DARK )
|
||||||
|
local x, y = hXY( -BWIDE/2, 36 )
|
||||||
|
qt( "POINT " .. (alphabet[ AllFlagFlip[obj] ] or AllFlagFlip[obj]), "HUD_24", x, y, COLOR_MAIN, TEXT_ALIGN_LEFT, nil, COLOR_DARK )
|
||||||
|
local x, y = hXY( BWIDE/2, 32 )
|
||||||
|
qt( math.floor(obj:GetCapturePercent()*100) .. "%", "HUD_36", x, y, COLOR_MAIN, TEXT_ALIGN_RIGHT, nil, COLOR_DARK )
|
||||||
|
|
||||||
|
S_Push( -BWIDE/2, 18 )
|
||||||
|
hCol( COLOR_DARK )
|
||||||
|
hRect( 0, 0, 180, BTALL )
|
||||||
|
hCol( COLOR_MAIN )
|
||||||
|
hORect( 1, 1, 180-2, BTALL-2 )
|
||||||
|
hRect( 3, 3, math.floor((BWIDE-6) * obj:GetCapturePercent()), BTALL-6 )
|
||||||
|
S_Pop()
|
||||||
|
S_Pop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
S_Pop() end
|
||||||
|
|
||||||
--local itemcheck = handler:ItemCheckTrace()
|
--local itemcheck = handler:ItemCheckTrace()
|
||||||
|
|
||||||
|
|
|
@ -219,6 +219,8 @@ AddItem( "base_firearm", {
|
||||||
|
|
||||||
local ply = handler:GetOwner()
|
local ply = handler:GetOwner()
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true )
|
||||||
|
|
||||||
|
ent:PlayAnimation( ent:LookupSequence("fire") )
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["Reload"] = function( class, ent, handler )
|
["Reload"] = function( class, ent, handler )
|
||||||
|
@ -237,12 +239,14 @@ AddItem( "base_firearm", {
|
||||||
ent:SetClip( 0 )
|
ent:SetClip( 0 )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true )
|
||||||
time = 0.4
|
time = 0.4
|
||||||
|
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 )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_insert"][class.HoldType] ), 0, true )
|
||||||
time = 0.8
|
time = 0.8
|
||||||
|
ent:PlayAnimation( ent:LookupSequence("magin") )
|
||||||
end
|
end
|
||||||
ent:SetDelay( CurTime() + time )
|
ent:SetDelay( CurTime() + time )
|
||||||
end,
|
end,
|
||||||
|
@ -420,11 +424,19 @@ AddItem( "toolgun", {
|
||||||
local p = handler:GetOwner()
|
local p = handler:GetOwner()
|
||||||
local tr = p:GetEyeTrace()
|
local tr = p:GetEyeTrace()
|
||||||
|
|
||||||
local summon = ents.Create( "b-npc_human" )
|
if lol then
|
||||||
summon:SetPos( tr.HitPos + tr.HitNormal )
|
local summon = ents.Create( "b-npc_human" )
|
||||||
local ang = Angle( 0, p:EyeAngles().y+0, 0 )
|
summon:SetPos( tr.HitPos + tr.HitNormal )
|
||||||
summon:SetAngles( ang )
|
local ang = Angle( 0, p:EyeAngles().y+0, 0 )
|
||||||
summon:Spawn()
|
summon:SetAngles( ang )
|
||||||
|
summon:Spawn()
|
||||||
|
else
|
||||||
|
local summon = ents.Create( "benny_domflag" )
|
||||||
|
summon:SetPos( tr.HitPos )
|
||||||
|
local ang = Angle( 0, 0, 0 )
|
||||||
|
summon:SetAngles( ang )
|
||||||
|
summon:Spawn()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
@ -466,7 +478,7 @@ do -- Handguns
|
||||||
Category = "pistol",
|
Category = "pistol",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testgun.mdl",
|
Model = "models/benny/weapons/test_mk23.mdl",
|
||||||
HoldType = "handgun",
|
HoldType = "handgun",
|
||||||
|
|
||||||
ClipSize = 12,
|
ClipSize = 12,
|
||||||
|
@ -476,9 +488,9 @@ do -- Handguns
|
||||||
"benny/weapons/usp/02.ogg",
|
"benny/weapons/usp/02.ogg",
|
||||||
"benny/weapons/usp/03.ogg",
|
"benny/weapons/usp/03.ogg",
|
||||||
},
|
},
|
||||||
MagOutSound = "benny/weapons/1911/magout.ogg",
|
MagOutSound = "benny/weapons/usp/magout.ogg",
|
||||||
MagInSound = "benny/weapons/1911/magin.ogg",
|
MagInSound = "benny/weapons/usp/magin.ogg",
|
||||||
BoltDropSound = "benny/weapons/1911/slidedrop.ogg",
|
BoltDropSound = "benny/weapons/usp/slidedrop.ogg",
|
||||||
BoltPullSound = "benny/weapons/glock/cock.ogg",
|
BoltPullSound = "benny/weapons/glock/cock.ogg",
|
||||||
|
|
||||||
Accuracy = 5/60,
|
Accuracy = 5/60,
|
||||||
|
@ -488,29 +500,57 @@ do -- Handguns
|
||||||
Accuracy_Decay = 5,
|
Accuracy_Decay = 5,
|
||||||
})
|
})
|
||||||
|
|
||||||
AddItem( "9mmhandgun", {
|
AddItem( "cz75", {
|
||||||
PrintName = "9mmhandgun",
|
PrintName = "CZ-75",
|
||||||
Description = "undecided 9mm handgun",
|
Description = "9mm handgun",
|
||||||
Category = "pistol",
|
Category = "pistol",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testgun.mdl",
|
Model = "models/benny/weapons/test_cz75.mdl",
|
||||||
HoldType = "handgun",
|
HoldType = "handgun",
|
||||||
|
|
||||||
ClipSize = 17,
|
ClipSize = 17,
|
||||||
Delay = (60/450),
|
Delay = (60/480),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/m92/01.ogg",
|
||||||
|
"benny/weapons/m92/02.ogg",
|
||||||
|
"benny/weapons/m92/03.ogg",
|
||||||
|
},
|
||||||
|
MagOutSound = "benny/weapons/m92/magout.ogg",
|
||||||
|
MagInSound = "benny/weapons/m92/magin.ogg",
|
||||||
|
BoltDropSound = "benny/weapons/m92/slidedrop.ogg",
|
||||||
|
BoltPullSound = "benny/weapons/glock/cock.ogg",
|
||||||
|
|
||||||
|
Accuracy = 5/60,
|
||||||
|
BurstCount = 1,
|
||||||
|
Accuracy_Add = 0.5,
|
||||||
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 5,
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "g18", {
|
||||||
|
PrintName = "G18",
|
||||||
|
Description = "automatic 9mm handgun",
|
||||||
|
Category = "pistol",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/test_g18.mdl",
|
||||||
|
HoldType = "handgun",
|
||||||
|
|
||||||
|
ClipSize = 33,
|
||||||
|
Delay = (60/1000),
|
||||||
FireSound = {
|
FireSound = {
|
||||||
"benny/weapons/glock/01.ogg",
|
"benny/weapons/glock/01.ogg",
|
||||||
"benny/weapons/glock/02.ogg",
|
"benny/weapons/glock/02.ogg",
|
||||||
"benny/weapons/glock/03.ogg",
|
"benny/weapons/glock/03.ogg",
|
||||||
},
|
},
|
||||||
MagOutSound = "benny/weapons/1911/magout.ogg",
|
MagOutSound = "benny/weapons/glock/magout.ogg",
|
||||||
MagInSound = "benny/weapons/1911/magin.ogg",
|
MagInSound = "benny/weapons/glock/magin.ogg",
|
||||||
BoltDropSound = "benny/weapons/1911/slidedrop.ogg",
|
BoltDropSound = "benny/weapons/glock/cock.ogg",
|
||||||
BoltPullSound = "benny/weapons/glock/cock.ogg",
|
BoltPullSound = "benny/weapons/glock/cock.ogg",
|
||||||
|
|
||||||
Accuracy = 5/60,
|
Accuracy = 5/60,
|
||||||
BurstCount = 1,
|
--BurstCount = 1,
|
||||||
Accuracy_Add = 0.5,
|
Accuracy_Add = 0.5,
|
||||||
Accuracy_Reset = 0.4,
|
Accuracy_Reset = 0.4,
|
||||||
Accuracy_Decay = 5,
|
Accuracy_Decay = 5,
|
||||||
|
@ -524,9 +564,9 @@ do -- Rifles
|
||||||
PrintName = "#Item.fnc.Name",
|
PrintName = "#Item.fnc.Name",
|
||||||
Description = "#Item.fnc.Description",
|
Description = "#Item.fnc.Description",
|
||||||
Category = "assaultrifle",
|
Category = "assaultrifle",
|
||||||
Base = "base_firearm_ubgl",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
Model = "models/benny/weapons/test_fnc.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
HoldType = "rifle",
|
HoldType = "rifle",
|
||||||
|
|
||||||
ClipSize = 30,
|
ClipSize = 30,
|
||||||
|
@ -543,13 +583,36 @@ do -- Rifles
|
||||||
Accuracy_Decay = 12,
|
Accuracy_Decay = 12,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
AddItem( "oicw", {
|
||||||
|
PrintName = "#Item.oicw.Name",
|
||||||
|
Description = "#Item.oicw.Description",
|
||||||
|
Category = "assaultrifle",
|
||||||
|
Base = "base_firearm_ubgl",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/test_oicw.mdl",
|
||||||
|
HoldType = "rifle",
|
||||||
|
|
||||||
|
ClipSize = 30,
|
||||||
|
Delay = (60/800),
|
||||||
|
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,
|
||||||
|
})
|
||||||
|
|
||||||
AddItem( "qbz", {
|
AddItem( "qbz", {
|
||||||
PrintName = "#Item.qbz.Name",
|
PrintName = "#Item.qbz.Name",
|
||||||
Description = "#Item.qbz.Description",
|
Description = "#Item.qbz.Description",
|
||||||
Category = "assaultrifle",
|
Category = "assaultrifle",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
Model = "models/benny/weapons/test_qbz.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
HoldType = "rifle",
|
HoldType = "rifle",
|
||||||
|
|
||||||
ClipSize = 30,
|
ClipSize = 30,
|
||||||
|
@ -572,7 +635,7 @@ do -- Rifles
|
||||||
Category = "assaultrifle",
|
Category = "assaultrifle",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle3.mdl",--"models/weapons/w_rif_m16a2.mdl",
|
Model = "models/benny/weapons/test_m16a2.mdl",--"models/weapons/w_rif_m16a2.mdl",
|
||||||
HoldType = "rifle",
|
HoldType = "rifle",
|
||||||
|
|
||||||
ClipSize = 30,
|
ClipSize = 30,
|
||||||
|
@ -603,7 +666,7 @@ do -- SMGs
|
||||||
Category = "smg",
|
Category = "smg",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
Model = "models/benny/weapons/test_tmp.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
HoldType = "handgun",
|
HoldType = "handgun",
|
||||||
|
|
||||||
ClipSize = 20,
|
ClipSize = 20,
|
||||||
|
@ -621,7 +684,7 @@ do -- SMGs
|
||||||
Category = "smg",
|
Category = "smg",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
Model = "models/benny/weapons/test_mp7.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
HoldType = "handgun",
|
HoldType = "handgun",
|
||||||
|
|
||||||
ClipSize = 20,
|
ClipSize = 20,
|
||||||
|
@ -639,7 +702,7 @@ do -- SMGs
|
||||||
Category = "smg",
|
Category = "smg",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
Model = "models/benny/weapons/test_mp5k.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
HoldType = "handgun",
|
HoldType = "handgun",
|
||||||
|
|
||||||
ClipSize = 20,
|
ClipSize = 20,
|
||||||
|
@ -657,7 +720,7 @@ do -- SMGs
|
||||||
Category = "smg",
|
Category = "smg",
|
||||||
Base = "base_firearm",
|
Base = "base_firearm",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
Model = "models/benny/weapons/test_mac10.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
HoldType = "handgun",
|
HoldType = "handgun",
|
||||||
|
|
||||||
ClipSize = 20,
|
ClipSize = 20,
|
||||||
|
|
|
@ -3,6 +3,26 @@ local L = {}
|
||||||
Languages["en-us"] = L
|
Languages["en-us"] = L
|
||||||
L["Name"] = "English (United States)"
|
L["Name"] = "English (United States)"
|
||||||
|
|
||||||
|
-- Teams
|
||||||
|
L["#Team.cia.Name"] = "CIA"
|
||||||
|
L["#Team.cia.Description"] = "CIA black ops, coverup crew"
|
||||||
|
|
||||||
|
L["#Team.halo.Name"] = "HALO"
|
||||||
|
L["#Team.halo.Description"] = "Assassination agency?"
|
||||||
|
|
||||||
|
L["#Team.plasof.Name"] = "PLASOF"
|
||||||
|
L["#Team.plasof.Description"] = "People's Liberation Army Special Operations Forces"
|
||||||
|
|
||||||
|
L["#Team.arng.Name"] = "NATIONAL GUARD"
|
||||||
|
L["#Team.arng.Description"] = "United States National Guard"
|
||||||
|
|
||||||
|
L["#Team.militia.Name"] = "MILITIA"
|
||||||
|
L["#Team.militia.Description"] = "Brazilian militia??? what"
|
||||||
|
|
||||||
|
L["#Team.viper.Name"] = "VIPERS"
|
||||||
|
L["#Team.viper.Description"] = "Gang"
|
||||||
|
|
||||||
|
-- Items
|
||||||
L["#Item.mk23.Name"] = "MK.23"
|
L["#Item.mk23.Name"] = "MK.23"
|
||||||
L["#Item.mk23.Description"] = "Special forces sidearm"
|
L["#Item.mk23.Description"] = "Special forces sidearm"
|
||||||
|
|
||||||
|
@ -15,6 +35,9 @@ L["#Item.qbz.Description"] = "Low-profile bullpup assault rifle"
|
||||||
L["#Item.m16a2.Name"] = "M16A2"
|
L["#Item.m16a2.Name"] = "M16A2"
|
||||||
L["#Item.m16a2.Description"] = "Rugged burst rifle"
|
L["#Item.m16a2.Description"] = "Rugged burst rifle"
|
||||||
|
|
||||||
|
L["#Item.oicw.Name"] = "OICW"
|
||||||
|
L["#Item.oicw.Description"] = "Advanced combat rifle"
|
||||||
|
|
||||||
L["#Item.spas12.Name"] = "SPAS-12"
|
L["#Item.spas12.Name"] = "SPAS-12"
|
||||||
L["#Item.spas12.Description"] = "Chrome-lined autoshotgun"
|
L["#Item.spas12.Description"] = "Chrome-lined autoshotgun"
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
-- Your Name is Benny
|
-- Your Name is Benny
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
function GM:PlayerInitialSpawn( ply, transiton )
|
||||||
|
ply:SetTeam( 1 )
|
||||||
|
end
|
||||||
|
|
||||||
function GM:PlayerSpawn( ply )
|
function GM:PlayerSpawn( ply )
|
||||||
player_manager.SetPlayerClass( ply, "player_benny" )
|
player_manager.SetPlayerClass( ply, "player_benny" )
|
||||||
ply:SetViewOffset( Vector( 0, 0, 64 ) )
|
ply:SetViewOffset( Vector( 0, 0, 64 ) )
|
||||||
|
@ -26,12 +30,46 @@ function GM:PlayerSpawn( ply )
|
||||||
ply:MakeCharacter()
|
ply:MakeCharacter()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GM:PlayerPostThink( ply )
|
||||||
|
if ply:GetTouchedObjective():IsValid() then
|
||||||
|
if ply:GetTouchedObjectiveTime()+0.1 <= CurTime() then
|
||||||
|
ply:SetTouchedObjective( NULL )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function GM:PlayerNoClip()
|
function GM:PlayerNoClip()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local PT = FindMetaTable( "Player" )
|
local PT = FindMetaTable( "Player" )
|
||||||
|
|
||||||
|
concommand.Add("b-cheat_setxp", function( ply, cmd, args )
|
||||||
|
if !ply or !ply:IsValid() then return end
|
||||||
|
|
||||||
|
ply:SetLevel_XP( args[1] )
|
||||||
|
end)
|
||||||
|
|
||||||
|
concommand.Add("b-cheat_rewardxp", function( ply, cmd, args )
|
||||||
|
if !ply or !ply:IsValid() then return end
|
||||||
|
|
||||||
|
ply:RewardXP( args[1] )
|
||||||
|
end)
|
||||||
|
|
||||||
|
function PT:RewardXP( amt )
|
||||||
|
if CLIENT then return end
|
||||||
|
|
||||||
|
--self.amountcollected = (self.amountcollected or 0) + amt
|
||||||
|
self:SetLevel_XP( self:GetLevel_XP() + amt )
|
||||||
|
--self:ChatPrint( "Rewarded " .. amt .. " XP" )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function PT:RewardScore()
|
||||||
|
if CLIENT then return end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
local bgl = {
|
local bgl = {
|
||||||
["benny"] = {
|
["benny"] = {
|
||||||
[0] = Vector( 0.275, 0.7, 0.7 ),
|
[0] = Vector( 0.275, 0.7, 0.7 ),
|
||||||
|
|
|
@ -31,24 +31,29 @@ STANCE_DUCK = 1
|
||||||
STANCE_PRONE = 2
|
STANCE_PRONE = 2
|
||||||
|
|
||||||
function PLAYER:SetupDataTables()
|
function PLAYER:SetupDataTables()
|
||||||
self.Player:NetworkVar( "Bool", 0, "Shoulder" )
|
self.Player:NetworkVar( "Bool", "Shoulder" )
|
||||||
self.Player:NetworkVar( "Bool", 1, "InDive" )
|
self.Player:NetworkVar( "Bool", "InDive" )
|
||||||
|
|
||||||
self.Player:NetworkVar( "Int", 0, "JumpBoost" )
|
self.Player:NetworkVar( "Int", "JumpBoost" )
|
||||||
self.Player:NetworkVar( "Int", 1, "Health_Blood" )
|
self.Player:NetworkVar( "Int", "Health_Blood" )
|
||||||
self.Player:NetworkVar( "Int", 2, "Health_Stamina" )
|
self.Player:NetworkVar( "Int", "Health_Stamina" )
|
||||||
self.Player:NetworkVar( "Int", 3, "Stance" )
|
self.Player:NetworkVar( "Int", "Stance" )
|
||||||
|
self.Player:NetworkVar( "Int", "Level" )
|
||||||
|
self.Player:NetworkVar( "Int", "Level_XP" )
|
||||||
|
|
||||||
self.Player:NetworkVar( "Float", 0, "VaultDebuff" )
|
self.Player:NetworkVar( "Float", "VaultDebuff" )
|
||||||
self.Player:NetworkVar( "Float", 1, "VaultTransition" )
|
self.Player:NetworkVar( "Float", "VaultTransition" )
|
||||||
self.Player:NetworkVar( "Float", 2, "Stamina" )
|
self.Player:NetworkVar( "Float", "Stamina" )
|
||||||
self.Player:NetworkVar( "Float", 3, "DivedAt" )
|
self.Player:NetworkVar( "Float", "DivedAt" )
|
||||||
|
self.Player:NetworkVar( "Float", "TouchedObjectiveTime" )
|
||||||
|
|
||||||
self.Player:NetworkVar( "Vector", 0, "VaultPos1")
|
self.Player:NetworkVar( "Entity", "TouchedObjective" )
|
||||||
self.Player:NetworkVar( "Vector", 1, "VaultPos2")
|
|
||||||
|
|
||||||
self.Player:NetworkVar( "String", 0, "ReqID1")
|
self.Player:NetworkVar( "Vector", "VaultPos1")
|
||||||
self.Player:NetworkVar( "String", 1, "ReqID2")
|
self.Player:NetworkVar( "Vector", "VaultPos2")
|
||||||
|
|
||||||
|
self.Player:NetworkVar( "String", "ReqID1")
|
||||||
|
self.Player:NetworkVar( "String", "ReqID2")
|
||||||
end
|
end
|
||||||
|
|
||||||
player_manager.RegisterClass( "player_benny", PLAYER, "player_default" )
|
player_manager.RegisterClass( "player_benny", PLAYER, "player_default" )
|
||||||
|
|
|
@ -28,6 +28,8 @@ AC("inventory.lua")
|
||||||
IN("inventory.lua")
|
IN("inventory.lua")
|
||||||
AC("gamestate.lua")
|
AC("gamestate.lua")
|
||||||
IN("gamestate.lua")
|
IN("gamestate.lua")
|
||||||
|
AC("teams.lua")
|
||||||
|
IN("teams.lua")
|
||||||
|
|
||||||
AC("debugmenu.lua")
|
AC("debugmenu.lua")
|
||||||
IN("debugmenu.lua")
|
IN("debugmenu.lua")
|
||||||
|
|
|
@ -0,0 +1,122 @@
|
||||||
|
|
||||||
|
|
||||||
|
concommand.Add("b-cheat_setteam", function( ply, cmd, args )
|
||||||
|
if !ply or !ply:IsValid() then return end
|
||||||
|
|
||||||
|
ply:SetTeam( args[1] )
|
||||||
|
end)
|
||||||
|
|
||||||
|
TEAMS = {
|
||||||
|
{
|
||||||
|
name = "#Team.cia.Name",
|
||||||
|
description = "#Team.cia.Description",
|
||||||
|
factionid = "mp_cia",
|
||||||
|
id = "CIA",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "#Team.halo.Name",
|
||||||
|
description = "#Team.halo.Description",
|
||||||
|
factionid = "mp_halo",
|
||||||
|
id = "HALO",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "#Team.plasof.Name",
|
||||||
|
description = "#Team.plasof.Description",
|
||||||
|
factionid = "mp_plasof",
|
||||||
|
id = "PLASOF",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "#Team.arng.Name",
|
||||||
|
description = "#Team.arng.Description",
|
||||||
|
factionid = "mp_arng",
|
||||||
|
id = "ARNG",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "#Team.militia.Name",
|
||||||
|
description = "#Team.militia.Description",
|
||||||
|
factionid = "mp_militia",
|
||||||
|
id = "MILITIA",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "#Team.viper.Name",
|
||||||
|
description = "#Team.viper.Description",
|
||||||
|
factionid = "mp_viper",
|
||||||
|
id = "VIPER",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "campaign",
|
||||||
|
description = "internal campaign faction",
|
||||||
|
factionid = "campaign",
|
||||||
|
id = "CAMPAIGN",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
TEAMS_IDtoTeam = {
|
||||||
|
[TEAMS[1].id] = TEAMS[1],
|
||||||
|
[TEAMS[2].id] = TEAMS[2],
|
||||||
|
[TEAMS[3].id] = TEAMS[3],
|
||||||
|
[TEAMS[4].id] = TEAMS[4],
|
||||||
|
[TEAMS[5].id] = TEAMS[5],
|
||||||
|
[TEAMS[6].id] = TEAMS[6],
|
||||||
|
}
|
||||||
|
|
||||||
|
TEAMS_FIDtoTeam = {
|
||||||
|
[TEAMS[1].factionid] = TEAMS[1],
|
||||||
|
[TEAMS[2].factionid] = TEAMS[2],
|
||||||
|
[TEAMS[3].factionid] = TEAMS[3],
|
||||||
|
[TEAMS[4].factionid] = TEAMS[4],
|
||||||
|
[TEAMS[5].factionid] = TEAMS[5],
|
||||||
|
[TEAMS[6].factionid] = TEAMS[6],
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Team 1 is CIA, Team 2 is HALO for now
|
||||||
|
TEAMS_Placeholder = {
|
||||||
|
[1] = "benny_playerstart_team1",
|
||||||
|
[2] = "benny_playerstart_team2",
|
||||||
|
[3] = "benny_playerstart_team3",
|
||||||
|
[4] = "benny_playerstart_team4",
|
||||||
|
[5] = "benny_playerstart_team5",
|
||||||
|
[6] = "benny_playerstart_team6",
|
||||||
|
}
|
||||||
|
|
||||||
|
TEAMS_Current = {
|
||||||
|
[1] = 1,
|
||||||
|
[2] = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
function GM:CreateTeams()
|
||||||
|
for index, data in ipairs( TEAMS ) do
|
||||||
|
team.SetUp( index, data.name, Color( 0, 0, 255 ) )
|
||||||
|
team.SetSpawnPoint( index, "benny_playerstart_team" .. index )
|
||||||
|
end
|
||||||
|
|
||||||
|
team.SetSpawnPoint( TEAM_SPECTATOR, "worldspawn" )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function GM:PlayerSelectSpawn( ply, transition )
|
||||||
|
if ( transition ) then return end
|
||||||
|
|
||||||
|
if BennyGame:GetType() == BG_GTYPE_MP then
|
||||||
|
local ent = self:PlayerSelectTeamSpawn( ply:Team(), ply )
|
||||||
|
if IsValid( ent ) then return ent end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function GM:PlayerSelectTeamSpawn( TeamID, ply )
|
||||||
|
local SpawnPoints = team.GetSpawnPoints( TeamID )
|
||||||
|
if ( !SpawnPoints || table.IsEmpty( SpawnPoints ) ) then return end
|
||||||
|
|
||||||
|
local ChosenSpawnPoint = nil
|
||||||
|
|
||||||
|
for i = 0, 6 do
|
||||||
|
|
||||||
|
ChosenSpawnPoint = table.Random( SpawnPoints )
|
||||||
|
if ( hook.Call( "IsSpawnpointSuitable", GAMEMODE, ply, ChosenSpawnPoint, i == 6 ) ) then
|
||||||
|
return ChosenSpawnPoint
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return ChosenSpawnPoint
|
||||||
|
end
|
Loading…
Reference in New Issue