Skip to content

Commit 85ca1d6

Browse files
authored
Merge branch 'wiremod:master' into master
2 parents 73973d9 + 66f03d5 commit 85ca1d6

File tree

11 files changed

+135
-268
lines changed

11 files changed

+135
-268
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Get any changed files
2020
id: changed-files
21-
uses: tj-actions/changed-files@v41
21+
uses: tj-actions/changed-files@v46
2222
with:
2323
files: |
2424
**.lua

lua/effects/jump_in.lua

Lines changed: 27 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,38 @@
1-
EFFECT.Mat = Material( "effects/select_ring" )
2-
3-
/*---------------------------------------------------------
4-
Initializes the effect. The data is a table of data
5-
which was passed from the server.
6-
---------------------------------------------------------*/
7-
function EFFECT:Init( data )
8-
9-
local TargetEntity = data:GetEntity()
10-
11-
if ( not TargetEntity or not TargetEntity:IsValid() ) then return end
12-
13-
//local vOffset = TargetEntity:GetPos()
14-
15-
local Low, High = TargetEntity:WorldSpaceAABB()
16-
local Center = data:GetOrigin() //High - (( High - Low ) * 0.5)
17-
18-
local NumParticles = TargetEntity:BoundingRadius()
19-
NumParticles = NumParticles * 2
20-
21-
NumParticles = math.Clamp( NumParticles, 10, 500 )
22-
23-
local emitter = ParticleEmitter( Center )
24-
25-
for i=0, NumParticles do
26-
27-
local vPos = Vector( math.Rand(Low.x,High.x), math.Rand(Low.y,High.y), math.Rand(Low.z,High.z) )
28-
local vVel = (vPos - Center) * 6
29-
local particle = emitter:Add( "effects/spark", Center )
30-
if (particle) then
31-
particle:SetVelocity( vVel )
32-
particle:SetLifeTime( 0 )
33-
particle:SetDieTime( math.Rand( 0.1, 0.4 ) )
34-
particle:SetStartAlpha( 0 )
35-
particle:SetEndAlpha( math.Rand( 200, 255 ) )
36-
particle:SetStartSize( 0 )
37-
particle:SetEndSize( 20 )
38-
particle:SetRoll( math.Rand(0, 360) )
39-
particle:SetRollDelta( 0 )
40-
end
41-
1+
function EFFECT:Init(data)
2+
local entity = data:GetEntity()
3+
if not entity:IsValid() then return end
4+
5+
local low, high = entity:WorldSpaceAABB()
6+
local origin = data:GetOrigin()
7+
8+
local emitter = ParticleEmitter(origin)
9+
10+
for i = 0, math.Clamp(entity:BoundingRadius() * 2, 10, 500) do
11+
local particle = emitter:Add("effects/spark", origin)
12+
13+
if particle then
14+
local velocity = Vector(math.Rand(low.x, high.x), math.Rand(low.y, high.y), math.Rand(low.z, high.z))
15+
velocity:Sub(origin)
16+
velocity:Mul(6)
17+
18+
particle:SetVelocity(velocity)
19+
particle:SetLifeTime(0)
20+
particle:SetDieTime(math.Rand(0.1, 0.4))
21+
particle:SetStartAlpha(0)
22+
particle:SetEndAlpha(math.Rand(200, 255))
23+
particle:SetStartSize(0)
24+
particle:SetEndSize(20)
25+
particle:SetRoll(math.Rand(0, 360))
26+
particle:SetRollDelta(0)
4227
end
28+
end
4329

4430
emitter:Finish()
45-
4631
end
4732

48-
49-
/*---------------------------------------------------------
50-
THINK
51-
---------------------------------------------------------*/
5233
function EFFECT:Think()
5334
return false
5435
end
5536

56-
/*---------------------------------------------------------
57-
Draw the effect
58-
---------------------------------------------------------*/
5937
function EFFECT:Render()
6038
end

lua/effects/jump_out.lua

