-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[P All][Bug] Various ME bugfixes (copy) (#4695)
* Mystery Encounter bugfixes * more ME bug fixes * update allowed pokemon in ME requirements * some unit test cleanup and general tidying * fix null exception on isBattleMysteryEncounter * clean up tsdocs and fix pokemon hasAbility check * fix double battle crash in challenge mode with a single eligible pokemon * apply suggestions from PR#4619's code reviews * revert fix for Keldeo crashes + implement fix suggestion from PR #4619 * fix session migration for PokemonCustomData * prevent test failure due to keldeo fix --------- Co-authored-by: ImperialSympathizer <[email protected]>
- Loading branch information
1 parent
39abac6
commit e6c06d5
Showing
32 changed files
with
263 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
...ounters/mystery-encounter-pokemon-data.ts → src/data/custom-pokemon-data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
import { Abilities } from "#enums/abilities"; | ||
import { Type } from "#app/data/type"; | ||
import { isNullOrUndefined } from "#app/utils"; | ||
import { Nature } from "#enums/nature"; | ||
|
||
/** | ||
* Data that can customize a Pokemon in non-standard ways from its Species | ||
* Currently only used by Mystery Encounters, may need to be renamed if it becomes more widely used | ||
* Currently only used by Mystery Encounters and Mints. | ||
*/ | ||
export class MysteryEncounterPokemonData { | ||
export class CustomPokemonData { | ||
public spriteScale: number; | ||
public ability: Abilities | -1; | ||
public passive: Abilities | -1; | ||
public nature: Nature | -1; | ||
public types: Type[]; | ||
|
||
constructor(data?: MysteryEncounterPokemonData | Partial<MysteryEncounterPokemonData>) { | ||
constructor(data?: CustomPokemonData | Partial<CustomPokemonData>) { | ||
if (!isNullOrUndefined(data)) { | ||
Object.assign(this, data); | ||
} | ||
|
||
this.spriteScale = this.spriteScale ?? -1; | ||
this.ability = this.ability ?? -1; | ||
this.passive = this.passive ?? -1; | ||
this.nature = this.nature ?? -1; | ||
this.types = this.types ?? []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.