Skip to content

Commit

Permalink
Games: update cooldown messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sirDonovan committed Apr 14, 2024
1 parent 116e903 commit 8703060
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1551,8 +1551,7 @@ export class Games {
this.gameCooldownMessageTimers[room.id] = setTimeout(() => {
delete this.gameCooldownMessageTimerData[room.id];
delete this.gameCooldownMessageTimers[room.id];
room.say("There " + (minigameCooldownMinutes === 1 ? "is **1 minute**" : "are **" + minigameCooldownMinutes +
" minutes**") + " of the game cooldown remaining so minigames can now be played!");
room.say("The cooldown timer is halfway over! Minigames can be played during the remaining time.");
}, timer);
}

Expand Down
3 changes: 1 addition & 2 deletions src/games/templates/battle-elimination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2258,8 +2258,7 @@ export abstract class BattleElimination extends ScriptedGame {
Games.setLastGame(this.room, Date.now());

if (Config.tournamentGameCooldownTimers && this.room.id in Config.tournamentGameCooldownTimers) {
this.say("The **" + Config.tournamentGameCooldownTimers[this.room.id] + "-minute cooldown** until the next tournament " +
"starts now!");
this.say("A " + Config.tournamentGameCooldownTimers[this.room.id] + "-minute cooldown timer starts now!");
}

this.setAutoCreateTimer();
Expand Down
4 changes: 2 additions & 2 deletions src/room-game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ export abstract class Game extends Activity {
if (nextGameType === 'userhosted' && previousGameDuration && Config.gameCooldownTimers &&
this.room.id in Config.gameCooldownTimers && Config.gameAutoCreateTimers && this.room.id in Config.gameAutoCreateTimers &&
Games.canSkipScriptedCooldown(this.room, previousGameDuration)) {
this.say("The cooldown will be skipped due to the duration of the previous game!");
this.say("The previous game was short enough to skip the cooldown timer!");

Games.skipScriptedCooldown(this.room);
} else {
Games.clearSkippedScriptedCooldown(this.room);

if (Config.gameCooldownTimers && this.room.id in Config.gameCooldownTimers) {
this.say("The **" + Config.gameCooldownTimers[this.room.id] + "-minute cooldown** until the next game starts now!");
this.say("A " + Config.gameCooldownTimers[this.room.id] + "-minute cooldown timer starts now!");
const minigameCooldownMinutes = Config.gameCooldownTimers[this.room.id] / 2;
if (minigameCooldownMinutes >= 1) Games.setGameCooldownMessageTimer(this.room, minigameCooldownMinutes);
}
Expand Down

0 comments on commit 8703060

Please sign in to comment.