Lines changed: 28 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,39 @@
1-
2-
3-
EFFECT.Mat = Material( "effects/select_ring" )
4-
5-
/*---------------------------------------------------------
6-
Initializes the effect. The data is a table of data
7-
which was passed from the server.
8-
---------------------------------------------------------*/
9-
function EFFECT:Init( data )
10-
11-
local TargetEntity = data:GetEntity()
12-
13-
if ( not TargetEntity or not TargetEntity:IsValid() ) then return end
14-
15-
local vOffset = TargetEntity:GetPos()
16-
17-
local Low, High = TargetEntity:WorldSpaceAABB()
18-
local Center = data:GetOrigin() //High - (( High - Low ) * 0.5)
19-
20-
local NumParticles = TargetEntity:BoundingRadius()
21-
NumParticles = NumParticles * 2
22-
23-
NumParticles = math.Clamp( NumParticles, 10, 500 )
24-
25-
local emitter = ParticleEmitter( vOffset )
26-
27-
for i=0, NumParticles do
28-
29-
local vPos = Vector( math.Rand(Low.x,High.x), math.Rand(Low.y,High.y), math.Rand(Low.z,High.z) )
30-
local vVel = (Center - vPos) * 6
31-
local particle = emitter:Add( "effects/spark", vPos )
32-
if (particle) then
33-
particle:SetVelocity( vVel )
34-
particle:SetLifeTime( 0 )
35-
particle:SetDieTime( math.Rand( 0.1, 0.3 ) )
36-
particle:SetStartAlpha( math.Rand( 200, 255 ) )
37-
particle:SetEndAlpha( 0 )
38-
particle:SetStartSize( 20 )
39-
particle:SetEndSize( 0 )
40-
particle:SetRoll( math.Rand(0, 360) )
41-
particle:SetRollDelta( 0 )
42-
end
43-
1+
function EFFECT:Init(data)
2+
local entity = data:GetEntity()
3+
if not entity:IsValid() then return end
4+
5+
local low, high = entity:WorldSpaceAABB()
6+
local origin = data:GetOrigin()
7+
8+
local emitter = ParticleEmitter(entity:GetPos())
9+
10+
for i = 0, math.Clamp(entity:BoundingRadius() * 2, 10, 500) do
11+
local position = Vector(math.Rand(low.x, high.x), math.Rand(low.y, high.y), math.Rand(low.z, high.z))
12+
local particle = emitter:Add("effects/spark", position)
13+
14+
if particle then
15+
position:Negate()
16+
position:Add(origin)
17+
position:Mul(6)
18+
19+
particle:SetVelocity(position)
20+
particle:SetLifeTime(0)
21+
particle:SetDieTime(math.Rand(0.1, 0.3))
22+
particle:SetStartAlpha(math.Rand(200, 255))
23+
particle:SetEndAlpha(0)
24+
particle:SetStartSize(20)
25+
particle:SetEndSize(0)
26+
particle:SetRoll(math.Rand(0, 360))
27+
particle:SetRollDelta(0)
4428
end
29+
end
4530

4631
emitter:Finish()
47-
4832
end
4933

50-
51-
/*---------------------------------------------------------
52-
THINK
53-
---------------------------------------------------------*/
5434
function EFFECT:Think()
5535
return false
5636
end
5737

58-
/*---------------------------------------------------------
59-
Draw the effect
60-
---------------------------------------------------------*/
6138
function EFFECT:Render()
6239
end

lua/effects/thruster_ring.lua

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,30 @@
1-
EFFECT.Mat = Material( "effects/select_ring" )
1+
function EFFECT:Init(data)
2+
self:SetCollisionBounds(Vector(-16, -16, -16), Vector(16, 16, 16))
23

3-
function EFFECT:Init( data )
4+
local origin, normal = data:GetOrigin(), data:GetNormal()
5+
self:SetPos(origin + normal * 2)
46

5-
local size = 16
6-
self:SetCollisionBounds( Vector( -size,-size,-size ), Vector( size,size,size ) )
7-
8-
local Pos = data:GetOrigin() + data:GetNormal() * 2
9-
10-
self:SetPos( Pos )
11-
self:SetAngles( data:GetNormal():Angle() + Angle( 0.01, 0.01, 0.01 ) )
12-
13-
self.Pos = data:GetOrigin()
14-
self.Normal = data:GetNormal()
15-
16-
self.Speed = 2
177
self.Size = 16
8+
self.Normal = normal
189
self.Alpha = 255
1910
self.GrowthRate = data:GetMagnitude()
2011
end
2112

