Update Vite and add sound for item rewards
This commit is contained in:
1 parent
c0e1c3bde7
commit
23a21af173
9 files changed
+386
-418
No files matched your search
@@ -2150,7 +2150,10 @@ export class ModifierRewardPhase extends BattlePhase {
|
||||
|
||||
const newModifier = this.modifierType.newModifier();
|
||||
|
||||
this.scene.addModifier(newModifier, true).then(() => this.scene.ui.showText(`You received\n${newModifier.type.name}!`, null, () => this.end(), null, true));
|
||||
this.scene.addModifier(newModifier).then(() => {
|
||||
this.scene.playSoundWithoutBgm('item_fanfare');
|
||||
this.scene.ui.showText(`You received\n${newModifier.type.name}!`, null, () => this.end(), null, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -314,6 +314,7 @@ export default class BattleScene extends Phaser.Scene {
|
||||
this.loadBgm('menu');
|
||||
|
||||
this.loadBgm('level_up_fanfare', 'bw/level_up_fanfare.mp3');
|
||||
this.loadBgm('item_fanfare', 'bw/item_fanfare.mp3');
|
||||
this.loadBgm('heal', 'bw/heal.mp3');
|
||||
this.loadBgm('victory_trainer', 'bw/victory_trainer.mp3');
|
||||
this.loadBgm('victory_gym', 'bw/victory_gym.mp3');
|
||||
@@ -849,7 +850,7 @@ export default class BattleScene extends Phaser.Scene {
|
||||
} else
|
||||
return;
|
||||
this.blockInput = true;
|
||||
this.time.delayedCall(new Utils.FixedInt(250) as unknown as integer, () => this.blockInput = false);
|
||||
this.time.delayedCall(Utils.fixedInt(250), () => this.blockInput = false);
|
||||
}
|
||||
|
||||
isButtonPressed(button: Button): boolean {
|
||||
@@ -954,7 +955,7 @@ export default class BattleScene extends Phaser.Scene {
|
||||
const sound = this.sound.get(soundName);
|
||||
if (this.bgmResumeTimer)
|
||||
this.bgmResumeTimer.destroy();
|
||||
this.bgmResumeTimer = this.time.delayedCall((pauseDuration || (sound.totalDuration * 1000)), () => {
|
||||
this.bgmResumeTimer = this.time.delayedCall((pauseDuration || Utils.fixedInt(sound.totalDuration * 1000)), () => {
|
||||
this.resumeBgm();
|
||||
this.bgmResumeTimer = null;
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ export class EvolutionPhase extends BattlePhase {
|
||||
this.scene.time.delayedCall(1250, () => {
|
||||
this.scene.playSound('evolution_fanfare');
|
||||
this.scene.ui.showText(`Congratulations! Your ${preName}\nevolved into ${pokemon.name}!`, null, () => this.end(), null, true, 3000);
|
||||
this.scene.time.delayedCall(new Utils.FixedInt(4250) as unknown as integer, () => this.scene.playBgm());
|
||||
this.scene.time.delayedCall(Utils.fixedInt(4250), () => this.scene.playBgm());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -383,10 +383,10 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.moveCursorObj.setVisible(true);
|
||||
this.moveCursorBlinkTimer = this.scene.time.addEvent({
|
||||
loop: true,
|
||||
delay: new Utils.FixedInt(600) as unknown as integer,
|
||||
delay: Utils.fixedInt(600),
|
||||
callback: () => {
|
||||
this.moveCursorObj.setVisible(false);
|
||||
this.scene.time.delayedCall(new Utils.FixedInt(100) as unknown as integer, () => {
|
||||
this.scene.time.delayedCall(Utils.fixedInt(100), () => {
|
||||
if (!this.moveCursorObj)
|
||||
return;
|
||||
this.moveCursorObj.setVisible(true);
|
||||
|
||||
@@ -92,7 +92,7 @@ export default class TargetSelectUiHandler extends UiHandler {
|
||||
targets: [ target ],
|
||||
alpha: 0,
|
||||
loop: -1,
|
||||
duration: new Utils.FixedInt(250) as unknown as integer,
|
||||
duration: Utils.fixedInt(250),
|
||||
ease: 'Sine.easeIn',
|
||||
yoyo: true,
|
||||
onUpdate: t => {
|
||||
|
||||
@@ -135,4 +135,8 @@ export class FixedInt extends IntegerHolder {
|
||||
constructor(value: integer) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
|
||||
export function fixedInt(value: integer): integer {
|
||||
return new FixedInt(value) as unknown as integer;
|
||||
}
|
||||
Reference in new issue
Block a user