Merge hotfixes from main to beta (1.2.2) (#4912)
This commit is contained in:
commit
a86afa6725
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "pokemon-rogue-battle",
|
"name": "pokemon-rogue-battle",
|
||||||
"version": "1.2.0",
|
"version": "1.2.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pokemon-rogue-battle",
|
"name": "pokemon-rogue-battle",
|
||||||
"version": "1.2.0",
|
"version": "1.2.2",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material/material-color-utilities": "^0.2.7",
|
"@material/material-color-utilities": "^0.2.7",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "pokemon-rogue-battle",
|
"name": "pokemon-rogue-battle",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.2.0",
|
"version": "1.2.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
|
|
|
@ -3243,11 +3243,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getMoveHistory(): TurnMove[] {
|
public getMoveHistory(): TurnMove[] {
|
||||||
return this.battleSummonData.moveHistory;
|
return this.battleSummonData.moveHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
pushMoveHistory(turnMove: TurnMove) {
|
public pushMoveHistory(turnMove: TurnMove): void {
|
||||||
|
if (!this.isOnField()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
turnMove.turn = this.scene.currentBattle?.turn;
|
turnMove.turn = this.scene.currentBattle?.turn;
|
||||||
this.getMoveHistory().push(turnMove);
|
this.getMoveHistory().push(turnMove);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,8 +92,20 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||||
|
|
||||||
const isDelayedAttack = this.move.getMove().hasAttr(DelayedAttackAttr);
|
const isDelayedAttack = this.move.getMove().hasAttr(DelayedAttackAttr);
|
||||||
/** If the user was somehow removed from the field and it's not a delayed attack, end this phase */
|
/** If the user was somehow removed from the field and it's not a delayed attack, end this phase */
|
||||||
if (!user.isOnField() && !isDelayedAttack) {
|
if (!user.isOnField()) {
|
||||||
return super.end();
|
if (!isDelayedAttack) {
|
||||||
|
return super.end();
|
||||||
|
} else {
|
||||||
|
if (!user.scene) {
|
||||||
|
/**
|
||||||
|
* This happens if the Pokemon that used the delayed attack gets caught and released
|
||||||
|
* on the turn the attack would have triggered. Having access to the global scene
|
||||||
|
* in the future may solve this entirely, so for now we just cancel the hit
|
||||||
|
*/
|
||||||
|
return super.end();
|
||||||
|
}
|
||||||
|
user.resetTurnData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,7 +186,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||||
|
|
||||||
const playOnEmptyField = this.scene.currentBattle?.mysteryEncounter?.hasBattleAnimationsWithoutTargets ?? false;
|
const playOnEmptyField = this.scene.currentBattle?.mysteryEncounter?.hasBattleAnimationsWithoutTargets ?? false;
|
||||||
// Move animation only needs one target
|
// Move animation only needs one target
|
||||||
new MoveAnim(move.id as Moves, user, this.getFirstTarget()!.getBattlerIndex()!, playOnEmptyField).play(this.scene, move.hitsSubstitute(user, this.getFirstTarget()!), () => {
|
new MoveAnim(move.id as Moves, user, this.getFirstTarget()!.getBattlerIndex(), playOnEmptyField).play(this.scene, move.hitsSubstitute(user, this.getFirstTarget()!), () => {
|
||||||
/** Has the move successfully hit a target (for damage) yet? */
|
/** Has the move successfully hit a target (for damage) yet? */
|
||||||
let hasHit: boolean = false;
|
let hasHit: boolean = false;
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
|
|
Loading…
Reference in New Issue