diff --git a/src/battle-animations.ts b/src/battle-animations.ts index cd1ba5fdf..54f8d2edc 100644 --- a/src/battle-animations.ts +++ b/src/battle-animations.ts @@ -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); diff --git a/src/battle-dex.ts b/src/battle-dex.ts index ce82059c3..0aa340441 100644 --- a/src/battle-dex.ts +++ b/src/battle-dex.ts @@ -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;