Skip to content

Commit 648a44e

Browse files
authored
Added Win Score Event (#1733)
Added win score to finish event with parameter for amount of score in role base and LANG entries I felt like it was weird that no score was gained for winning, especially for roles that cant gain score as quickly in other ways. This adds an event for that where score amount can also be configured for every role.
1 parent 7ac7b60 commit 648a44e

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
1313
- Added support for "toggle_zoom" binds to trigger the radio commands menu (by @TW1STaL1CKY)
1414
- Added option to use right click to enable/disable roles in the role layering menu (by @TimGoll)
1515
- Added option to enable team name next to role name on the HUD (by @milkwxter)
16+
- Added score event for winning with configurable role parameter (by @MrXonte)
1617

1718
### Fixed
1819

lua/terrortown/entities/roles/ttt_role_base/shared.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ ROLE.score = {
4040
-- round ended with nobody winning, usually a negative number.
4141
timelimitMultiplier = 0,
4242

43-
-- The amount of points gained by killing yourself. Should be a
43+
-- The amount of score points gained by killing yourself. Should be a
4444
-- negative number for most roles.
4545
suicideMultiplier = -1,
46+
47+
-- The amount of score points gained when your team wins.
48+
winMultiplier = 3,
4649
}
4750

4851
ROLE.karma = {

lua/terrortown/events/finish.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ function EVENT:CalculateScore()
122122
score_timelimit = wintype == WIN_TIMELIMIT and math.ceil(
123123
otherAlivePlayers * roleData.score.timelimitMultiplier
124124
) or 0,
125+
score_win = wintype == team and roleData.score.winMultiplier,
125126
})
126127
end
127128
end

lua/terrortown/lang/de.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,13 +1170,15 @@ L.tooltip_karma_gained = "Karmaänderungen für diese Runde:"
11701170
L.tooltip_score_gained = "Punkteänderungen für diese Runde:"
11711171
L.tooltip_roles_time = "Rollenwechsel für diese Runde:"
11721172

1173+
L.tooltip_finish_score_win = "Gewinner: {score}"
11731174
L.tooltip_finish_score_alive_teammates = "Lebende Teammitglieder: {score}"
11741175
L.tooltip_finish_score_alive_all = "Lebende Spieler: {score}"
11751176
L.tooltip_finish_score_timelimit = "Zeit vorbei: {score}"
11761177
L.tooltip_finish_score_dead_enemies = "Tote Gegner: {score}"
11771178
L.tooltip_kill_score = "Mord: {score}"
11781179
L.tooltip_bodyfound_score = "Leichenfund: {score}"
11791180

1181+
L.finish_score_win = "Gewinner:"
11801182
L.finish_score_alive_teammates = "Lebende Teammitglieder:"
11811183
L.finish_score_alive_all = "Lebende Spieler:"
11821184
L.finish_score_timelimit = "Zeit vorbei:"

lua/terrortown/lang/en.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,13 +1170,15 @@ L.tooltip_karma_gained = "Karma changes for this round:"
11701170
L.tooltip_score_gained = "Score changes for this round:"
11711171
L.tooltip_roles_time = "Role changes for this round:"
11721172

1173+
L.tooltip_finish_score_win = "Win: {score}"
11731174
L.tooltip_finish_score_alive_teammates = "Alive teammates: {score}"
11741175
L.tooltip_finish_score_alive_all = "Alive players: {score}"
11751176
L.tooltip_finish_score_timelimit = "Time is up: {score}"
11761177
L.tooltip_finish_score_dead_enemies = "Dead enemies: {score}"
11771178
L.tooltip_kill_score = "Kill: {score}"
11781179
L.tooltip_bodyfound_score = "Body found: {score}"
11791180

1181+
L.finish_score_win = "Win:"
11801182
L.finish_score_alive_teammates = "Alive teammates:"
11811183
L.finish_score_alive_all = "Alive players:"
11821184
L.finish_score_timelimit = "Time is up:"

0 commit comments

Comments
 (0)