Skip to content

Commit ff6a47c

Browse files
committed
Updated Phantom tutorial to show the maximum number of respawns they have, if that setting is enabled
1 parent cb27b13 commit ff6a47c

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Includes beta updates [2.3.1](#231-beta) to [2.3.5](#235-beta).
1010

1111
### Changes
1212
- Changed Taskmaster's "Stay Hidden" task to be a bit less lenient
13+
- Updated Phantom tutorial to show the maximum number of respawns they have, if that setting is enabled
1314
- Ported "TTT: Reduce Healing sound repetition count in Radio"
1415
- Ported "TTT: Do not stack round start popups"
1516
- There is no change in functionality, we just adjusted our implementation of this feature to match the base

gamemodes/terrortown/gamemode/roles/phantom/cl_phantom.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ local phantom_weaker_each_respawn = GetConVar("ttt_phantom_weaker_each_respawn")
1616
local phantom_announce_death = GetConVar("ttt_phantom_announce_death")
1717
local phantom_killer_footstep_time = GetConVar("ttt_phantom_killer_footstep_time")
1818
local phantom_respawn = GetConVar("ttt_phantom_respawn")
19+
local phantom_respawn_limit = GetConVar("ttt_phantom_respawn_limit")
1920

2021
------------------
2122
-- TRANSLATIONS --
@@ -230,7 +231,15 @@ hook.Add("TTTTutorialRoleText", "Phantom_TTTTutorialRoleText", function(role, ti
230231

231232
-- Respawn
232233
if phantom_respawn:GetBool() then
233-
html = html .. "<span style='display: block; margin-top: 10px;'>If the " .. ROLE_STRINGS[ROLE_PHANTOM] .. " is killed, they will <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>be resurrected</span> if the person that killed them then dies.</span>"
234+
local respawn_limit = phantom_respawn_limit:GetInt()
235+
236+
html = html .. "<span style='display: block; margin-top: 10px;'>If the " .. ROLE_STRINGS[ROLE_PHANTOM] .. " is killed, they will <span style='color: rgb(" .. roleColor.r .. ", " .. roleColor.g .. ", " .. roleColor.b .. ")'>be resurrected</span> if the person that killed them then dies"
237+
if respawn_limit > 1 then
238+
html = html .. ", up to " .. respawn_limit .. " times"
239+
elseif respawn_limit == 1 then
240+
html = html .. ", but only once"
241+
end
242+
html = html .. ".</span>"
234243

235244
-- Weaker each respawn
236245
if phantom_weaker_each_respawn:GetBool() then

gamemodes/terrortown/gamemode/roles/phantom/phantom.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ local phantom_weaker_each_respawn = GetConVar("ttt_phantom_weaker_each_respawn")
2828
local phantom_announce_death = GetConVar("ttt_phantom_announce_death")
2929
local phantom_killer_footstep_time = GetConVar("ttt_phantom_killer_footstep_time")
3030
local phantom_respawn = GetConVar("ttt_phantom_respawn")
31+
local phantom_respawn_limit = GetConVar("ttt_phantom_respawn_limit")
3132

3233
local phantom_respawn_health = CreateConVar("ttt_phantom_respawn_health", "50", FCVAR_NONE, "The amount of health a phantom will respawn with", 1, 100)
33-
local phantom_respawn_limit = CreateConVar("ttt_phantom_respawn_limit", "0", FCVAR_NONE, "The amount of times a phantom can respawn. Set to 0 to have no limit", 0, 20)
3434
local phantom_killer_haunt_power_rate = CreateConVar("ttt_phantom_killer_haunt_power_rate", "10", FCVAR_NONE, "The amount of power to regain per second when a phantom is haunting their killer", 1, 25)
3535
local phantom_killer_haunt_power_starting = CreateConVar("ttt_phantom_killer_haunt_power_starting", "0", FCVAR_NONE, "The amount of power to the phantom starts with", 0, 200)
3636
local phantom_killer_haunt_without_body = CreateConVar("ttt_phantom_killer_haunt_without_body", "1")

gamemodes/terrortown/gamemode/roles/phantom/shared.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CreateConVar("ttt_phantom_weaker_each_respawn", "0", FCVAR_REPLICATED)
2424
CreateConVar("ttt_phantom_announce_death", "0", FCVAR_REPLICATED)
2525
CreateConVar("ttt_phantom_killer_footstep_time", "0", FCVAR_REPLICATED, "The amount of time a phantom's killer's footsteps should show before fading. Set to 0 to disable", 0, 60)
2626
CreateConVar("ttt_phantom_respawn", "1", FCVAR_REPLICATED, "Whether the phantom should respawn when their killer is killed", 0, 1)
27+
CreateConVar("ttt_phantom_respawn_limit", "0", FCVAR_REPLICATED, "The amount of times a phantom can respawn. Set to 0 to have no limit", 0, 20)
2728

2829
ROLE_CONVARS[ROLE_PHANTOM] = {}
2930
table.insert(ROLE_CONVARS[ROLE_PHANTOM], {

0 commit comments

Comments
 (0)