Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions lua/slashco/slasher/tyler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)")
Expand All @@ -729,15 +734,15 @@ 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
hud:SetTitle("Tyler_destroyer")
hud:SetAvatar("destroyer")
end

if state == 3 then
if state == TYLER_DESTROYER then
hud:SetCrosshairEnabled(true)
else
hud:SetCrosshairAlpha(0)
Expand All @@ -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()
Expand Down