From b7697853d04a8cdf2c8ac60abce7ebf3a701fa13 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 26 Apr 2022 19:34:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B5=20=D0=BF=D0=BE=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=9A=D0=9C=20=E2=84=96=20013=20=D0=B8=20334,?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B7=D0=BE=D0=B1=D1=89=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=8B=D1=85=20=D0=BA=D1=80=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B8=20=D0=B4=D0=B2=D0=B5=D1=80=D0=B5=D0=B9=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D1=81=D0=BF=D0=B0=D0=B2=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_lvz/init.lua | 2 +- .../gmod_subway_81-717_lvz/shared.lua | 12 ++++++++- .../gmod_subway_81-717_lvz_custom.lua | 18 +++++++++++-- .../gmod_subway_81-717_mvm/shared.lua | 25 ++++++++++++++++-- .../gmod_subway_81-717_mvm_custom.lua | 26 ++++++++++++++++--- 5 files changed, 74 insertions(+), 9 deletions(-) diff --git a/lua/entities/gmod_subway_81-717_lvz/init.lua b/lua/entities/gmod_subway_81-717_lvz/init.lua index 9c0de18..428bbed 100644 --- a/lua/entities/gmod_subway_81-717_lvz/init.lua +++ b/lua/entities/gmod_subway_81-717_lvz/init.lua @@ -680,7 +680,7 @@ function ENT:Think() else self:SetPackedRatio("BLPressure", self.Pneumatic.BrakeLinePressure/16.0) end - self:SetPackedRatio("TLPressure", self.Pneumatic.TrainLinePressure/16.0) + self:SetPackedRatio("TLPressure", self.Pneumatic.AuxiliaryLinePressure/16.0) self:SetPackedRatio("BCPressure", self.Pneumatic.BrakeCylinderPressure/6.0) self:SetPackedRatio("EnginesVoltage", self.Electric.Aux750V/1000.0) self:SetPackedRatio("EnginesCurrent2", 0.5 + 0.5*(self.Electric.I13/500.0)) diff --git a/lua/entities/gmod_subway_81-717_lvz/shared.lua b/lua/entities/gmod_subway_81-717_lvz/shared.lua index 5ec9bde..decc626 100644 --- a/lua/entities/gmod_subway_81-717_lvz/shared.lua +++ b/lua/entities/gmod_subway_81-717_lvz/shared.lua @@ -992,7 +992,7 @@ ENT.Spawner = { if ent._SpawnerStarted~=val then ent.VB:TriggerInput("Set",val<=2 and 1 or 0) ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) - if ent.AR63 then + if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() ent.OhrSig:TriggerInput("Set",val<4 and 1 or 0) ent.A53:TriggerInput("Set",val<=3 and 1 or 0) @@ -1018,6 +1018,16 @@ ENT.Spawner = { ent.L_3:TriggerInput("Set",val==1 and 1 or 0) ent.L_4:TriggerInput("Set",val==1 and 1 or 0) ent.EPK:TriggerInput("Set",(ent.Plombs.RC1 and val==1) and 1 or 0) + timer.Simple(1,function() + if ent:GetNW2Int("Crane") == 1 then--ent.Pneumatic.ValveType == 2 then + ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val~=2) and (not first and 7 or 2) or 7) + else + ent.DriverValveBLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.DriverValveTLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val==4 and first) and 2 or 1) + end + end) _LastSpawner=CurTime() ent.CabinDoor = val==4 and first ent.PassengerDoor = val==4 diff --git a/lua/entities/gmod_subway_81-717_lvz_custom.lua b/lua/entities/gmod_subway_81-717_lvz_custom.lua index e973c6c..afbb032 100644 --- a/lua/entities/gmod_subway_81-717_lvz_custom.lua +++ b/lua/entities/gmod_subway_81-717_lvz_custom.lua @@ -64,11 +64,12 @@ ENT.Spawner = { if ent._SpawnerStarted~=val then ent.VB:TriggerInput("Set",val<=2 and 1 or 0) ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) - if ent.AR63 then + if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() ent.OhrSig:TriggerInput("Set",val<4 and 1 or 0) ent.A53:TriggerInput("Set",val<=3 and 1 or 0) ent.AR63:TriggerInput("Set",val<=2 and 1 or 0) + --ent.A75:TriggerInput("Set",0) ent.R_UNch:TriggerInput("Set",val==1 and 1 or 0) ent.R_UPO:TriggerInput("Set",val<=2 and 1 or 0) if ent.Plombs.RC1 and val<=2 then @@ -90,6 +91,16 @@ ENT.Spawner = { ent.L_3:TriggerInput("Set",val==1 and 1 or 0) ent.L_4:TriggerInput("Set",val==1 and 1 or 0) ent.EPK:TriggerInput("Set",(ent.Plombs.RC1 and val==1) and 1 or 0) + timer.Simple(1,function() + if ent:GetNW2Int("Crane") == 1 then--ent.Pneumatic.ValveType == 2 then + ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val~=2) and (not first and 7 or 2) or 7) + else + ent.DriverValveBLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.DriverValveTLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val==4 and first) and 2 or 1) + end + end) _LastSpawner=CurTime() ent.CabinDoor = val==4 and first ent.PassengerDoor = val==4 @@ -107,7 +118,10 @@ ENT.Spawner = { ent.GV:TriggerInput("Set",val<4 and 1 or 0) ent._SpawnerStarted = val end + --ent.Pneumatic.TrainLinePressure = val==3 and math.random()*4 or val==2 and 4.5+math.random()*3 or 7.6+math.random()*0.6 + --if val==4 then ent.Pneumatic.BrakeLinePressure = 5.2 end ent.Pneumatic.TrainLinePressure = val==3 and math.random()*4 or val==2 and 4.5+math.random()*3 or 7.6+math.random()*0.6 - if val==4 then ent.Pneumatic.BrakeLinePressure = 5.2 end + ent.Pneumatic.BrakeLinePressure = val == 4 and 5.2 or val == 1 and 2.3 or math.min(ent.Pneumatic.TrainLinePressure+0.25,math.random()*4) + ent.Pneumatic.WorkingChamberPressure = val==3 and math.random()*1.0 or val==2 and 4.0+math.random()*1.0 or 5.2 end}, } diff --git a/lua/entities/gmod_subway_81-717_mvm/shared.lua b/lua/entities/gmod_subway_81-717_mvm/shared.lua index 3b92104..7ddaca7 100644 --- a/lua/entities/gmod_subway_81-717_mvm/shared.lua +++ b/lua/entities/gmod_subway_81-717_mvm/shared.lua @@ -965,9 +965,10 @@ ENT.Spawner = { ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() - ent.A53:TriggerInput("Set",val<=2 and 1 or 0) + ent.A53:TriggerInput("Set",val<=3 and 1 or 0) ent.A49:TriggerInput("Set",val<=2 and 1 or 0) ent.AR63:TriggerInput("Set",val<=2 and 1 or 0) + ent.A75:TriggerInput("Set",0) ent.R_UNch:TriggerInput("Set",val==1 and 1 or 0) ent.R_Radio:TriggerInput("Set",val==1 and 1 or 0) ent.BPSNon:TriggerInput("Set",(val==1 and first) and 1 or 0) @@ -978,7 +979,16 @@ ENT.Spawner = { ent.L_3:TriggerInput("Set",val==1 and 1 or 0) ent.L_4:TriggerInput("Set",val==1 and 1 or 0) ent.EPK:TriggerInput("Set",(ent.Plombs.RC1 and val==1) and 1 or 0) - ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + timer.Simple(1,function() + if ent:GetNW2Int("Crane") == 2 then--ent.Pneumatic.ValveType == 2 then + ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val~=2) and (not first and 6 or 2) or 6) + else + ent.DriverValveBLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.DriverValveTLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val==4 and first) and 2 or 1) + end + end) _LastSpawner=CurTime() ent.CabinDoor = val==4 and first ent.PassengerDoor = val==4 @@ -993,6 +1003,17 @@ ENT.Spawner = { ent.BV:TriggerInput("Enable",1) end) end + if val == 4 then + ent.Pneumatic.RightDoorState = {1,1,1,1} + ent.Pneumatic.LeftDoorState = {1,1,1,1} + ent.Pneumatic.DoorRight = true + ent.Pneumatic.DoorLeft = true + else + ent.Pneumatic.RightDoorState = {0,0,0,0} + ent.Pneumatic.LeftDoorState = {0,0,0,0} + ent.Pneumatic.DoorRight = false + ent.Pneumatic.DoorLeft = false + end ent.GV:TriggerInput("Set",val<4 and 1 or 0) ent._SpawnerStarted = val end diff --git a/lua/entities/gmod_subway_81-717_mvm_custom.lua b/lua/entities/gmod_subway_81-717_mvm_custom.lua index 843d2be..b086a77 100644 --- a/lua/entities/gmod_subway_81-717_mvm_custom.lua +++ b/lua/entities/gmod_subway_81-717_mvm_custom.lua @@ -77,11 +77,12 @@ ENT.Spawner = { if ent._SpawnerStarted~=val then ent.VB:TriggerInput("Set",val<=2 and 1 or 0) ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0) - if ent.AR63 then + if ent.AR63 then local first = i==1 or _LastSpawner~=CurTime() - ent.A53:TriggerInput("Set",val<=2 and 1 or 0) + ent.A53:TriggerInput("Set",val<=3 and 1 or 0) ent.A49:TriggerInput("Set",val<=2 and 1 or 0) ent.AR63:TriggerInput("Set",val<=2 and 1 or 0) + ent.A75:TriggerInput("Set",0) ent.R_UNch:TriggerInput("Set",val==1 and 1 or 0) ent.R_Radio:TriggerInput("Set",val==1 and 1 or 0) ent.BPSNon:TriggerInput("Set",(val==1 and first) and 1 or 0) @@ -92,7 +93,15 @@ ENT.Spawner = { ent.L_3:TriggerInput("Set",val==1 and 1 or 0) ent.L_4:TriggerInput("Set",val==1 and 1 or 0) ent.EPK:TriggerInput("Set",(ent.Plombs.RC1 and val==1) and 1 or 0) - ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + local kran = ent:GetNW2String("Cran") + if kran == "2" then--ent.Pneumatic.ValveType == 2 then + ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val~=2) and (not first and 6 or 2) or 6) + else + ent.DriverValveBLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.DriverValveTLDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) + ent.Pneumatic:TriggerInput("BrakeSet",(val==4 and first) and 2 or 1) + end _LastSpawner=CurTime() ent.CabinDoor = val==4 and first ent.PassengerDoor = val==4 @@ -107,6 +116,17 @@ ENT.Spawner = { ent.BV:TriggerInput("Enable",1) end) end + if val == 4 then + ent.Pneumatic.RightDoorState = {1,1,1,1} + ent.Pneumatic.LeftDoorState = {1,1,1,1} + ent.Pneumatic.DoorRight = true + ent.Pneumatic.DoorLeft = true + else + ent.Pneumatic.RightDoorState = {0,0,0,0} + ent.Pneumatic.LeftDoorState = {0,0,0,0} + ent.Pneumatic.DoorRight = false + ent.Pneumatic.DoorLeft = false + end ent.GV:TriggerInput("Set",val<4 and 1 or 0) ent._SpawnerStarted = val end