Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lua/entities/base_wdr_entity/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function ENT:Think()
if self:CanTX() then
if RES_DISTRIB then
local amt = RD.GetResourceAmount(self, "energy")

if amt < (self.txwatts * 4 * ThinkInterval) then
RD.ConsumeResource(self, "energy", amt)
else
Expand All @@ -120,8 +120,8 @@ function ENT:Think()
end

if self.txwatts >= 200 then
local e = ents.FindInCone(self:GetPos(), self:GetForward(), self.txwatts/5, self.beamWidth)
local e = ents.FindInCone(self:GetPos(), self:GetForward(), self.txwatts/5, self.beamWidthCos)

for k, v in pairs(e) do
if v:IsPlayer() then v:TakeDamage(self.txwatts / 500 + (100/self:GetPos():Distance(v:GetPos())), self) end
end
Expand Down Expand Up @@ -163,7 +163,7 @@ function ENT:Think()
local skew = 0
-- One vertical, one horizontal
if self.pol ~= v.pol then skew = 1.5707963267949 end

skewloss = math.abs(math.sin(math.rad(v:GetAngles().r) - math.rad(self:GetAngles().r) + skew) * 20)
end

Expand All @@ -174,7 +174,7 @@ function ENT:Think()

-- Calculate the received signal strength (strength + self.gain)
-- If this transmitter is operational, within our field of vision, and we are within its beam
if v:CanTX() and math.deg(onedir) <= (self.beamWidth/2.0) and math.deg(otherdir) <= (v.beamWidth/2.0) then
if v:CanTX() and math.deg(onedir) <= (self.beamWidth) and math.deg(otherdir) <= (v.beamWidth) then
table.insert(txs, v)
end
end
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_domestic_dish/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 25.0 -- dB
self.pol = 2 -- Horizontal Polarization
self.beamWidth = 5.0 -- Degrees
self.beamWidth = 5 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_large_drum/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 22.0 -- dB
self.pol = 0 -- Cross Polarization
self.beamWidth = 5.0 -- Degrees
self.beamWidth = 5 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_large_omni/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 2.2 -- dB
self.pol = 1 -- Vertical Polarization
self.beamWidth = 360.0 -- Degrees
self.beamWidth = 360 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_log/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 9.6 -- dB
self.pol = 2 -- Horizontal Polarization
self.beamWidth = 20.0 -- Degrees
self.beamWidth = 20 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_orbital_dish/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 20.0 -- dB
self.pol = 1 -- Vertical Polarization
self.beamWidth = 15.0 -- Degrees
self.beamWidth = 15 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_panel/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 19.5 -- dB
self.pol = 1 -- Vertical Polarization
self.beamWidth = 8.0 -- Degrees
self.beamWidth = 8 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_sector/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 16.0 -- dB
self.pol = 0 -- Cross Polarization
self.beamWidth = 120.0 -- Degrees
self.beamWidth = 120 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_small_drum/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 17.5 -- dB
self.pol = 0 -- Cross Polarization
self.beamWidth = 5.0 -- Degrees
self.beamWidth = 5 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_small_omni/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 2.1 -- dB
self.pol = 1 -- Vertical Polarization
self.beamWidth = 360.0 -- Degrees
self.beamWidth = 360 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/ra_uplink_dish/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include("shared.lua")
function ENT:Initialize()
self.gain = 32.0 -- dB
self.pol = 2 -- Horizontal Polarization
self.beamWidth = 5.0 -- Degrees
self.beamWidth = 5 -- Degrees
self.beamWidthCos = math.cos(math.rad(self.beamWidth/2))
self.active = false -- TX enabled (if TX)
self.txchannels = {} -- tx data
self.txwatts = 0 -- tx power
Expand Down