Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Win Score Event #1733

Merged
merged 8 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Added support for "toggle_zoom" binds to trigger the radio commands menu (by @TW1STaL1CKY)
- Added option to use right click to enable/disable roles in the role layering menu (by @TimGoll)
- Added option to enable team name next to role name on the HUD (by @milkwxter)
- Added score event for winning with configurable role parameter (by @MrXonte)

### Fixed

Expand Down
5 changes: 4 additions & 1 deletion lua/terrortown/entities/roles/ttt_role_base/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ ROLE.score = {
-- round ended with nobody winning, usually a negative number.
timelimitMultiplier = 0,

-- The amount of points gained by killing yourself. Should be a
-- The amount of score points gained by killing yourself. Should be a
-- negative number for most roles.
suicideMultiplier = -1,

-- The amount of score points gained when your team wins.
winMultiplier = 3,
}

ROLE.karma = {
Expand Down
1 change: 1 addition & 0 deletions lua/terrortown/events/finish.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function EVENT:CalculateScore()
score_timelimit = wintype == WIN_TIMELIMIT and math.ceil(
otherAlivePlayers * roleData.score.timelimitMultiplier
) or 0,
score_win = wintype == team and roleData.score.winMultiplier,
})
end
end
Expand Down
2 changes: 2 additions & 0 deletions lua/terrortown/lang/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1170,13 +1170,15 @@ L.tooltip_karma_gained = "Karmaänderungen für diese Runde:"
L.tooltip_score_gained = "Punkteänderungen für diese Runde:"
L.tooltip_roles_time = "Rollenwechsel für diese Runde:"

L.tooltip_finish_score_win = "Gewinner: {score}"
L.tooltip_finish_score_alive_teammates = "Lebende Teammitglieder: {score}"
L.tooltip_finish_score_alive_all = "Lebende Spieler: {score}"
L.tooltip_finish_score_timelimit = "Zeit vorbei: {score}"
L.tooltip_finish_score_dead_enemies = "Tote Gegner: {score}"
L.tooltip_kill_score = "Mord: {score}"
L.tooltip_bodyfound_score = "Leichenfund: {score}"

L.finish_score_win = "Gewinner:"
L.finish_score_alive_teammates = "Lebende Teammitglieder:"
L.finish_score_alive_all = "Lebende Spieler:"
L.finish_score_timelimit = "Zeit vorbei:"
Expand Down
2 changes: 2 additions & 0 deletions lua/terrortown/lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1170,13 +1170,15 @@ L.tooltip_karma_gained = "Karma changes for this round:"
L.tooltip_score_gained = "Score changes for this round:"
L.tooltip_roles_time = "Role changes for this round:"

L.tooltip_finish_score_win = "Win: {score}"
L.tooltip_finish_score_alive_teammates = "Alive teammates: {score}"
L.tooltip_finish_score_alive_all = "Alive players: {score}"
L.tooltip_finish_score_timelimit = "Time is up: {score}"
L.tooltip_finish_score_dead_enemies = "Dead enemies: {score}"
L.tooltip_kill_score = "Kill: {score}"
L.tooltip_bodyfound_score = "Body found: {score}"

L.finish_score_win = "Win:"
L.finish_score_alive_teammates = "Alive teammates:"
L.finish_score_alive_all = "Alive players:"
L.finish_score_timelimit = "Time is up:"
Expand Down
Loading