Skip to content

Commit

Permalink
added musics and made winners bigger
Browse files Browse the repository at this point in the history
  • Loading branch information
Pshy0 committed Aug 28, 2023
1 parent d06af11 commit b73be0f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions lua/pshy/games/vs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ system.disableChatCommandDisplay(nil, true)


newgame.SetRotation("racing_vanilla")
tfm.exec.playMusic("casual", "musique", 70, true)
tfm.exec.newGame("lobby")
27 changes: 24 additions & 3 deletions lua/pshy/teams/racingvs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ teams.rejoin = true -- players leaving a team will rejoin the same one



local pending_music_switch = true



--- Replace #ff0000 by the winner team color.
local function ReplaceRedToWinningColor(xml)
local winner_team = teams.teams[teams.winner_index]
Expand Down Expand Up @@ -67,20 +71,37 @@ function eventNewGame()
if teams.winner_index then
if not teams.have_played_winner_round then
-- winner round
tfm.exec.stopMusic("musique")
teams.have_played_winner_round = true
tfm.exec.setGameTime(13, true)
local winner_team = teams.GetTeam(teams.winner_index)
for player_name, void in pairs(winner_team.player_names) do
tfm.exec.setVampirePlayer(player_name, true)
for player_name in pairs(tfm.get.room.playerList) do
if winner_team.player_names[player_name] then
tfm.exec.playSound("fortoresse/x_victoire", 80, nil, nil, player_name)
tfm.exec.changePlayerSize(player_name, 1.5)
else
tfm.exec.playSound("fortoresse/x_defaite", 80, nil, nil, player_name)
tfm.exec.changePlayerSize(player_name, 0.5)
end
end
newgame.SetNextMap("lobby")
else
-- first round of new match
-- first round of new match / could be lobby
tfm.exec.playMusic("casual", "musique", 70, true)
for player_name in pairs(tfm.get.room.playerList) do
tfm.exec.changePlayerSize(player_name, 1)
end
teams.winner_index = nil
teams.have_played_winner_round = false
teams.ResetScores()
pending_music_switch = true
end
end
if pending_music_switch and newgame.current_map_identifying_name ~= "lobby" then -- looks like a bug
print_debug("newgame.current_map_identifying_name %s", newgame.current_map_identifying_name)
tfm.exec.playMusic("fight", "musique", 70, true)
pending_music_switch = false
end
utils_messages.Title(nil)
end

Expand Down

0 comments on commit b73be0f

Please sign in to comment.