mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-04 00:52:33 +00:00
release branch init
This commit is contained in:
@@ -40,7 +40,6 @@ include("shared.lua")
|
||||
ENT.ClientProps = {}
|
||||
ENT.ButtonMap = {}
|
||||
ENT.AutoAnims = {}
|
||||
ENT.AutoAnimNames = {}
|
||||
ENT.ClientSounds = {}
|
||||
|
||||
ENT.ButtonMap["PanelLamp"] = {
|
||||
@@ -51,7 +50,7 @@ ENT.ButtonMap["PanelLamp"] = {
|
||||
scale = 0.0588,
|
||||
|
||||
buttons = {
|
||||
{ID = "PanelLampToggle", x=0, y=0, w=100, h=200, tooltip="",var="PanelLights"},
|
||||
{ID = "PanelLampToggle", x=0, y=0, w=100, h=200, tooltip=""},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,16 +66,13 @@ ENT.ButtonMap["MainL"] = {
|
||||
buttons = {
|
||||
----Лампы
|
||||
{ID = "!RedRP", x=10,y=10, radius=10, tooltip="", model = {
|
||||
lamp = {model = "models/metrostroi_train/81-703/cabin_lamp_red3.mdl",z=1,color = Color(178,112,112), var="RRP", getfunc = function(ent,min,max) return ent:GetPackedRatio("RRP") end},
|
||||
sprite = {bright=0.1,size=0.25,scale=0.07,color=Color(255,60,60),z=3,}
|
||||
lamp = {model = "models/metrostroi_train/81-703/cabin_lamp_red3.mdl",z=1,color = Color(255,160,160), var="RRP", getfunc = function(ent,min,max) return ent:GetPackedRatio("RRP") end}
|
||||
}},
|
||||
{ID = "!GreenRP", x=40.71,y=10, radius=10, tooltip="", model = {
|
||||
lamp = {model = "models/metrostroi_train/81-703/cabin_lamp_green.mdl",z=1,color = Color(98,178,178), var="GRP"},
|
||||
sprite = {bright=0.1,size=0.25,scale=0.07,color=Color(40,255,100),z=3,}
|
||||
lamp = {model = "models/metrostroi_train/81-703/cabin_lamp_green.mdl",z=1,color = Color(140,255,255), var="GRP"}
|
||||
}},
|
||||
{ID = "!Blue", x=73.50,y=10, radius=10, tooltip="", model = {
|
||||
lamp = {model = "models/metrostroi_train/81-703/cabin_lamp_white.mdl",z=1,color = Color(112,140,178), var="SD",},
|
||||
sprite = {bright=0.1,size=0.25,scale=0.07,color=Color(60,200,255),z=3,}
|
||||
lamp = {model = "models/metrostroi_train/81-703/cabin_lamp_white.mdl",z=1,color = Color(160,200,255), var="SD",}
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -96,7 +92,6 @@ ENT.ButtonMap["MainB"] = {
|
||||
var="KU7",speed=6,
|
||||
sndvol = 1, snd = function(val) return val and "vu13a_on" or "vu13a_off" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
states={"Train.Buttons.Unlocked","Train.Buttons.Locked"},
|
||||
}},
|
||||
|
||||
{ ID = "KU6Set", x=0+56*1, y=0, w=50,h=90, tooltip="", model = {
|
||||
@@ -190,7 +185,7 @@ ENT.ButtonMap["Stopkran"] = {
|
||||
height = 1300,
|
||||
scale = 0.1/2,
|
||||
buttons = {
|
||||
{ID = "EmergencyBrakeValveToggle",x=0, y=0, w=200, h=1300, tooltip="", tooltip="",tooltip="",states={"Train.Buttons.Closed","Train.Buttons.Opened"},var="EmergencyBrakeValve"},
|
||||
{ID = "EmergencyBrakeValveToggle",x=0, y=0, w=200, h=1300, tooltip=""},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,8 +295,8 @@ ENT.ButtonMap["ParkingBrake"] = {
|
||||
scale = 0.0625,
|
||||
|
||||
buttons = {
|
||||
{ID = "ParkingBrakeLeft",x=0, y=0, w=170, h=400, tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.ParkingBrake"),ent:GetPackedRatio("ManualBrake")*100) end},
|
||||
{ID = "ParkingBrakeRight",x=170, y=0, w=170, h=400, tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.ParkingBrake"),ent:GetPackedRatio("ManualBrake")*100) end},
|
||||
{ID = "ParkingBrakeLeft",x=0, y=0, w=170, h=400, tooltip=""},
|
||||
{ID = "ParkingBrakeRight",x=170, y=0, w=170, h=400, tooltip=""},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,7 +323,6 @@ ENT.ButtonMap["HelperPanel"] = {
|
||||
var="KU8",speed=6,
|
||||
sndvol = 1, snd = function(val) return val and "vu13a_on" or "vu13a_off" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
states={"Train.Buttons.Unlocked","Train.Buttons.Locked"},
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -342,7 +336,7 @@ ENT.ButtonMap["HVMeters"] = {
|
||||
scale = 0.0625,
|
||||
|
||||
buttons = {
|
||||
{ID = "!EnginesVoltage", x=0, y=0, w=55, h=55, tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.EnginesVoltage"),ent:GetPackedRatio("EnginesVoltage")*1000) end},
|
||||
{ID = "!EnginesVoltage", x=0, y=0, w=55, h=55, tooltip=""},
|
||||
}
|
||||
}
|
||||
ENT.ButtonMap["Speedometer"] = {
|
||||
@@ -353,7 +347,7 @@ ENT.ButtonMap["Speedometer"] = {
|
||||
scale = 0.0625,
|
||||
|
||||
buttons = {
|
||||
{ID = "!Speedometer", x=0, y=0, w=135, h=135, tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.Speed"),ent:GetPackedRatio("Speed")*100) end},
|
||||
{ID = "!Speedometer", x=0, y=0, w=135, h=135, tooltip=""},
|
||||
}
|
||||
}
|
||||
ENT.ButtonMap["BLTLPressure"] = {
|
||||
@@ -364,7 +358,7 @@ ENT.ButtonMap["BLTLPressure"] = {
|
||||
scale = 0.0625,
|
||||
|
||||
buttons = {
|
||||
{ID = "!BLTLPressure", x=60,y=60,radius=60,tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BLTLPressure"),ent:GetPackedRatio("TLPressure")*16,ent:GetPackedRatio("BLPressure")*16) end},
|
||||
{ID = "!BLTLPressure", x=60,y=60,radius=60,tooltip=""},
|
||||
}
|
||||
}
|
||||
ENT.ButtonMap["BCPressure"] = {
|
||||
@@ -376,7 +370,7 @@ ENT.ButtonMap["BCPressure"] = {
|
||||
scale = 0.0625,
|
||||
|
||||
buttons = {
|
||||
{ID = "!BCPressure", x=34,y=34,radius=34,tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BCPressure"),ent:GetPackedRatio("BCPressure")*6) end},
|
||||
{ID = "!BCPressure", x=34,y=34,radius=34,tooltip=""},
|
||||
}
|
||||
}
|
||||
ENT.ButtonMap["BatteryVoltage"] = {
|
||||
@@ -387,7 +381,7 @@ ENT.ButtonMap["BatteryVoltage"] = {
|
||||
scale = 0.0625,
|
||||
|
||||
buttons = {
|
||||
{ID = "!BatteryVoltage", x=0,y=0,w=60,h=60,tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BatteryVoltage"),ent:GetPackedRatio("BatteryVoltage")*100) end},
|
||||
{ID = "!BatteryVoltage", x=0,y=0,w=60,h=60,tooltip=""},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +397,6 @@ ENT.ButtonMap["DriverValveBLDisconnect"] = {
|
||||
var="DriverValveBLDisconnect",sndid="brake_disconnect",
|
||||
sndvol = 1, snd = function(val) return "disconnect_valve" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
states={"Train.Buttons.Closed","Train.Buttons.Opened"},
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -419,7 +412,6 @@ ENT.ButtonMap["DriverValveTLDisconnect"] = {
|
||||
var="DriverValveTLDisconnect",sndid="train_disconnect",
|
||||
sndvol = 1, snd = function(val) return val and "pneumo_TL_open" or "pneumo_TL_disconnect" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
states={"Train.Buttons.Closed","Train.Buttons.Opened"},
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -454,10 +446,13 @@ ENT.ButtonMap["FrontPneumatic"] = {
|
||||
width = 900,
|
||||
height = 100,
|
||||
scale = 0.1,
|
||||
hideseat=0.2,
|
||||
hide=true,
|
||||
screenHide = true,
|
||||
|
||||
buttons = {
|
||||
{ID = "FrontBrakeLineIsolationToggle",x=000, y=0, w=400, h=100, tooltip="",var="FbI",states={"Train.Buttons.Opened","Train.Buttons.Closed"}},
|
||||
{ID = "FrontTrainLineIsolationToggle",x=500, y=0, w=400, h=100, tooltip="",var="FtI",states={"Train.Buttons.Opened","Train.Buttons.Closed"}},
|
||||
{ID = "FrontBrakeLineIsolationToggle",x=000, y=0, w=400, h=100, tooltip=""},
|
||||
{ID = "FrontTrainLineIsolationToggle",x=500, y=0, w=400, h=100, tooltip=""},
|
||||
}
|
||||
}
|
||||
ENT.ClientProps["FrontBrake"] = {--
|
||||
@@ -480,10 +475,13 @@ ENT.ButtonMap["RearPneumatic"] = {
|
||||
width = 900,
|
||||
height = 100,
|
||||
scale = 0.1,
|
||||
hideseat=0.2,
|
||||
hide=true,
|
||||
screenHide = true,
|
||||
|
||||
buttons = {
|
||||
{ID = "RearBrakeLineIsolationToggle",x=000, y=0, w=400, h=100, tooltip="",var="RbI",states={"Train.Buttons.Opened","Train.Buttons.Closed"}},
|
||||
{ID = "RearTrainLineIsolationToggle",x=500, y=0, w=400, h=100, tooltip="",var="RtI",states={"Train.Buttons.Opened","Train.Buttons.Closed"}},
|
||||
{ID = "RearBrakeLineIsolationToggle",x=000, y=0, w=400, h=100, tooltip=""},
|
||||
{ID = "RearTrainLineIsolationToggle",x=500, y=0, w=400, h=100, tooltip=""},
|
||||
}
|
||||
}
|
||||
ENT.ClientProps["RearTrain"] = {--
|
||||
@@ -513,7 +511,6 @@ ENT.ButtonMap["GV"] = {
|
||||
var="GV",sndid = "gv",
|
||||
sndvol = 0.8,sndmin = 80, sndmax = 1e3/3, sndang = Angle(-90,0,0),
|
||||
snd = function(val) return val and "gv_f" or "gv_b" end,
|
||||
states={"Train.Buttons.Disconnected","Train.Buttons.On"}
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -543,7 +540,7 @@ ENT.ButtonMap["AirDistributor"] = {
|
||||
screenHide = true,
|
||||
|
||||
buttons = {
|
||||
{ID = "AirDistributorDisconnectToggle",x=0, y=0, w= 170,h = 260, tooltip="",var="AD",states={"Train.Buttons.On","Train.Buttons.Off"}},
|
||||
{ID = "AirDistributorDisconnectToggle",x=0, y=0, w= 170,h = 260, tooltip=""},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,12 +554,12 @@ ENT.ButtonMap["UAVAPanel"] = {
|
||||
|
||||
buttons = {
|
||||
{ID = "UAVAToggle",x=0, y=0, w=60, h=170, tooltip="", model = {
|
||||
plomb = {var="UAVAPl", ID="UAVAPl"},
|
||||
plomb = {model = "models/metrostroi_train/81/plomb.mdl",ang=-20,x=6,y=65,z=-122,var="UAVAPl", ID="UAVAPl"},
|
||||
var="UAVA",
|
||||
sndid="UAVALever",sndvol = 1, snd = function(val) return val and "uava_on" or "uava_off" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
}},
|
||||
{ID = "UAVACToggle",x=60, y=0, w=120, h=170, tooltip="",var="UAVAC",states={"Train.Buttons.UAVAOff","Train.Buttons.UAVAOn"}},
|
||||
{ID = "UAVAContactSet",x=60, y=0, w=120, h=170, tooltip=""},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,7 +598,6 @@ ENT.ButtonMap["FrontDoor"] = {
|
||||
var="door1",sndid="door1",
|
||||
sndvol = 1, snd = function(val) return val and "cab_door_open" or "cab_door_close" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
noTooltip = true,
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -617,7 +613,6 @@ ENT.ButtonMap["CabinDoor"] = {
|
||||
var="door4",sndid="door4",
|
||||
sndvol = 1, snd = function(val) return val and "cab_door_open" or "cab_door_close" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
noTooltip = true,
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -633,7 +628,6 @@ ENT.ButtonMap["PassengerDoor"] = {
|
||||
var="door3",sndid="door3",
|
||||
sndvol = 1, snd = function(val) return val and "cab_door_open" or "cab_door_close" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
noTooltip = true,
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -659,7 +653,6 @@ ENT.ButtonMap["RearDoor"] = {
|
||||
var="door2",sndid="door2",
|
||||
sndvol = 1, snd = function(val) return val and "cab_door_open" or "cab_door_close" end,
|
||||
sndmin = 90, sndmax = 1e3, sndang = Angle(-90,0,0),
|
||||
noTooltip = true,
|
||||
}},
|
||||
}
|
||||
}
|
||||
@@ -966,22 +959,7 @@ ENT.ClientProps["WhiteLights"] = {
|
||||
|
||||
ENT.Lights = {
|
||||
[1] = { "headlight", Vector(475,0,-20), Angle(0,0,0), Color(188,130,88), brightness = 5 ,fov = 90, texture = "models/metrostroi_train/equipment/headlight",shadows = 1,headlight=true},
|
||||
[22] = { "headlight", Vector(450,-40.5,40.2), Angle(90,0,0), Color(255,130,88), fov=125,farz=80,brightness = 2,shadows = 1, texture = "models/metrostroi_train/equipment/headlight", hidden = "Lamps_pult"},
|
||||
|
||||
[9] = { "dynamiclight", Vector(200, 0, -5), Angle(0,0,0), Color(255, 176, 59), brightness = 2, distance = 200},
|
||||
[10] = { "dynamiclight", Vector(-150, 0, -5), Angle(0,0,0), Color(255, 176, 59), brightness = 2, distance = 200},
|
||||
[11] = { "dynamiclight", Vector( 200, 0, -5), Angle(0,0,0), Color(255, 176, 59), brightness = 4, distance = 260},
|
||||
[12] = { "dynamiclight", Vector( 0, 0, -5), Angle(0,0,0), Color(255, 176, 59), brightness = 4, distance = 260},
|
||||
[13] = { "dynamiclight", Vector(-260, 0, -5), Angle(0,0,0), Color(255, 176, 59), brightness = 4, distance = 260},
|
||||
|
||||
[23] = { "dynamiclight", Vector(425,0,35), Angle(0,0,0), Color(252, 157, 77), brightness = 0.0005, distance = 600, hidden = "salon2"},
|
||||
-- Interior
|
||||
[30] = { "light", Vector(465+5 , -47, -41), Angle(0,0,0), Color(255,220,180), brightness = 0.2, scale = 1.5, texture = "sprites/light_glow02", size = 2 },
|
||||
[31] = { "light", Vector(465+5 , 47, -41), Angle(0,0,0), Color(255,220,180), brightness = 0.2, scale = 1.5, texture = "sprites/light_glow02", size = 2 },
|
||||
[32] = { "light", Vector(465+5 , 0, 46), Angle(0,0,0), Color(255,220,180), brightness = 0.2, scale = 2, texture = "sprites/light_glow02", size = 2 },
|
||||
|
||||
Lamps_pult = {"light", Vector(450,-55,31), Angle(0,0,0),Color(255,220,180),brightness = 0.35,scale = 0.4, texture = "sprites/light_glow02", hidden = "Lamps_pult"},
|
||||
Lamps_cab = {"light", Vector(412,0,42.5), Angle(0,0,0),Color(255,220,180),brightness = 0.25,scale = 0.3, texture = "sprites/light_glow02", hidden = "Lamps_cab1"},
|
||||
[22] = { "headlight", Vector(450,-40.5,40.2), Angle(90,0,0), Color(255,130,88), hfov=90, vfov=90,farz=62,brightness = 5,shadows = 1, texture = "models/metrostroi_train/equipment/headlight2"},
|
||||
}
|
||||
function ENT:Initialize()
|
||||
self.BaseClass.Initialize(self)
|
||||
@@ -1034,40 +1012,18 @@ function ENT:Think()
|
||||
end
|
||||
self.BrakeAngleSND = BAsnd
|
||||
end
|
||||
|
||||
local Lamps = self:GetPackedRatio("LampsStrength")
|
||||
local half1 = self:GetPackedBool("Lamps_half1")
|
||||
local half2 = self:GetPackedBool("Lamps_half2")
|
||||
local emer1 = self:GetPackedBool("lamps_emer1")
|
||||
local emer2 = self:GetPackedBool("Lamps_emer2")
|
||||
|
||||
local emer1S = self:Animate("lamps_emer1",(not half2 and emer1) and 1 or 0,0,1,5,false)
|
||||
local cab1S = self:Animate("lamps_cab1",emer1 and 1 or 0,0,1,5,false)
|
||||
local emer2S = self:Animate("lamps_emer2",(not half2 and not half1 and emer2) and 1 or 0,0,1,5,false)
|
||||
local half1S = self:Animate("lamps_half1",half1 and 0.4+Lamps*0.6 or 0,0,1,5,false)
|
||||
local half2S = self:Animate("lamps_half2",half2 and 0.4+Lamps*0.6 or 0,0,1,5,false)
|
||||
|
||||
self:ShowHideSmooth("Lamps_emer1",emer1S)
|
||||
self:ShowHideSmooth("Lamps_cab1",cab1S)
|
||||
self:ShowHideSmooth("Lamps_emer2",emer2S)
|
||||
self:ShowHideSmooth("Lamps_half1",half1S,Color(255,105+half1S*150,105+half1S*150))
|
||||
self:ShowHideSmooth("Lamps_half2",half2S,Color(255,105+half2S*150,105+half2S*150))
|
||||
|
||||
self:SetLightPower(23, cab1S > 0,cab1S)
|
||||
self:SetLightPower("Lamps_cab", cab1S > 0,cab1S)
|
||||
if not half1 then
|
||||
self:SetLightPower(9,emer1S > 0,emer1S*0.2+emer2S*0.8)
|
||||
self:SetLightPower(10,emer2S > 0,emer2S)
|
||||
self:SetLightPower(11, false)
|
||||
self:SetLightPower(12, false)
|
||||
self:SetLightPower(13, false)
|
||||
else
|
||||
self:SetLightPower(9,false)
|
||||
self:SetLightPower(10,false)
|
||||
self:SetLightPower(11, half1S > 0, half1S*0.3+half2S*0.7)
|
||||
self:SetLightPower(12, half1S > 0, half1S*0.3+half2S*0.7)
|
||||
self:SetLightPower(13, half1S > 0, half1S*0.3+half2S*0.7)
|
||||
end
|
||||
self:ShowHideSmooth("Lamps_emer1",self:Animate("lamps_emer1",(not half2 and emer1) and 1 or 0,0,1,5,false))
|
||||
self:ShowHideSmooth("Lamps_cab1",self:Animate("lamps_cab1",emer1 and 1 or 0,0,1,5,false))
|
||||
self:ShowHideSmooth("Lamps_emer2",self:Animate("lamps_emer2",(not half2 and not half1 and emer2) and 1 or 0,0,1,5,false))
|
||||
local half1 = self:Animate("lamps_half1",half1 and 0.4+Lamps*0.6 or 0,0,1,5,false)
|
||||
local half2 = self:Animate("lamps_half2",half2 and 0.4+Lamps*0.6 or 0,0,1,5,false)
|
||||
self:ShowHideSmooth("Lamps_half1",half1,Color(255,105+half1*150,105+half1*150))
|
||||
self:ShowHideSmooth("Lamps_half2",half2,Color(255,105+half2*150,105+half2*150))
|
||||
|
||||
self:Animate("UAVALever", self:GetPackedBool("UAVA") and 1 or 0, 0,0.6, 128, 3,false)
|
||||
self:Animate("EmergencyBrakeValve", self:GetPackedBool("EmergencyBrakeValve") and 1 or 0, 0.5,0, 64, 3,false)
|
||||
@@ -1080,14 +1036,10 @@ function ENT:Think()
|
||||
|
||||
self:ShowHideSmooth("WhiteLights",HL1)
|
||||
self:ShowHideSmooth("DistantLights",HL2)
|
||||
self:SetLightPower(30,HL1 > 0,HL1)
|
||||
self:SetLightPower(31,HL1 > 0,HL1)
|
||||
self:SetLightPower(32,HL2 > 0,HL2)
|
||||
|
||||
local PL = HL1*self:Animate("lamps_pult",self:GetPackedBool("PanelLights") and 1 or 0,0,1,12,false)
|
||||
self:ShowHideSmooth("Lamps_pult",PL)
|
||||
self:SetLightPower(22,PL>0,PL)
|
||||
self:SetLightPower("Lamps_pult",PL>0,PL)
|
||||
self:SetLightPower(22,IsValid(self.ClientEnts.Lamps_pult) and PL>0,PL)
|
||||
|
||||
local bright = HL1*0.3+HL2*0.7
|
||||
self:SetLightPower(1,bright>0,bright)
|
||||
@@ -1214,6 +1166,7 @@ function ENT:Think()
|
||||
--self.StreetCoeff = 0
|
||||
local rollingi = math.min(1,self.TunnelCoeff+math.Clamp((self.StreetCoeff-0.82)/0.3,0,1))
|
||||
local rollings = math.max(self.TunnelCoeff*1,self.StreetCoeff)
|
||||
--if self:EntIndex() == 3239 then LocalPlayer():ChatPrint(Format("T: %.2f, S: %.2f",rollingi,rollings)) end
|
||||
-- Brake-related sounds
|
||||
local dT = self.DeltaTime
|
||||
local speed = self:GetPackedRatio("Speed")*100.0
|
||||
@@ -1291,9 +1244,9 @@ function ENT:Think()
|
||||
self:SetSoundState("rk",(CurTime() - (self.RKTimer or 0)) < 0.2 and 0.7 or 0,1)
|
||||
|
||||
local work = self:GetPackedBool("AnnPlay")
|
||||
local noise = self:GetNW2Int("AnnouncerBuzz",-1) > 0
|
||||
local noise = self:GetNW2Bool("AnnouncerBuzz",false)
|
||||
self.NoiseVolume = self.NoiseVolume or 0
|
||||
local noisevolume = 1
|
||||
local noisevolume = 0
|
||||
if self.Sounds["announcer1"] and IsValid(self.Sounds["announcer1"]) then noisevolume = (1-(self.Sounds["announcer1"]:GetLevel())*math.Rand(0.9,3))*1 end
|
||||
if self.NoiseVolume > noisevolume then
|
||||
self.NoiseVolume = math.Clamp(self.NoiseVolume + 8*(noisevolume-self.NoiseVolume)*dT,0.1,1)
|
||||
@@ -1304,18 +1257,14 @@ function ENT:Think()
|
||||
for i=1,2 do
|
||||
self:SetSoundState(Format("announcer_noise%d_%d",i,k),noise and self.NoiseVolume*(v[3] or 1) or 0,1)
|
||||
end
|
||||
if IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(work and (v[3] or 1) or 0) end
|
||||
if self.Sounds["announcer"..k] and IsValid(self.Sounds["announcer"..k]) then self.Sounds["announcer"..k]:SetVolume(work and (v[3] or 1) or 0) end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnAnnouncer(volume)
|
||||
return self:GetPackedBool("AnnPlay") and volume or 0
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self.BaseClass.Draw(self)
|
||||
end
|
||||
function ENT:DrawPost()
|
||||
function ENT:DrawPost(special)
|
||||
self:DrawOnPanel("AirDistributor",function()
|
||||
draw.DrawText(self:GetNW2Bool("AD") and "Air Distributor ON" or "Air Distributor OFF","Trebuchet24",0,0,Color(0,0,0,255))
|
||||
end)
|
||||
@@ -1373,9 +1322,6 @@ function ENT:OnPlay(soundid,location,range,pitch)
|
||||
self:PlayOnce("brake_b",location,range,pitch)
|
||||
return
|
||||
end
|
||||
if soundid == "UAVAC" then
|
||||
return "uava_reset",location,range,pitch
|
||||
end
|
||||
end
|
||||
return soundid,location,range,pitch
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user