diff --git a/lua/entities/gmod_tardis/modules/cl_scanner.lua b/lua/entities/gmod_tardis/modules/cl_scanner.lua index 8ecdebb0a..c9403d22e 100644 --- a/lua/entities/gmod_tardis/modules/cl_scanner.lua +++ b/lua/entities/gmod_tardis/modules/cl_scanner.lua @@ -1,5 +1,5 @@ -ENT:AddHook("VortexEnabled", "scanner", function(self) +ENT:AddHook("ShouldVortexIgnoreZ", "scanner", function(self) if self.interior and self.interior.scannerrender then - return false + return true end end) \ No newline at end of file diff --git a/lua/entities/gmod_tardis/modules/sh_lock.lua b/lua/entities/gmod_tardis/modules/sh_lock.lua index 5e0056a02..f36ad887d 100644 --- a/lua/entities/gmod_tardis/modules/sh_lock.lua +++ b/lua/entities/gmod_tardis/modules/sh_lock.lua @@ -54,7 +54,7 @@ if SERVER then if self:CallHook("LockedUse",a,c)==nil then a:ChatPrint("This TARDIS is locked.") end - self:EmitSound("doors/door_lock_1.wav") + self:EmitSound(self.metadata.Exterior.Sounds.Door.locked) end end) diff --git a/lua/entities/gmod_tardis/modules/sh_outside.lua b/lua/entities/gmod_tardis/modules/sh_outside.lua index 268987beb..6dd4753b9 100644 --- a/lua/entities/gmod_tardis/modules/sh_outside.lua +++ b/lua/entities/gmod_tardis/modules/sh_outside.lua @@ -95,6 +95,12 @@ else local enabled = net.ReadBool() self:CallHook("Outside",ply,enabled) end) + + ENT:AddHook("ShouldVortexIgnoreZ", "outside", function(self) + if LocalPlayer():GetTardisData("outside") then + return true + end + end) oldgetviewentity=oldgetviewentity or GetViewEntity function GetViewEntity(...) diff --git a/lua/entities/gmod_tardis/modules/sh_portals.lua b/lua/entities/gmod_tardis/modules/sh_portals.lua index f239614e9..388cd07f1 100644 --- a/lua/entities/gmod_tardis/modules/sh_portals.lua +++ b/lua/entities/gmod_tardis/modules/sh_portals.lua @@ -35,4 +35,10 @@ ENT:AddHook("TraceFilterPortal", "portals", function(self,portal) if self.interior and portal == self.interior.portals.exterior then return self.interior:GetPart("door") end +end) + +ENT:AddHook("ShouldVortexIgnoreZ", "portals", function(self) + if self.interior and wp.drawingent==self.interior.portals.interior then + return true + end end) \ No newline at end of file diff --git a/lua/entities/gmod_tardis/modules/sh_teleport.lua b/lua/entities/gmod_tardis/modules/sh_teleport.lua index e179fbc4f..b1e1c9aa1 100644 --- a/lua/entities/gmod_tardis/modules/sh_teleport.lua +++ b/lua/entities/gmod_tardis/modules/sh_teleport.lua @@ -75,21 +75,18 @@ if SERVER then for k,v in pairs(self.parts) do v:DrawShadow(false) end - local attached = constraint.GetAllConstrainedEntities(self) - if attached then - for k,v in pairs(attached) do - if v.TardisPart or v==self then - attached[k]=nil - end - end - for k,v in pairs(attached) do - local a=v:GetColor().a - if not (a==255) then - v.tempa=a + local constrained = constraint.GetAllConstrainedEntities(self) + local attached + if constrained then + for k,v in pairs(constrained) do + if not (v.TardisPart or v==self) then + local a=v:GetColor().a + if not attached then attached = {} end + attached[k] = a end end end - self:SetData("demat-attached",attached) + self:SetData("demat-attached",attached,true) if callback then callback(true) end end end) @@ -125,10 +122,10 @@ if SERVER then local attached=self:GetData("demat-attached") if attached then for k,v in pairs(attached) do - if IsValid(v) and not IsValid(v:GetParent()) then - v.telepos=v:GetPos()-self:GetPos() - if v:GetClass()=="gmod_hoverball" then -- fixes hoverballs spazzing out - v:SetTargetZ( (pos-self:GetPos()).z+v:GetTargetZ() ) + if IsValid(k) and not IsValid(k:GetParent()) then + k.telepos=k:GetPos()-self:GetPos() + if k:GetClass()=="gmod_hoverball" then -- fixes hoverballs spazzing out + k:SetTargetZ( (pos-self:GetPos()).z+k:GetTargetZ() ) end end end @@ -137,26 +134,22 @@ if SERVER then self:SetAngles(ang) if attached then for k,v in pairs(attached) do - if IsValid(v) and not IsValid(v:GetParent()) then - if v:IsRagdoll() then - for i=0,v:GetPhysicsObjectCount() do - local bone=v:GetPhysicsObjectNum(i) + if IsValid(k) and not IsValid(k:GetParent()) then + if k:IsRagdoll() then + for i=0,k:GetPhysicsObjectCount() do + local bone=k:GetPhysicsObjectNum(i) if IsValid(bone) then - bone:SetPos(self:GetPos()+v.telepos) + bone:SetPos(self:GetPos()+k.telepos) end end end - v:SetPos(self:GetPos()+v.telepos) - v.telepos=nil - local phys=v:GetPhysicsObject() + k:SetPos(self:GetPos()+k.telepos) + k.telepos=nil + local phys=k:GetPhysicsObject() if phys and IsValid(phys) then - if not v.frozen and not v.physlocked then - phys:EnableMotion(true) - end - v:SetSolid(SOLID_VPHYSICS) + k:SetSolid(SOLID_VPHYSICS) end - v.frozen=nil - v.nocollide=nil + k.nocollide=nil end end end @@ -202,14 +195,10 @@ if SERVER then local attached=self:GetData("demat-attached") if attached then for k,v in pairs(attached) do - if IsValid(v) and not IsValid(v:GetParent()) then - local phys=v:GetPhysicsObject() + if IsValid(k) and not IsValid(k:GetParent()) then + local phys=k:GetPhysicsObject() if phys and IsValid(phys) then - if not phys:IsMotionEnabled() then - v.frozen=true - end - phys:EnableMotion(false) - v:SetSolid(SOLID_NONE) + k:SetSolid(SOLID_NONE) end end end @@ -241,15 +230,12 @@ if SERVER then local attached=self:GetData("demat-attached") if attached then for k,v in pairs(attached) do - if IsValid(v) and v.tempa then - local col=v:GetColor() - col=Color(col.r,col.g,col.b,v.tempa) - v:SetColor(col) - v.tempa=nil + if IsValid(k) then + k:SetColor(ColorAlpha(k:GetColor(),v)) end end end - self:SetData("demat-attached") + self:SetData("demat-attached",nil,true) if self:GetData("fastreturn",false) then self:SetFastRemat(false) self:SetData("fastreturn",false) @@ -561,16 +547,14 @@ ENT:AddHook("Think","teleport",function(self,delta) local attached=self:GetData("demat-attached") if attached then for k,v in pairs(attached) do - if IsValid(v) then - local col=v:GetColor() - col=Color(col.r,col.g,col.b,alpha) - if not (v.tempa==0) then - if not (v:GetRenderMode()==RENDERMODE_TRANSALPHA) then - v:SetRenderMode(RENDERMODE_TRANSALPHA) + if IsValid(k) then + if not (v==0) then + if not (k:GetRenderMode()==RENDERMODE_TRANSALPHA) then + k:SetRenderMode(RENDERMODE_TRANSALPHA) end - v:SetColor(col) + k:SetColor(ColorAlpha(k:GetColor(),alpha)) end end end end -end) +end) \ No newline at end of file diff --git a/lua/entities/gmod_tardis/modules/sh_vortex.lua b/lua/entities/gmod_tardis/modules/sh_vortex.lua index bc8de6f0a..ece8e78de 100644 --- a/lua/entities/gmod_tardis/modules/sh_vortex.lua +++ b/lua/entities/gmod_tardis/modules/sh_vortex.lua @@ -131,7 +131,7 @@ else if TARDIS:GetExteriorEnt()==self and enabled then if (not (target == 0 and alpha == 0)) or vortexpart then render.SetBlend(alpha) - if alpha>0 and (LocalPlayer():GetTardisData("outside") or (self.interior and wp.drawingent==self.interior.portals.interior)) then + if alpha>0 and self:CallHook("ShouldVortexIgnoreZ") then cam.IgnoreZ(true) end end @@ -144,7 +144,24 @@ else local function dodraw(self,part) render.SetBlend(1) - if self:GetData("vortexalpha",0) then + local vortexalpha = self:GetData("vortexalpha",0) + if vortexalpha>0 then + if not part and TARDIS:GetExteriorEnt()==self then + local attached = self:GetData("demat-attached") + if attached then + local oldblend = render.GetBlend() + render.SetBlend(vortexalpha) + for k,v in pairs(attached) do + if IsValid(k) and k.DrawModel and v>0 then + local oldc = k:GetColor() + k:SetColor(ColorAlpha(oldc,v)) + k:DrawModel() + k:SetColor(oldc) + end + end + render.SetBlend(oldblend) + end + end cam.IgnoreZ(false) end end diff --git a/lua/tardis/interiors/base.lua b/lua/tardis/interiors/base.lua index 82e3161fb..d35dc59fb 100644 --- a/lua/tardis/interiors/base.lua +++ b/lua/tardis/interiors/base.lua @@ -84,7 +84,8 @@ T.Exterior={ Door={ enabled=true, open="drmatt/tardis/door_open.wav", - close="drmatt/tardis/door_close.wav" + close="drmatt/tardis/door_close.wav", + locked="drmatt/tardis/door_locked.wav" }, FlightLoop="drmatt/tardis/flight_loop.wav", }, @@ -97,7 +98,7 @@ T.Exterior={ } }, Teleport={ - SequenceSpeed=0.85, + SequenceSpeed=0.77, SequenceSpeedFast=0.935, DematSequence={ 150, diff --git a/lua/tardis/interiors/default.lua b/lua/tardis/interiors/default.lua index 9bfd8853b..3bcc8f68c 100644 --- a/lua/tardis/interiors/default.lua +++ b/lua/tardis/interiors/default.lua @@ -8,11 +8,11 @@ T.Interior={ Model="models/drmatt/tardis/interior.mdl", IdleSound={ { - path="tardis/interior_idle_loop.wav", + path="drmatt/tardis/default/interior_idle_loop.wav", volume=0.5 }, { - path="tardis/interior_idle2_loop.wav", + path="drmatt/tardis/default/interior_idle2_loop.wav", volume=0.5 } }, diff --git a/lua/tardis/parts/default/flightlever.lua b/lua/tardis/parts/default/flightlever.lua index e816c92e6..fc6d5f323 100644 --- a/lua/tardis/parts/default/flightlever.lua +++ b/lua/tardis/parts/default/flightlever.lua @@ -8,7 +8,7 @@ PART.Model = "models/drmatt/tardis/handbrake.mdl" PART.AutoSetup = true PART.Collision = true PART.Animate = true -PART.Sound = "tardis/control_handbrake.wav" +PART.Sound = "drmatt/tardis/default/control_handbrake.wav" if SERVER then function PART:Use(ply) diff --git a/lua/tardis/parts/default/float.lua b/lua/tardis/parts/default/float.lua index dce3dc0bf..ccc3a104a 100644 --- a/lua/tardis/parts/default/float.lua +++ b/lua/tardis/parts/default/float.lua @@ -8,7 +8,7 @@ PART.Model = "models/drmatt/tardis/handbrake.mdl" PART.AutoSetup = true PART.Collision = true PART.Animate = true -PART.Sound = "tardis/control_handbrake.wav" +PART.Sound = "drmatt/tardis/default/control_handbrake.wav" if SERVER then function PART:Use(ply) diff --git a/lua/tardis/parts/default/hads.lua b/lua/tardis/parts/default/hads.lua index a4e4cf0e9..e32f205d9 100644 --- a/lua/tardis/parts/default/hads.lua +++ b/lua/tardis/parts/default/hads.lua @@ -8,7 +8,7 @@ PART.Model = "models/drmatt/tardis/handbrake.mdl" PART.AutoSetup = true PART.Collision = true PART.Animate = true -PART.Sound = "tardis/control_handbrake.wav" +PART.Sound = "drmatt/tardis/default/control_handbrake.wav" if SERVER then function PART:Use(ply) diff --git a/lua/tardis/parts/default/handbrake.lua b/lua/tardis/parts/default/handbrake.lua index 51d40764f..b470f59be 100644 --- a/lua/tardis/parts/default/handbrake.lua +++ b/lua/tardis/parts/default/handbrake.lua @@ -8,6 +8,6 @@ PART.Model = "models/drmatt/tardis/handbrake.mdl" PART.AutoSetup = true PART.Collision = true PART.Animate = true -PART.Sound = "tardis/control_handbrake.wav" +PART.Sound = "drmatt/tardis/default/control_handbrake.wav" TARDIS:AddPart(PART) diff --git a/lua/tardis/parts/default/isomorphic.lua b/lua/tardis/parts/default/isomorphic.lua index ea703ab16..d055f4fab 100644 --- a/lua/tardis/parts/default/isomorphic.lua +++ b/lua/tardis/parts/default/isomorphic.lua @@ -8,7 +8,7 @@ PART.Model = "models/drmatt/tardis/handbrake.mdl" PART.AutoSetup = true PART.Collision = true PART.Animate = true -PART.Sound = "tardis/control_handbrake.wav" +PART.Sound = "drmatt/tardis/default/control_handbrake.wav" function PART:Use(ply) if ply~=self.interior:GetCreator() then diff --git a/lua/tardis/parts/default/physbrake.lua b/lua/tardis/parts/default/physbrake.lua index 422d978e7..c00984046 100644 --- a/lua/tardis/parts/default/physbrake.lua +++ b/lua/tardis/parts/default/physbrake.lua @@ -8,7 +8,7 @@ PART.Model = "models/drmatt/tardis/handbrake.mdl" PART.AutoSetup = true PART.Collision = true PART.Animate = true -PART.Sound = "tardis/control_handbrake.wav" +PART.Sound = "drmatt/tardis/default/control_handbrake.wav" if SERVER then function PART:Use(ply) diff --git a/lua/tardis/parts/default/throttle.lua b/lua/tardis/parts/default/throttle.lua index 135617b0c..15f7b9cec 100644 --- a/lua/tardis/parts/default/throttle.lua +++ b/lua/tardis/parts/default/throttle.lua @@ -8,7 +8,7 @@ PART.Model = "models/drmatt/tardis/throttle.mdl" PART.AutoSetup = true PART.Collision = true PART.Animate = true -PART.Sound = "tardis/control_throttle.wav" +PART.Sound = "drmatt/tardis/default/control_throttle.wav" if SERVER then function PART:Use(ply) diff --git a/lua/tardis/parts/door.lua b/lua/tardis/parts/door.lua index 0655922a2..6a9089fd7 100644 --- a/lua/tardis/parts/door.lua +++ b/lua/tardis/parts/door.lua @@ -45,7 +45,7 @@ if SERVER then if self.exterior:CallHook("LockedUse",a)==nil then a:ChatPrint("The doors are locked.") end - self:EmitSound("doors/door_lock_1.wav") + self:EmitSound(self.exterior.metadata.Exterior.Sounds.Door.locked) end else if a:KeyDown(IN_WALK) then diff --git a/sound/tardis/control_handbrake.wav b/sound/drmatt/tardis/default/control_handbrake.wav similarity index 100% rename from sound/tardis/control_handbrake.wav rename to sound/drmatt/tardis/default/control_handbrake.wav diff --git a/sound/tardis/control_throttle.wav b/sound/drmatt/tardis/default/control_throttle.wav similarity index 100% rename from sound/tardis/control_throttle.wav rename to sound/drmatt/tardis/default/control_throttle.wav diff --git a/sound/tardis/interior_idle2_loop.wav b/sound/drmatt/tardis/default/interior_idle2_loop.wav similarity index 100% rename from sound/tardis/interior_idle2_loop.wav rename to sound/drmatt/tardis/default/interior_idle2_loop.wav diff --git a/sound/tardis/interior_idle_loop.wav b/sound/drmatt/tardis/default/interior_idle_loop.wav similarity index 100% rename from sound/tardis/interior_idle_loop.wav rename to sound/drmatt/tardis/default/interior_idle_loop.wav diff --git a/sound/drmatt/tardis/door_locked.wav b/sound/drmatt/tardis/door_locked.wav new file mode 100644 index 000000000..305d4257e Binary files /dev/null and b/sound/drmatt/tardis/door_locked.wav differ diff --git a/sound/tardis/advflight_bad.wav b/sound/tardis/advflight_bad.wav deleted file mode 100644 index ac0027977..000000000 Binary files a/sound/tardis/advflight_bad.wav and /dev/null differ diff --git a/sound/tardis/advflight_good.wav b/sound/tardis/advflight_good.wav deleted file mode 100644 index 2c4b14710..000000000 Binary files a/sound/tardis/advflight_good.wav and /dev/null differ diff --git a/sound/tardis/cloisterbell_loop.wav b/sound/tardis/cloisterbell_loop.wav deleted file mode 100644 index 7fa3ea146..000000000 Binary files a/sound/tardis/cloisterbell_loop.wav and /dev/null differ diff --git a/sound/tardis/demat.wav b/sound/tardis/demat.wav deleted file mode 100644 index 4dce1f491..000000000 Binary files a/sound/tardis/demat.wav and /dev/null differ diff --git a/sound/tardis/door.wav b/sound/tardis/door.wav deleted file mode 100644 index 2c45a27a4..000000000 Binary files a/sound/tardis/door.wav and /dev/null differ diff --git a/sound/tardis/door2.wav b/sound/tardis/door2.wav deleted file mode 100644 index 6ec1a5148..000000000 Binary files a/sound/tardis/door2.wav and /dev/null differ diff --git a/sound/tardis/emergencyland.wav b/sound/tardis/emergencyland.wav deleted file mode 100644 index ed5b3c19e..000000000 Binary files a/sound/tardis/emergencyland.wav and /dev/null differ diff --git a/sound/tardis/fast_demat.wav b/sound/tardis/fast_demat.wav deleted file mode 100644 index 9cef5016d..000000000 Binary files a/sound/tardis/fast_demat.wav and /dev/null differ diff --git a/sound/tardis/fastreturn_demat.wav b/sound/tardis/fastreturn_demat.wav deleted file mode 100644 index 87017ac47..000000000 Binary files a/sound/tardis/fastreturn_demat.wav and /dev/null differ diff --git a/sound/tardis/fastreturn_full.wav b/sound/tardis/fastreturn_full.wav deleted file mode 100644 index cfc399195..000000000 Binary files a/sound/tardis/fastreturn_full.wav and /dev/null differ diff --git a/sound/tardis/fastreturn_mat.wav b/sound/tardis/fastreturn_mat.wav deleted file mode 100644 index 2e19f51d4..000000000 Binary files a/sound/tardis/fastreturn_mat.wav and /dev/null differ diff --git a/sound/tardis/flight_loop.wav b/sound/tardis/flight_loop.wav deleted file mode 100644 index 658485c4c..000000000 Binary files a/sound/tardis/flight_loop.wav and /dev/null differ diff --git a/sound/tardis/full.wav b/sound/tardis/full.wav deleted file mode 100644 index 67af7ec89..000000000 Binary files a/sound/tardis/full.wav and /dev/null differ diff --git a/sound/tardis/lock.wav b/sound/tardis/lock.wav deleted file mode 100644 index 522ee3da1..000000000 Binary files a/sound/tardis/lock.wav and /dev/null differ diff --git a/sound/tardis/mat.wav b/sound/tardis/mat.wav deleted file mode 100644 index 335f0201c..000000000 Binary files a/sound/tardis/mat.wav and /dev/null differ diff --git a/sound/tardis/phase_enable.wav b/sound/tardis/phase_enable.wav deleted file mode 100644 index ade526114..000000000 Binary files a/sound/tardis/phase_enable.wav and /dev/null differ diff --git a/sound/tardis/powerdown.wav b/sound/tardis/powerdown.wav deleted file mode 100644 index c22fbf341..000000000 Binary files a/sound/tardis/powerdown.wav and /dev/null differ diff --git a/sound/tardis/powerup.wav b/sound/tardis/powerup.wav deleted file mode 100644 index 56154f6ca..000000000 Binary files a/sound/tardis/powerup.wav and /dev/null differ diff --git a/sound/tardis/repairfinish.wav b/sound/tardis/repairfinish.wav deleted file mode 100644 index 4eb19a339..000000000 Binary files a/sound/tardis/repairfinish.wav and /dev/null differ diff --git a/sound/tardis/throttle.wav b/sound/tardis/throttle.wav deleted file mode 100644 index 9bdf3f4ac..000000000 Binary files a/sound/tardis/throttle.wav and /dev/null differ