summaryrefslogtreecommitdiff
path: root/gamemode/cl_hudstains.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 21:01:18 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 21:01:18 -0400
commitd62058fcdea5fc6736a2a373f47dc6c14c70c319 (patch)
tree79a1325190e3f1f1b6d6a2dbcdfc1ba3fa866ac9 /gamemode/cl_hudstains.lua
parentc38f00182ba6c282806eecb39a42e64d5feafa37 (diff)
downloadredead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.gz
redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.bz2
redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.zip
Removed exessive whitespace so future commits will be cleaner
Diffstat (limited to 'gamemode/cl_hudstains.lua')
-rw-r--r--gamemode/cl_hudstains.lua56
1 files changed, 28 insertions, 28 deletions
diff --git a/gamemode/cl_hudstains.lua b/gamemode/cl_hudstains.lua
index 9b2b637..587b1dc 100644
--- a/gamemode/cl_hudstains.lua
+++ b/gamemode/cl_hudstains.lua
@@ -2,46 +2,46 @@
local BloodTable = {}
local function DrawBlood()
-
+
if #BloodTable < 1 then return end
for i=1, #BloodTable do
-
+
if BloodTable[i] then
-
+
local scale = math.Clamp( ( BloodTable[i].DieTime - CurTime() ) / BloodTable[i].Die, 0, 1 )
-
+
if scale == 0 then
-
+
BloodTable[i].Remove = true
-
+
else
-
+
local alpha = math.floor( BloodTable[i].Alpha * scale )
-
+
surface.SetTexture( BloodTable[i].Mat )
//surface.SetDrawColor( 250, 10, 10, alpha )
surface.SetDrawColor( 175, 10, 10, alpha )
surface.DrawTexturedRect( BloodTable[i].X, BloodTable[i].Y, BloodTable[i].Size, BloodTable[i].Size )//, BloodTable[i].Rot )
-
+
end
-
+
end
-
+
end
-
+
for k,v in pairs( BloodTable ) do
-
+
if v.Remove then
-
+
table.remove( BloodTable, k )
-
+
break
-
+
end
-
+
end
-
+
end
hook.Add( "HUDPaint", "BloodPaint", DrawBlood )
@@ -51,31 +51,31 @@ StainMats = { "nuke/blood/Blood1",
"nuke/blood/Blood4",
"nuke/blood/Blood5",
"nuke/blood/Blood6",
-"nuke/blood/Blood7" }
+"nuke/blood/Blood7" }
function AddStain( msg )
local num = 1
- if msg then
-
+ if msg then
+
num = msg:ReadShort()
-
+
end
-
+
for i=1, num do
local count = #BloodTable + 1
-
+
local size = math.random( 256, 1024 )
local x = math.random( size * -0.5, ScrW() - ( size * 0.5 ) )
local y = math.random( size * -0.5, ScrH() - ( size * 0.5 ) )
local rand = math.Rand( 3.5, 6.5 )
-
+
BloodTable[count] = { Size = size, X = x, Y = y, Mat = surface.GetTextureID( table.Random( StainMats ) ), Die = rand, DieTime = CurTime() + rand, Alpha = math.random( 150, 250 ) }
-
+
end
-
+
end
-usermessage.Hook( "BloodStain", AddStain )
+usermessage.Hook( "BloodStain", AddStain )