mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-02 07:42:12 -05:00
Support Digimon Showdown cries (#1273)
This commit is contained in:
@@ -37,6 +37,7 @@ class BattleScene {
|
||||
|
||||
/** Note: Not the actual generation of the battle, but the gen of the sprites/background */
|
||||
gen = 7;
|
||||
mod = '';
|
||||
/** 1 = singles, 2 = doubles, 3 = triples */
|
||||
activeCount = 1;
|
||||
|
||||
@@ -106,6 +107,7 @@ class BattleScene {
|
||||
let numericId = 0;
|
||||
if (battle.id) {
|
||||
numericId = parseInt(battle.id.slice(battle.id.lastIndexOf('-') + 1), 10);
|
||||
if (this.battle.id.includes('digimon')) this.mod = 'digimon';
|
||||
}
|
||||
if (!numericId) {
|
||||
numericId = Math.floor(Math.random() * 1000000);
|
||||
|
||||
@@ -438,7 +438,7 @@ const Dex = new class implements ModdedDex {
|
||||
document.getElementsByTagName('body')[0].appendChild(el);
|
||||
}
|
||||
getSpriteData(pokemon: Pokemon | Template | string, siden: number, options: {
|
||||
gen?: number, shiny?: boolean, gender?: GenderName, afd?: boolean, noScale?: boolean,
|
||||
gen?: number, shiny?: boolean, gender?: GenderName, afd?: boolean, noScale?: boolean, mod?: string,
|
||||
} = {gen: 6}) {
|
||||
if (!options.gen) options.gen = 6;
|
||||
if (pokemon instanceof Pokemon) {
|
||||
@@ -528,6 +528,12 @@ const Dex = new class implements ModdedDex {
|
||||
return spriteData;
|
||||
}
|
||||
|
||||
// Mod Cries
|
||||
if (options.mod) {
|
||||
spriteData.cryurl = `sprites/${options.mod}/audio/${toId(template.baseSpecies)}`;
|
||||
spriteData.cryurl += (window.nodewebkit ? '.ogg' : '.mp3');
|
||||
}
|
||||
|
||||
if (animationData[facing + 'f'] && options.gender === 'F') facing += 'f';
|
||||
let allowAnim = !Dex.prefs('noanim') && !Dex.prefs('nogif');
|
||||
if (allowAnim && genNum >= 6) spriteData.pixelated = false;
|
||||
|
||||
Reference in New Issue
Block a user