diff --git a/public/exp-sprites.json b/public/exp-sprites.json index 12ada72f917..4e5a51aa94d 100644 --- a/public/exp-sprites.json +++ b/public/exp-sprites.json @@ -1069,6 +1069,8 @@ "971", "972", "972", + "973", + "973", "974", "974", "975", @@ -2201,6 +2203,8 @@ "971b", "972b", "972b", + "973b", + "973b", "974b", "974b", "975b", @@ -3331,6 +3335,8 @@ "971sb", "972sb", "972sb", + "973sb", + "973sb", "974sb", "974sb", "975sb", @@ -4468,6 +4474,8 @@ "971s", "972s", "972s", + "973s", + "973s", "974s", "974s", "975s", @@ -4527,5 +4535,184 @@ "999s-roaming", "999s-roaming", "999s", - "999s" + "999s", + "1000", + "1001", + "1004", + "181-mega", + "212-mega", + "282-mega_2", + "282-mega_2", + "282-mega_3", + "282-mega_3", + "303-mega", + "334-mega", + "334-mega_2", + "334-mega_2", + "376-mega", + "384-mega", + "384-mega_2", + "384-mega_2", + "4263", + "4264", + "428-mega", + "445-mega", + "448-mega", + "475-mega_2", + "475-mega_2", + "475-mega_3", + "475-mega_3", + "6549", + "6570", + "6571", + "6705", + "6706_2", + "6706_2", + "6706_3", + "6706_3", + "700", + "704", + "705_2", + "705_2", + "705_3", + "705_3", + "706", + "708", + "709", + "710", + "711", + "720-unbound", + "720", + "755", + "756", + "789", + "791_1", + "791_1", + "802", + "856", + "857_2", + "857_2", + "857_3", + "857_3", + "858", + "872", + "873", + "877-hangry", + "877", + "885", + "886", + "887", + "890_2", + "890_2", + "890_3", + "890_3", + "900", + "919", + "920", + "924", + "925-four", + "925-four_2", + "925-four_2", + "925-four_3", + "925-four_3", + "925-three", + "925-three_2", + "925-three_2", + "925-three_3", + "925-three_3", + "94-mega_1", + "94-mega_1", + "94-mega_2", + "94-mega_2", + "94-mega_3", + "94-mega_3", + "962", + "967", + "973", + "987", + "988", + "988_3", + "988_3", + "999", + "999_1", + "999_1", + "1000b", + "1001b", + "1004b", + "181b-mega", + "212b-mega", + "282b-mega", + "303b-mega", + "334b-mega", + "376b-mega", + "384b-mega", + "4263b", + "4264b", + "428b-mega", + "445b-mega", + "448b-mega", + "475b-mega_2", + "475b-mega_2", + "475b-mega_3", + "475b-mega_3", + "6549b", + "6570b", + "6571b", + "6705b", + "6706_2b", + "6706_2b", + "6706_3b", + "6706_3b", + "700b", + "704b", + "705b", + "706b", + "708b", + "709b", + "710b", + "711b", + "720b-unbound", + "720b", + "755b", + "756b", + "789b", + "791b", + "802b", + "856b", + "857_2b", + "857_2b", + "857_3b", + "857_3b", + "858b", + "872b", + "873b", + "877b-hangry", + "877b", + "885b", + "886b", + "887b", + "890b", + "900b", + "919b", + "920b", + "924b", + "925b-four", + "925b-four_2", + "925b-four_2", + "925b-four_3", + "925b-four_3", + "925b-three", + "925b-three_2", + "925b-three_2", + "925b-three_3", + "925b-three_3", + "94b-mega", + "962b", + "962_3b", + "962_3b", + "967b", + "973b", + "987b", + "988b", + "999b" ] diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 532ff22b65b..4ea2503ec55 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -272,7 +272,7 @@ export default class BattleScene extends SceneBase { populateAnims(); - await this.cachedFetch('./images/pokemon/variant/_masterlist.json').then(res => res.json()).then(v => Object.keys(v).forEach(k => variantData[k] = v[k])); + await this.initVariantData(); } create() { @@ -513,6 +513,21 @@ export default class BattleScene extends SceneBase { }); } + async initVariantData(): Promise { + Object.keys(variantData).forEach(key => delete variantData[key]); + await this.cachedFetch('./images/pokemon/variant/_masterlist.json').then(res => res.json()) + .then(v => { + Object.keys(v).forEach(k => variantData[k] = v[k]); + if (this.experimentalSprites) { + const expTree = variantData['exp']; + Object.keys(expTree).forEach(ek => { + variantData[ek] = expTree[ek]; + }); + } + Promise.resolve(); + }); + } + cachedFetch(url: string, init?: RequestInit): Promise { const manifest = this.game['manifest']; if (manifest) { @@ -817,6 +832,9 @@ export default class BattleScene extends SceneBase { } if (clearScene) { + // Reload variant data in case sprite set has changed + this.initVariantData(); + this.fadeOutBgm(250, false); this.tweens.add({ targets: [ this.uiContainer ], diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index e4db82f3dc5..a8fceb76b29 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -312,12 +312,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const battleSpritePath = this.getBattleSpriteAtlasPath(back, ignoreOverride).replace('variant/', '').replace(/_[1-3]$/, ''); let variantSet: VariantSet; let config = variantData; + const useExpSprite = this.scene.experimentalSprites && this.scene.hasExpSprite(this.getBattleSpriteKey(back, ignoreOverride)); battleSpritePath.split('/').map(p => config ? config = config[p] : null); variantSet = config as VariantSet; if (variantSet && variantSet[this.variant] === 1) { if (variantColorCache.hasOwnProperty(key)) return resolve(); - this.scene.cachedFetch(`./images/pokemon/variant/${battleSpritePath}.json`).then(res => res.json()).then(c => { + this.scene.cachedFetch(`./images/pokemon/variant/${useExpSprite ? 'exp/' : ''}${battleSpritePath}.json`).then(res => res.json()).then(c => { variantColorCache[key] = c; resolve(); }); diff --git a/src/system/settings.ts b/src/system/settings.ts index a8dc4afd83e..df4f894c949 100644 --- a/src/system/settings.ts +++ b/src/system/settings.ts @@ -48,7 +48,7 @@ export const settingOptions: SettingOptions = { [Setting.Window_Type]: new Array(5).fill(null).map((_, i) => (i + 1).toString()), [Setting.Tutorials]: [ 'Off', 'On' ], [Setting.Enable_Retries]: [ 'Off', 'On' ], - [Setting.Sprite_Set]: [ 'Consistent', 'Prioritize Animation' ], + [Setting.Sprite_Set]: [ 'Consistent', 'Mixed Animated' ], [Setting.Move_Animations]: [ 'Off', 'On' ], [Setting.Show_Stats_on_Level_Up]: [ 'Off', 'On' ], [Setting.EXP_Gains_Speed]: [ 'Normal', 'Fast', 'Faster', 'Skip' ], @@ -83,7 +83,7 @@ export const settingDefaults: SettingDefaults = { [Setting.Vibration]: 0 }; -export const reloadSettings: Setting[] = [ Setting.UI_Theme, Setting.Language ]; +export const reloadSettings: Setting[] = [ Setting.UI_Theme, Setting.Language, Setting.Sprite_Set ]; export function setSetting(scene: BattleScene, setting: Setting, value: integer): boolean { switch (setting) { diff --git a/update_exp_sprites.ps1 b/update_exp_sprites.ps1 index 936a6779714..ed80566b459 100644 --- a/update_exp_sprites.ps1 +++ b/update_exp_sprites.ps1 @@ -21,4 +21,4 @@ Get-ChildItem -Path '.\public\images\pokemon' -Recurse -Directory | Where-Object } } -$keys | ConvertTo-Json | Out-File -encoding ASCII .\public\exp_sprites.json \ No newline at end of file +$keys | ConvertTo-Json | Out-File -encoding ASCII .\public\exp-sprites.json \ No newline at end of file