Skip to content

Commit 277a1cb

Browse files
authored
Merge pull request #877 from Malivil/dev
Misc. changes
2 parents e2642f0 + cb8e2f9 commit 277a1cb

26 files changed

Lines changed: 190 additions & 77 deletions

.github/workflows/luacheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
uses: leafo/gh-actions-luarocks@v4
3131

3232
- name: Setup dependencies
33-
run: luarocks install --deps-only gluacheck-dev-1.rockspec
33+
run: luarocks install --deps-only luacheck-dev-1.rockspec
3434

3535
- name: Build ‘luacheck’ (bootstrap)
36-
run: luarocks make gluacheck-dev-1.rockspec
36+
run: luarocks make luacheck-dev-1.rockspec
3737

3838
- name: Run ‘luacheck’ (dogfood)
3939
run: lua -e 'package.path="./gluacheck/src/?.lua;./gluacheck/src/?/init.lua;"..package.path' gluacheck/bin/luacheck.lua gamemodes scripts

.luacheckrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,9 @@ globals = {
10891089
"VAMPIRE_DEATH_NONE",
10901090
"VAMPIRE_DEATH_KILL_CONVERTED",
10911091
"VAMPIRE_DEATH_REVERT_CONVERTED",
1092+
"VAMPIRE_OVERHEAL_MODE_HEALTH",
1093+
"VAMPIRE_OVERHEAL_MODE_MAX_HEALTH",
1094+
"VAMPIRE_OVERHEAL_MODE_BOTH",
10921095
"VAMPIRE_THRALL_FF_MODE_NONE",
10931096
"VAMPIRE_THRALL_FF_MODE_REFLECT",
10941097
"VAMPIRE_THRALL_FF_MODE_IMMUNE",
@@ -1250,6 +1253,7 @@ std = {
12501253
EqualValues = {},
12511254
ExcludedKeys = {},
12521255
GetKeys = {},
1256+
GetFirstItemWithPropertyValue = {},
12531257
HasItemWithPropertyValue = {},
12541258
HasTable = {},
12551259
HasValue = {},

API/HOOKS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,13 +1263,14 @@ Called before a team chat message is sent. Used to modify the targets of the tea
12631263

12641264
*Return:* Whether or not this team chat message should be sent (Defaults to `true`)
12651265

1266-
### TTTTeamVoiceChatTargets(speaker, targets)
1266+
### TTTTeamVoiceChatTargets(speaker, targets, state)
12671267
Called before a team voice state message is sent. Used to modify the targets of the team voice state message.\
12681268
*Realm:* Server\
12691269
*Added in:* 2.0.7\
12701270
*Parameters:*
12711271
- *speaker* - The player trying to send their team voice state message
12721272
- *targets* - The table of players that this message will be sent to. Add or remove players from this table to change the message recipients
1273+
- *state* - Whether the speaker is speaking globally (`true`) or only to their team (`false`) *(Added in 2.3.5)*
12731274

12741275
*Return:* Whether or not this team voice state message should be sent (Defaults to `true`)
12751276

@@ -1340,7 +1341,7 @@ Called after globals are synced but but before role colors and strings are set.
13401341
*Realm:* Client and Server\
13411342
*Added in:* 1.2.7
13421343

1343-
### TTTVampireBodyEaten(ply, ent, living, healed)
1344+
### TTTVampireBodyEaten(ply, ent, living, healed, maxchange)
13441345
Called after a vampire eats a body.\
13451346
*Realm:* Server\
13461347
*Added in:* 1.6.16\
@@ -1349,6 +1350,7 @@ Called after a vampire eats a body.\
13491350
- *ent* - The target entity. Generally either a player or a ragdoll
13501351
- *living* - Whether the target entity was living at the time they were eaten
13511352
- *healed* - The amount of health the player gained from eating the body
1353+
- *maxchange* - The amount of maximum health the player gained from eating the body *(Added in 2.3.5)*
13521354

13531355
### TTTVampireInvisibilityChange(ply, invisible)
13541356
Called when a vampire starts or ends their invisibility.\

API/METHODS_TABLE.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@ Returns new table that contains the keys not present as values in in the given e
99
- *tbl* - The table whose keys are being inspected
1010
- *excludes* - Table of values to exclude
1111

12+
### table.GetFirstItemWithPropertyValue(tbl, key, val)
13+
Returns the first item in the given table that has an item whose property specified by the provided `key` has a value that matches the given `val`.\
14+
*Realm:* Client and Server\
15+
*Added in:* 2.3.5\
16+
*Parameters:*
17+
- *tbl* - The table whose values are being inspected
18+
- *key* - The property name whose value is being compared
19+
- *val* - The value to find in the given property
20+
1221
### table.HasItemWithPropertyValue(tbl, key, val)
13-
Returns whether the given table has an item whose property specified by the provided `key` has a value that makes the given `val`.\
22+
Returns whether the given table has an item whose property specified by the provided `key` has a value that matches the given `val`.\
1423
*Realm:* Client and Server\
1524
*Added in:* 1.8.7\
1625
*Parameters:*

CONVARS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,10 @@ ttt_vampire_show_target_icon 0 // Whether Vampires have
300300
ttt_vampire_damage_reduction 0 // The fraction an attacker's bullet damage will be reduced by when they are shooting a Vampire
301301
ttt_vampire_fang_timer 5 // The amount of time fangs must be used to fully drain a target's blood
302302
ttt_vampire_fang_dead_timer 0 // The amount of time fangs must be used to fully drain a dead target's blood. Set to 0 to use the same time as "ttt_vampire_fang_timer"
303-
ttt_vampire_fang_heal 50 // The amount of health a vVampire will heal by when they fully drain a target's blood
303+
ttt_vampire_fang_heal 50 // The amount of health a Vampire will heal by when they fully drain a target's blood
304304
ttt_vampire_fang_overheal 25 // The amount over the Vampire's normal maximum health (e.g. 100 + this ConVar) that the Vampire can heal to by drinking blood.
305305
ttt_vampire_fang_overheal_living -1 // The amount of overheal (see "ttt_vampire_fang_overheal") to give if the Vampire's target is living. Set to -1 to use the same amount as "ttt_vampire_fang_overheal" instead
306+
ttt_vampire_fang_overheal_mode 0 // How to handle healing a vampire over their maximum health. 0 - Increase health. 1 - Increase max health. 2 - Increase both.
306307
ttt_vampire_fang_unfreeze_delay 2 // The number of seconds before players who were frozen in place by the fangs should be released if the Vampire stops using the fangs on them
307308
ttt_vampire_prime_death_mode 0 // What to do when the prime Vampire(s) (e.g. players who spawn as Vampires originally) are killed. 0 - Do nothing. 1 - Kill all Vampire thralls (non-prime Vampires). 2 - Revert all Vampire thralls (non-prime Vampires) to their original role
308309
ttt_vampire_prime_only_convert 1 // Whether only prime Vampires (e.g. players who spawn as Vampire originally) are allowed to convert other players
@@ -411,6 +412,7 @@ ttt_deputy_activation_credits 0 // The number of credits
411412

412413
// Mercenary
413414
ttt_mercenary_credits_starting 1 // The number of credits a Mercenary should start with
415+
ttt_mercenary_armor_loadout 1 // Whether the mercenary should get body armor as part of their loadout
414416

415417
// Veteran
416418
ttt_veteran_damage_bonus 0.5 // Damage bonus that the Veteran has when they are the last innocent alive (e.g. 0.5 = 50% more damage)
@@ -1240,7 +1242,8 @@ ttt_dna_scan_detectives_loadout 0 // Whether all detectives
12401242
ttt_dna_scan_on_dialog 1 // Whether to show a button to open the DNA scanner on the body search dialog
12411243
ttt_dna_scan_only_drop_on_death 0 // Whether the DNA scanner should only be droppable when the holder dies
12421244
ttt_spectator_corpse_search 1 // Whether spectators can search bodies (not shared with other players)
1243-
ttt_corpse_search_not_shared 0 // Whether corpse searches are not shared with other players (only affects non-detective-like searchers)
1245+
ttt_corpse_search_auto_confirm 1 // Whether corpse searches are not shared with other players (only affects non-detective-like searchers)
1246+
ttt_corpse_search_not_shared 0 // Whether corpse searches automatically confirm the death of the player
12441247
ttt_corpse_search_killer_team_text_traitor 0 // Whether corpse searches should include flavor text hinting at the team of their traitor team killer
12451248
ttt_corpse_search_killer_team_text_innocent 0 // Whether corpse searches should include flavor text hinting at the team of their innocent team killer
12461249
ttt_corpse_search_killer_team_text_monster 0 // Whether corpse searches should include flavor text hinting at the team of their monster team killer

RELEASE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Release Notes
22

3+
## 2.3.5 (Beta)
4+
**Released:**
5+
6+
### Changes
7+
- Updated weapon switch and pickup HUD elements to use the same logic for getting weapon names
8+
- Fixes very rare cases where they would say different things
9+
10+
### Additions
11+
- Added ability to control whether the mercenary gets body armor as part of their loadout (defaults to `true`)
12+
- Added ability to change vampire's fang drain overheal to overheal (default), increase max health, or do both
13+
- Added ability to disable automatically confirming a players death when searching their body (disabled by default)
14+
15+
### Fixes
16+
- Fixed illusionist not blocking traitor team voice chat
17+
- Fixed promoted impersonator and deputy who are searched by a detective not always showing their true role on the scoreboard
18+
19+
### Developer
20+
- Added `state` parameter to `TTTTeamVoiceChatTargets` hook
21+
- Added `table.GetFirstItemWithPropertyValue` static method
22+
- Added `maxchange` parameter to `TTTVampireBodyEaten` hook
23+
324
## 2.3.4 (Beta)
425
**Released: August 9th, 2025**
526

docs/api/hooks.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ <h3><a id="tttteamchattargetssender-msg-targets-from_chat" href="#tttteamchattar
18891889
<em>Return:</em> Whether or not this team chat message should be sent (Defaults to <code>true</code>).
18901890
</p>
18911891

1892-
<h3><a id="tttteamvoicechattargetsspeaker-targetsfrom_chat" href="#tttteamvoicechattargetsspeaker-targetsfrom_chat">TTTTeamVoiceChatTargets(speaker, targets)</a></h3>
1892+
<h3><a id="tttteamvoicechattargetsspeaker-targets-state" href="#tttteamvoicechattargetsspeaker-targets-state">TTTTeamVoiceChatTargets(speaker, targets, state)</a></h3>
18931893
<p>
18941894
Called before a team voice state message is sent. Used to modify the targets of the team voice state message.<br>
18951895
<em>Realm:</em> Server<br>
@@ -1899,6 +1899,7 @@ <h3><a id="tttteamvoicechattargetsspeaker-targetsfrom_chat" href="#tttteamvoicec
18991899
<ul>
19001900
<li><em>speaker</em> - The player trying to send their team voice state message</li>
19011901
<li><em>targets</em> - The table of players that this message will be sent to. Add or remove players from this table to change the message recipients</li>
1902+
<li><em>state</em> - Whether the speaker is speaking globally (<code>true</code>) or only to their team (<code>false</code>) <em>(Added in 2.3.5)</em></li>
19021903
</ul>
19031904
<p>
19041905
<em>Return:</em> Whether or not this team voice state message should be sent (Defaults to <code>true</code>).
@@ -2001,7 +2002,7 @@ <h3><a id="tttupdaterolestate" href="#tttupdaterolestate">TTTUpdateRoleState()</
20012002
<em>Added in:</em> 1.2.7
20022003
</p>
20032004

2004-
<h3><a id="tttvampirebodyeatenply-ent-living-healed" href="#tttvampirebodyeatenply-ent-living-healed">TTTVampireBodyEaten(ply, ent, living, healed)</a></h3>
2005+
<h3><a id="tttvampirebodyeatenply-ent-living-healed-maxchange" href="#tttvampirebodyeatenply-ent-living-healed-maxchange">TTTVampireBodyEaten(ply, ent, living, healed, maxchange)</a></h3>
20052006
<p>
20062007
Called after a Vampire eats a body.<br>
20072008
<em>Realm:</em> Server<br>
@@ -2013,6 +2014,7 @@ <h3><a id="tttvampirebodyeatenply-ent-living-healed" href="#tttvampirebodyeatenp
20132014
<li><em>ent</em> - The target entity. Generally either a player or a ragdoll</li>
20142015
<li><em>living</em> - Whether the target entity was living at the time they were eaten</li>
20152016
<li><em>healed</em> - The amount of health the player gained from eating the body</li>
2017+
<li><em>maxchange</em> - The amount of maximum health the player gained from eating the body <em>(Added in 2.3.5)</em> <span data-text="Beta Only" class="betaonly betaicon tooltip">&nbsp;</span></li>
20162018
</ul>
20172019

20182020
<h3><a id="tttvampireinvisibilitychangeply-invisible" href="#tttvampireinvisibilitychangeply-invisible">TTTVampireInvisibilityChange(ply, invisible)</a></h3>

docs/api/methods_table.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,22 @@ <h3><a id="tableexcludedkeystbl-excludes" href="#tableexcludedkeystbl-excludes">
2929
<li><em>excludes</em> - Table of values to exclude</li>
3030
</ul>
3131

32+
<h3><a id="tablegetfirstitemwithpropertyvaluetbl-key-val" href="#tablegetfirstitemwithpropertyvaluetbl-key-val">table.GetFirstItemWithPropertyValue(tbl, key, val)</a></h3>
33+
<p>
34+
Returns the first item in the given table that has an item whose property specified by the provided <code>key</code> has a value that matches the given <code>val</code>.<br>
35+
<em>Realm:</em> Client and Server<br>
36+
<em>Added in:</em> 2.3.5<br>
37+
<em>Parameters:</em>
38+
</p>
39+
<ul>
40+
<li><em>tbl</em> - The table whose values are being inspected</li>
41+
<li><em>key</em> - The property name whose value is being compared</li>
42+
<li><em>val</em> - The value to find in the given property</li>
43+
</ul>
44+
3245
<h3><a id="tablehasitemwithpropertyvaluetbl-key-val" href="#tablehasitemwithpropertyvaluetbl-key-val">table.HasItemWithPropertyValue(tbl, key, val)</a></h3>
3346
<p>
34-
Returns whether the given table has an item whose property specified by the provided <code>key</code> has a value that makes the given <code>val</code>.<br>
47+
Returns whether the given table has an item whose property specified by the provided <code>key</code> has a value that matches the given <code>val</code>.<br>
3548
<em>Realm:</em> Client and Server<br>
3649
<em>Added in:</em> 1.8.7<br>
3750
<em>Parameters:</em>

docs/teams/innocent.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,12 @@ <h3 style="margin: 10px 0; padding: 0;">Role Configuration:</h3>
426426
</tr>
427427
</thead>
428428
<tbody>
429+
<tr>
430+
<td>ttt_mercenary_armor_loadout <span data-text="Beta Only" class="betaonly betaicon tooltip">&nbsp;</span></td>
431+
<td>1</td>
432+
<td>Boolean</td>
433+
<td>Whether the mercenary should get body armor as part of their loadout.</td>
434+
</tr>
429435
<tr>
430436
<td>ttt_mercenary_credits_starting</td>
431437
<td>1</td>

docs/teams/traitor.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,18 @@ <h3 style="margin: 10px 0; padding: 0;">Role Configuration:</h3>
984984
<td>Integer</td>
985985
<td>The amount over the Vampire's normal maximum health that the Vampire can heal to by drinking blood from living players. <i>(Set to -1 to use the same amount as <code>ttt_vampire_fang_overheal</code> instead.)</i></td>
986986
</tr>
987+
<tr>
988+
<td>ttt_vampire_fang_overheal_mode</td>
989+
<td>0</td>
990+
<td>Integer (0-1)</td>
991+
<td>How to handle healing a vampire over their maximum health:
992+
<ol start="0">
993+
<li>Heal over their max health.</li>
994+
<li>Increase their max health.</li>
995+
<li>Increase their max health and heal them to full.</li>
996+
</ol>
997+
</td>
998+
</tr>
987999
<tr>
9881000
<td>ttt_vampire_fang_timer</td>
9891001
<td>5</td>

0 commit comments

Comments
 (0)