From 50156f5220809cf0158bf68af7c8a7ddb52d8a51 Mon Sep 17 00:00:00 2001 From: BhushanT Date: Mon, 16 Dec 2024 11:44:32 -0500 Subject: [PATCH] Added a toggle /blitzanims to enable fast animations on non blitz battles. --- play.pokemonshowdown.com/js/client-chat.js | 15 +++++++++++++++ play.pokemonshowdown.com/src/battle.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/play.pokemonshowdown.com/js/client-chat.js b/play.pokemonshowdown.com/js/client-chat.js index fb4da9d3ed..82a586c691 100644 --- a/play.pokemonshowdown.com/js/client-chat.js +++ b/play.pokemonshowdown.com/js/client-chat.js @@ -1130,6 +1130,18 @@ } return false; + case 'blitzanims': + if (this.checkBroadcast(cmd, text)) return false; + var blitzanims = (toID(target) === 'on'); + Storage.prefs('blitzanims', blitzanims); + this.add('Fast animations ' + (blitzanims ? 'ON' : 'OFF') + " for next battle."); + for (var roomid in app.rooms) { + var battle = app.rooms[roomid] && app.rooms[roomid].battle; + if (!battle) continue; + battle.resetToCurrentTurn(); + } + return false; + // documentation of client commands case 'help': case 'h': @@ -1224,6 +1236,9 @@ this.add('/afd - Enable April Fools\' Day sprites.'); this.add('/afd disable - Disable April Fools\' Day sprites.'); return false; + case 'blitzanims': + this.add('/blitzanims [on|off] - Enable or disable fast animations.'); + return false; } } diff --git a/play.pokemonshowdown.com/src/battle.ts b/play.pokemonshowdown.com/src/battle.ts index 6a298afcef..5502f59a2c 100644 --- a/play.pokemonshowdown.com/src/battle.ts +++ b/play.pokemonshowdown.com/src/battle.ts @@ -1034,7 +1034,7 @@ export class Battle { ) => void) | null; mute = false; - messageFadeTime = 300; + messageFadeTime = Dex.prefs('blitzanims') === true ? 40 : 300; messageShownTime = 1; /** for tracking when to accelerate animations in long battles full of double switches */ turnsSinceMoved = 0;