Skip to content

Commit

Permalink
Added a toggle /blitzanims to enable fast animations on non blitz bat…
Browse files Browse the repository at this point in the history
…tles.
  • Loading branch information
BhushanT committed Dec 16, 2024
1 parent f4baa24 commit 50156f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions play.pokemonshowdown.com/js/client-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion play.pokemonshowdown.com/src/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50156f5

Please sign in to comment.