Skip to content

Commit

Permalink
Merge pull request #421 from MattJeanes/dev
Browse files Browse the repository at this point in the history
March 2021 Update 2
  • Loading branch information
MattJeanes authored Mar 18, 2021
2 parents 62caeae + f02a629 commit 15910ef
Show file tree
Hide file tree
Showing 41 changed files with 82 additions and 68 deletions.
4 changes: 2 additions & 2 deletions lua/entities/gmod_tardis/modules/cl_scanner.lua
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion lua/entities/gmod_tardis/modules/sh_lock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 6 additions & 0 deletions lua/entities/gmod_tardis/modules/sh_outside.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(...)
Expand Down
6 changes: 6 additions & 0 deletions lua/entities/gmod_tardis/modules/sh_portals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
86 changes: 35 additions & 51 deletions lua/entities/gmod_tardis/modules/sh_teleport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
21 changes: 19 additions & 2 deletions lua/entities/gmod_tardis/modules/sh_vortex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions lua/tardis/interiors/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -97,7 +98,7 @@ T.Exterior={
}
},
Teleport={
SequenceSpeed=0.85,
SequenceSpeed=0.77,
SequenceSpeedFast=0.935,
DematSequence={
150,
Expand Down
4 changes: 2 additions & 2 deletions lua/tardis/interiors/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/parts/default/flightlever.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/parts/default/float.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/parts/default/hads.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/parts/default/handbrake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion lua/tardis/parts/default/isomorphic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/parts/default/physbrake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/parts/default/throttle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lua/tardis/parts/door.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added sound/drmatt/tardis/door_locked.wav
Binary file not shown.
Binary file removed sound/tardis/advflight_bad.wav
Binary file not shown.
Binary file removed sound/tardis/advflight_good.wav
Binary file not shown.
Binary file removed sound/tardis/cloisterbell_loop.wav
Binary file not shown.
Binary file removed sound/tardis/demat.wav
Binary file not shown.
Binary file removed sound/tardis/door.wav
Binary file not shown.
Binary file removed sound/tardis/door2.wav
Binary file not shown.
Binary file removed sound/tardis/emergencyland.wav
Binary file not shown.
Binary file removed sound/tardis/fast_demat.wav
Binary file not shown.
Binary file removed sound/tardis/fastreturn_demat.wav
Binary file not shown.
Binary file removed sound/tardis/fastreturn_full.wav
Binary file not shown.
Binary file removed sound/tardis/fastreturn_mat.wav
Binary file not shown.
Binary file removed sound/tardis/flight_loop.wav
Binary file not shown.
Binary file removed sound/tardis/full.wav
Binary file not shown.
Binary file removed sound/tardis/lock.wav
Binary file not shown.
Binary file removed sound/tardis/mat.wav
Binary file not shown.
Binary file removed sound/tardis/phase_enable.wav
Binary file not shown.
Binary file removed sound/tardis/powerdown.wav
Binary file not shown.
Binary file removed sound/tardis/powerup.wav
Binary file not shown.
Binary file removed sound/tardis/repairfinish.wav
Binary file not shown.
Binary file removed sound/tardis/throttle.wav
Binary file not shown.

0 comments on commit 15910ef

Please sign in to comment.