2213
function EFFECT:Think()
14+
local speed = FrameTime() * 2
15+
local alpha = self.Alpha - 250 * speed
16+
if alpha <= 0 then return false end
2317

24-
local speed = FrameTime() * self.Speed
25-
26-
self.Alpha = self.Alpha - 250.0 * speed
27-
self.Size = self.Size + (255 - self.Alpha) * self.GrowthRate
28-
self:SetPos( self:GetPos() + self.Normal * speed * 128 )
18+
self.Alpha = alpha
19+
self.Size = self.Size + (255 - alpha) * self.GrowthRate
20+
self:SetPos(self:GetPos() + self.Normal * (speed * 128))
2921

30-
if (self.Alpha < 0 ) then return false end
31-
if (self.Size < 0) then return false end
3222
return true
33-
3423
end
3524

36-
function EFFECT:Render()
37-
38-
if (self.Alpha < 1 ) then return end
39-
40-
render.SetMaterial( self.Mat )
41-
42-
render.DrawQuadEasy( self:GetPos(),
43-
self:GetAngles():Forward(),
44-
self.Size, self.Size,
45-
Color( math.Rand( 10, 100), math.Rand( 100, 220), math.Rand( 240, 255), self.Alpha )
46-
)
25+
local ring = Material("effects/select_ring")
4726

27+
function EFFECT:Render()
28+
render.SetMaterial(ring)
29+
render.DrawQuadEasy(self:GetPos(), self.Normal, self.Size, self.Size, Color(math.random(10, 100), math.random(100, 220), math.random(240, 255), self.Alpha))
4830
end

lua/effects/thruster_sperm.lua

Lines changed: 0 additions & 66 deletions
This file was deleted.

lua/entities/gmod_wire_expression2/core/entity.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ end
9191
--[[******************************************************************************]]
9292
-- Functions getting string
9393

94-
E2Lib.registerConstant("NULL", NULL)
94+
E2Lib.registerConstant("NO_ENTITY", NULL, "An invalid entity")
9595

96-
[deprecated = "Use the constant NULL instead"]
96+
[deprecated = "Use the constant NO_ENTITY instead"]
9797
e2function entity noentity()
9898
return NULL
9999
end
@@ -791,9 +791,8 @@ end
791791
e2function void entity:podSetName(string name)
792792
if not IsValid(this) or not this:IsVehicle() or not this.VehicleTable or not this.VehicleTable.Name then return self:throw("Invalid vehicle!", nil) end
793793
if not isOwner(self, this) then return self:throw("You do not own this entity!", nil) end
794-
if hook.Run("Wire_CanName") == false then return self:throw("A hook prevented this function from running") end
795-
name = name:sub(1,200)
796-
this.VehicleTable.Name = name
794+
if hook.Run("Wire_CanName", name, this, self.player) == false then return self:throw("A hook prevented this function from running") end
795+
this.VehicleTable.Name = name:sub(1, 200)
797796
end
798797

799798
--[[******************************************************************************]]

lua/entities/gmod_wire_gate.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ function ENT:CalcOutput(iter, selfTbl)
127127
end
128128
end
129129

130-
function ENT:ShowOutput(selfTbl)
131-
selfTbl = selfTbl or self:GetTable()
130+
function ENT:PrepareOverlayData()
131+
local selfTbl = self:GetTable()
132132
local action = selfTbl.Action
133133
local txt
134134

@@ -145,10 +145,6 @@ function ENT:ShowOutput(selfTbl)
145145
self:SetOverlayText(txt)
146146
end
147147

148-
function ENT:PrepareOverlayData()
149-
self:ShowOutput()
150-
end
151-
152148
function ENT:OnRestore()
153149
self.Action = GateActions[self.action]
154150
BaseClass.OnRestore(self)

lua/entities/gmod_wire_hologram.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ end
2222

2323
function ENT:SetPlayer(ply)
2424
self:SetPlayerEnt(ply)
25+
self:SetCreator(ply)
2526
self.steamid = ply:SteamID()
2627
end
2728

0 commit comments

Comments
 (0)