Fix some bugs

pull/1/head
Flashfyre 2023-04-24 22:32:12 -04:00
parent 842e2707a1
commit 3753ea73be
7 changed files with 19 additions and 11 deletions

View File

@ -4674,7 +4674,7 @@
},
{
"frameIndex": 12,
"resourceName": "Overheat1.ogg",
"resourceName": "PRSFX- Overheat1.wav",
"volume": 100,
"pitch": 100,
"eventType": "AnimTimedSoundEvent"
@ -9398,7 +9398,7 @@
},
{
"frameIndex": 12,
"resourceName": "Overheat1.ogg",
"resourceName": "PRSFX- Overheat1.wav",
"volume": 100,
"pitch": 100,
"eventType": "AnimTimedSoundEvent"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -559,7 +559,7 @@ export class CommandPhase extends BattlePhase {
}, null, true);
break;
case Command.RUN:
//this.scene.unshiftPhase(new MoveAnimTestPhase(this.scene, [ Moves.SEISMIC_TOSS ]));
//this.scene.unshiftPhase(new MoveAnimTestPhase(this.scene));
//success = true;
break;
}
@ -1048,7 +1048,8 @@ export class MoveAnimTestPhase extends BattlePhase {
if (moveId === undefined) {
this.playMoveAnim(this.moveQueue.slice(0), true);
return;
}
} else if (player)
console.log(Moves[moveId]);
initMoveAnim(moveId).then(() => {
loadMoveAnimAssets(this.scene, [ moveId ], true)

View File

@ -1,6 +1,6 @@
import Phaser from 'phaser';
import { Biome } from './data/biome';
import UI, { Mode } from './ui/ui';
import UI from './ui/ui';
import { EncounterPhase, SummonPhase, CommandPhase, NextEncounterPhase, NewBiomeEncounterPhase, SelectBiomePhase, SelectStarterPhase, MessagePhase } from './battle-phases';
import Pokemon, { PlayerPokemon, EnemyPokemon } from './pokemon';
import PokemonSpecies, { allSpecies, getPokemonSpecies } from './data/pokemon-species';
@ -385,8 +385,6 @@ export default class BattleScene extends Phaser.Scene {
if (enableAuto)
initAutoPlay.apply(this);
this.pokeballCounts[PokeballType.POKEBALL] += 5;
this.newBattle();
this.shiftPhase();
@ -444,6 +442,7 @@ export default class BattleScene extends Phaser.Scene {
reset(): void {
this.pokeballCounts = Object.fromEntries(Utils.getEnumValues(PokeballType).filter(p => p <= PokeballType.MASTER_BALL).map(t => [ t, 0 ]));
this.pokeballCounts[PokeballType.POKEBALL] += 5;
this.modifiers = [];
this.enemyModifiers = [];

View File

@ -557,7 +557,7 @@ export abstract class BattleAnim {
let xOffset = (!isReverseCoords ? (userInitialX - targetInitialX) : (targetInitialX - userInitialX));
let yOffset = (!isReverseCoords ? (userInitialY - targetInitialY) : (targetInitialY - userInitialY));
const ySpriteOffset = ((userHalfHeight * (1 - xProgress)) + (targetHalfHeight * xProgress)) * -1;
const globalXOffset = !isGlobal ? 0 : -114;
const globalXOffset = 0;//!isGlobal ? 0 : -114;
const globalYOffset = 0;
if (isGlobal) {
xOffset -= ((scene.game.canvas.width / 6) * 0.25) / 2;

View File

@ -296,7 +296,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
value = Math.min(value + this.level + 10, 99999);
if (this.hp > value || this.hp === undefined)
this.hp = value;
else {
else if (this.hp) {
const lastMaxHp = this.getMaxHp();
if (lastMaxHp && value > lastMaxHp)
this.hp += value - lastMaxHp;

View File

@ -136,7 +136,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
icon.setScale(0.5);
icon.setOrigin(0, 0);
icon.play(species.getIconKey(dexEntry?.female, dexEntry?.formIndex)).stop();
if (!dexEntry)
icon.setTintFill(0);
this.starterSelectGenIconContainers[g].add(icon);
s++;
@ -184,6 +183,15 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (args.length >= 1 && args[0] instanceof Function) {
super.show(args);
for (let g = 0; g < this.genSpecies.length; g++) {
this.genSpecies[g].forEach((species, s) => {
const dexEntry = this.scene.gameData.getDefaultDexEntry(species);
const icon = this.starterSelectGenIconContainers[g].getAt(s) as Phaser.GameObjects.Sprite;
if (dexEntry)
icon.clearTint();
});
}
this.starterSelectCallback = args[0] as StarterSelectCallback;
this.starterSelectContainer.setVisible(true);