Fix crash with stat change after Pokemon is recalled
parent
80095a64fc
commit
c5eb86b0b1
|
@ -2151,7 +2151,7 @@ export class StatChangePhase extends PokemonPhase {
|
||||||
start() {
|
start() {
|
||||||
const pokemon = this.getPokemon();
|
const pokemon = this.getPokemon();
|
||||||
|
|
||||||
if (pokemon.isFainted())
|
if (!pokemon.isActive(true))
|
||||||
return this.end();
|
return this.end();
|
||||||
|
|
||||||
const allStats = Utils.getEnumValues(BattleStat);
|
const allStats = Utils.getEnumValues(BattleStat);
|
||||||
|
|
|
@ -1601,7 +1601,7 @@ export class ProtectAttr extends AddBattlerTagAttr {
|
||||||
let timesUsed = 0;
|
let timesUsed = 0;
|
||||||
const moveHistory = user.getLastXMoves();
|
const moveHistory = user.getLastXMoves();
|
||||||
let turnMove: TurnMove;
|
let turnMove: TurnMove;
|
||||||
while (moveHistory.length && allMoves[(turnMove = moveHistory.shift()).move].getAttrs(ProtectAttr).find(pa => (pa as ProtectAttr).tagType === this.tagType) && turnMove.result === MoveResult.SUCCESS)
|
while (moveHistory.length && allMoves[(turnMove = moveHistory.shift()).move].getAttrs(ProtectAttr).find(pa => (pa as ProtectAttr).tagType === this.tagType))
|
||||||
timesUsed++;
|
timesUsed++;
|
||||||
if (timesUsed)
|
if (timesUsed)
|
||||||
return !user.randSeedInt(Math.pow(2, timesUsed));
|
return !user.randSeedInt(Math.pow(2, timesUsed));
|
||||||
|
|
|
@ -2413,7 +2413,7 @@ export const speciesStarters = {
|
||||||
[Species.SPIRITOMB]: 5,
|
[Species.SPIRITOMB]: 5,
|
||||||
[Species.GIBLE]: 4,
|
[Species.GIBLE]: 4,
|
||||||
[Species.MUNCHLAX]: 4,
|
[Species.MUNCHLAX]: 4,
|
||||||
[Species.RIOLU]: 5,
|
[Species.RIOLU]: 4,
|
||||||
[Species.HIPPOPOTAS]: 3,
|
[Species.HIPPOPOTAS]: 3,
|
||||||
[Species.SKORUPI]: 3,
|
[Species.SKORUPI]: 3,
|
||||||
[Species.CROAGUNK]: 3,
|
[Species.CROAGUNK]: 3,
|
||||||
|
|
Loading…
Reference in New Issue