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