diff --git a/lua/slashco/slasher/tyler.lua b/lua/slashco/slasher/tyler.lua index f05b5dd2..106295dc 100644 --- a/lua/slashco/slasher/tyler.lua +++ b/lua/slashco/slasher/tyler.lua @@ -700,12 +700,17 @@ function SLASHER.InitHud(_, hud) hud:AddMeter("anger", 100, "", nil, true) hud:TieMeterInt("anger", "TylerAnger") + function hud.TitleCard.Label:PaintOver() + draw.SimpleText("HIDE TIME: " .. math.Round(GameData.LocalPlayer:GetNWInt("TylerHideTime"), 1), "TVCD", 4, 18, red) + end + hud.prevState = -1 hud.destroyEnabled = true hud.prevWater = -1 + local HuntTimeColor = Color(255, 0, 0, 255) function hud.AlsoThink() local state = GameData.LocalPlayer:GetNWInt("TylerState") - if state == 0 then + if state == TYLER_SPECTER then local isInWater = GameData.LocalPlayer:WaterLevel() > 1 if hud.prevWater ~= isInWater then if isInWater then @@ -717,10 +722,10 @@ function SLASHER.InitHud(_, hud) end if state ~= hud.prevState then - if state == 0 then + if state == TYLER_SPECTER then hud:SetControlVisible("R", true) hud:SetControlText("R", "manifest") - elseif state == 1 then + elseif state == TYLER_CREATOR then hud:SetControlVisible("R", true) hud:SetControlEnabled("R", false) hud:SetControlText("R", "(hiding)") @@ -729,7 +734,7 @@ function SLASHER.InitHud(_, hud) hud:SetControlVisible("R", false) end - if state <= 1 then + if state <= TYLER_CREATOR then hud:SetTitle("Tyler_creator") hud:SetAvatar("creator") else @@ -737,7 +742,7 @@ function SLASHER.InitHud(_, hud) hud:SetAvatar("destroyer") end - if state == 3 then + if state == TYLER_DESTROYER then hud:SetCrosshairEnabled(true) else hud:SetCrosshairAlpha(0) @@ -750,15 +755,19 @@ function SLASHER.InitHud(_, hud) hud.prevState = state end - if hud.prevState ~= 3 then -- eno: Just checking if he's in any form other than Destroyer. - if GameData.LocalPlayer:GetNWInt("TylerHideTime") then - draw.SimpleText("HIDE TIME: " .. math.Round(GameData.LocalPlayer:GetNWInt("TylerHideTime"), 1), "TVCD", ScrW() / 2, 550, Color(255, 0, 0, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) - end - elseif hud.prevState == 3 and hud.prevState ~= 1 then -- eno: Basically checking if he's in Destroyer form and not in Creator form. - if GameData.LocalPlayer:GetNWInt("TylerHuntTime") then - draw.SimpleText("HUNT TIME: " .. math.Round(GameData.LocalPlayer:GetNWInt("TylerHuntTime"), 1), "TVCD", ScrW() / 2, 550, Color(255, 0, 0, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) + hook.Add("SlashCo:DrawHUD", "SlashCo:SlasherHUD", function() + if GameData.LocalPlayer:Team() ~= TEAM_SLASHER then + hook.Remove("SlashCo:DrawHUD", "SlashCo:SlasherHUD") + return + end + + if state == TYLER_DESTROYER then + local HuntTime = GameData.LocalPlayer:GetNWInt("TylerHuntTime") + if HuntTime > 0 then -- In Lua "if 0 then" is still true. + draw.SimpleText("HUNT TIME: " .. math.Round(HuntTime, 1), "TVCD", ScrW() / 2, 550, HuntTimeColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) end end + end) local target = GameData.LocalPlayer:GetEyeTrace().Entity local class = IsValid(target) and target:GetClass()