mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-11 10:52:17 +02:00
Cleanup tsdoc comments and remove invalid syntax
This commit is contained in:
parent
65294f408e
commit
51944e3d1f
@ -830,7 +830,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
* and {@linkcode PlayerPokemon.isActive is active}
|
* and {@linkcode PlayerPokemon.isActive is active}
|
||||||
* (aka {@linkcode PlayerPokemon.isAllowedInBattle is allowed in battle}),
|
* (aka {@linkcode PlayerPokemon.isAllowedInBattle is allowed in battle}),
|
||||||
* or `undefined` if there are no valid pokemon
|
* or `undefined` if there are no valid pokemon
|
||||||
* @param includeSwitching Whether a pokemon that is currently switching out is valid, default `true`
|
* @param includeSwitching - Whether a pokemon that is currently switching out is valid, default `true`
|
||||||
*/
|
*/
|
||||||
public getPlayerPokemon(includeSwitching = true): PlayerPokemon | undefined {
|
public getPlayerPokemon(includeSwitching = true): PlayerPokemon | undefined {
|
||||||
return this.getPlayerField().find(p => p.isActive() && (includeSwitching || p.switchOutStatus === false));
|
return this.getPlayerField().find(p => p.isActive() && (includeSwitching || p.switchOutStatus === false));
|
||||||
@ -855,7 +855,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
* and {@linkcode EnemyPokemon.isActive is active}
|
* and {@linkcode EnemyPokemon.isActive is active}
|
||||||
* (aka {@linkcode EnemyPokemon.isAllowedInBattle is allowed in battle}),
|
* (aka {@linkcode EnemyPokemon.isAllowedInBattle is allowed in battle}),
|
||||||
* or `undefined` if there are no valid pokemon
|
* or `undefined` if there are no valid pokemon
|
||||||
* @param includeSwitching Whether a pokemon that is currently switching out is valid, default `true`
|
* @param includeSwitching - Whether a pokemon that is currently switching out is valid, default `true`
|
||||||
*/
|
*/
|
||||||
public getEnemyPokemon(includeSwitching = true): EnemyPokemon | undefined {
|
public getEnemyPokemon(includeSwitching = true): EnemyPokemon | undefined {
|
||||||
return this.getEnemyField().find(p => p.isActive() && (includeSwitching || p.switchOutStatus === false));
|
return this.getEnemyField().find(p => p.isActive() && (includeSwitching || p.switchOutStatus === false));
|
||||||
@ -874,7 +874,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
/**
|
/**
|
||||||
* Returns an array of Pokemon on both sides of the battle - player first, then enemy.
|
* Returns an array of Pokemon on both sides of the battle - player first, then enemy.
|
||||||
* Does not actually check if the pokemon are on the field or not, and always has length 4 regardless of battle type.
|
* Does not actually check if the pokemon are on the field or not, and always has length 4 regardless of battle type.
|
||||||
* @param activeOnly Whether to consider only active pokemon
|
* @param activeOnly - Whether to consider only active pokemon
|
||||||
* @returns array of {@linkcode Pokemon}
|
* @returns array of {@linkcode Pokemon}
|
||||||
*/
|
*/
|
||||||
public getField(activeOnly = false): Pokemon[] {
|
public getField(activeOnly = false): Pokemon[] {
|
||||||
@ -888,8 +888,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used in doubles battles to redirect moves from one pokemon to another when one faints or is removed from the field
|
* Used in doubles battles to redirect moves from one pokemon to another when one faints or is removed from the field
|
||||||
* @param removedPokemon {@linkcode Pokemon} the pokemon that is being removed from the field (flee, faint), moves to be redirected FROM
|
* @param removedPokemon - The pokemon that is being removed from the field (flee, faint), moves to be redirected FROM
|
||||||
* @param allyPokemon {@linkcode Pokemon} the pokemon that will have the moves be redirected TO
|
* @param allyPokemon - The pokemon that will have the moves be redirected TO
|
||||||
*/
|
*/
|
||||||
redirectPokemonMoves(removedPokemon: Pokemon, allyPokemon: Pokemon): void {
|
redirectPokemonMoves(removedPokemon: Pokemon, allyPokemon: Pokemon): void {
|
||||||
// failsafe: if not a double battle just return
|
// failsafe: if not a double battle just return
|
||||||
@ -915,8 +915,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ModifierBar of this scene, which is declared private and therefore not accessible elsewhere
|
* Returns the ModifierBar of this scene, which is declared private and therefore not accessible elsewhere
|
||||||
* @param isEnemy Whether to return the enemy's modifier bar
|
* @param isEnemy - Whether to return the enemy's modifier bar
|
||||||
* @returns {ModifierBar}
|
|
||||||
*/
|
*/
|
||||||
getModifierBar(isEnemy?: boolean): ModifierBar {
|
getModifierBar(isEnemy?: boolean): ModifierBar {
|
||||||
return isEnemy ? this.enemyModifierBar : this.modifierBar;
|
return isEnemy ? this.enemyModifierBar : this.modifierBar;
|
||||||
@ -1023,7 +1022,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
* Removes a {@linkcode PlayerPokemon} from the party, and clears modifiers for that Pokemon's id
|
* Removes a {@linkcode PlayerPokemon} from the party, and clears modifiers for that Pokemon's id
|
||||||
* Useful for MEs/Challenges that remove Pokemon from the player party temporarily or permanently
|
* Useful for MEs/Challenges that remove Pokemon from the player party temporarily or permanently
|
||||||
* @param pokemon
|
* @param pokemon
|
||||||
* @param destroy Default true. If true, will destroy the {@linkcode PlayerPokemon} after removing
|
* @param destroy - Default true. If true, will destroy the {@linkcode PlayerPokemon} after removing
|
||||||
*/
|
*/
|
||||||
removePokemonFromPlayerParty(pokemon: PlayerPokemon, destroy = true) {
|
removePokemonFromPlayerParty(pokemon: PlayerPokemon, destroy = true) {
|
||||||
if (!pokemon) {
|
if (!pokemon) {
|
||||||
@ -1154,8 +1153,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
* This calls {@linkcode Battle.randSeedInt}({@linkcode range}, {@linkcode min}) in `src/battle.ts`
|
* This calls {@linkcode Battle.randSeedInt}({@linkcode range}, {@linkcode min}) in `src/battle.ts`
|
||||||
* which calls {@linkcode randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts`
|
* which calls {@linkcode randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts`
|
||||||
*
|
*
|
||||||
* @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
* @param range - How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
||||||
* @param min The minimum integer to pick, default `0`
|
* @param min - The minimum integer to pick, default `0`
|
||||||
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
||||||
*/
|
*/
|
||||||
randBattleSeedInt(range: number, min = 0): number {
|
randBattleSeedInt(range: number, min = 0): number {
|
||||||
@ -2039,7 +2038,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the current luck value.
|
* Displays the current luck value.
|
||||||
* @param duration The time for this label to fade in, if it is not already visible.
|
* @param duration - The time for this label to fade in, if it is not already visible.
|
||||||
*/
|
*/
|
||||||
updateAndShowText(duration: number): void {
|
updateAndShowText(duration: number): void {
|
||||||
const labels = [this.luckLabelText, this.luckText];
|
const labels = [this.luckLabelText, this.luckText];
|
||||||
@ -2628,8 +2627,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
* This method allows deferring the execution of a phase until certain conditions are met, which is useful for handling
|
* This method allows deferring the execution of a phase until certain conditions are met, which is useful for handling
|
||||||
* situations like abilities and entry hazards that depend on specific game states.
|
* situations like abilities and entry hazards that depend on specific game states.
|
||||||
*
|
*
|
||||||
* @param {Phase} phase - The phase to be added to the conditional queue.
|
* @param phase - The phase to be added to the conditional queue.
|
||||||
* @param {() => boolean} condition - A function that returns a boolean indicating whether the phase should be executed.
|
* @param condition - A function that returns a boolean indicating whether the phase should be executed.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
pushConditionalPhase(phase: Phase, condition: () => boolean): void {
|
pushConditionalPhase(phase: Phase, condition: () => boolean): void {
|
||||||
@ -2638,8 +2637,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a phase to nextCommandPhaseQueue, as long as boolean passed in is false
|
* Adds a phase to nextCommandPhaseQueue, as long as boolean passed in is false
|
||||||
* @param phase {@linkcode Phase} the phase to add
|
* @param phase - The phase to add
|
||||||
* @param defer boolean on which queue to add to, defaults to false, and adds to phaseQueue
|
* @param defer - boolean on which queue to add to, defaults to false, and adds to phaseQueue
|
||||||
*/
|
*/
|
||||||
pushPhase(phase: Phase, defer = false): void {
|
pushPhase(phase: Phase, defer = false): void {
|
||||||
(!defer ? this.phaseQueue : this.nextCommandPhaseQueue).push(phase);
|
(!defer ? this.phaseQueue : this.nextCommandPhaseQueue).push(phase);
|
||||||
@ -2647,7 +2646,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds Phase(s) to the end of phaseQueuePrepend, or at phaseQueuePrependSpliceIndex
|
* Adds Phase(s) to the end of phaseQueuePrepend, or at phaseQueuePrependSpliceIndex
|
||||||
* @param phases {@linkcode Phase} the phase(s) to add
|
* @param phases - The phase(s) to add
|
||||||
*/
|
*/
|
||||||
unshiftPhase(...phases: Phase[]): void {
|
unshiftPhase(...phases: Phase[]): void {
|
||||||
if (this.phaseQueuePrependSpliceIndex === -1) {
|
if (this.phaseQueuePrependSpliceIndex === -1) {
|
||||||
@ -2759,7 +2758,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
/**
|
/**
|
||||||
* Find a specific {@linkcode Phase} in the phase queue.
|
* Find a specific {@linkcode Phase} in the phase queue.
|
||||||
*
|
*
|
||||||
* @param phaseFilter filter function to use to find the wanted phase
|
* @param phaseFilter - filter function to use to find the wanted phase
|
||||||
* @returns the found phase or undefined if none found
|
* @returns the found phase or undefined if none found
|
||||||
*/
|
*/
|
||||||
findPhase<P extends Phase = Phase>(phaseFilter: (phase: P) => boolean): P | undefined {
|
findPhase<P extends Phase = Phase>(phaseFilter: (phase: P) => boolean): P | undefined {
|
||||||
@ -2786,7 +2785,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Will search for a specific phase in {@linkcode phaseQueuePrepend} via filter, and remove the first result if a match is found.
|
* Will search for a specific phase in {@linkcode phaseQueuePrepend} via filter, and remove the first result if a match is found.
|
||||||
* @param phaseFilter filter function
|
* @param phaseFilter - filter function
|
||||||
*/
|
*/
|
||||||
tryRemoveUnshiftedPhase(phaseFilter: (phase: Phase) => boolean): boolean {
|
tryRemoveUnshiftedPhase(phaseFilter: (phase: Phase) => boolean): boolean {
|
||||||
const phaseIndex = this.phaseQueuePrepend.findIndex(phaseFilter);
|
const phaseIndex = this.phaseQueuePrepend.findIndex(phaseFilter);
|
||||||
@ -2799,8 +2798,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to add the input phase to index before target phase in the phaseQueue, else simply calls unshiftPhase()
|
* Tries to add the input phase to index before target phase in the phaseQueue, else simply calls unshiftPhase()
|
||||||
* @param phase {@linkcode Phase} the phase to be added
|
* @param phase - The phase to be added
|
||||||
* @param targetPhase {@linkcode Phase} the type of phase to search for in phaseQueue
|
* @param targetPhase - The type of phase to search for in phaseQueue
|
||||||
* @returns boolean if a targetPhase was found and added
|
* @returns boolean if a targetPhase was found and added
|
||||||
*/
|
*/
|
||||||
prependToPhase(phase: Phase | Phase[], targetPhase: Constructor<Phase>): boolean {
|
prependToPhase(phase: Phase | Phase[], targetPhase: Constructor<Phase>): boolean {
|
||||||
@ -2819,8 +2818,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to add the input phase(s) to index after target phase in the {@linkcode phaseQueue}, else simply calls {@linkcode unshiftPhase()}
|
* Tries to add the input phase(s) to index after target phase in the {@linkcode phaseQueue}, else simply calls {@linkcode unshiftPhase()}
|
||||||
* @param phase {@linkcode Phase} the phase(s) to be added
|
* @param phase - The phase(s) to be added
|
||||||
* @param targetPhase {@linkcode Phase} the type of phase to search for in {@linkcode phaseQueue}
|
* @param targetPhase - The type of phase to search for in {@linkcode phaseQueue}
|
||||||
* @returns `true` if a `targetPhase` was found to append to
|
* @returns `true` if a `targetPhase` was found to append to
|
||||||
*/
|
*/
|
||||||
appendToPhase(phase: Phase | Phase[], targetPhase: Constructor<Phase>): boolean {
|
appendToPhase(phase: Phase | Phase[], targetPhase: Constructor<Phase>): boolean {
|
||||||
@ -2839,11 +2838,11 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a MessagePhase, either to PhaseQueuePrepend or nextCommandPhaseQueue
|
* Adds a MessagePhase, either to PhaseQueuePrepend or nextCommandPhaseQueue
|
||||||
* @param message string for MessagePhase
|
* @param message - string for MessagePhase
|
||||||
* @param callbackDelay optional param for MessagePhase constructor
|
* @param callbackDelay - optional param for MessagePhase constructor
|
||||||
* @param prompt optional param for MessagePhase constructor
|
* @param prompt - optional param for MessagePhase constructor
|
||||||
* @param promptDelay optional param for MessagePhase constructor
|
* @param promptDelay - optional param for MessagePhase constructor
|
||||||
* @param defer boolean for which queue to add it to, false -> add to PhaseQueuePrepend, true -> nextCommandPhaseQueue
|
* @param defer - boolean for which queue to add it to, false -> add to PhaseQueuePrepend, true -> nextCommandPhaseQueue
|
||||||
*/
|
*/
|
||||||
queueMessage(
|
queueMessage(
|
||||||
message: string,
|
message: string,
|
||||||
@ -2864,9 +2863,9 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Queues an ability bar flyout phase
|
* Queues an ability bar flyout phase
|
||||||
* @param pokemon The pokemon who has the ability
|
* @param pokemon - The pokemon who has the ability
|
||||||
* @param passive Whether the ability is a passive
|
* @param passive - Whether the ability is a passive
|
||||||
* @param show Whether to show or hide the bar
|
* @param show - Whether to show or hide the bar
|
||||||
*/
|
*/
|
||||||
public queueAbilityDisplay(pokemon: Pokemon, passive: boolean, show: boolean): void {
|
public queueAbilityDisplay(pokemon: Pokemon, passive: boolean, show: boolean): void {
|
||||||
this.unshiftPhase(show ? new ShowAbilityPhase(pokemon.getBattlerIndex(), passive) : new HideAbilityPhase());
|
this.unshiftPhase(show ? new ShowAbilityPhase(pokemon.getBattlerIndex(), passive) : new HideAbilityPhase());
|
||||||
@ -3026,13 +3025,13 @@ export default class BattleScene extends SceneBase {
|
|||||||
* If the recepient already has the maximum amount allowed for this item, the transfer is cancelled.
|
* If the recepient already has the maximum amount allowed for this item, the transfer is cancelled.
|
||||||
* The quantity to transfer is automatically capped at how much the recepient can take before reaching the maximum stack size for the item.
|
* The quantity to transfer is automatically capped at how much the recepient can take before reaching the maximum stack size for the item.
|
||||||
* A transfer that moves a quantity smaller than what is specified in the transferQuantity parameter is still considered successful.
|
* A transfer that moves a quantity smaller than what is specified in the transferQuantity parameter is still considered successful.
|
||||||
* @param itemModifier {@linkcode PokemonHeldItemModifier} item to transfer (represents the whole stack)
|
* @param itemModifier - The item to transfer (represents the whole stack)
|
||||||
* @param target {@linkcode Pokemon} recepient in this transfer
|
* @param target - The pokemon receiving the item in this transfer
|
||||||
* @param playSound `true` to play a sound when transferring the item
|
* @param playSound - `true` to play a sound when transferring the item
|
||||||
* @param transferQuantity How many items of the stack to transfer. Optional, defaults to `1`
|
* @param transferQuantity - How many items of the stack to transfer. Optional, defaults to `1`
|
||||||
* @param instant ??? (Optional)
|
* @param instant - If an item changes a display, such as the HP bar, whether changes will be animated or move instantly (Optional, defaults to false)
|
||||||
* @param ignoreUpdate ??? (Optional)
|
* @param ignoreUpdate - ??? (Optional)
|
||||||
* @param itemLost If `true`, treat the item's current holder as losing the item (for now, this simply enables Unburden). Default is `true`.
|
* @param itemLost - If `true`, treat the item's current holder as losing the item (for now, this simply enables Unburden). Default is `true`.
|
||||||
* @returns `true` if the transfer was successful
|
* @returns `true` if the transfer was successful
|
||||||
*/
|
*/
|
||||||
tryTransferHeldItemModifier(
|
tryTransferHeldItemModifier(
|
||||||
@ -3312,8 +3311,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
* Removes a currently owned item. If the item is stacked, the entire item stack
|
* Removes a currently owned item. If the item is stacked, the entire item stack
|
||||||
* gets removed. This function does NOT apply in-battle effects, such as Unburden.
|
* gets removed. This function does NOT apply in-battle effects, such as Unburden.
|
||||||
* If in-battle effects are needed, use {@linkcode Pokemon.loseHeldItem} instead.
|
* If in-battle effects are needed, use {@linkcode Pokemon.loseHeldItem} instead.
|
||||||
* @param modifier The item to be removed.
|
* @param modifier - The item to be removed.
|
||||||
* @param enemy If `true`, remove an item owned by the enemy. If `false`, remove an item owned by the player. Default is `false`.
|
* @param enemy - If `true`, remove an item owned by the enemy. If `false`, remove an item owned by the player. Default is `false`.
|
||||||
* @returns `true` if the item exists and was successfully removed, `false` otherwise.
|
* @returns `true` if the item exists and was successfully removed, `false` otherwise.
|
||||||
*/
|
*/
|
||||||
removeModifier(modifier: PersistentModifier, enemy = false): boolean {
|
removeModifier(modifier: PersistentModifier, enemy = false): boolean {
|
||||||
@ -3335,8 +3334,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all of the modifiers that match `modifierType`
|
* Get all of the modifiers that match `modifierType`
|
||||||
* @param modifierType The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
* @param modifierType - The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
||||||
* @param player Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
* @param player - Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
||||||
* @returns the list of all modifiers that matched `modifierType`.
|
* @returns the list of all modifiers that matched `modifierType`.
|
||||||
*/
|
*/
|
||||||
getModifiers<T extends PersistentModifier>(modifierType: Constructor<T>, player = true): T[] {
|
getModifiers<T extends PersistentModifier>(modifierType: Constructor<T>, player = true): T[] {
|
||||||
@ -3345,8 +3344,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all of the modifiers that pass the `modifierFilter` function
|
* Get all of the modifiers that pass the `modifierFilter` function
|
||||||
* @param modifierFilter The function used to filter a target's modifiers
|
* @param modifierFilter - The function used to filter a target's modifiers
|
||||||
* @param isPlayer Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
* @param isPlayer - Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
||||||
* @returns the list of all modifiers that passed the `modifierFilter` function
|
* @returns the list of all modifiers that passed the `modifierFilter` function
|
||||||
*/
|
*/
|
||||||
findModifiers(modifierFilter: ModifierPredicate, isPlayer = true): PersistentModifier[] {
|
findModifiers(modifierFilter: ModifierPredicate, isPlayer = true): PersistentModifier[] {
|
||||||
@ -3355,8 +3354,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the first modifier that pass the `modifierFilter` function
|
* Find the first modifier that pass the `modifierFilter` function
|
||||||
* @param modifierFilter The function used to filter a target's modifiers
|
* @param modifierFilter - The function used to filter a target's modifiers
|
||||||
* @param player Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
* @param player - Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
||||||
* @returns the first modifier that passed the `modifierFilter` function; `undefined` if none passed
|
* @returns the first modifier that passed the `modifierFilter` function; `undefined` if none passed
|
||||||
*/
|
*/
|
||||||
findModifier(modifierFilter: ModifierPredicate, player = true): PersistentModifier | undefined {
|
findModifier(modifierFilter: ModifierPredicate, player = true): PersistentModifier | undefined {
|
||||||
@ -3365,9 +3364,9 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply all modifiers that match `modifierType` in a random order
|
* Apply all modifiers that match `modifierType` in a random order
|
||||||
* @param modifierType The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
* @param modifierType - The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
||||||
* @param player Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
* @param player - Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
||||||
* @param ...args The list of arguments needed to invoke `modifierType.apply`
|
* @param ...args - The list of arguments needed to invoke `modifierType.apply`
|
||||||
* @returns the list of all modifiers that matched `modifierType` and were applied.
|
* @returns the list of all modifiers that matched `modifierType` and were applied.
|
||||||
*/
|
*/
|
||||||
applyShuffledModifiers<T extends PersistentModifier>(
|
applyShuffledModifiers<T extends PersistentModifier>(
|
||||||
@ -3397,9 +3396,9 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply all modifiers that match `modifierType`
|
* Apply all modifiers that match `modifierType`
|
||||||
* @param modifierType The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
* @param modifierType - The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
||||||
* @param player Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
* @param player - Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
||||||
* @param ...args The list of arguments needed to invoke `modifierType.apply`
|
* @param ...args - The list of arguments needed to invoke `modifierType.apply`
|
||||||
* @returns the list of all modifiers that matched `modifierType` and were applied.
|
* @returns the list of all modifiers that matched `modifierType` and were applied.
|
||||||
*/
|
*/
|
||||||
applyModifiers<T extends PersistentModifier>(
|
applyModifiers<T extends PersistentModifier>(
|
||||||
@ -3432,9 +3431,9 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply the first modifier that matches `modifierType`
|
* Apply the first modifier that matches `modifierType`
|
||||||
* @param modifierType The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
* @param modifierType - The type of modifier to apply; must extend {@linkcode PersistentModifier}
|
||||||
* @param player Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
* @param player - Whether to search the player (`true`) or the enemy (`false`); Defaults to `true`
|
||||||
* @param ...args The list of arguments needed to invoke `modifierType.apply`
|
* @param ...args - The list of arguments needed to invoke `modifierType.apply`
|
||||||
* @returns the first modifier that matches `modifierType` and was applied; return `null` if none matched
|
* @returns the first modifier that matches `modifierType` and was applied; return `null` if none matched
|
||||||
*/
|
*/
|
||||||
applyModifier<T extends PersistentModifier>(
|
applyModifier<T extends PersistentModifier>(
|
||||||
@ -3606,7 +3605,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialized the 2nd phase of the final boss (e.g. form-change for Eternatus)
|
* Initialized the 2nd phase of the final boss (e.g. form-change for Eternatus)
|
||||||
* @param pokemon The (enemy) pokemon
|
* @param pokemon - The (enemy) pokemon
|
||||||
*/
|
*/
|
||||||
initFinalBossPhaseTwo(pokemon: Pokemon): void {
|
initFinalBossPhaseTwo(pokemon: Pokemon): void {
|
||||||
if (pokemon instanceof EnemyPokemon && pokemon.isBoss() && !pokemon.formIndex && pokemon.bossSegmentIndex < 1) {
|
if (pokemon instanceof EnemyPokemon && pokemon.isBoss() && !pokemon.formIndex && pokemon.bossSegmentIndex < 1) {
|
||||||
@ -3644,10 +3643,10 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates Exp and level values for Player's party, adding new level up phases as required
|
* Updates Exp and level values for Player's party, adding new level up phases as required
|
||||||
* @param expValue raw value of exp to split among participants, OR the base multiplier to use with waveIndex
|
* @param expValue - raw value of exp to split among participants, OR the base multiplier to use with waveIndex
|
||||||
* @param pokemonDefeated If true, will increment Macho Brace stacks and give the party Pokemon friendship increases
|
* @param pokemonDefeated - If true, will increment Macho Brace stacks and give the party Pokemon friendship increases
|
||||||
* @param useWaveIndexMultiplier Default false. If true, will multiply expValue by a scaling waveIndex multiplier. Not needed if expValue is already scaled by level/wave
|
* @param useWaveIndexMultiplier - Default false. If true, will multiply expValue by a scaling waveIndex multiplier. Not needed if expValue is already scaled by level/wave
|
||||||
* @param pokemonParticipantIds Participants. If none are defined, no exp will be given. To spread evenly among the party, should pass all ids of party members.
|
* @param pokemonParticipantIds - Participants. If none are defined, no exp will be given. To spread evenly among the party, should pass all ids of party members.
|
||||||
*/
|
*/
|
||||||
applyPartyExp(
|
applyPartyExp(
|
||||||
expValue: number,
|
expValue: number,
|
||||||
@ -3830,8 +3829,8 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads or generates a mystery encounter
|
* Loads or generates a mystery encounter
|
||||||
* @param encounterType used to load session encounter when restarting game, etc.
|
* @param encounterType - used to load session encounter when restarting game, etc.
|
||||||
* @param canBypass optional boolean to indicate that the request is coming from a function that needs to access a Mystery Encounter outside of gameplay requirements
|
* @param canBypass - optional boolean to indicate that the request is coming from a function that needs to access a Mystery Encounter outside of gameplay requirements
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getMysteryEncounter(encounterType?: MysteryEncounterType, canBypass?: boolean): MysteryEncounter {
|
getMysteryEncounter(encounterType?: MysteryEncounterType, canBypass?: boolean): MysteryEncounter {
|
||||||
|
@ -451,8 +451,8 @@ export default class Battle {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a random number using the current battle's seed. Calls {@linkcode randSeedInt}
|
* Generates a random number using the current battle's seed. Calls {@linkcode randSeedInt}
|
||||||
* @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
* @param range - How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
||||||
* @param min The minimum integer to pick, default `0`
|
* @param min - The minimum integer to pick, default `0`
|
||||||
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
||||||
*/
|
*/
|
||||||
randSeedInt(range: number, min = 0): number {
|
randSeedInt(range: number, min = 0): number {
|
||||||
@ -545,9 +545,9 @@ export class FixedBattleConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to generate a random trainer for evil team trainers and the elite 4/champion
|
* Helper function to generate a random trainer for evil team trainers and the elite 4/champion
|
||||||
* @param trainerPool The TrainerType or list of TrainerTypes that can possibly be generated
|
* @param trainerPool - The TrainerType or list of TrainerTypes that can possibly be generated
|
||||||
* @param randomGender whether or not to randomly (50%) generate a female trainer (for use with evil team grunts)
|
* @param randomGender - whether or not to randomly (50%) generate a female trainer (for use with evil team grunts)
|
||||||
* @param seedOffset the seed offset to use for the random generation of the trainer
|
* @param seedOffset - the seed offset to use for the random generation of the trainer
|
||||||
* @returns the generated trainer
|
* @returns the generated trainer
|
||||||
*/
|
*/
|
||||||
export function getRandomTrainerFunc(
|
export function getRandomTrainerFunc(
|
||||||
|
@ -51,7 +51,7 @@ export class Ability implements Localizable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all ability attributes that match `attrType`
|
* Get all ability attributes that match `attrType`
|
||||||
* @param attrType any attribute that extends {@linkcode AbAttr}
|
* @param attrType - any attribute that extends {@linkcode AbAttr}
|
||||||
* @returns Array of attributes that match `attrType`, Empty Array if none match.
|
* @returns Array of attributes that match `attrType`, Empty Array if none match.
|
||||||
*/
|
*/
|
||||||
getAttrs<T extends AbAttr>(attrType: Constructor<T>): T[] {
|
getAttrs<T extends AbAttr>(attrType: Constructor<T>): T[] {
|
||||||
@ -60,7 +60,7 @@ export class Ability implements Localizable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if an ability has an attribute that matches `attrType`
|
* Check if an ability has an attribute that matches `attrType`
|
||||||
* @param attrType any attribute that extends {@linkcode AbAttr}
|
* @param attrType - any attribute that extends {@linkcode AbAttr}
|
||||||
* @returns true if the ability has attribute `attrType`
|
* @returns true if the ability has attribute `attrType`
|
||||||
*/
|
*/
|
||||||
hasAttr<T extends AbAttr>(attrType: Constructor<T>): boolean {
|
hasAttr<T extends AbAttr>(attrType: Constructor<T>): boolean {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -76,7 +76,7 @@ export abstract class ArenaTag {
|
|||||||
/**
|
/**
|
||||||
* When given a arena tag or json representing one, load the data for it.
|
* When given a arena tag or json representing one, load the data for it.
|
||||||
* This is meant to be inherited from by any arena tag with custom attributes
|
* This is meant to be inherited from by any arena tag with custom attributes
|
||||||
* @param {ArenaTag | any} source An arena tag
|
* @param source - An arena tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: ArenaTag | any): void {
|
loadTag(source: ArenaTag | any): void {
|
||||||
this.turnCount = source.turnCount;
|
this.turnCount = source.turnCount;
|
||||||
@ -139,10 +139,10 @@ export class MistTag extends ArenaTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the lowering of stats
|
* Cancels the lowering of stats
|
||||||
* @param _arena the {@linkcode Arena} containing this effect
|
* @param _arena - the {@linkcode Arena} containing this effect
|
||||||
* @param simulated `true` if the effect should be applied quietly
|
* @param simulated - `true` if the effect should be applied quietly
|
||||||
* @param attacker the {@linkcode Pokemon} using a move into this effect.
|
* @param attacker - the {@linkcode Pokemon} using a move into this effect.
|
||||||
* @param cancelled a {@linkcode BooleanHolder} whose value is set to `true`
|
* @param cancelled - a {@linkcode BooleanHolder} whose value is set to `true`
|
||||||
* to flag the stat reduction as cancelled
|
* to flag the stat reduction as cancelled
|
||||||
* @returns `true` if a stat reduction was cancelled; `false` otherwise
|
* @returns `true` if a stat reduction was cancelled; `false` otherwise
|
||||||
*/
|
*/
|
||||||
@ -170,7 +170,6 @@ export class MistTag extends ArenaTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reduces the damage of specific move categories in the arena.
|
* Reduces the damage of specific move categories in the arena.
|
||||||
* @extends ArenaTag
|
|
||||||
*/
|
*/
|
||||||
export class WeakenMoveScreenTag extends ArenaTag {
|
export class WeakenMoveScreenTag extends ArenaTag {
|
||||||
protected weakenedCategories: MoveCategory[];
|
protected weakenedCategories: MoveCategory[];
|
||||||
@ -201,11 +200,11 @@ export class WeakenMoveScreenTag extends ArenaTag {
|
|||||||
/**
|
/**
|
||||||
* Applies the weakening effect to the move.
|
* Applies the weakening effect to the move.
|
||||||
*
|
*
|
||||||
* @param _arena the {@linkcode Arena} where the move is applied.
|
* @param _arena - the {@linkcode Arena} where the move is applied.
|
||||||
* @param _simulated n/a
|
* @param _simulated - n/a
|
||||||
* @param attacker the attacking {@linkcode Pokemon}
|
* @param attacker - the attacking {@linkcode Pokemon}
|
||||||
* @param moveCategory the attacking move's {@linkcode MoveCategory}.
|
* @param moveCategory - the attacking move's {@linkcode MoveCategory}.
|
||||||
* @param damageMultiplier A {@linkcode NumberHolder} containing the damage multiplier
|
* @param damageMultiplier - A {@linkcode NumberHolder} containing the damage multiplier
|
||||||
* @returns `true` if the attacking move was weakened; `false` otherwise.
|
* @returns `true` if the attacking move was weakened; `false` otherwise.
|
||||||
*/
|
*/
|
||||||
override apply(
|
override apply(
|
||||||
@ -332,13 +331,13 @@ export class ConditionalProtectTag extends ArenaTag {
|
|||||||
/**
|
/**
|
||||||
* Checks incoming moves against the condition function
|
* Checks incoming moves against the condition function
|
||||||
* and protects the target if conditions are met
|
* and protects the target if conditions are met
|
||||||
* @param arena the {@linkcode Arena} containing this tag
|
* @param arena - the {@linkcode Arena} containing this tag
|
||||||
* @param simulated `true` if the tag is applied quietly; `false` otherwise.
|
* @param simulated - `true` if the tag is applied quietly; `false` otherwise.
|
||||||
* @param isProtected a {@linkcode BooleanHolder} used to flag if the move is protected against
|
* @param isProtected - a {@linkcode BooleanHolder} used to flag if the move is protected against
|
||||||
* @param attacker the attacking {@linkcode Pokemon}
|
* @param attacker - the attacking {@linkcode Pokemon}
|
||||||
* @param defender the defending {@linkcode Pokemon}
|
* @param defender - the defending {@linkcode Pokemon}
|
||||||
* @param moveId the {@linkcode Moves | identifier} for the move being used
|
* @param moveId - the {@linkcode Moves | identifier} for the move being used
|
||||||
* @param ignoresProtectBypass a {@linkcode BooleanHolder} used to flag if a protection effect supercedes effects that ignore protection
|
* @param ignoresProtectBypass - a {@linkcode BooleanHolder} used to flag if a protection effect supercedes effects that ignore protection
|
||||||
* @returns `true` if this tag protected against the attack; `false` otherwise
|
* @returns `true` if this tag protected against the attack; `false` otherwise
|
||||||
*/
|
*/
|
||||||
override apply(
|
override apply(
|
||||||
@ -376,8 +375,8 @@ export class ConditionalProtectTag extends ArenaTag {
|
|||||||
/**
|
/**
|
||||||
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Quick_Guard_(move) Quick Guard's}
|
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Quick_Guard_(move) Quick Guard's}
|
||||||
* protection effect.
|
* protection effect.
|
||||||
* @param _arena {@linkcode Arena} The arena containing the protection effect
|
* @param _arena - The arena containing the protection effect
|
||||||
* @param moveId {@linkcode Moves} The move to check against this condition
|
* @param moveId - The move to check against this condition
|
||||||
* @returns `true` if the incoming move's priority is greater than 0.
|
* @returns `true` if the incoming move's priority is greater than 0.
|
||||||
* This includes moves with modified priorities from abilities (e.g. Prankster)
|
* This includes moves with modified priorities from abilities (e.g. Prankster)
|
||||||
*/
|
*/
|
||||||
@ -407,8 +406,8 @@ class QuickGuardTag extends ConditionalProtectTag {
|
|||||||
/**
|
/**
|
||||||
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Wide_Guard_(move) Wide Guard's}
|
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Wide_Guard_(move) Wide Guard's}
|
||||||
* protection effect.
|
* protection effect.
|
||||||
* @param _arena {@linkcode Arena} The arena containing the protection effect
|
* @param _arena - The arena containing the protection effect
|
||||||
* @param moveId {@linkcode Moves} The move to check against this condition
|
* @param moveId - The move to check against this condition
|
||||||
* @returns `true` if the incoming move is multi-targeted (even if it's only used against one Pokemon).
|
* @returns `true` if the incoming move is multi-targeted (even if it's only used against one Pokemon).
|
||||||
*/
|
*/
|
||||||
const WideGuardConditionFunc: ProtectConditionFunc = (_arena, moveId): boolean => {
|
const WideGuardConditionFunc: ProtectConditionFunc = (_arena, moveId): boolean => {
|
||||||
@ -438,8 +437,8 @@ class WideGuardTag extends ConditionalProtectTag {
|
|||||||
/**
|
/**
|
||||||
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Mat_Block_(move) Mat Block's}
|
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Mat_Block_(move) Mat Block's}
|
||||||
* protection effect.
|
* protection effect.
|
||||||
* @param _arena {@linkcode Arena} The arena containing the protection effect.
|
* @param _arena - The arena containing the protection effect.
|
||||||
* @param moveId {@linkcode Moves} The move to check against this condition.
|
* @param moveId - The move to check against this condition.
|
||||||
* @returns `true` if the incoming move is not a Status move.
|
* @returns `true` if the incoming move is not a Status move.
|
||||||
*/
|
*/
|
||||||
const MatBlockConditionFunc: ProtectConditionFunc = (_arena, moveId): boolean => {
|
const MatBlockConditionFunc: ProtectConditionFunc = (_arena, moveId): boolean => {
|
||||||
@ -475,8 +474,8 @@ class MatBlockTag extends ConditionalProtectTag {
|
|||||||
/**
|
/**
|
||||||
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Crafty_Shield_(move) Crafty Shield's}
|
* Condition function for {@link https://bulbapedia.bulbagarden.net/wiki/Crafty_Shield_(move) Crafty Shield's}
|
||||||
* protection effect.
|
* protection effect.
|
||||||
* @param _arena {@linkcode Arena} The arena containing the protection effect
|
* @param _arena - The arena containing the protection effect
|
||||||
* @param moveId {@linkcode Moves} The move to check against this condition
|
* @param moveId - The move to check against this condition
|
||||||
* @returns `true` if the incoming move is a Status move, is not a hazard, and does not target all
|
* @returns `true` if the incoming move is a Status move, is not a hazard, and does not target all
|
||||||
* Pokemon or sides of the field.
|
* Pokemon or sides of the field.
|
||||||
*/
|
*/
|
||||||
@ -508,10 +507,10 @@ class CraftyShieldTag extends ConditionalProtectTag {
|
|||||||
export class NoCritTag extends ArenaTag {
|
export class NoCritTag extends ArenaTag {
|
||||||
/**
|
/**
|
||||||
* Constructor method for the NoCritTag class
|
* Constructor method for the NoCritTag class
|
||||||
* @param turnCount `number` the number of turns this effect lasts
|
* @param turnCount - `number` the number of turns this effect lasts
|
||||||
* @param sourceMove {@linkcode Moves} the move that created this effect
|
* @param sourceMove - the move that created this effect
|
||||||
* @param sourceId `number` the ID of the {@linkcode Pokemon} that created this effect
|
* @param sourceId - `number` the ID of the {@linkcode Pokemon} that created this effect
|
||||||
* @param side {@linkcode ArenaTagSide} the side to which this effect belongs
|
* @param side - the side to which this effect belongs
|
||||||
*/
|
*/
|
||||||
constructor(turnCount: number, sourceMove: Moves, sourceId: number, side: ArenaTagSide) {
|
constructor(turnCount: number, sourceMove: Moves, sourceId: number, side: ArenaTagSide) {
|
||||||
super(ArenaTagType.NO_CRIT, turnCount, sourceMove, sourceId, side);
|
super(ArenaTagType.NO_CRIT, turnCount, sourceMove, sourceId, side);
|
||||||
@ -598,10 +597,10 @@ export class WeakenMoveTypeTag extends ArenaTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reduces an attack's power by 0.33x if it matches this tag's weakened type.
|
* Reduces an attack's power by 0.33x if it matches this tag's weakened type.
|
||||||
* @param _arena n/a
|
* @param _arena - n/a
|
||||||
* @param _simulated n/a
|
* @param _simulated - n/a
|
||||||
* @param type the attack's {@linkcode PokemonType}
|
* @param type - the attack's {@linkcode PokemonType}
|
||||||
* @param power a {@linkcode NumberHolder} containing the attack's power
|
* @param power - a {@linkcode NumberHolder} containing the attack's power
|
||||||
* @returns `true` if the attack's power was reduced; `false` otherwise.
|
* @returns `true` if the attack's power was reduced; `false` otherwise.
|
||||||
*/
|
*/
|
||||||
override apply(_arena: Arena, _simulated: boolean, type: PokemonType, power: NumberHolder): boolean {
|
override apply(_arena: Arena, _simulated: boolean, type: PokemonType, power: NumberHolder): boolean {
|
||||||
@ -668,9 +667,9 @@ export class IonDelugeTag extends ArenaTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts Normal-type moves to Electric type
|
* Converts Normal-type moves to Electric type
|
||||||
* @param _arena n/a
|
* @param _arena - n/a
|
||||||
* @param _simulated n/a
|
* @param _simulated - n/a
|
||||||
* @param moveType a {@linkcode NumberHolder} containing a move's {@linkcode PokemonType}
|
* @param moveType - a {@linkcode NumberHolder} containing a move's {@linkcode PokemonType}
|
||||||
* @returns `true` if the given move type changed; `false` otherwise.
|
* @returns `true` if the given move type changed; `false` otherwise.
|
||||||
*/
|
*/
|
||||||
override apply(_arena: Arena, _simulated: boolean, moveType: NumberHolder): boolean {
|
override apply(_arena: Arena, _simulated: boolean, moveType: NumberHolder): boolean {
|
||||||
@ -715,9 +714,9 @@ export class ArenaTrapTag extends ArenaTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Activates the hazard effect onto a Pokemon when it enters the field
|
* Activates the hazard effect onto a Pokemon when it enters the field
|
||||||
* @param _arena the {@linkcode Arena} containing this tag
|
* @param _arena - the {@linkcode Arena} containing this tag
|
||||||
* @param simulated if `true`, only checks if the hazard would activate.
|
* @param simulated - if `true`, only checks if the hazard would activate.
|
||||||
* @param pokemon the {@linkcode Pokemon} triggering this hazard
|
* @param pokemon - the {@linkcode Pokemon} triggering this hazard
|
||||||
* @returns `true` if this hazard affects the given Pokemon; `false` otherwise.
|
* @returns `true` if this hazard affects the given Pokemon; `false` otherwise.
|
||||||
*/
|
*/
|
||||||
override apply(_arena: Arena, simulated: boolean, pokemon: Pokemon): boolean {
|
override apply(_arena: Arena, simulated: boolean, pokemon: Pokemon): boolean {
|
||||||
@ -1070,9 +1069,9 @@ export class TrickRoomTag extends ArenaTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverses Speed-based turn order for all Pokemon on the field
|
* Reverses Speed-based turn order for all Pokemon on the field
|
||||||
* @param _arena n/a
|
* @param _arena - n/a
|
||||||
* @param _simulated n/a
|
* @param _simulated - n/a
|
||||||
* @param speedReversed a {@linkcode BooleanHolder} used to flag if Speed-based
|
* @param speedReversed - a {@linkcode BooleanHolder} used to flag if Speed-based
|
||||||
* turn order should be reversed.
|
* turn order should be reversed.
|
||||||
* @returns `true` if turn order is successfully reversed; `false` otherwise
|
* @returns `true` if turn order is successfully reversed; `false` otherwise
|
||||||
*/
|
*/
|
||||||
@ -1267,7 +1266,7 @@ class ImprisonTag extends ArenaTrapTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This applies the effects of Imprison to any opposing Pokemon that switch into the field while the source Pokemon is still active
|
* This applies the effects of Imprison to any opposing Pokemon that switch into the field while the source Pokemon is still active
|
||||||
* @param {Pokemon} pokemon the Pokemon Imprison is applied to
|
* @param pokemon - the Pokemon Imprison is applied to
|
||||||
* @returns `true`
|
* @returns `true`
|
||||||
*/
|
*/
|
||||||
override activateTrap(pokemon: Pokemon): boolean {
|
override activateTrap(pokemon: Pokemon): boolean {
|
||||||
@ -1358,9 +1357,9 @@ class WaterFirePledgeTag extends ArenaTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Doubles the chance for the given move's secondary effect(s) to trigger
|
* Doubles the chance for the given move's secondary effect(s) to trigger
|
||||||
* @param _arena the {@linkcode Arena} containing this tag
|
* @param _arena - the {@linkcode Arena} containing this tag
|
||||||
* @param _simulated n/a
|
* @param _simulated - n/a
|
||||||
* @param moveChance a {@linkcode NumberHolder} containing
|
* @param moveChance - a {@linkcode NumberHolder} containing
|
||||||
* the move's current effect chance
|
* the move's current effect chance
|
||||||
* @returns `true` if the move's effect chance was doubled (currently always `true`)
|
* @returns `true` if the move's effect chance was doubled (currently always `true`)
|
||||||
*/
|
*/
|
||||||
@ -1567,7 +1566,7 @@ export function getArenaTag(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, creates an actual ArenaTag object with the same data.
|
* When given a battler tag or json representing one, creates an actual ArenaTag object with the same data.
|
||||||
* @param {ArenaTag | any} source An arena tag
|
* @param source - An arena tag
|
||||||
* @return {ArenaTag} The valid arena tag
|
* @return {ArenaTag} The valid arena tag
|
||||||
*/
|
*/
|
||||||
export function loadArenaTag(source: ArenaTag | any): ArenaTag {
|
export function loadArenaTag(source: ArenaTag | any): ArenaTag {
|
||||||
|
@ -10,7 +10,7 @@ export const FRIENDSHIP_LOSS_FROM_FAINT = 5;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to get the cumulative friendship threshold at which a candy is earned
|
* Function to get the cumulative friendship threshold at which a candy is earned
|
||||||
* @param starterCost The cost of the starter, found in {@linkcode speciesStarterCosts}
|
* @param starterCost - The cost of the starter, found in {@linkcode speciesStarterCosts}
|
||||||
* @returns aforementioned threshold
|
* @returns aforementioned threshold
|
||||||
*/
|
*/
|
||||||
export function getStarterValueFriendshipCap(starterCost: number): number {
|
export function getStarterValueFriendshipCap(starterCost: number): number {
|
||||||
@ -633,7 +633,7 @@ const starterCandyCosts: { passive: number; costReduction: [number, number]; egg
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for {@linkcode starterCandyCosts} for passive unlock candy cost based on initial point cost
|
* Getter for {@linkcode starterCandyCosts} for passive unlock candy cost based on initial point cost
|
||||||
* @param starterCost the default point cost of the starter found in {@linkcode speciesStarterCosts}
|
* @param starterCost - the default point cost of the starter found in {@linkcode speciesStarterCosts}
|
||||||
* @returns the candy cost for passive unlock
|
* @returns the candy cost for passive unlock
|
||||||
*/
|
*/
|
||||||
export function getPassiveCandyCount(starterCost: number): number {
|
export function getPassiveCandyCount(starterCost: number): number {
|
||||||
@ -642,7 +642,7 @@ export function getPassiveCandyCount(starterCost: number): number {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for {@linkcode starterCandyCosts} for value reduction unlock candy cost based on initial point cost
|
* Getter for {@linkcode starterCandyCosts} for value reduction unlock candy cost based on initial point cost
|
||||||
* @param starterCost the default point cost of the starter found in {@linkcode speciesStarterCosts}
|
* @param starterCost - the default point cost of the starter found in {@linkcode speciesStarterCosts}
|
||||||
* @returns respective candy cost for the two cost reductions as an array 2 numbers
|
* @returns respective candy cost for the two cost reductions as an array 2 numbers
|
||||||
*/
|
*/
|
||||||
export function getValueReductionCandyCounts(starterCost: number): [number, number] {
|
export function getValueReductionCandyCounts(starterCost: number): [number, number] {
|
||||||
@ -651,7 +651,7 @@ export function getValueReductionCandyCounts(starterCost: number): [number, numb
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for {@linkcode starterCandyCosts} for egg purchase candy cost based on initial point cost
|
* Getter for {@linkcode starterCandyCosts} for egg purchase candy cost based on initial point cost
|
||||||
* @param starterCost the default point cost of the starter found in {@linkcode speciesStarterCosts}
|
* @param starterCost - the default point cost of the starter found in {@linkcode speciesStarterCosts}
|
||||||
* @returns the candy cost for the purchasable egg
|
* @returns the candy cost for the purchasable egg
|
||||||
*/
|
*/
|
||||||
export function getSameSpeciesEggCandyCounts(starterCost: number): number {
|
export function getSameSpeciesEggCandyCounts(starterCost: number): number {
|
||||||
|
@ -590,8 +590,8 @@ export function initMoveAnim(move: Moves): Promise<void> {
|
|||||||
/**
|
/**
|
||||||
* Populates the default animation for the given move.
|
* Populates the default animation for the given move.
|
||||||
*
|
*
|
||||||
* @param move the move to populate an animation for
|
* @param move - the move to populate an animation for
|
||||||
* @param defaultMoveAnim the move to use as the default animation
|
* @param defaultMoveAnim - the move to use as the default animation
|
||||||
*/
|
*/
|
||||||
function useDefaultAnim(move: Moves, defaultMoveAnim: Moves) {
|
function useDefaultAnim(move: Moves, defaultMoveAnim: Moves) {
|
||||||
populateMoveAnim(move, moveAnims.get(defaultMoveAnim));
|
populateMoveAnim(move, moveAnims.get(defaultMoveAnim));
|
||||||
@ -600,8 +600,8 @@ function useDefaultAnim(move: Moves, defaultMoveAnim: Moves) {
|
|||||||
/**
|
/**
|
||||||
* Helper method for printing a warning to the console when a move animation is missing.
|
* Helper method for printing a warning to the console when a move animation is missing.
|
||||||
*
|
*
|
||||||
* @param move the move to populate an animation for
|
* @param move - the move to populate an animation for
|
||||||
* @param optionalParams parameters to add to the error logging
|
* @param optionalParams - parameters to add to the error logging
|
||||||
*
|
*
|
||||||
* @remarks use {@linkcode useDefaultAnim} to use a default animation
|
* @remarks use {@linkcode useDefaultAnim} to use a default animation
|
||||||
*/
|
*/
|
||||||
@ -612,7 +612,7 @@ function logMissingMoveAnim(move: Moves, ...optionalParams: any[]) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches animation configs to be used in a Mystery Encounter
|
* Fetches animation configs to be used in a Mystery Encounter
|
||||||
* @param encounterAnim one or more animations to fetch
|
* @param encounterAnim - one or more animations to fetch
|
||||||
*/
|
*/
|
||||||
export async function initEncounterAnims(encounterAnim: EncounterAnim | EncounterAnim[]): Promise<void> {
|
export async function initEncounterAnims(encounterAnim: EncounterAnim | EncounterAnim[]): Promise<void> {
|
||||||
const anims = Array.isArray(encounterAnim) ? encounterAnim : [encounterAnim];
|
const anims = Array.isArray(encounterAnim) ? encounterAnim : [encounterAnim];
|
||||||
@ -1114,7 +1114,7 @@ export abstract class BattleAnim {
|
|||||||
if (spritePriorities[graphicIndex] !== frame.priority) {
|
if (spritePriorities[graphicIndex] !== frame.priority) {
|
||||||
spritePriorities[graphicIndex] = frame.priority;
|
spritePriorities[graphicIndex] = frame.priority;
|
||||||
/** Move the position that the moveSprite is rendered in based on the priority.
|
/** Move the position that the moveSprite is rendered in based on the priority.
|
||||||
* @param priority The priority level to draw the sprite.
|
* @param priority - The priority level to draw the sprite.
|
||||||
* - 0: Draw the sprite in front of the pokemon on the field.
|
* - 0: Draw the sprite in front of the pokemon on the field.
|
||||||
* - 1: Draw the sprite in front of the user pokemon.
|
* - 1: Draw the sprite in front of the user pokemon.
|
||||||
* - 2: Draw the sprite in front of its `bgSprite` (if it has one), or its
|
* - 2: Draw the sprite in front of its `bgSprite` (if it has one), or its
|
||||||
|
@ -110,7 +110,7 @@ export class BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* This is meant to be inherited from by any battler tag with custom attributes
|
* This is meant to be inherited from by any battler tag with custom attributes
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
this.turnCount = source.turnCount;
|
this.turnCount = source.turnCount;
|
||||||
@ -186,9 +186,9 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Checks if this tag is restricting a move based on a user's decisions during the target selection phase
|
* Checks if this tag is restricting a move based on a user's decisions during the target selection phase
|
||||||
*
|
*
|
||||||
* @param {Moves} _move {@linkcode Moves} move ID to check restriction for
|
* @param _move - move ID to check restriction for
|
||||||
* @param {Pokemon} _user {@linkcode Pokemon} the user of the above move
|
* @param _user - the user of the above move
|
||||||
* @param {Pokemon} _target {@linkcode Pokemon} the target of the above move
|
* @param _target - the target of the above move
|
||||||
* @returns {boolean} `false` unless overridden by the child tag
|
* @returns {boolean} `false` unless overridden by the child tag
|
||||||
*/
|
*/
|
||||||
isMoveTargetRestricted(_move: Moves, _user: Pokemon, _target: Pokemon): boolean {
|
isMoveTargetRestricted(_move: Moves, _user: Pokemon, _target: Pokemon): boolean {
|
||||||
@ -198,8 +198,8 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Gets the text to display when the player attempts to select a move that is restricted by this tag.
|
* Gets the text to display when the player attempts to select a move that is restricted by this tag.
|
||||||
*
|
*
|
||||||
* @param {Pokemon} pokemon {@linkcode Pokemon} for which the player is attempting to select the restricted move
|
* @param pokemon - for which the player is attempting to select the restricted move
|
||||||
* @param {Moves} move {@linkcode Moves} ID of the move that is having its selection denied
|
* @param move - ID of the move that is having its selection denied
|
||||||
* @returns {string} text to display when the player attempts to select the restricted move
|
* @returns {string} text to display when the player attempts to select the restricted move
|
||||||
*/
|
*/
|
||||||
abstract selectionDeniedText(pokemon: Pokemon, move: Moves): string;
|
abstract selectionDeniedText(pokemon: Pokemon, move: Moves): string;
|
||||||
@ -209,8 +209,8 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
|||||||
* Because restriction effects also prevent selection of the move, this situation can only arise if a
|
* Because restriction effects also prevent selection of the move, this situation can only arise if a
|
||||||
* pokemon first selects a move, then gets outsped by a pokemon using a move that restricts the selected move.
|
* pokemon first selects a move, then gets outsped by a pokemon using a move that restricts the selected move.
|
||||||
*
|
*
|
||||||
* @param {Pokemon} _pokemon {@linkcode Pokemon} attempting to use the restricted move
|
* @param _pokemon - attempting to use the restricted move
|
||||||
* @param {Moves} _move {@linkcode Moves} ID of the move being interrupted
|
* @param _move - ID of the move being interrupted
|
||||||
* @returns {string} text to display when the move is interrupted
|
* @returns {string} text to display when the move is interrupted
|
||||||
*/
|
*/
|
||||||
interruptedText(_pokemon: Pokemon, _move: Moves): string {
|
interruptedText(_pokemon: Pokemon, _move: Moves): string {
|
||||||
@ -221,7 +221,6 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Tag representing the "Throat Chop" effect. Pokemon with this tag cannot use sound-based moves.
|
* Tag representing the "Throat Chop" effect. Pokemon with this tag cannot use sound-based moves.
|
||||||
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Throat_Chop_(move) | Throat Chop}
|
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Throat_Chop_(move) | Throat Chop}
|
||||||
* @extends MoveRestrictionBattlerTag
|
|
||||||
*/
|
*/
|
||||||
export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
|
export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -236,7 +235,7 @@ export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Checks if a {@linkcode Moves | move} is restricted by Throat Chop.
|
* Checks if a {@linkcode Moves | move} is restricted by Throat Chop.
|
||||||
* @override
|
* @override
|
||||||
* @param {Moves} move the {@linkcode Moves | move} to check for sound-based restriction
|
* @param move - the {@linkcode Moves | move} to check for sound-based restriction
|
||||||
* @returns true if the move is sound-based
|
* @returns true if the move is sound-based
|
||||||
*/
|
*/
|
||||||
override isMoveRestricted(move: Moves): boolean {
|
override isMoveRestricted(move: Moves): boolean {
|
||||||
@ -246,8 +245,8 @@ export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Shows a message when the player attempts to select a move that is restricted by Throat Chop.
|
* Shows a message when the player attempts to select a move that is restricted by Throat Chop.
|
||||||
* @override
|
* @override
|
||||||
* @param {Pokemon} _pokemon the {@linkcode Pokemon} that is attempting to select the restricted move
|
* @param _pokemon - the {@linkcode Pokemon} that is attempting to select the restricted move
|
||||||
* @param {Moves} move the {@linkcode Moves | move} that is being restricted
|
* @param move - the {@linkcode Moves | move} that is being restricted
|
||||||
* @returns the message to display when the player attempts to select the restricted move
|
* @returns the message to display when the player attempts to select the restricted move
|
||||||
*/
|
*/
|
||||||
override selectionDeniedText(_pokemon: Pokemon, move: Moves): string {
|
override selectionDeniedText(_pokemon: Pokemon, move: Moves): string {
|
||||||
@ -259,8 +258,8 @@ export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Shows a message when a move is interrupted by Throat Chop.
|
* Shows a message when a move is interrupted by Throat Chop.
|
||||||
* @override
|
* @override
|
||||||
* @param {Pokemon} pokemon the interrupted {@linkcode Pokemon}
|
* @param pokemon - the interrupted {@linkcode Pokemon}
|
||||||
* @param {Moves} _move the {@linkcode Moves | move} that was interrupted
|
* @param _move - the {@linkcode Moves | move} that was interrupted
|
||||||
* @returns the message to display when the move is interrupted
|
* @returns the message to display when the move is interrupted
|
||||||
*/
|
*/
|
||||||
override interruptedText(pokemon: Pokemon, _move: Moves): string {
|
override interruptedText(pokemon: Pokemon, _move: Moves): string {
|
||||||
@ -336,8 +335,8 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @override
|
* @override
|
||||||
* @param {Pokemon} pokemon {@linkcode Pokemon} attempting to use the restricted move
|
* @param pokemon - attempting to use the restricted move
|
||||||
* @param {Moves} move {@linkcode Moves} ID of the move being interrupted
|
* @param move - ID of the move being interrupted
|
||||||
* @returns {string} text to display when the move is interrupted
|
* @returns {string} text to display when the move is interrupted
|
||||||
*/
|
*/
|
||||||
override interruptedText(pokemon: Pokemon, move: Moves): string {
|
override interruptedText(pokemon: Pokemon, move: Moves): string {
|
||||||
@ -356,7 +355,6 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag used by Gorilla Tactics to restrict the user to using only one move.
|
* Tag used by Gorilla Tactics to restrict the user to using only one move.
|
||||||
* @extends MoveRestrictionBattlerTag
|
|
||||||
*/
|
*/
|
||||||
export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
||||||
private moveId = Moves.NONE;
|
private moveId = Moves.NONE;
|
||||||
@ -372,7 +370,7 @@ export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @override
|
* @override
|
||||||
* @param {Pokemon} pokemon the {@linkcode Pokemon} to check if the tag can be added
|
* @param pokemon - the {@linkcode Pokemon} to check if the tag can be added
|
||||||
* @returns `true` if the pokemon has a valid move and no existing {@linkcode GorillaTacticsTag}; `false` otherwise
|
* @returns `true` if the pokemon has a valid move and no existing {@linkcode GorillaTacticsTag}; `false` otherwise
|
||||||
*/
|
*/
|
||||||
override canAdd(pokemon: Pokemon): boolean {
|
override canAdd(pokemon: Pokemon): boolean {
|
||||||
@ -383,7 +381,7 @@ export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
|||||||
* Ensures that move history exists on {@linkcode Pokemon} and has a valid move.
|
* Ensures that move history exists on {@linkcode Pokemon} and has a valid move.
|
||||||
* If so, sets the {@linkcode moveId} and increases the user's Attack by 50%.
|
* If so, sets the {@linkcode moveId} and increases the user's Attack by 50%.
|
||||||
* @override
|
* @override
|
||||||
* @param {Pokemon} pokemon the {@linkcode Pokemon} to add the tag to
|
* @param pokemon - the {@linkcode Pokemon} to add the tag to
|
||||||
*/
|
*/
|
||||||
override onAdd(pokemon: Pokemon): void {
|
override onAdd(pokemon: Pokemon): void {
|
||||||
const lastValidMove = this.getLastValidMove(pokemon);
|
const lastValidMove = this.getLastValidMove(pokemon);
|
||||||
@ -399,7 +397,7 @@ export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Loads the Gorilla Tactics Battler Tag along with its unique class variable moveId
|
* Loads the Gorilla Tactics Battler Tag along with its unique class variable moveId
|
||||||
* @override
|
* @override
|
||||||
* @param source Gorilla Tactics' {@linkcode BattlerTag} information
|
* @param source - Gorilla Tactics' {@linkcode BattlerTag} information
|
||||||
*/
|
*/
|
||||||
public override loadTag(source: BattlerTag | any): void {
|
public override loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -409,8 +407,8 @@ export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @override
|
* @override
|
||||||
* @param {Pokemon} pokemon n/a
|
* @param pokemon - n/a
|
||||||
* @param {Moves} _move {@linkcode Moves} ID of the move being denied
|
* @param _move - ID of the move being denied
|
||||||
* @returns {string} text to display when the move is denied
|
* @returns {string} text to display when the move is denied
|
||||||
*/
|
*/
|
||||||
override selectionDeniedText(pokemon: Pokemon, _move: Moves): string {
|
override selectionDeniedText(pokemon: Pokemon, _move: Moves): string {
|
||||||
@ -422,7 +420,7 @@ export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the last valid move from the pokemon's move history.
|
* Gets the last valid move from the pokemon's move history.
|
||||||
* @param {Pokemon} pokemon {@linkcode Pokemon} to get the last valid move from
|
* @param pokemon - to get the last valid move from
|
||||||
* @returns {Moves | undefined} the last valid move from the pokemon's move history
|
* @returns {Moves | undefined} the last valid move from the pokemon's move history
|
||||||
*/
|
*/
|
||||||
getLastValidMove(pokemon: Pokemon): Moves | undefined {
|
getLastValidMove(pokemon: Pokemon): Moves | undefined {
|
||||||
@ -492,8 +490,8 @@ export class BeakBlastChargingTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Inflicts `BURN` status on attackers that make contact, and causes this tag
|
* Inflicts `BURN` status on attackers that make contact, and causes this tag
|
||||||
* to be removed after the source makes a move (or the turn ends, whichever comes first)
|
* to be removed after the source makes a move (or the turn ends, whichever comes first)
|
||||||
* @param pokemon {@linkcode Pokemon} the owner of this tag
|
* @param pokemon - the owner of this tag
|
||||||
* @param lapseType {@linkcode BattlerTagLapseType} the type of functionality invoked in battle
|
* @param lapseType - the type of functionality invoked in battle
|
||||||
* @returns `true` if invoked with the `AFTER_HIT` lapse type
|
* @returns `true` if invoked with the `AFTER_HIT` lapse type
|
||||||
*/
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
@ -536,8 +534,8 @@ export class ShellTrapTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* "Activates" the shell trap, causing the tag owner to move next.
|
* "Activates" the shell trap, causing the tag owner to move next.
|
||||||
* @param pokemon {@linkcode Pokemon} the owner of this tag
|
* @param pokemon - the owner of this tag
|
||||||
* @param lapseType {@linkcode BattlerTagLapseType} the type of functionality invoked in battle
|
* @param lapseType - the type of functionality invoked in battle
|
||||||
* @returns `true` if invoked with the `AFTER_HIT` lapse type
|
* @returns `true` if invoked with the `AFTER_HIT` lapse type
|
||||||
*/
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
@ -625,7 +623,6 @@ export class TrappedTag extends BattlerTag {
|
|||||||
* BattlerTag implementing No Retreat's trapping effect.
|
* BattlerTag implementing No Retreat's trapping effect.
|
||||||
* This is treated separately from other trapping effects to prevent
|
* This is treated separately from other trapping effects to prevent
|
||||||
* Ghost-type Pokemon from being able to reuse the move.
|
* Ghost-type Pokemon from being able to reuse the move.
|
||||||
* @extends TrappedTag
|
|
||||||
*/
|
*/
|
||||||
class NoRetreatTag extends TrappedTag {
|
class NoRetreatTag extends TrappedTag {
|
||||||
constructor(sourceId: number) {
|
constructor(sourceId: number) {
|
||||||
@ -654,8 +651,8 @@ export class FlinchedTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the Pokemon's next Move on the turn this tag is applied
|
* Cancels the Pokemon's next Move on the turn this tag is applied
|
||||||
* @param pokemon The {@linkcode Pokemon} with this tag
|
* @param pokemon - The {@linkcode Pokemon} with this tag
|
||||||
* @param lapseType The {@linkcode BattlerTagLapseType lapse type} used for this function call
|
* @param lapseType - The {@linkcode BattlerTagLapseType lapse type} used for this function call
|
||||||
* @returns `false` (This tag is always removed after applying its effects)
|
* @returns `false` (This tag is always removed after applying its effects)
|
||||||
*/
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
@ -780,7 +777,6 @@ export class ConfusedTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag applied to the {@linkcode Move.DESTINY_BOND} user.
|
* Tag applied to the {@linkcode Move.DESTINY_BOND} user.
|
||||||
* @extends BattlerTag
|
|
||||||
* @see {@linkcode apply}
|
* @see {@linkcode apply}
|
||||||
*/
|
*/
|
||||||
export class DestinyBondTag extends BattlerTag {
|
export class DestinyBondTag extends BattlerTag {
|
||||||
@ -793,8 +789,8 @@ export class DestinyBondTag extends BattlerTag {
|
|||||||
* or after receiving fatal damage. When the damage is fatal,
|
* or after receiving fatal damage. When the damage is fatal,
|
||||||
* the attacking Pokemon is taken down as well, unless it's a boss.
|
* the attacking Pokemon is taken down as well, unless it's a boss.
|
||||||
*
|
*
|
||||||
* @param {Pokemon} pokemon Pokemon that is attacking the Destiny Bond user.
|
* @param pokemon - Pokemon that is attacking the Destiny Bond user.
|
||||||
* @param {BattlerTagLapseType} lapseType CUSTOM or PRE_MOVE
|
* @param lapseType - CUSTOM or PRE_MOVE
|
||||||
* @returns false if the tag source fainted or one turn has passed since the application
|
* @returns false if the tag source fainted or one turn has passed since the application
|
||||||
*/
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
@ -923,7 +919,7 @@ export class SeedTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -1012,8 +1008,8 @@ export class PowderTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Applies Powder's effects before the tag owner uses a Fire-type move.
|
* Applies Powder's effects before the tag owner uses a Fire-type move.
|
||||||
* Also causes the tag to expire at the end of turn.
|
* Also causes the tag to expire at the end of turn.
|
||||||
* @param pokemon {@linkcode Pokemon} the owner of this tag
|
* @param pokemon - the owner of this tag
|
||||||
* @param lapseType {@linkcode BattlerTagLapseType} the type of lapse functionality to carry out
|
* @param lapseType - the type of lapse functionality to carry out
|
||||||
* @returns `true` if the tag should not expire after this lapse; `false` otherwise.
|
* @returns `true` if the tag should not expire after this lapse; `false` otherwise.
|
||||||
*/
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
@ -1135,7 +1131,7 @@ export class EncoreTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -1209,8 +1205,8 @@ export class EncoreTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the move matches the moveId stored within the tag and returns a boolean value
|
* Checks if the move matches the moveId stored within the tag and returns a boolean value
|
||||||
* @param move {@linkcode Moves} the move selected
|
* @param move - the move selected
|
||||||
* @param user N/A
|
* @param user - N/A
|
||||||
* @returns `true` if the move does not match with the moveId stored and as a result, restricted
|
* @returns `true` if the move does not match with the moveId stored and as a result, restricted
|
||||||
*/
|
*/
|
||||||
override isMoveRestricted(move: Moves, _user?: Pokemon): boolean {
|
override isMoveRestricted(move: Moves, _user?: Pokemon): boolean {
|
||||||
@ -1252,7 +1248,6 @@ export class HelpingHandTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies the Ingrain tag to a pokemon
|
* Applies the Ingrain tag to a pokemon
|
||||||
* @extends TrappedTag
|
|
||||||
*/
|
*/
|
||||||
export class IngrainTag extends TrappedTag {
|
export class IngrainTag extends TrappedTag {
|
||||||
constructor(sourceId: number) {
|
constructor(sourceId: number) {
|
||||||
@ -1261,7 +1256,7 @@ export class IngrainTag extends TrappedTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the Ingrain tag can be added to the pokemon
|
* Check if the Ingrain tag can be added to the pokemon
|
||||||
* @param pokemon {@linkcode Pokemon} The pokemon to check if the tag can be added to
|
* @param pokemon - The pokemon to check if the tag can be added to
|
||||||
* @returns boolean True if the tag can be added, false otherwise
|
* @returns boolean True if the tag can be added, false otherwise
|
||||||
*/
|
*/
|
||||||
canAdd(pokemon: Pokemon): boolean {
|
canAdd(pokemon: Pokemon): boolean {
|
||||||
@ -1420,7 +1415,7 @@ export abstract class DamagingTrapTag extends TrappedTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -1667,7 +1662,7 @@ export class ContactDamageProtectedTag extends ContactProtectedTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -1695,9 +1690,9 @@ export class DamageProtectedTag extends ContactProtectedTag {}
|
|||||||
|
|
||||||
export class ContactSetStatusProtectedTag extends DamageProtectedTag {
|
export class ContactSetStatusProtectedTag extends DamageProtectedTag {
|
||||||
/**
|
/**
|
||||||
* @param sourceMove The move that caused the tag to be applied
|
* @param sourceMove - The move that caused the tag to be applied
|
||||||
* @param tagType The type of the tag
|
* @param tagType - The type of the tag
|
||||||
* @param statusEffect The status effect to apply to the attacker
|
* @param statusEffect - The status effect to apply to the attacker
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
sourceMove: Moves,
|
sourceMove: Moves,
|
||||||
@ -1734,7 +1729,7 @@ export class ContactStatStageChangeProtectedTag extends DamageProtectedTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
override loadTag(source: BattlerTag | any): void {
|
override loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -1874,7 +1869,7 @@ export class AbilityBattlerTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -1884,7 +1879,6 @@ export class AbilityBattlerTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag used by Unburden to double speed
|
* Tag used by Unburden to double speed
|
||||||
* @extends AbilityBattlerTag
|
|
||||||
*/
|
*/
|
||||||
export class UnburdenTag extends AbilityBattlerTag {
|
export class UnburdenTag extends AbilityBattlerTag {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -1974,7 +1968,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2034,7 +2028,7 @@ export class WeatherHighestStatBoostTag extends HighestStatBoostTag implements W
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2052,7 +2046,7 @@ export class TerrainHighestStatBoostTag extends HighestStatBoostTag implements T
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2091,7 +2085,7 @@ export class TypeImmuneTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2154,7 +2148,7 @@ export class TypeBoostTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2215,7 +2209,6 @@ export class CritBoostTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag for the effects of Dragon Cheer, which boosts the critical hit ratio of the user's allies.
|
* Tag for the effects of Dragon Cheer, which boosts the critical hit ratio of the user's allies.
|
||||||
* @extends {CritBoostTag}
|
|
||||||
*/
|
*/
|
||||||
export class DragonCheerTag extends CritBoostTag {
|
export class DragonCheerTag extends CritBoostTag {
|
||||||
/** The types of the user's ally when the tag is added */
|
/** The types of the user's ally when the tag is added */
|
||||||
@ -2241,7 +2234,7 @@ export class SaltCuredTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2298,7 +2291,7 @@ export class CursedTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2427,7 +2420,7 @@ export class FormBlockDamageTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if the tag can be added to the Pokémon.
|
* Determines if the tag can be added to the Pokémon.
|
||||||
* @param {Pokemon} pokemon The Pokémon to which the tag might be added.
|
* @param pokemon - The Pokémon to which the tag might be added.
|
||||||
* @returns {boolean} True if the tag can be added, false otherwise.
|
* @returns {boolean} True if the tag can be added, false otherwise.
|
||||||
*/
|
*/
|
||||||
canAdd(pokemon: Pokemon): boolean {
|
canAdd(pokemon: Pokemon): boolean {
|
||||||
@ -2437,7 +2430,7 @@ export class FormBlockDamageTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Applies the tag to the Pokémon.
|
* Applies the tag to the Pokémon.
|
||||||
* Triggers a form change if the Pokémon is not in its defense form.
|
* Triggers a form change if the Pokémon is not in its defense form.
|
||||||
* @param {Pokemon} pokemon The Pokémon to which the tag is added.
|
* @param pokemon - The Pokémon to which the tag is added.
|
||||||
*/
|
*/
|
||||||
onAdd(pokemon: Pokemon): void {
|
onAdd(pokemon: Pokemon): void {
|
||||||
super.onAdd(pokemon);
|
super.onAdd(pokemon);
|
||||||
@ -2450,7 +2443,7 @@ export class FormBlockDamageTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Removes the tag from the Pokémon.
|
* Removes the tag from the Pokémon.
|
||||||
* Triggers a form change when the tag is removed.
|
* Triggers a form change when the tag is removed.
|
||||||
* @param {Pokemon} pokemon The Pokémon from which the tag is removed.
|
* @param pokemon - The Pokémon from which the tag is removed.
|
||||||
*/
|
*/
|
||||||
onRemove(pokemon: Pokemon): void {
|
onRemove(pokemon: Pokemon): void {
|
||||||
super.onRemove(pokemon);
|
super.onRemove(pokemon);
|
||||||
@ -2462,7 +2455,7 @@ export class FormBlockDamageTag extends BattlerTag {
|
|||||||
export class IceFaceBlockDamageTag extends FormBlockDamageTag {
|
export class IceFaceBlockDamageTag extends FormBlockDamageTag {
|
||||||
/**
|
/**
|
||||||
* Determines if the tag can be added to the Pokémon.
|
* Determines if the tag can be added to the Pokémon.
|
||||||
* @param {Pokemon} pokemon The Pokémon to which the tag might be added.
|
* @param pokemon - The Pokémon to which the tag might be added.
|
||||||
* @returns {boolean} True if the tag can be added, false otherwise.
|
* @returns {boolean} True if the tag can be added, false otherwise.
|
||||||
*/
|
*/
|
||||||
canAdd(pokemon: Pokemon): boolean {
|
canAdd(pokemon: Pokemon): boolean {
|
||||||
@ -2617,7 +2610,6 @@ export class StockpilingTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Battler tag for Gulp Missile used by Cramorant.
|
* Battler tag for Gulp Missile used by Cramorant.
|
||||||
* @extends BattlerTag
|
|
||||||
*/
|
*/
|
||||||
export class GulpMissileTag extends BattlerTag {
|
export class GulpMissileTag extends BattlerTag {
|
||||||
constructor(tagType: BattlerTagType, sourceMove: Moves) {
|
constructor(tagType: BattlerTagType, sourceMove: Moves) {
|
||||||
@ -2659,7 +2651,7 @@ export class GulpMissileTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gulp Missile's initial form changes are triggered by using Surf and Dive.
|
* Gulp Missile's initial form changes are triggered by using Surf and Dive.
|
||||||
* @param {Pokemon} pokemon The Pokemon with Gulp Missile ability.
|
* @param pokemon - The Pokemon with Gulp Missile ability.
|
||||||
* @returns Whether the BattlerTag can be added.
|
* @returns Whether the BattlerTag can be added.
|
||||||
*/
|
*/
|
||||||
canAdd(pokemon: Pokemon): boolean {
|
canAdd(pokemon: Pokemon): boolean {
|
||||||
@ -2691,7 +2683,6 @@ export class GulpMissileTag extends BattlerTag {
|
|||||||
* Applied by moves: {@linkcode Moves.ODOR_SLEUTH | Odor Sleuth},
|
* Applied by moves: {@linkcode Moves.ODOR_SLEUTH | Odor Sleuth},
|
||||||
* {@linkcode Moves.MIRACLE_EYE | Miracle Eye} and {@linkcode Moves.FORESIGHT | Foresight}.
|
* {@linkcode Moves.MIRACLE_EYE | Miracle Eye} and {@linkcode Moves.FORESIGHT | Foresight}.
|
||||||
*
|
*
|
||||||
* @extends BattlerTag
|
|
||||||
* @see {@linkcode ignoreImmunity}
|
* @see {@linkcode ignoreImmunity}
|
||||||
*/
|
*/
|
||||||
export class ExposedTag extends BattlerTag {
|
export class ExposedTag extends BattlerTag {
|
||||||
@ -2706,7 +2697,7 @@ export class ExposedTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -2715,8 +2706,8 @@ export class ExposedTag extends BattlerTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param types {@linkcode PokemonType} of the defending Pokemon
|
* @param types - of the defending Pokemon
|
||||||
* @param moveType {@linkcode PokemonType} of the move targetting it
|
* @param moveType - of the move targetting it
|
||||||
* @returns `true` if the move should be allowed to target the defender.
|
* @returns `true` if the move should be allowed to target the defender.
|
||||||
*/
|
*/
|
||||||
ignoreImmunity(type: PokemonType, moveType: PokemonType): boolean {
|
ignoreImmunity(type: PokemonType, moveType: PokemonType): boolean {
|
||||||
@ -2728,7 +2719,6 @@ export class ExposedTag extends BattlerTag {
|
|||||||
* Tag that prevents HP recovery from held items and move effects. It also blocks the usage of recovery moves.
|
* Tag that prevents HP recovery from held items and move effects. It also blocks the usage of recovery moves.
|
||||||
* Applied by moves: {@linkcode Moves.HEAL_BLOCK | Heal Block (5 turns)}, {@linkcode Moves.PSYCHIC_NOISE | Psychic Noise (2 turns)}
|
* Applied by moves: {@linkcode Moves.HEAL_BLOCK | Heal Block (5 turns)}, {@linkcode Moves.PSYCHIC_NOISE | Psychic Noise (2 turns)}
|
||||||
*
|
*
|
||||||
* @extends MoveRestrictionBattlerTag
|
|
||||||
*/
|
*/
|
||||||
export class HealBlockTag extends MoveRestrictionBattlerTag {
|
export class HealBlockTag extends MoveRestrictionBattlerTag {
|
||||||
constructor(turnCount: number, sourceMove: Moves) {
|
constructor(turnCount: number, sourceMove: Moves) {
|
||||||
@ -2748,7 +2738,7 @@ export class HealBlockTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a move is disabled under Heal Block
|
* Checks if a move is disabled under Heal Block
|
||||||
* @param {Moves} move {@linkcode Moves} the move ID
|
* @param move - The move ID
|
||||||
* @returns `true` if the move has a TRIAGE_MOVE flag and is a status move
|
* @returns `true` if the move has a TRIAGE_MOVE flag and is a status move
|
||||||
*/
|
*/
|
||||||
override isMoveRestricted(move: Moves): boolean {
|
override isMoveRestricted(move: Moves): boolean {
|
||||||
@ -2761,9 +2751,9 @@ export class HealBlockTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Checks if a move is disabled under Heal Block because of its choice of target
|
* Checks if a move is disabled under Heal Block because of its choice of target
|
||||||
* Implemented b/c of Pollen Puff
|
* Implemented b/c of Pollen Puff
|
||||||
* @param {Moves} move {@linkcode Moves} the move ID
|
* @param move - The move ID
|
||||||
* @param {Pokemon} user {@linkcode Pokemon} the move user
|
* @param user - The move user
|
||||||
* @param {Pokemon} target {@linkcode Pokemon} the target of the move
|
* @param target - The target of the move
|
||||||
* @returns `true` if the move cannot be used because the target is an ally
|
* @returns `true` if the move cannot be used because the target is an ally
|
||||||
*/
|
*/
|
||||||
override isMoveTargetRestricted(move: Moves, user: Pokemon, target: Pokemon) {
|
override isMoveTargetRestricted(move: Moves, user: Pokemon, target: Pokemon) {
|
||||||
@ -2788,8 +2778,8 @@ export class HealBlockTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @override
|
* @override
|
||||||
* @param {Pokemon} pokemon {@linkcode Pokemon} attempting to use the restricted move
|
* @param pokemon - attempting to use the restricted move
|
||||||
* @param {Moves} move {@linkcode Moves} ID of the move being interrupted
|
* @param move - ID of the move being interrupted
|
||||||
* @returns {string} text to display when the move is interrupted
|
* @returns {string} text to display when the move is interrupted
|
||||||
*/
|
*/
|
||||||
override interruptedText(pokemon: Pokemon, move: Moves): string {
|
override interruptedText(pokemon: Pokemon, move: Moves): string {
|
||||||
@ -2816,7 +2806,6 @@ export class HealBlockTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag that doubles the type effectiveness of Fire-type moves.
|
* Tag that doubles the type effectiveness of Fire-type moves.
|
||||||
* @extends BattlerTag
|
|
||||||
*/
|
*/
|
||||||
export class TarShotTag extends BattlerTag {
|
export class TarShotTag extends BattlerTag {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -2825,7 +2814,7 @@ export class TarShotTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* If the Pokemon is terastallized, the tag cannot be added.
|
* If the Pokemon is terastallized, the tag cannot be added.
|
||||||
* @param {Pokemon} pokemon the {@linkcode Pokemon} to which the tag is added
|
* @param pokemon - the {@linkcode Pokemon} to which the tag is added
|
||||||
* @returns whether the tag is applied
|
* @returns whether the tag is applied
|
||||||
*/
|
*/
|
||||||
override canAdd(pokemon: Pokemon): boolean {
|
override canAdd(pokemon: Pokemon): boolean {
|
||||||
@ -2873,7 +2862,7 @@ export class AutotomizedTag extends BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Adds an autotomize count to the Pokemon. Each stack reduces weight by 100kg
|
* Adds an autotomize count to the Pokemon. Each stack reduces weight by 100kg
|
||||||
* If the Pokemon is over 0.1kg it also displays a message.
|
* If the Pokemon is over 0.1kg it also displays a message.
|
||||||
* @param pokemon The Pokemon that is being autotomized
|
* @param pokemon - The Pokemon that is being autotomized
|
||||||
*/
|
*/
|
||||||
onAdd(pokemon: Pokemon): void {
|
onAdd(pokemon: Pokemon): void {
|
||||||
const minWeight = 0.1;
|
const minWeight = 0.1;
|
||||||
@ -3008,7 +2997,7 @@ export class SubstituteTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, load the data for it.
|
* When given a battler tag or json representing one, load the data for it.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
*/
|
*/
|
||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
@ -3070,7 +3059,7 @@ export class TormentTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Adds the battler tag to the target Pokemon and defines the private class variable 'target'
|
* Adds the battler tag to the target Pokemon and defines the private class variable 'target'
|
||||||
* 'Target' is used to track the Pokemon's current status
|
* 'Target' is used to track the Pokemon's current status
|
||||||
* @param {Pokemon} pokemon the Pokemon tormented
|
* @param pokemon - the Pokemon tormented
|
||||||
*/
|
*/
|
||||||
override onAdd(pokemon: Pokemon) {
|
override onAdd(pokemon: Pokemon) {
|
||||||
super.onAdd(pokemon);
|
super.onAdd(pokemon);
|
||||||
@ -3084,7 +3073,7 @@ export class TormentTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Torment only ends when the affected Pokemon leaves the battle field
|
* Torment only ends when the affected Pokemon leaves the battle field
|
||||||
* @param {Pokemon} pokemon the Pokemon under the effects of Torment
|
* @param pokemon - the Pokemon under the effects of Torment
|
||||||
* @param _tagType
|
* @param _tagType
|
||||||
* @returns `true` if still present | `false` if not
|
* @returns `true` if still present | `false` if not
|
||||||
*/
|
*/
|
||||||
@ -3094,7 +3083,7 @@ export class TormentTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This checks if the current move used is identical to the last used move with a {@linkcode MoveResult} of `SUCCESS`/`MISS`
|
* This checks if the current move used is identical to the last used move with a {@linkcode MoveResult} of `SUCCESS`/`MISS`
|
||||||
* @param {Moves} move the move under investigation
|
* @param move - the move under investigation
|
||||||
* @returns `true` if there is valid consecutive usage | `false` if the moves are different from each other
|
* @returns `true` if there is valid consecutive usage | `false` if the moves are different from each other
|
||||||
*/
|
*/
|
||||||
public override isMoveRestricted(move: Moves, user: Pokemon): boolean {
|
public override isMoveRestricted(move: Moves, user: Pokemon): boolean {
|
||||||
@ -3155,7 +3144,7 @@ export class TauntTag extends MoveRestrictionBattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a move is a status move and determines its restriction status on that basis
|
* Checks if a move is a status move and determines its restriction status on that basis
|
||||||
* @param {Moves} move the move under investigation
|
* @param move - the move under investigation
|
||||||
* @returns `true` if the move is a status move
|
* @returns `true` if the move is a status move
|
||||||
*/
|
*/
|
||||||
override isMoveRestricted(move: Moves): boolean {
|
override isMoveRestricted(move: Moves): boolean {
|
||||||
@ -3196,7 +3185,7 @@ export class ImprisonTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Checks if the source of Imprison is still active
|
* Checks if the source of Imprison is still active
|
||||||
* @override
|
* @override
|
||||||
* @param pokemon The pokemon this tag is attached to
|
* @param pokemon - The pokemon this tag is attached to
|
||||||
* @returns `true` if the source is still active
|
* @returns `true` if the source is still active
|
||||||
*/
|
*/
|
||||||
public override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
public override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
@ -3213,7 +3202,7 @@ export class ImprisonTag extends MoveRestrictionBattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Checks if the source of the tag has the parameter move in its moveset and that the source is still active
|
* Checks if the source of the tag has the parameter move in its moveset and that the source is still active
|
||||||
* @override
|
* @override
|
||||||
* @param {Moves} move the move under investigation
|
* @param move - the move under investigation
|
||||||
* @returns `false` if either condition is not met
|
* @returns `false` if either condition is not met
|
||||||
*/
|
*/
|
||||||
public override isMoveRestricted(move: Moves, _user: Pokemon): boolean {
|
public override isMoveRestricted(move: Moves, _user: Pokemon): boolean {
|
||||||
@ -3315,7 +3304,6 @@ export class TelekinesisTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag that swaps the user's base ATK stat with its base DEF stat.
|
* Tag that swaps the user's base ATK stat with its base DEF stat.
|
||||||
* @extends BattlerTag
|
|
||||||
*/
|
*/
|
||||||
export class PowerTrickTag extends BattlerTag {
|
export class PowerTrickTag extends BattlerTag {
|
||||||
constructor(sourceMove: Moves, sourceId: number) {
|
constructor(sourceMove: Moves, sourceId: number) {
|
||||||
@ -3342,7 +3330,7 @@ export class PowerTrickTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the Power Trick tag and reverts any stat changes if the tag is already applied.
|
* Removes the Power Trick tag and reverts any stat changes if the tag is already applied.
|
||||||
* @param {Pokemon} pokemon The {@linkcode Pokemon} that already has the Power Trick tag.
|
* @param pokemon - The {@linkcode Pokemon} that already has the Power Trick tag.
|
||||||
*/
|
*/
|
||||||
onOverlap(pokemon: Pokemon): void {
|
onOverlap(pokemon: Pokemon): void {
|
||||||
pokemon.removeTag(this.tagType);
|
pokemon.removeTag(this.tagType);
|
||||||
@ -3350,7 +3338,7 @@ export class PowerTrickTag extends BattlerTag {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Swaps the user's base ATK stat with its base DEF stat.
|
* Swaps the user's base ATK stat with its base DEF stat.
|
||||||
* @param {Pokemon} pokemon The {@linkcode Pokemon} whose stats will be swapped.
|
* @param pokemon - The {@linkcode Pokemon} whose stats will be swapped.
|
||||||
*/
|
*/
|
||||||
swapStat(pokemon: Pokemon): void {
|
swapStat(pokemon: Pokemon): void {
|
||||||
const temp = pokemon.getStat(Stat.ATK, false);
|
const temp = pokemon.getStat(Stat.ATK, false);
|
||||||
@ -3382,7 +3370,7 @@ export class GrudgeTag extends BattlerTag {
|
|||||||
* Activates Grudge's special effect on the attacking Pokemon and lapses the tag.
|
* Activates Grudge's special effect on the attacking Pokemon and lapses the tag.
|
||||||
* @param pokemon
|
* @param pokemon
|
||||||
* @param lapseType
|
* @param lapseType
|
||||||
* @param sourcePokemon {@linkcode Pokemon} the source of the move that fainted the tag's bearer
|
* @param sourcePokemon - the source of the move that fainted the tag's bearer
|
||||||
* @returns `false` if Grudge activates its effect or lapses
|
* @returns `false` if Grudge activates its effect or lapses
|
||||||
*/
|
*/
|
||||||
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType, sourcePokemon?: Pokemon): boolean {
|
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType, sourcePokemon?: Pokemon): boolean {
|
||||||
@ -3659,7 +3647,7 @@ export function getBattlerTag(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When given a battler tag or json representing one, creates an actual BattlerTag object with the same data.
|
* When given a battler tag or json representing one, creates an actual BattlerTag object with the same data.
|
||||||
* @param {BattlerTag | any} source A battler tag
|
* @param source - A battler tag
|
||||||
* @return {BattlerTag} The valid battler tag
|
* @return {BattlerTag} The valid battler tag
|
||||||
*/
|
*/
|
||||||
export function loadBattlerTag(source: BattlerTag | any): BattlerTag {
|
export function loadBattlerTag(source: BattlerTag | any): BattlerTag {
|
||||||
@ -3671,7 +3659,7 @@ export function loadBattlerTag(source: BattlerTag | any): BattlerTag {
|
|||||||
/**
|
/**
|
||||||
* Helper function to verify that the current phase is a MoveEffectPhase and provide quick access to commonly used fields
|
* Helper function to verify that the current phase is a MoveEffectPhase and provide quick access to commonly used fields
|
||||||
*
|
*
|
||||||
* @param _pokemon {@linkcode Pokemon} The Pokémon used to access the current phase
|
* @param _pokemon - The Pokémon used to access the current phase
|
||||||
* @returns null if current phase is not MoveEffectPhase, otherwise Object containing the {@linkcode MoveEffectPhase}, and its
|
* @returns null if current phase is not MoveEffectPhase, otherwise Object containing the {@linkcode MoveEffectPhase}, and its
|
||||||
* corresponding {@linkcode Move} and user {@linkcode Pokemon}
|
* corresponding {@linkcode Move} and user {@linkcode Pokemon}
|
||||||
*/
|
*/
|
||||||
|
@ -115,15 +115,19 @@ export enum MoveSourceType {
|
|||||||
export abstract class Challenge {
|
export abstract class Challenge {
|
||||||
public id: Challenges; // The id of the challenge
|
public id: Challenges; // The id of the challenge
|
||||||
|
|
||||||
public value: number; // The "strength" of the challenge, all challenges have a numerical value.
|
/** The "strength" of the challenge; all challenges have a numerical value */
|
||||||
public maxValue: number; // The maximum strength of the challenge.
|
public value: number;
|
||||||
public severity: number; // The current severity of the challenge. Some challenges have multiple severities in addition to strength.
|
/** The maximum strength of the challenge */
|
||||||
public maxSeverity: number; // The maximum severity of the challenge.
|
public maxValue: number;
|
||||||
|
/** The current severity of the challenge. Some challenges have multiple severities in addition to strength. */
|
||||||
|
public severity: number;
|
||||||
|
public maxSeverity: number;
|
||||||
|
|
||||||
public conditions: ChallengeCondition[];
|
public conditions: ChallengeCondition[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param id {@link Challenges} The enum value for the challenge
|
* @param id - The enum value for the challenge
|
||||||
|
* @param maxValue - The maximum strength of the challenge
|
||||||
*/
|
*/
|
||||||
constructor(id: Challenges, maxValue: number = Number.MAX_SAFE_INTEGER) {
|
constructor(id: Challenges, maxValue: number = Number.MAX_SAFE_INTEGER) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -136,7 +140,7 @@ export abstract class Challenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset the challenge to a base state.
|
* Reset the challenge to a base state
|
||||||
*/
|
*/
|
||||||
reset(): void {
|
reset(): void {
|
||||||
this.value = 0;
|
this.value = 0;
|
||||||
@ -144,8 +148,8 @@ export abstract class Challenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the localisation key for the challenge
|
* Get the localisation key for the challenge
|
||||||
* @returns {@link string} The i18n key for this challenge
|
* @returns The i18n key for this challenge
|
||||||
*/
|
*/
|
||||||
geti18nKey(): string {
|
geti18nKey(): string {
|
||||||
return Challenges[this.id]
|
return Challenges[this.id]
|
||||||
@ -155,18 +159,18 @@ export abstract class Challenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for unlockable challenges to check if they're unlocked.
|
* Check whether the challenge has been unlocked
|
||||||
* @param data {@link GameData} The save data.
|
* @param data - The save data to check
|
||||||
* @returns {@link boolean} Whether this challenge is unlocked.
|
* @returns Whether this challenge is unlocked
|
||||||
*/
|
*/
|
||||||
isUnlocked(data: GameData): boolean {
|
isUnlocked(data: GameData): boolean {
|
||||||
return this.conditions.every(f => f(data));
|
return this.conditions.every(f => f(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an unlock condition to this challenge.
|
* Add an unlock condition to this challenge
|
||||||
* @param condition {@link ChallengeCondition} The condition to add.
|
* @param condition - The condition to add
|
||||||
* @returns {@link Challenge} This challenge
|
* @returns This challenge
|
||||||
*/
|
*/
|
||||||
condition(condition: ChallengeCondition): Challenge {
|
condition(condition: ChallengeCondition): Challenge {
|
||||||
this.conditions.push(condition);
|
this.conditions.push(condition);
|
||||||
@ -175,16 +179,16 @@ export abstract class Challenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {@link string} The localised name of this challenge.
|
* @returns The localised name of this challenge.
|
||||||
*/
|
*/
|
||||||
getName(): string {
|
getName(): string {
|
||||||
return i18next.t(`challenges:${this.geti18nKey()}.name`);
|
return i18next.t(`challenges:${this.geti18nKey()}.name`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the textual representation of a challenge's current value.
|
* Return the textual representation of a challenge's current value.
|
||||||
* @param overrideValue {@link number} The value to check for. If undefined, gets the current value.
|
* @param overrideValue - The value to check for. If undefined, gets the current value.
|
||||||
* @returns {@link string} The localised name for the current value.
|
* @returns The localised name for the current value.
|
||||||
*/
|
*/
|
||||||
getValue(overrideValue?: number): string {
|
getValue(overrideValue?: number): string {
|
||||||
const value = overrideValue ?? this.value;
|
const value = overrideValue ?? this.value;
|
||||||
@ -193,8 +197,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the description of a challenge's current value.
|
* Returns the description of a challenge's current value.
|
||||||
* @param overrideValue {@link number} The value to check for. If undefined, gets the current value.
|
* @param overrideValue - The value to check for. If undefined, gets the current value.
|
||||||
* @returns {@link string} The localised description for the current value.
|
* @returns The localised description for the current value.
|
||||||
*/
|
*/
|
||||||
getDescription(overrideValue?: number): string {
|
getDescription(overrideValue?: number): string {
|
||||||
const value = overrideValue ?? this.value;
|
const value = overrideValue ?? this.value;
|
||||||
@ -203,7 +207,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Increase the value of the challenge
|
* Increase the value of the challenge
|
||||||
* @returns {@link boolean} Returns true if the value changed
|
* @returns whether the value changed
|
||||||
*/
|
*/
|
||||||
increaseValue(): boolean {
|
increaseValue(): boolean {
|
||||||
if (this.value < this.maxValue) {
|
if (this.value < this.maxValue) {
|
||||||
@ -215,7 +219,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decrease the value of the challenge
|
* Decrease the value of the challenge
|
||||||
* @returns {@link boolean} Returns true if the value changed
|
* @returns whether the value changed
|
||||||
*/
|
*/
|
||||||
decreaseValue(): boolean {
|
decreaseValue(): boolean {
|
||||||
if (this.value > 0) {
|
if (this.value > 0) {
|
||||||
@ -234,7 +238,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decrease the severity of the challenge
|
* Decrease the severity of the challenge
|
||||||
* @returns {@link boolean} Returns true if the value changed
|
* @returns whether the value changed
|
||||||
*/
|
*/
|
||||||
decreaseSeverity(): boolean {
|
decreaseSeverity(): boolean {
|
||||||
if (this.severity > 0) {
|
if (this.severity > 0) {
|
||||||
@ -246,7 +250,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Increase the severity of the challenge
|
* Increase the severity of the challenge
|
||||||
* @returns {@link boolean} Returns true if the value changed
|
* @returns whether the value changed
|
||||||
*/
|
*/
|
||||||
increaseSeverity(): boolean {
|
increaseSeverity(): boolean {
|
||||||
if (this.severity < this.maxSeverity) {
|
if (this.severity < this.maxSeverity) {
|
||||||
@ -257,16 +261,14 @@ export abstract class Challenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the "difficulty" value of this challenge.
|
* Get the "difficulty" value of this challenge
|
||||||
* @returns {@link integer} The difficulty value.
|
|
||||||
*/
|
*/
|
||||||
getDifficulty(): number {
|
getDifficulty(): number {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the minimum difficulty added by this challenge.
|
* Gets the minimum difficulty added by this challenge
|
||||||
* @returns {@link integer} The difficulty value.
|
|
||||||
*/
|
*/
|
||||||
getMinDifficulty(): number {
|
getMinDifficulty(): number {
|
||||||
return 0;
|
return 0;
|
||||||
@ -274,8 +276,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clones a challenge, either from another challenge or json. Chainable.
|
* Clones a challenge, either from another challenge or json. Chainable.
|
||||||
* @param source The source challenge or json.
|
* @param source - The source challenge or json
|
||||||
* @returns This challenge.
|
* @returns This challenge
|
||||||
*/
|
*/
|
||||||
static loadChallenge(_source: Challenge | any): Challenge {
|
static loadChallenge(_source: Challenge | any): Challenge {
|
||||||
throw new Error("Method not implemented! Use derived class");
|
throw new Error("Method not implemented! Use derived class");
|
||||||
@ -283,10 +285,10 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for STARTER_CHOICE challenges. Derived classes should alter this.
|
* An apply function for STARTER_CHOICE challenges. Derived classes should alter this.
|
||||||
* @param _pokemon {@link PokemonSpecies} The pokemon to check the validity of.
|
* @param _pokemon - The pokemon to check the validity of
|
||||||
* @param _valid {@link BooleanHolder} A BooleanHolder, the value gets set to false if the pokemon isn't allowed.
|
* @param _valid - A BooleanHolder, the value gets set to false if the pokemon isn't allowed
|
||||||
* @param _dexAttr {@link DexAttrProps} The dex attributes of the pokemon.
|
* @param _dexAttr - The dex attributes of the pokemon
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns - Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyStarterChoice(_pokemon: PokemonSpecies, _valid: BooleanHolder, _dexAttr: DexAttrProps): boolean {
|
applyStarterChoice(_pokemon: PokemonSpecies, _valid: BooleanHolder, _dexAttr: DexAttrProps): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -294,7 +296,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for STARTER_POINTS challenges. Derived classes should alter this.
|
* An apply function for STARTER_POINTS challenges. Derived classes should alter this.
|
||||||
* @param _points {@link NumberHolder} The amount of points you have available.
|
* @param _points - The amount of points you have available.
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns {@link boolean} Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyStarterPoints(_points: NumberHolder): boolean {
|
applyStarterPoints(_points: NumberHolder): boolean {
|
||||||
@ -303,9 +305,9 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for STARTER_COST challenges. Derived classes should alter this.
|
* An apply function for STARTER_COST challenges. Derived classes should alter this.
|
||||||
* @param _species {@link Species} The pokemon to change the cost of.
|
* @param _species - The pokemon to change the cost of
|
||||||
* @param _cost {@link NumberHolder} The cost of the starter.
|
* @param _cost - The cost of the starter
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns - Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyStarterCost(_species: Species, _cost: NumberHolder): boolean {
|
applyStarterCost(_species: Species, _cost: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -313,8 +315,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for STARTER_MODIFY challenges. Derived classes should alter this.
|
* An apply function for STARTER_MODIFY challenges. Derived classes should alter this.
|
||||||
* @param _pokemon {@link Pokemon} The starter pokemon to modify.
|
* @param _pokemon - The starter pokemon to modify.
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns - Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyStarterModify(_pokemon: Pokemon): boolean {
|
applyStarterModify(_pokemon: Pokemon): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -322,8 +324,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for POKEMON_IN_BATTLE challenges. Derived classes should alter this.
|
* An apply function for POKEMON_IN_BATTLE challenges. Derived classes should alter this.
|
||||||
* @param _pokemon {@link Pokemon} The pokemon to check the validity of.
|
* @param _pokemon - The pokemon to check the validity of.
|
||||||
* @param _valid {@link BooleanHolder} A BooleanHolder, the value gets set to false if the pokemon isn't allowed.
|
* @param _valid - Holder for the validity of the pokemon
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns {@link boolean} Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyPokemonInBattle(_pokemon: Pokemon, _valid: BooleanHolder): boolean {
|
applyPokemonInBattle(_pokemon: Pokemon, _valid: BooleanHolder): boolean {
|
||||||
@ -332,9 +334,9 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for FIXED_BATTLE challenges. Derived classes should alter this.
|
* An apply function for FIXED_BATTLE challenges. Derived classes should alter this.
|
||||||
* @param _waveIndex {@link Number} The current wave index.
|
* @param _waveIndex - The current wave index.
|
||||||
* @param _battleConfig {@link FixedBattleConfig} The battle config to modify.
|
* @param _battleConfig - The battle config to modify.
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyFixedBattle(_waveIndex: number, _battleConfig: FixedBattleConfig): boolean {
|
applyFixedBattle(_waveIndex: number, _battleConfig: FixedBattleConfig): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -342,7 +344,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for TYPE_EFFECTIVENESS challenges. Derived classes should alter this.
|
* An apply function for TYPE_EFFECTIVENESS challenges. Derived classes should alter this.
|
||||||
* @param _effectiveness {@linkcode NumberHolder} The current effectiveness of the move.
|
* @param _effectiveness - The current effectiveness of the move.
|
||||||
* @returns Whether this function did anything.
|
* @returns Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyTypeEffectiveness(_effectiveness: NumberHolder): boolean {
|
applyTypeEffectiveness(_effectiveness: NumberHolder): boolean {
|
||||||
@ -351,11 +353,11 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for AI_LEVEL challenges. Derived classes should alter this.
|
* An apply function for AI_LEVEL challenges. Derived classes should alter this.
|
||||||
* @param _level {@link NumberHolder} The generated level.
|
* @param _level - The generated level
|
||||||
* @param _levelCap {@link Number} The current level cap.
|
* @param _levelCap - The current level cap
|
||||||
* @param _isTrainer {@link Boolean} Whether this is a trainer pokemon.
|
* @param _isTrainer - Whether this is a trainer pokemon
|
||||||
* @param _isBoss {@link Boolean} Whether this is a non-trainer boss pokemon.
|
* @param _isBoss - Whether this is a non-trainer boss pokemon
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyLevelChange(_level: NumberHolder, _levelCap: number, _isTrainer: boolean, _isBoss: boolean): boolean {
|
applyLevelChange(_level: NumberHolder, _levelCap: number, _isTrainer: boolean, _isBoss: boolean): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -363,9 +365,9 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for AI_MOVE_SLOTS challenges. Derived classes should alter this.
|
* An apply function for AI_MOVE_SLOTS challenges. Derived classes should alter this.
|
||||||
* @param pokemon {@link Pokemon} The pokemon that is being considered.
|
* @param pokemon - The pokemon that is being considered
|
||||||
* @param moveSlots {@link NumberHolder} The amount of move slots.
|
* @param moveSlots - The amount of move slots
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyMoveSlot(_pokemon: Pokemon, _moveSlots: NumberHolder): boolean {
|
applyMoveSlot(_pokemon: Pokemon, _moveSlots: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -373,8 +375,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for PASSIVE_ACCESS challenges. Derived classes should alter this.
|
* An apply function for PASSIVE_ACCESS challenges. Derived classes should alter this.
|
||||||
* @param pokemon {@link Pokemon} The pokemon to change.
|
* @param pokemon - The pokemon to change
|
||||||
* @param hasPassive {@link BooleanHolder} Whether it should have its passive.
|
* @param hasPassive - Whether it should have its passive
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns {@link boolean} Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyPassiveAccess(_pokemon: Pokemon, _hasPassive: BooleanHolder): boolean {
|
applyPassiveAccess(_pokemon: Pokemon, _hasPassive: BooleanHolder): boolean {
|
||||||
@ -383,7 +385,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for GAME_MODE_MODIFY challenges. Derived classes should alter this.
|
* An apply function for GAME_MODE_MODIFY challenges. Derived classes should alter this.
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyGameModeModify(): boolean {
|
applyGameModeModify(): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -391,11 +393,11 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for MOVE_ACCESS. Derived classes should alter this.
|
* An apply function for MOVE_ACCESS. Derived classes should alter this.
|
||||||
* @param _pokemon {@link Pokemon} What pokemon would learn the move.
|
* @param _pokemon - What pokemon would learn the move
|
||||||
* @param _moveSource {@link MoveSourceType} What source the pokemon would get the move from.
|
* @param _moveSource - What source the pokemon would get the move from
|
||||||
* @param _move {@link Moves} The move in question.
|
* @param _move - The move in question
|
||||||
* @param _level {@link NumberHolder} The level threshold for access.
|
* @param _level - The level threshold for access
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyMoveAccessLevel(_pokemon: Pokemon, _moveSource: MoveSourceType, _move: Moves, _level: NumberHolder): boolean {
|
applyMoveAccessLevel(_pokemon: Pokemon, _moveSource: MoveSourceType, _move: Moves, _level: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -403,11 +405,11 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for MOVE_WEIGHT. Derived classes should alter this.
|
* An apply function for MOVE_WEIGHT. Derived classes should alter this.
|
||||||
* @param _pokemon {@link Pokemon} What pokemon would learn the move.
|
* @param _pokemon - What pokemon would learn the move
|
||||||
* @param _moveSource {@link MoveSourceType} What source the pokemon would get the move from.
|
* @param _moveSource - What source the pokemon would get the move from
|
||||||
* @param _move {@link Moves} The move in question.
|
* @param _move - The move in question
|
||||||
* @param _weight {@link NumberHolder} The base weight of the move
|
* @param _weight - The base weight of the move
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyMoveWeight(_pokemon: Pokemon, _moveSource: MoveSourceType, _move: Moves, _level: NumberHolder): boolean {
|
applyMoveWeight(_pokemon: Pokemon, _moveSource: MoveSourceType, _move: Moves, _level: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -415,9 +417,9 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for FlipStats. Derived classes should alter this.
|
* An apply function for FlipStats. Derived classes should alter this.
|
||||||
* @param _pokemon {@link Pokemon} What pokemon would learn the move.
|
* @param _pokemon - What pokemon would learn the move
|
||||||
* @param _baseStats What are the stats to flip.
|
* @param _baseStats - - What are the stats to flip
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyFlipStat(_pokemon: Pokemon, _baseStats: number[]) {
|
applyFlipStat(_pokemon: Pokemon, _baseStats: number[]) {
|
||||||
return false;
|
return false;
|
||||||
@ -658,7 +660,7 @@ export class SingleGenerationChallenge extends Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the textual representation of a challenge's current value.
|
* Returns the textual representation of a challenge's current value.
|
||||||
* @param {value} overrideValue The value to check for. If undefined, gets the current value.
|
* @param overrideValue - The value to check for. If undefined, gets the current value.
|
||||||
* @returns {string} The localised name for the current value.
|
* @returns {string} The localised name for the current value.
|
||||||
*/
|
*/
|
||||||
getValue(overrideValue?: number): string {
|
getValue(overrideValue?: number): string {
|
||||||
@ -671,7 +673,7 @@ export class SingleGenerationChallenge extends Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the description of a challenge's current value.
|
* Returns the description of a challenge's current value.
|
||||||
* @param {value} overrideValue The value to check for. If undefined, gets the current value.
|
* @param overrideValue - The value to check for. If undefined, gets the current value.
|
||||||
* @returns {string} The localised description for the current value.
|
* @returns {string} The localised description for the current value.
|
||||||
*/
|
*/
|
||||||
getDescription(overrideValue?: number): string {
|
getDescription(overrideValue?: number): string {
|
||||||
@ -750,7 +752,7 @@ export class SingleTypeChallenge extends Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the textual representation of a challenge's current value.
|
* Returns the textual representation of a challenge's current value.
|
||||||
* @param {value} overrideValue The value to check for. If undefined, gets the current value.
|
* @param overrideValue - The value to check for. If undefined, gets the current value.
|
||||||
* @returns {string} The localised name for the current value.
|
* @returns {string} The localised name for the current value.
|
||||||
*/
|
*/
|
||||||
getValue(overrideValue?: number): string {
|
getValue(overrideValue?: number): string {
|
||||||
@ -762,8 +764,8 @@ export class SingleTypeChallenge extends Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the description of a challenge's current value.
|
* Returns the description of a challenge's current value.
|
||||||
* @param {value} overrideValue The value to check for. If undefined, gets the current value.
|
* @param overrideValue - The value to check for. If undefined, gets the current value.
|
||||||
* @returns {string} The localised description for the current value.
|
* @returns The localised description for the current value.
|
||||||
*/
|
*/
|
||||||
getDescription(overrideValue?: number): string {
|
getDescription(overrideValue?: number): string {
|
||||||
if (overrideValue === undefined) {
|
if (overrideValue === undefined) {
|
||||||
@ -968,12 +970,13 @@ export class LowerStarterPointsChallenge extends Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify starter choice.
|
* Apply all challenges that modify starter choice.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.STARTER_CHOICE
|
* @param challengeType - ChallengeType.STARTER_CHOICE
|
||||||
* @param pokemon {@link PokemonSpecies} The pokemon to check the validity of.
|
* @param pokemon - The pokemon to check the validity of.
|
||||||
* @param valid {@link BooleanHolder} A BooleanHolder, the value gets set to false if the pokemon isn't allowed.
|
* @param valid - A BooleanHolder, the value gets set to false if the pokemon isn't allowed.
|
||||||
* @param dexAttr {@link DexAttrProps} The dex attributes of the pokemon.
|
* @param dexAttr - The dex attributes of the pokemon.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
challengeType: ChallengeType.STARTER_CHOICE,
|
challengeType: ChallengeType.STARTER_CHOICE,
|
||||||
pokemon: PokemonSpecies,
|
pokemon: PokemonSpecies,
|
||||||
@ -982,16 +985,16 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify available total starter points.
|
* Apply all challenges that modify available total starter points.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.STARTER_POINTS
|
* @param challengeType - ChallengeType.STARTER_POINTS
|
||||||
* @param points {@link NumberHolder} The amount of points you have available.
|
* @param points - The amount of points you have available.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(challengeType: ChallengeType.STARTER_POINTS, points: NumberHolder): boolean;
|
export function applyChallenges(challengeType: ChallengeType.STARTER_POINTS, points: NumberHolder): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify the cost of a starter.
|
* Apply all challenges that modify the cost of a starter.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.STARTER_COST
|
* @param challengeType - ChallengeType.STARTER_COST
|
||||||
* @param species {@link Species} The pokemon to change the cost of.
|
* @param species - The pokemon to change the cost of.
|
||||||
* @param points {@link NumberHolder} The cost of the pokemon.
|
* @param points - The cost of the pokemon.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
@ -1001,16 +1004,16 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify a starter after selection.
|
* Apply all challenges that modify a starter after selection.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.STARTER_MODIFY
|
* @param challengeType - ChallengeType.STARTER_MODIFY
|
||||||
* @param pokemon {@link Pokemon} The starter pokemon to modify.
|
* @param pokemon - The starter pokemon to modify.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(challengeType: ChallengeType.STARTER_MODIFY, pokemon: Pokemon): boolean;
|
export function applyChallenges(challengeType: ChallengeType.STARTER_MODIFY, pokemon: Pokemon): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that what pokemon you can have in battle.
|
* Apply all challenges that what pokemon you can have in battle.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.POKEMON_IN_BATTLE
|
* @param challengeType - ChallengeType.POKEMON_IN_BATTLE
|
||||||
* @param pokemon {@link Pokemon} The pokemon to check the validity of.
|
* @param pokemon - The pokemon to check the validity of.
|
||||||
* @param valid {@link BooleanHolder} A BooleanHolder, the value gets set to false if the pokemon isn't allowed.
|
* @param valid - A BooleanHolder, the value gets set to false if the pokemon isn't allowed.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
@ -1020,9 +1023,9 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify what fixed battles there are.
|
* Apply all challenges that modify what fixed battles there are.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.FIXED_BATTLES
|
* @param challengeType - ChallengeType.FIXED_BATTLES
|
||||||
* @param waveIndex {@link Number} The current wave index.
|
* @param waveIndex - The current wave index.
|
||||||
* @param battleConfig {@link FixedBattleConfig} The battle config to modify.
|
* @param battleConfig - The battle config to modify.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
@ -1032,19 +1035,19 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify type effectiveness.
|
* Apply all challenges that modify type effectiveness.
|
||||||
* @param challengeType {@linkcode ChallengeType} ChallengeType.TYPE_EFFECTIVENESS
|
* @param challengeType - ChallengeType.TYPE_EFFECTIVENESS
|
||||||
* @param effectiveness {@linkcode NumberHolder} The current effectiveness of the move.
|
* @param effectiveness - The current effectiveness of the move.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(challengeType: ChallengeType.TYPE_EFFECTIVENESS, effectiveness: NumberHolder): boolean;
|
export function applyChallenges(challengeType: ChallengeType.TYPE_EFFECTIVENESS, effectiveness: NumberHolder): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify what level AI are.
|
* Apply all challenges that modify what level AI are.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.AI_LEVEL
|
* @param challengeType - ChallengeType.AI_LEVEL
|
||||||
* @param level {@link NumberHolder} The generated level of the pokemon.
|
* @param level - The generated level of the pokemon
|
||||||
* @param levelCap {@link Number} The maximum level cap for the current wave.
|
* @param levelCap - The maximum level cap for the current wave
|
||||||
* @param isTrainer {@link Boolean} Whether this is a trainer pokemon.
|
* @param isTrainer - Whether this is a trainer pokemon
|
||||||
* @param isBoss {@link Boolean} Whether this is a non-trainer boss pokemon.
|
* @param isBoss - Whether this is a non-trainer boss pokemon
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
challengeType: ChallengeType.AI_LEVEL,
|
challengeType: ChallengeType.AI_LEVEL,
|
||||||
@ -1055,10 +1058,10 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify how many move slots the AI has.
|
* Apply all challenges that modify how many move slots the AI has.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.AI_MOVE_SLOTS
|
* @param challengeType - ChallengeType.AI_MOVE_SLOTS
|
||||||
* @param pokemon {@link Pokemon} The pokemon being considered.
|
* @param pokemon - The pokemon being considered
|
||||||
* @param moveSlots {@link NumberHolder} The amount of move slots.
|
* @param moveSlots - The amount of move slots
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
challengeType: ChallengeType.AI_MOVE_SLOTS,
|
challengeType: ChallengeType.AI_MOVE_SLOTS,
|
||||||
@ -1067,10 +1070,10 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify whether a pokemon has its passive.
|
* Apply all challenges that modify whether a pokemon has its passive.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.PASSIVE_ACCESS
|
* @param challengeType - ChallengeType.PASSIVE_ACCESS
|
||||||
* @param pokemon {@link Pokemon} The pokemon to modify.
|
* @param pokemon - The pokemon to modify
|
||||||
* @param hasPassive {@link BooleanHolder} Whether it has its passive.
|
* @param hasPassive - Whether it has its passive
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
challengeType: ChallengeType.PASSIVE_ACCESS,
|
challengeType: ChallengeType.PASSIVE_ACCESS,
|
||||||
@ -1079,17 +1082,17 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify the game modes settings.
|
* Apply all challenges that modify the game modes settings.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.GAME_MODE_MODIFY
|
* @param challengeType - The type of the challenge to apply
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns whether any challenge was successfully applied
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(challengeType: ChallengeType.GAME_MODE_MODIFY): boolean;
|
export function applyChallenges(challengeType: ChallengeType.GAME_MODE_MODIFY): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify what level a pokemon can access a move.
|
* Apply all challenges that modify what level a pokemon can access a move.
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.MOVE_ACCESS
|
* @param challengeType - The type of the challenge to apply
|
||||||
* @param pokemon {@link Pokemon} What pokemon would learn the move.
|
* @param pokemon - What pokemon would learn the move
|
||||||
* @param moveSource {@link MoveSourceType} What source the pokemon would get the move from.
|
* @param moveSource - What source the pokemon would get the move from
|
||||||
* @param move {@link Moves} The move in question.
|
* @param move - The move in question
|
||||||
* @param level {@link NumberHolder} The level threshold for access.
|
* @param level - The level threshold for access
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
@ -1101,11 +1104,11 @@ export function applyChallenges(
|
|||||||
): boolean;
|
): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify what weight a pokemon gives to move generation
|
* Apply all challenges that modify what weight a pokemon gives to move generation
|
||||||
* @param challengeType {@link ChallengeType} ChallengeType.MOVE_WEIGHT
|
* @param challengeType - ChallengeType.MOVE_WEIGHT
|
||||||
* @param pokemon {@link Pokemon} What pokemon would learn the move.
|
* @param pokemon - What pokemon would learn the move.
|
||||||
* @param moveSource {@link MoveSourceType} What source the pokemon would get the move from.
|
* @param moveSource - What source the pokemon would get the move from.
|
||||||
* @param move {@link Moves} The move in question.
|
* @param move - The move in question.
|
||||||
* @param weight {@link NumberHolder} The weight of the move.
|
* @param weight - The weight of the move.
|
||||||
* @returns True if any challenge was successfully applied.
|
* @returns True if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(
|
export function applyChallenges(
|
||||||
@ -1173,7 +1176,7 @@ export function applyChallenges(challengeType: ChallengeType, ...args: any[]): b
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param source A challenge to copy, or an object of a challenge's properties. Missing values are treated as defaults.
|
* @param source - A challenge to copy, or an object of a challenge's properties. Missing values are treated as defaults.
|
||||||
* @returns The challenge in question.
|
* @returns The challenge in question.
|
||||||
*/
|
*/
|
||||||
export function copyChallenge(source: Challenge | any): Challenge {
|
export function copyChallenge(source: Challenge | any): Challenge {
|
||||||
@ -1210,11 +1213,11 @@ export function initChallenges() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply all challenges to the given starter (and form) to check its validity.
|
* Apply all challenges to the given starter (and form) to check its validity.
|
||||||
* Differs from {@linkcode checkSpeciesValidForChallenge} which only checks form changes.
|
* Differs from {@linkcode checkSpeciesValidForChallenge} which only checks form changes
|
||||||
* @param species - The {@linkcode PokemonSpecies} to check the validity of.
|
* @param species - The {@linkcode PokemonSpecies} to check the validity of
|
||||||
* @param dexAttr - The {@linkcode DexAttrProps | dex attributes} of the species, including its form index.
|
* @param dexAttr - The {@linkcode DexAttrProps | dex attributes} of the species, including its form index
|
||||||
* @param soft - If `true`, allow it if it could become valid through evolution or form change.
|
* @param soft - If `true`, allow it if it could become valid through evolution or form change
|
||||||
* @returns `true` if the species is considered valid.
|
* @returns `true` if the species is considered valid
|
||||||
*/
|
*/
|
||||||
export function checkStarterValidForChallenge(species: PokemonSpecies, props: DexAttrProps, soft: boolean) {
|
export function checkStarterValidForChallenge(species: PokemonSpecies, props: DexAttrProps, soft: boolean) {
|
||||||
if (!soft) {
|
if (!soft) {
|
||||||
@ -1249,11 +1252,11 @@ export function checkStarterValidForChallenge(species: PokemonSpecies, props: De
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply all challenges to the given species (and form) to check its validity.
|
* Apply all challenges to the given species (and form) to check its validity.
|
||||||
* Differs from {@linkcode checkStarterValidForChallenge} which also checks evolutions.
|
* Differs from {@linkcode checkStarterValidForChallenge} which also checks evolutions
|
||||||
* @param species - The {@linkcode PokemonSpecies} to check the validity of.
|
* @param species - The {@linkcode PokemonSpecies} to check the validity of
|
||||||
* @param dexAttr - The {@linkcode DexAttrProps | dex attributes} of the species, including its form index.
|
* @param dexAttr - The {@linkcode DexAttrProps | dex attributes} of the species, including its form index
|
||||||
* @param soft - If `true`, allow it if it could become valid through a form change.
|
* @param soft - If `true`, allow it if it could become valid through a form change
|
||||||
* @returns `true` if the species is considered valid.
|
* @returns `true` if the species is considered valid
|
||||||
*/
|
*/
|
||||||
function checkSpeciesValidForChallenge(species: PokemonSpecies, props: DexAttrProps, soft: boolean) {
|
function checkSpeciesValidForChallenge(species: PokemonSpecies, props: DexAttrProps, soft: boolean) {
|
||||||
const isValidForChallenge = new BooleanHolder(true);
|
const isValidForChallenge = new BooleanHolder(true);
|
||||||
|
@ -25,7 +25,7 @@ export class EggHatchData {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the boolean for if the egg move for the hatch is a new unlock
|
* Sets the boolean for if the egg move for the hatch is a new unlock
|
||||||
* @param unlocked True if the EM is new
|
* @param unlocked - True if the EM is new
|
||||||
*/
|
*/
|
||||||
setEggMoveUnlocked(unlocked: boolean) {
|
setEggMoveUnlocked(unlocked: boolean) {
|
||||||
this.eggMoveUnlocked = unlocked;
|
this.eggMoveUnlocked = unlocked;
|
||||||
@ -78,7 +78,7 @@ export class EggHatchData {
|
|||||||
/**
|
/**
|
||||||
* Update the pokedex data corresponding with the new hatch's pokemon data
|
* Update the pokedex data corresponding with the new hatch's pokemon data
|
||||||
* Also sets whether the egg move is a new unlock or not
|
* Also sets whether the egg move is a new unlock or not
|
||||||
* @param showMessage boolean to show messages for the new catches and egg moves (false by default)
|
* @param showMessage - boolean to show messages for the new catches and egg moves (false by default)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
updatePokemon(showMessage = false) {
|
updatePokemon(showMessage = false) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -500,7 +500,7 @@ function doGreedentEatBerries() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param isEat Default false. Will "create" pile when false, and remove pile when true.
|
* @param isEat - Default false. Will "create" pile when false, and remove pile when true.
|
||||||
*/
|
*/
|
||||||
function doBerrySpritePile(isEat = false) {
|
function doBerrySpritePile(isEat = false) {
|
||||||
const berryAddDelay = 150;
|
const berryAddDelay = 150;
|
||||||
|
@ -496,7 +496,7 @@ async function doNewTeamPostProcess(transformations: PokemonTransformation[]) {
|
|||||||
* @param previousPokemon
|
* @param previousPokemon
|
||||||
* @param newPokemon
|
* @param newPokemon
|
||||||
* @param speciesRootForm
|
* @param speciesRootForm
|
||||||
* @param forBattle Default `false`. If false, will perform achievements and dex unlocks for the player.
|
* @param forBattle - Default `false`. If false, will perform achievements and dex unlocks for the player.
|
||||||
*/
|
*/
|
||||||
async function postProcessTransformedPokemon(
|
async function postProcessTransformedPokemon(
|
||||||
previousPokemon: PlayerPokemon,
|
previousPokemon: PlayerPokemon,
|
||||||
|
@ -276,9 +276,9 @@ export class MysteryEncounterOptionBuilder implements Partial<IMysteryEncounterO
|
|||||||
/**
|
/**
|
||||||
* Player is required to have certain type/s of pokemon in his party (with optional min number of pokemons with that type)
|
* Player is required to have certain type/s of pokemon in his party (with optional min number of pokemons with that type)
|
||||||
*
|
*
|
||||||
* @param type the required type/s
|
* @param type - the required type/s
|
||||||
* @param excludeFainted whether to exclude fainted pokemon
|
* @param excludeFainted - whether to exclude fainted pokemon
|
||||||
* @param minNumberOfPokemon number of pokemons to have that type
|
* @param minNumberOfPokemon - number of pokemons to have that type
|
||||||
* @param invertQuery
|
* @param invertQuery
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
@ -296,8 +296,8 @@ export class MysteryEncounterOptionBuilder implements Partial<IMysteryEncounterO
|
|||||||
/**
|
/**
|
||||||
* Player is required to have a pokemon that can learn a certain move/moveset
|
* Player is required to have a pokemon that can learn a certain move/moveset
|
||||||
*
|
*
|
||||||
* @param move the required move/moves
|
* @param move - the required move/moves
|
||||||
* @param options see {@linkcode CanLearnMoveRequirementOptions}
|
* @param options - see {@linkcode CanLearnMoveRequirementOptions}
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withPokemonCanLearnMoveRequirement(move: Moves | Moves[], options?: CanLearnMoveRequirementOptions) {
|
withPokemonCanLearnMoveRequirement(move: Moves | Moves[], options?: CanLearnMoveRequirementOptions) {
|
||||||
@ -327,7 +327,7 @@ export class MysteryEncounterOptionBuilder implements Partial<IMysteryEncounterO
|
|||||||
/**
|
/**
|
||||||
* Set the full dialogue object to the option. Will override anything already set
|
* Set the full dialogue object to the option. Will override anything already set
|
||||||
*
|
*
|
||||||
* @param dialogue see {@linkcode OptionTextDisplay}
|
* @param dialogue - see {@linkcode OptionTextDisplay}
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withDialogue(dialogue: OptionTextDisplay) {
|
withDialogue(dialogue: OptionTextDisplay) {
|
||||||
|
@ -69,7 +69,7 @@ export class CombinationSceneRequirement extends EncounterSceneRequirement {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a dialogue token key/value pair for the given {@linkcode EncounterSceneRequirement | requirements}.
|
* Retrieves a dialogue token key/value pair for the given {@linkcode EncounterSceneRequirement | requirements}.
|
||||||
* @param pokemon The {@linkcode PlayerPokemon} to check against
|
* @param pokemon - The {@linkcode PlayerPokemon} to check against
|
||||||
* @returns A dialogue token key/value pair
|
* @returns A dialogue token key/value pair
|
||||||
* @throws An {@linkcode Error} if {@linkcode isAnd} is `true` (not supported)
|
* @throws An {@linkcode Error} if {@linkcode isAnd} is `true` (not supported)
|
||||||
*/
|
*/
|
||||||
@ -146,7 +146,7 @@ export class CombinationPokemonRequirement extends EncounterPokemonRequirement {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries the players party for all party members that are compatible with all/any requirements (depends on {@linkcode isAnd})
|
* Queries the players party for all party members that are compatible with all/any requirements (depends on {@linkcode isAnd})
|
||||||
* @param partyPokemon The party of {@linkcode PlayerPokemon}
|
* @param partyPokemon - The party of {@linkcode PlayerPokemon}
|
||||||
* @returns All party members that are compatible with all/any requirements (depends on {@linkcode isAnd})
|
* @returns All party members that are compatible with all/any requirements (depends on {@linkcode isAnd})
|
||||||
*/
|
*/
|
||||||
override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] {
|
override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] {
|
||||||
@ -159,7 +159,7 @@ export class CombinationPokemonRequirement extends EncounterPokemonRequirement {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a dialogue token key/value pair for the given {@linkcode EncounterPokemonRequirement | requirements}.
|
* Retrieves a dialogue token key/value pair for the given {@linkcode EncounterPokemonRequirement | requirements}.
|
||||||
* @param pokemon The {@linkcode PlayerPokemon} to check against
|
* @param pokemon - The {@linkcode PlayerPokemon} to check against
|
||||||
* @returns A dialogue token key/value pair
|
* @returns A dialogue token key/value pair
|
||||||
* @throws An {@linkcode Error} if {@linkcode isAnd} is `true` (not supported)
|
* @throws An {@linkcode Error} if {@linkcode isAnd} is `true` (not supported)
|
||||||
*/
|
*/
|
||||||
@ -211,7 +211,7 @@ export class WaveRangeRequirement extends EncounterSceneRequirement {
|
|||||||
/**
|
/**
|
||||||
* Used for specifying a unique wave or wave range requirement
|
* Used for specifying a unique wave or wave range requirement
|
||||||
* If minWaveIndex and maxWaveIndex are equivalent, will check for exact wave number
|
* If minWaveIndex and maxWaveIndex are equivalent, will check for exact wave number
|
||||||
* @param waveRange [min, max]
|
* @param waveRange - [min, max]
|
||||||
*/
|
*/
|
||||||
constructor(waveRange: [number, number]) {
|
constructor(waveRange: [number, number]) {
|
||||||
super();
|
super();
|
||||||
@ -243,8 +243,8 @@ export class WaveModulusRequirement extends EncounterSceneRequirement {
|
|||||||
/**
|
/**
|
||||||
* Used for specifying a modulus requirement on the wave index
|
* Used for specifying a modulus requirement on the wave index
|
||||||
* For example, can be used to require the wave index to end with 1, 2, or 3
|
* For example, can be used to require the wave index to end with 1, 2, or 3
|
||||||
* @param waveModuli The allowed modulus results
|
* @param waveModuli - The allowed modulus results
|
||||||
* @param modulusValue The modulus calculation value
|
* @param modulusValue - The modulus calculation value
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* new WaveModulusRequirement([1, 2, 3], 10) will check for 1st/2nd/3rd waves that are immediately after a multiple of 10 wave
|
* new WaveModulusRequirement([1, 2, 3], 10) will check for 1st/2nd/3rd waves that are immediately after a multiple of 10 wave
|
||||||
|
@ -592,7 +592,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
* Use for complex options.
|
* Use for complex options.
|
||||||
* There should be at least 2 options defined and no more than 4.
|
* There should be at least 2 options defined and no more than 4.
|
||||||
*
|
*
|
||||||
* @param option MysteryEncounterOption to add, can use MysteryEncounterOptionBuilder to create instance
|
* @param option - MysteryEncounterOption to add, can use MysteryEncounterOptionBuilder to create instance
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withOption(option: MysteryEncounterOption): this & Pick<IMysteryEncounter, "options"> {
|
withOption(option: MysteryEncounterOption): this & Pick<IMysteryEncounter, "options"> {
|
||||||
@ -610,8 +610,8 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
* There should be at least 2 options defined and no more than 4.
|
* There should be at least 2 options defined and no more than 4.
|
||||||
* If complex use {@linkcode MysteryEncounterBuilder.withOption}
|
* If complex use {@linkcode MysteryEncounterBuilder.withOption}
|
||||||
*
|
*
|
||||||
* @param dialogue {@linkcode OptionTextDisplay}
|
* @param dialogue
|
||||||
* @param callback {@linkcode OptionPhaseCallback}
|
* @param callback
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withSimpleOption(
|
withSimpleOption(
|
||||||
@ -632,8 +632,8 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
* There should be at least 2 options defined and no more than 4.
|
* There should be at least 2 options defined and no more than 4.
|
||||||
* If complex use {@linkcode MysteryEncounterBuilder.withOption}
|
* If complex use {@linkcode MysteryEncounterBuilder.withOption}
|
||||||
*
|
*
|
||||||
* @param dialogue {@linkcode OptionTextDisplay}
|
* @param dialogue
|
||||||
* @param callback {@linkcode OptionPhaseCallback}
|
* @param callback
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withSimpleDexProgressOption(
|
withSimpleDexProgressOption(
|
||||||
@ -678,7 +678,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the localization key used by the encounter
|
* Sets the localization key used by the encounter
|
||||||
* @param localizationKey the string used as the key
|
* @param localizationKey - the string used as the key
|
||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
setLocalizationKey(localizationKey: string): this {
|
setLocalizationKey(localizationKey: string): this {
|
||||||
@ -830,8 +830,8 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Specifies a wave range requirement for an encounter.
|
* Specifies a wave range requirement for an encounter.
|
||||||
*
|
*
|
||||||
* @param min min wave (or exact wave if only min is given)
|
* @param min - min wave (or exact wave if only min is given)
|
||||||
* @param max optional max wave. If not given, defaults to min => exact wave
|
* @param max - optional max wave. If not given, defaults to min => exact wave
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withSceneWaveRangeRequirement(min: number, max?: number): this & Required<Pick<IMysteryEncounter, "requirements">> {
|
withSceneWaveRangeRequirement(min: number, max?: number): this & Required<Pick<IMysteryEncounter, "requirements">> {
|
||||||
@ -841,9 +841,9 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Specifies a party size requirement for an encounter.
|
* Specifies a party size requirement for an encounter.
|
||||||
*
|
*
|
||||||
* @param min min wave (or exact size if only min is given)
|
* @param min - min wave (or exact size if only min is given)
|
||||||
* @param max optional max size. If not given, defaults to min => exact wave
|
* @param max - optional max size. If not given, defaults to min => exact wave
|
||||||
* @param excludeDisallowedPokemon if true, only counts allowed (legal in Challenge/unfainted) mons
|
* @param excludeDisallowedPokemon - if true, only counts allowed (legal in Challenge/unfainted) mons
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withScenePartySizeRequirement(
|
withScenePartySizeRequirement(
|
||||||
@ -857,7 +857,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Add a primary pokemon requirement
|
* Add a primary pokemon requirement
|
||||||
*
|
*
|
||||||
* @param requirement {@linkcode EncounterPokemonRequirement}
|
* @param requirement
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withPrimaryPokemonRequirement(
|
withPrimaryPokemonRequirement(
|
||||||
@ -876,9 +876,9 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Add a primary pokemon status effect requirement
|
* Add a primary pokemon status effect requirement
|
||||||
*
|
*
|
||||||
* @param statusEffect the status effect/s to check
|
* @param statusEffect - the status effect/s to check
|
||||||
* @param minNumberOfPokemon minimum number of pokemon to have the effect
|
* @param minNumberOfPokemon - minimum number of pokemon to have the effect
|
||||||
* @param invertQuery if true will invert the query
|
* @param invertQuery - if true will invert the query
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withPrimaryPokemonStatusEffectRequirement(
|
withPrimaryPokemonStatusEffectRequirement(
|
||||||
@ -894,9 +894,9 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Add a primary pokemon health ratio requirement
|
* Add a primary pokemon health ratio requirement
|
||||||
*
|
*
|
||||||
* @param requiredHealthRange the health range to check
|
* @param requiredHealthRange - the health range to check
|
||||||
* @param minNumberOfPokemon minimum number of pokemon to have the health range
|
* @param minNumberOfPokemon - minimum number of pokemon to have the health range
|
||||||
* @param invertQuery if true will invert the query
|
* @param invertQuery - if true will invert the query
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withPrimaryPokemonHealthRatioRequirement(
|
withPrimaryPokemonHealthRatioRequirement(
|
||||||
@ -935,7 +935,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
* NOTE: If rewards are dependent on options selected, runtime data, etc.,
|
* NOTE: If rewards are dependent on options selected, runtime data, etc.,
|
||||||
* It may be better to programmatically set doEncounterRewards elsewhere.
|
* It may be better to programmatically set doEncounterRewards elsewhere.
|
||||||
* There is a helper function in mystery-encounter utils, setEncounterRewards(), which can be called programmatically to set rewards
|
* There is a helper function in mystery-encounter utils, setEncounterRewards(), which can be called programmatically to set rewards
|
||||||
* @param doEncounterRewards Synchronous callback function to perform during rewards phase of the encounter
|
* @param doEncounterRewards - Synchronous callback function to perform during rewards phase of the encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withRewards(doEncounterRewards: () => boolean): this & Required<Pick<IMysteryEncounter, "doEncounterRewards">> {
|
withRewards(doEncounterRewards: () => boolean): this & Required<Pick<IMysteryEncounter, "doEncounterRewards">> {
|
||||||
@ -949,7 +949,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
* NOTE: If rewards are dependent on options selected, runtime data, etc.,
|
* NOTE: If rewards are dependent on options selected, runtime data, etc.,
|
||||||
* It may be better to programmatically set doEncounterExp elsewhere.
|
* It may be better to programmatically set doEncounterExp elsewhere.
|
||||||
* There is a helper function in mystery-encounter utils, setEncounterExp(), which can be called programmatically to set rewards
|
* There is a helper function in mystery-encounter utils, setEncounterExp(), which can be called programmatically to set rewards
|
||||||
* @param doEncounterExp Synchronous callback function to perform during rewards phase of the encounter
|
* @param doEncounterExp - Synchronous callback function to perform during rewards phase of the encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withExp(doEncounterExp: () => boolean): this & Required<Pick<IMysteryEncounter, "doEncounterExp">> {
|
withExp(doEncounterExp: () => boolean): this & Required<Pick<IMysteryEncounter, "doEncounterExp">> {
|
||||||
@ -960,7 +960,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
* Can be used to perform init logic before intro visuals are shown and before the MysteryEncounterPhase begins
|
* Can be used to perform init logic before intro visuals are shown and before the MysteryEncounterPhase begins
|
||||||
* Useful for performing things like procedural generation of intro sprites, etc.
|
* Useful for performing things like procedural generation of intro sprites, etc.
|
||||||
*
|
*
|
||||||
* @param onInit Synchronous callback function to perform as soon as the encounter is selected for the next phase
|
* @param onInit - Synchronous callback function to perform as soon as the encounter is selected for the next phase
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withOnInit(onInit: () => boolean): this & Required<Pick<IMysteryEncounter, "onInit">> {
|
withOnInit(onInit: () => boolean): this & Required<Pick<IMysteryEncounter, "onInit">> {
|
||||||
@ -970,7 +970,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Can be used to perform some extra logic (usually animations) when the enemy field is finished sliding in
|
* Can be used to perform some extra logic (usually animations) when the enemy field is finished sliding in
|
||||||
*
|
*
|
||||||
* @param onVisualsStart Synchronous callback function to perform as soon as the enemy field finishes sliding in
|
* @param onVisualsStart - Synchronous callback function to perform as soon as the enemy field finishes sliding in
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withOnVisualsStart(onVisualsStart: () => boolean): this & Required<Pick<IMysteryEncounter, "onVisualsStart">> {
|
withOnVisualsStart(onVisualsStart: () => boolean): this & Required<Pick<IMysteryEncounter, "onVisualsStart">> {
|
||||||
@ -980,7 +980,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Can set whether catching is allowed or not on the encounter
|
* Can set whether catching is allowed or not on the encounter
|
||||||
* This flag can also be programmatically set inside option event functions or elsewhere
|
* This flag can also be programmatically set inside option event functions or elsewhere
|
||||||
* @param catchAllowed If `true`, allows enemy pokemon to be caught during the encounter
|
* @param catchAllowed - If `true`, allows enemy pokemon to be caught during the encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withCatchAllowed(catchAllowed: boolean): this & Required<Pick<IMysteryEncounter, "catchAllowed">> {
|
withCatchAllowed(catchAllowed: boolean): this & Required<Pick<IMysteryEncounter, "catchAllowed">> {
|
||||||
@ -989,7 +989,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Can set whether fleeing is allowed or not on the encounter
|
* Can set whether fleeing is allowed or not on the encounter
|
||||||
* @param fleeAllowed If `false`, prevents fleeing from a wild battle (trainer battle MEs already have flee disabled)
|
* @param fleeAllowed - If `false`, prevents fleeing from a wild battle (trainer battle MEs already have flee disabled)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withFleeAllowed(fleeAllowed: boolean): this & Required<Pick<IMysteryEncounter, "fleeAllowed">> {
|
withFleeAllowed(fleeAllowed: boolean): this & Required<Pick<IMysteryEncounter, "fleeAllowed">> {
|
||||||
@ -997,7 +997,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param hideBattleIntroMessage If `true`, will not show the trainerAppeared/wildAppeared/bossAppeared message for an encounter
|
* @param hideBattleIntroMessage - If `true`, will not show the trainerAppeared/wildAppeared/bossAppeared message for an encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withHideWildIntroMessage(
|
withHideWildIntroMessage(
|
||||||
@ -1009,7 +1009,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param autoHideIntroVisuals If `false`, will not hide the intro visuals that are displayed at the beginning of encounter
|
* @param autoHideIntroVisuals - If `false`, will not hide the intro visuals that are displayed at the beginning of encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withAutoHideIntroVisuals(
|
withAutoHideIntroVisuals(
|
||||||
@ -1019,7 +1019,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enterIntroVisualsFromRight If `true`, will slide in intro visuals from the right side of the screen. If false, slides in from left, as normal
|
* @param enterIntroVisualsFromRight - If `true`, will slide in intro visuals from the right side of the screen. If false, slides in from left, as normal
|
||||||
* Default false
|
* Default false
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
@ -1034,7 +1034,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Add a title for the encounter
|
* Add a title for the encounter
|
||||||
*
|
*
|
||||||
* @param title Title of the encounter
|
* @param title - Title of the encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withTitle(title: string): this {
|
withTitle(title: string): this {
|
||||||
@ -1054,7 +1054,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Add a description of the encounter
|
* Add a description of the encounter
|
||||||
*
|
*
|
||||||
* @param description Description of the encounter
|
* @param description - Description of the encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withDescription(description: string): this {
|
withDescription(description: string): this {
|
||||||
@ -1074,7 +1074,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Add a query for the encounter
|
* Add a query for the encounter
|
||||||
*
|
*
|
||||||
* @param query Query to use for the encounter
|
* @param query - Query to use for the encounter
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withQuery(query: string): this {
|
withQuery(query: string): this {
|
||||||
@ -1094,7 +1094,7 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
|||||||
/**
|
/**
|
||||||
* Add outro dialogue/s for the encounter
|
* Add outro dialogue/s for the encounter
|
||||||
*
|
*
|
||||||
* @param dialogue Outro dialogue(s)
|
* @param dialogue - Outro dialogue(s)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
withOutroDialogue(dialogue: MysteryEncounterDialogue["outro"] = []): this {
|
withOutroDialogue(dialogue: MysteryEncounterDialogue["outro"] = []): this {
|
||||||
|
@ -9,7 +9,7 @@ import i18next from "i18next";
|
|||||||
* Will inject all relevant dialogue tokens that exist in the {@linkcode BattlegScene.currentBattle.mysteryEncounter.dialogueTokens}, into i18n text.
|
* Will inject all relevant dialogue tokens that exist in the {@linkcode BattlegScene.currentBattle.mysteryEncounter.dialogueTokens}, into i18n text.
|
||||||
* Also adds BBCodeText fragments for colored text, if applicable
|
* Also adds BBCodeText fragments for colored text, if applicable
|
||||||
* @param keyOrString
|
* @param keyOrString
|
||||||
* @param primaryStyle Can define a text style to be applied to the entire string. Must be defined for BBCodeText styles to be applied correctly
|
* @param primaryStyle - Can define a text style to be applied to the entire string. Must be defined for BBCodeText styles to be applied correctly
|
||||||
*/
|
*/
|
||||||
export function getEncounterText(keyOrString?: string, primaryStyle?: TextStyle): string | null {
|
export function getEncounterText(keyOrString?: string, primaryStyle?: TextStyle): string | null {
|
||||||
if (isNullOrUndefined(keyOrString)) {
|
if (isNullOrUndefined(keyOrString)) {
|
||||||
|
@ -143,7 +143,7 @@ export interface EnemyPartyConfig {
|
|||||||
* Generates an enemy party for a mystery encounter battle
|
* Generates an enemy party for a mystery encounter battle
|
||||||
* This will override and replace any standard encounter generation logic
|
* This will override and replace any standard encounter generation logic
|
||||||
* Useful for tailoring specific battles to mystery encounters
|
* Useful for tailoring specific battles to mystery encounters
|
||||||
* @param partyConfig Can pass various customizable attributes for the enemy party, see EnemyPartyConfig
|
* @param partyConfig - Can pass various customizable attributes for the enemy party, see EnemyPartyConfig
|
||||||
*/
|
*/
|
||||||
export async function initBattleWithEnemyConfig(partyConfig: EnemyPartyConfig): Promise<void> {
|
export async function initBattleWithEnemyConfig(partyConfig: EnemyPartyConfig): Promise<void> {
|
||||||
const loaded: boolean = false;
|
const loaded: boolean = false;
|
||||||
@ -509,7 +509,7 @@ export function updatePlayerMoney(changeValue: number, playSound = true, showMes
|
|||||||
/**
|
/**
|
||||||
* Converts modifier bullshit to an actual item
|
* Converts modifier bullshit to an actual item
|
||||||
* @param modifier
|
* @param modifier
|
||||||
* @param pregenArgs Can specify BerryType for berries, TM for TMs, AttackBoostType for item, etc.
|
* @param pregenArgs - Can specify BerryType for berries, TM for TMs, AttackBoostType for item, etc.
|
||||||
*/
|
*/
|
||||||
export function generateModifierType(modifier: () => ModifierType, pregenArgs?: any[]): ModifierType | null {
|
export function generateModifierType(modifier: () => ModifierType, pregenArgs?: any[]): ModifierType | null {
|
||||||
const modifierId = Object.keys(modifierTypes).find(k => modifierTypes[k] === modifier);
|
const modifierId = Object.keys(modifierTypes).find(k => modifierTypes[k] === modifier);
|
||||||
@ -1039,9 +1039,9 @@ export function handleMysteryEncounterTurnStartEffects(): boolean {
|
|||||||
/**
|
/**
|
||||||
* Helper function for encounters such as {@linkcode UncommonBreedEncounter} which call for a random species including event encounters.
|
* Helper function for encounters such as {@linkcode UncommonBreedEncounter} which call for a random species including event encounters.
|
||||||
* If the mon is from the event encounter list, it will do an extra shiny roll.
|
* If the mon is from the event encounter list, it will do an extra shiny roll.
|
||||||
* @param level the level of the mon, which differs between MEs
|
* @param level - the level of the mon, which differs between MEs
|
||||||
* @param isBoss whether the mon should be a Boss
|
* @param isBoss - whether the mon should be a Boss
|
||||||
* @param rerollHidden whether the mon should get an extra roll for Hidden Ability
|
* @param rerollHidden - whether the mon should get an extra roll for Hidden Ability
|
||||||
* @returns {@linkcode EnemyPokemon} for the requested encounter
|
* @returns {@linkcode EnemyPokemon} for the requested encounter
|
||||||
*/
|
*/
|
||||||
export function getRandomEncounterSpecies(level: number, isBoss = false, rerollHidden = false): EnemyPokemon {
|
export function getRandomEncounterSpecies(level: number, isBoss = false, rerollHidden = false): EnemyPokemon {
|
||||||
|
@ -92,9 +92,9 @@ export function getSpriteKeysFromPokemon(pokemon: Pokemon): {
|
|||||||
/**
|
/**
|
||||||
* Will never remove the player's last non-fainted Pokemon (if they only have 1).
|
* Will never remove the player's last non-fainted Pokemon (if they only have 1).
|
||||||
* Otherwise, picks a Pokemon completely at random and removes from the party
|
* Otherwise, picks a Pokemon completely at random and removes from the party
|
||||||
* @param isAllowed Default `false`. If `true`, only picks from legal mons. If no legal mons are found (or there is 1, with `doNotReturnLastAllowedMon = true`), will return a mon that is not allowed.
|
* @param isAllowed - Default `false`. If `true`, only picks from legal mons. If no legal mons are found (or there is 1, with `doNotReturnLastAllowedMon = true`), will return a mon that is not allowed.
|
||||||
* @param isFainted Default `false`. If `true`, includes fainted mons.
|
* @param isFainted - Default `false`. If `true`, includes fainted mons.
|
||||||
* @param doNotReturnLastAllowedMon Default `false`. If `true`, will never return the last unfainted pokemon in the party. Useful when this function is being used to determine what Pokemon to remove from the party (Don't want to remove last unfainted)
|
* @param doNotReturnLastAllowedMon - Default `false`. If `true`, will never return the last unfainted pokemon in the party. Useful when this function is being used to determine what Pokemon to remove from the party (Don't want to remove last unfainted)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getRandomPlayerPokemon(
|
export function getRandomPlayerPokemon(
|
||||||
@ -136,8 +136,8 @@ export function getRandomPlayerPokemon(
|
|||||||
/**
|
/**
|
||||||
* Ties are broken by whatever mon is closer to the front of the party
|
* Ties are broken by whatever mon is closer to the front of the party
|
||||||
* @param scene
|
* @param scene
|
||||||
* @param isAllowed Default false. If true, only picks from legal mons.
|
* @param isAllowed - Default false. If true, only picks from legal mons.
|
||||||
* @param isFainted Default false. If true, includes fainted mons.
|
* @param isFainted - Default false. If true, includes fainted mons.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getHighestLevelPlayerPokemon(isAllowed = false, isFainted = false): PlayerPokemon {
|
export function getHighestLevelPlayerPokemon(isAllowed = false, isFainted = false): PlayerPokemon {
|
||||||
@ -161,9 +161,9 @@ export function getHighestLevelPlayerPokemon(isAllowed = false, isFainted = fals
|
|||||||
/**
|
/**
|
||||||
* Ties are broken by whatever mon is closer to the front of the party
|
* Ties are broken by whatever mon is closer to the front of the party
|
||||||
* @param scene
|
* @param scene
|
||||||
* @param stat Stat to search for
|
* @param stat - Stat to search for
|
||||||
* @param isAllowed Default false. If true, only picks from legal mons.
|
* @param isAllowed - Default false. If true, only picks from legal mons.
|
||||||
* @param isFainted Default false. If true, includes fainted mons.
|
* @param isFainted - Default false. If true, includes fainted mons.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getHighestStatPlayerPokemon(stat: PermanentStat, isAllowed = false, isFainted = false): PlayerPokemon {
|
export function getHighestStatPlayerPokemon(stat: PermanentStat, isAllowed = false, isFainted = false): PlayerPokemon {
|
||||||
@ -187,8 +187,8 @@ export function getHighestStatPlayerPokemon(stat: PermanentStat, isAllowed = fal
|
|||||||
/**
|
/**
|
||||||
* Ties are broken by whatever mon is closer to the front of the party
|
* Ties are broken by whatever mon is closer to the front of the party
|
||||||
* @param scene
|
* @param scene
|
||||||
* @param isAllowed Default false. If true, only picks from legal mons.
|
* @param isAllowed - Default false. If true, only picks from legal mons.
|
||||||
* @param isFainted Default false. If true, includes fainted mons.
|
* @param isFainted - Default false. If true, includes fainted mons.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getLowestLevelPlayerPokemon(isAllowed = false, isFainted = false): PlayerPokemon {
|
export function getLowestLevelPlayerPokemon(isAllowed = false, isFainted = false): PlayerPokemon {
|
||||||
@ -212,8 +212,8 @@ export function getLowestLevelPlayerPokemon(isAllowed = false, isFainted = false
|
|||||||
/**
|
/**
|
||||||
* Ties are broken by whatever mon is closer to the front of the party
|
* Ties are broken by whatever mon is closer to the front of the party
|
||||||
* @param scene
|
* @param scene
|
||||||
* @param isAllowed Default false. If true, only picks from legal mons.
|
* @param isAllowed - Default false. If true, only picks from legal mons.
|
||||||
* @param isFainted Default false. If true, includes fainted mons.
|
* @param isFainted - Default false. If true, includes fainted mons.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getHighestStatTotalPlayerPokemon(isAllowed = false, isFainted = false): PlayerPokemon {
|
export function getHighestStatTotalPlayerPokemon(isAllowed = false, isFainted = false): PlayerPokemon {
|
||||||
@ -300,8 +300,8 @@ export function getRandomSpeciesByStarterCost(
|
|||||||
/**
|
/**
|
||||||
* Takes care of handling player pokemon KO (with all its side effects)
|
* Takes care of handling player pokemon KO (with all its side effects)
|
||||||
*
|
*
|
||||||
* @param scene the battle scene
|
* @param scene - the battle scene
|
||||||
* @param pokemon the player pokemon to KO
|
* @param pokemon - the player pokemon to KO
|
||||||
*/
|
*/
|
||||||
export function koPlayerPokemon(pokemon: PlayerPokemon) {
|
export function koPlayerPokemon(pokemon: PlayerPokemon) {
|
||||||
pokemon.hp = 0;
|
pokemon.hp = 0;
|
||||||
@ -318,9 +318,9 @@ export function koPlayerPokemon(pokemon: PlayerPokemon) {
|
|||||||
* Handles applying hp changes to a player pokemon.
|
* Handles applying hp changes to a player pokemon.
|
||||||
* Takes care of not going below `0`, above max-hp, adding `FNT` status correctly and updating the pokemon info.
|
* Takes care of not going below `0`, above max-hp, adding `FNT` status correctly and updating the pokemon info.
|
||||||
* TODO: should we handle special cases like wonder-guard/shedinja?
|
* TODO: should we handle special cases like wonder-guard/shedinja?
|
||||||
* @param scene the battle scene
|
* @param scene - the battle scene
|
||||||
* @param pokemon the player pokemon to apply the hp change to
|
* @param pokemon - the player pokemon to apply the hp change to
|
||||||
* @param value the hp change amount. Positive for heal. Negative for damage
|
* @param value - the hp change amount. Positive for heal. Negative for damage
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function applyHpChangeToPokemon(pokemon: PlayerPokemon, value: number) {
|
function applyHpChangeToPokemon(pokemon: PlayerPokemon, value: number) {
|
||||||
@ -335,9 +335,9 @@ function applyHpChangeToPokemon(pokemon: PlayerPokemon, value: number) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles applying damage to a player pokemon
|
* Handles applying damage to a player pokemon
|
||||||
* @param scene the battle scene
|
* @param scene - the battle scene
|
||||||
* @param pokemon the player pokemon to apply damage to
|
* @param pokemon - the player pokemon to apply damage to
|
||||||
* @param damage the amount of damage to apply
|
* @param damage - the amount of damage to apply
|
||||||
* @see {@linkcode applyHpChangeToPokemon}
|
* @see {@linkcode applyHpChangeToPokemon}
|
||||||
*/
|
*/
|
||||||
export function applyDamageToPokemon(pokemon: PlayerPokemon, damage: number) {
|
export function applyDamageToPokemon(pokemon: PlayerPokemon, damage: number) {
|
||||||
@ -355,9 +355,9 @@ export function applyDamageToPokemon(pokemon: PlayerPokemon, damage: number) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles applying heal to a player pokemon
|
* Handles applying heal to a player pokemon
|
||||||
* @param scene the battle scene
|
* @param scene - the battle scene
|
||||||
* @param pokemon the player pokemon to apply heal to
|
* @param pokemon - the player pokemon to apply heal to
|
||||||
* @param heal the amount of heal to apply
|
* @param heal - the amount of heal to apply
|
||||||
* @see {@linkcode applyHpChangeToPokemon}
|
* @see {@linkcode applyHpChangeToPokemon}
|
||||||
*/
|
*/
|
||||||
export function applyHealToPokemon(pokemon: PlayerPokemon, heal: number) {
|
export function applyHealToPokemon(pokemon: PlayerPokemon, heal: number) {
|
||||||
@ -957,7 +957,7 @@ export function getGoldenBugNetSpecies(level: number): PokemonSpecies {
|
|||||||
/**
|
/**
|
||||||
* Generates a Pokemon level for a given wave, with an option to increase/decrease by a scaling modifier
|
* Generates a Pokemon level for a given wave, with an option to increase/decrease by a scaling modifier
|
||||||
* @param scene
|
* @param scene
|
||||||
* @param levelAdditiveModifier Default 0. will add +(1 level / 10 waves * levelAdditiveModifier) to the level calculation
|
* @param levelAdditiveModifier - Default 0. will add +(1 level / 10 waves * levelAdditiveModifier) to the level calculation
|
||||||
*/
|
*/
|
||||||
export function getEncounterPokemonLevelForWave(levelAdditiveModifier = 0) {
|
export function getEncounterPokemonLevelForWave(levelAdditiveModifier = 0) {
|
||||||
const currentBattle = globalScene.currentBattle;
|
const currentBattle = globalScene.currentBattle;
|
||||||
|
@ -85,7 +85,7 @@ export function getPokeballTintColor(type: PokeballType): number {
|
|||||||
/**
|
/**
|
||||||
* Gets the critical capture chance based on number of mons registered in Dex and modified {@link https://bulbapedia.bulbagarden.net/wiki/Catch_rate Catch rate}
|
* Gets the critical capture chance based on number of mons registered in Dex and modified {@link https://bulbapedia.bulbagarden.net/wiki/Catch_rate Catch rate}
|
||||||
* Formula from {@link https://www.dragonflycave.com/mechanics/gen-vi-vii-capturing Dragonfly Cave Gen 6 Capture Mechanics page}
|
* Formula from {@link https://www.dragonflycave.com/mechanics/gen-vi-vii-capturing Dragonfly Cave Gen 6 Capture Mechanics page}
|
||||||
* @param modifiedCatchRate the modified catch rate as calculated in {@linkcode AttemptCapturePhase}
|
* @param modifiedCatchRate - the modified catch rate as calculated in {@linkcode AttemptCapturePhase}
|
||||||
* @returns the chance of getting a critical capture, out of 256
|
* @returns the chance of getting a critical capture, out of 256
|
||||||
*/
|
*/
|
||||||
export function getCriticalCaptureChance(modifiedCatchRate: number): number {
|
export function getCriticalCaptureChance(modifiedCatchRate: number): number {
|
||||||
|
@ -431,7 +431,6 @@ export class SpeciesDefaultFormMatchTrigger extends SpeciesFormChangeTrigger {
|
|||||||
/**
|
/**
|
||||||
* Class used for triggering form changes based on the user's Tera type.
|
* Class used for triggering form changes based on the user's Tera type.
|
||||||
* Used by Ogerpon and Terapagos.
|
* Used by Ogerpon and Terapagos.
|
||||||
* @extends SpeciesFormChangeTrigger
|
|
||||||
*/
|
*/
|
||||||
export class SpeciesFormChangeTeraTrigger extends SpeciesFormChangeTrigger {
|
export class SpeciesFormChangeTeraTrigger extends SpeciesFormChangeTrigger {
|
||||||
description = i18next.t("pokemonEvolutions:Forms.tera");
|
description = i18next.t("pokemonEvolutions:Forms.tera");
|
||||||
@ -440,7 +439,6 @@ export class SpeciesFormChangeTeraTrigger extends SpeciesFormChangeTrigger {
|
|||||||
/**
|
/**
|
||||||
* Class used for triggering form changes based on the user's lapsed Tera type.
|
* Class used for triggering form changes based on the user's lapsed Tera type.
|
||||||
* Used by Ogerpon and Terapagos.
|
* Used by Ogerpon and Terapagos.
|
||||||
* @extends SpeciesFormChangeTrigger
|
|
||||||
*/
|
*/
|
||||||
export class SpeciesFormChangeLapseTeraTrigger extends SpeciesFormChangeTrigger {
|
export class SpeciesFormChangeLapseTeraTrigger extends SpeciesFormChangeTrigger {
|
||||||
description = i18next.t("pokemonEvolutions:Forms.teraLapse");
|
description = i18next.t("pokemonEvolutions:Forms.teraLapse");
|
||||||
@ -449,7 +447,6 @@ export class SpeciesFormChangeLapseTeraTrigger extends SpeciesFormChangeTrigger
|
|||||||
/**
|
/**
|
||||||
* Class used for triggering form changes based on weather.
|
* Class used for triggering form changes based on weather.
|
||||||
* Used by Castform and Cherrim.
|
* Used by Castform and Cherrim.
|
||||||
* @extends SpeciesFormChangeTrigger
|
|
||||||
*/
|
*/
|
||||||
export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger {
|
export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger {
|
||||||
/** The ability that triggers the form change */
|
/** The ability that triggers the form change */
|
||||||
@ -465,10 +462,10 @@ export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the Pokemon has the required ability and is in the correct weather while
|
* Check if the Pokemon has the required ability and is in the correct weather while
|
||||||
* the weather or ability is also not suppressed.
|
* the weather or ability is also not suppressed.
|
||||||
* @param {Pokemon} pokemon the pokemon that is trying to do the form change
|
* @param pokemon - The pokemon that is trying to do the form change
|
||||||
* @returns `true` if the Pokemon can change forms, `false` otherwise
|
* @returns whether the Pokemon can change forms
|
||||||
*/
|
*/
|
||||||
canChange(pokemon: Pokemon): boolean {
|
canChange(pokemon: Pokemon): boolean {
|
||||||
const currentWeather = globalScene.arena.weather?.weatherType ?? WeatherType.NONE;
|
const currentWeather = globalScene.arena.weather?.weatherType ?? WeatherType.NONE;
|
||||||
@ -488,7 +485,6 @@ export class SpeciesFormChangeWeatherTrigger extends SpeciesFormChangeTrigger {
|
|||||||
* Class used for reverting to the original form when the weather runs out
|
* Class used for reverting to the original form when the weather runs out
|
||||||
* or when the user loses the ability/is suppressed.
|
* or when the user loses the ability/is suppressed.
|
||||||
* Used by Castform and Cherrim.
|
* Used by Castform and Cherrim.
|
||||||
* @extends SpeciesFormChangeTrigger
|
|
||||||
*/
|
*/
|
||||||
export class SpeciesFormChangeRevertWeatherFormTrigger extends SpeciesFormChangeTrigger {
|
export class SpeciesFormChangeRevertWeatherFormTrigger extends SpeciesFormChangeTrigger {
|
||||||
/** The ability that triggers the form change*/
|
/** The ability that triggers the form change*/
|
||||||
@ -506,7 +502,7 @@ export class SpeciesFormChangeRevertWeatherFormTrigger extends SpeciesFormChange
|
|||||||
/**
|
/**
|
||||||
* Checks if the Pokemon has the required ability and the weather is one that will revert
|
* Checks if the Pokemon has the required ability and the weather is one that will revert
|
||||||
* the Pokemon to its original form or the weather or ability is suppressed
|
* the Pokemon to its original form or the weather or ability is suppressed
|
||||||
* @param {Pokemon} pokemon the pokemon that is trying to do the form change
|
* @param pokemon - the pokemon that is trying to do the form change
|
||||||
* @returns `true` if the Pokemon will revert to its original form, `false` otherwise
|
* @returns `true` if the Pokemon will revert to its original form, `false` otherwise
|
||||||
*/
|
*/
|
||||||
canChange(pokemon: Pokemon): boolean {
|
canChange(pokemon: Pokemon): boolean {
|
||||||
@ -562,7 +558,7 @@ export function getSpeciesFormChangeMessage(pokemon: Pokemon, formChange: Specie
|
|||||||
/**
|
/**
|
||||||
* Gives a condition for form changing checking if a species is registered as caught in the player's dex data.
|
* Gives a condition for form changing checking if a species is registered as caught in the player's dex data.
|
||||||
* Used for fusion forms such as Kyurem and Necrozma.
|
* Used for fusion forms such as Kyurem and Necrozma.
|
||||||
* @param species {@linkcode Species}
|
* @param species
|
||||||
* @returns A {@linkcode SpeciesFormChangeCondition} checking if that species is registered as caught
|
* @returns A {@linkcode SpeciesFormChangeCondition} checking if that species is registered as caught
|
||||||
*/
|
*/
|
||||||
function getSpeciesDependentFormChangeCondition(species: Species): SpeciesFormChangeCondition {
|
function getSpeciesDependentFormChangeCondition(species: Species): SpeciesFormChangeCondition {
|
||||||
|
@ -75,7 +75,7 @@ export const normalForm: Species[] = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the {@linkcode PokemonSpecies} object associated with the {@linkcode Species} enum given
|
* Gets the {@linkcode PokemonSpecies} object associated with the {@linkcode Species} enum given
|
||||||
* @param species The species to fetch
|
* @param species - The species to fetch
|
||||||
* @returns The associated {@linkcode PokemonSpecies} object
|
* @returns The associated {@linkcode PokemonSpecies} object
|
||||||
*/
|
*/
|
||||||
export function getPokemonSpecies(species: Species | Species[]): PokemonSpecies {
|
export function getPokemonSpecies(species: Species | Species[]): PokemonSpecies {
|
||||||
@ -229,7 +229,7 @@ export abstract class PokemonSpeciesForm {
|
|||||||
* Method to get the root species id of a Pokemon.
|
* Method to get the root species id of a Pokemon.
|
||||||
* Magmortar.getRootSpeciesId(true) => Magmar
|
* Magmortar.getRootSpeciesId(true) => Magmar
|
||||||
* Magmortar.getRootSpeciesId(false) => Magby
|
* Magmortar.getRootSpeciesId(false) => Magby
|
||||||
* @param forStarter boolean to get the nonbaby form of a starter
|
* @param forStarter - boolean to get the nonbaby form of a starter
|
||||||
* @returns The species
|
* @returns The species
|
||||||
*/
|
*/
|
||||||
getRootSpeciesId(forStarter = false): Species {
|
getRootSpeciesId(forStarter = false): Species {
|
||||||
@ -270,7 +270,7 @@ export abstract class PokemonSpeciesForm {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to get the ability of a Pokemon species.
|
* Method to get the ability of a Pokemon species.
|
||||||
* @param abilityIndex Which ability to get (should only be 0-2)
|
* @param abilityIndex - Which ability to get (should only be 0-2)
|
||||||
* @returns The id of the Ability
|
* @returns The id of the Ability
|
||||||
*/
|
*/
|
||||||
getAbility(abilityIndex: number): Abilities {
|
getAbility(abilityIndex: number): Abilities {
|
||||||
@ -287,7 +287,7 @@ export abstract class PokemonSpeciesForm {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to get the passive ability of a Pokemon species
|
* Method to get the passive ability of a Pokemon species
|
||||||
* @param formIndex The form index to use, defaults to form for this species instance
|
* @param formIndex - The form index to use, defaults to form for this species instance
|
||||||
* @returns The id of the ability
|
* @returns The id of the ability
|
||||||
*/
|
*/
|
||||||
getPassiveAbility(formIndex?: number): Abilities {
|
getPassiveAbility(formIndex?: number): Abilities {
|
||||||
@ -362,7 +362,7 @@ export abstract class PokemonSpeciesForm {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the species' base stat amount for the given stat.
|
* Gets the species' base stat amount for the given stat.
|
||||||
* @param stat The desired stat.
|
* @param stat - The desired stat.
|
||||||
* @returns The species' base stat amount.
|
* @returns The species' base stat amount.
|
||||||
*/
|
*/
|
||||||
getBaseStat(stat: Stat): number {
|
getBaseStat(stat: Stat): number {
|
||||||
@ -422,7 +422,7 @@ export abstract class PokemonSpeciesForm {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Variant Data key/index is either species id or species id followed by -formkey
|
* Variant Data key/index is either species id or species id followed by -formkey
|
||||||
* @param formIndex optional form index for pokemon with different forms
|
* @param formIndex - optional form index for pokemon with different forms
|
||||||
* @returns species id if no additional forms, index with formkey if a pokemon with a form
|
* @returns species id if no additional forms, index with formkey if a pokemon with a form
|
||||||
*/
|
*/
|
||||||
getVariantDataIndex(formIndex?: number) {
|
getVariantDataIndex(formIndex?: number) {
|
||||||
@ -860,8 +860,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the form name for species with just one form (regional variants, Floette, Ursaluna)
|
* Find the form name for species with just one form (regional variants, Floette, Ursaluna)
|
||||||
* @param formIndex The form index to check (defaults to 0)
|
* @param formIndex - The form index to check (defaults to 0)
|
||||||
* @param append Whether to append the species name to the end (defaults to false)
|
* @param append - Whether to append the species name to the end (defaults to false)
|
||||||
* @returns the pokemon-form locale key for the single form name ("Alolan Form", "Eternal Flower" etc)
|
* @returns the pokemon-form locale key for the single form name ("Alolan Form", "Eternal Flower" etc)
|
||||||
*/
|
*/
|
||||||
getFormNameToDisplay(formIndex = 0, append = false): string {
|
getFormNameToDisplay(formIndex = 0, append = false): string {
|
||||||
@ -960,7 +960,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
|
|||||||
* It's also used for preferredMinLevel, which is used when an evolution delay exists.
|
* It's also used for preferredMinLevel, which is used when an evolution delay exists.
|
||||||
* The calculation with evolution delay is a weighted average of the easeIn and easeOut functions where preferredMinLevel is the denominator.
|
* The calculation with evolution delay is a weighted average of the easeIn and easeOut functions where preferredMinLevel is the denominator.
|
||||||
* This also means a lower value of x will lead to a higher evolution chance.
|
* This also means a lower value of x will lead to a higher evolution chance.
|
||||||
* @param strength {@linkcode PartyMemberStrength} The strength of the party member in question
|
* @param strength - The strength of the party member in question
|
||||||
* @returns {@linkcode number} The level difference from expected evolution level tolerated for a mon to be unevolved. Lower value = higher evolution chance.
|
* @returns {@linkcode number} The level difference from expected evolution level tolerated for a mon to be unevolved. Lower value = higher evolution chance.
|
||||||
*/
|
*/
|
||||||
private getStrengthLevelDiff(strength: PartyMemberStrength): number {
|
private getStrengthLevelDiff(strength: PartyMemberStrength): number {
|
||||||
|
@ -124,8 +124,8 @@ export function generateRandomStatusEffect(): StatusEffect {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a random non-volatile StatusEffect between the two provided
|
* Returns a random non-volatile StatusEffect between the two provided
|
||||||
* @param statusEffectA The first StatusEffect
|
* @param statusEffectA - The first StatusEffect
|
||||||
* @param statusEffectA The second StatusEffect
|
* @param statusEffectA - The second StatusEffect
|
||||||
*/
|
*/
|
||||||
export function getRandomStatusEffect(statusEffectA: StatusEffect, statusEffectB: StatusEffect): StatusEffect {
|
export function getRandomStatusEffect(statusEffectA: StatusEffect, statusEffectB: StatusEffect): StatusEffect {
|
||||||
if (statusEffectA === StatusEffect.NONE || statusEffectA === StatusEffect.FAINT) {
|
if (statusEffectA === StatusEffect.NONE || statusEffectA === StatusEffect.FAINT) {
|
||||||
@ -140,8 +140,8 @@ export function getRandomStatusEffect(statusEffectA: StatusEffect, statusEffectB
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a random non-volatile StatusEffect between the two provided
|
* Returns a random non-volatile StatusEffect between the two provided
|
||||||
* @param statusA The first Status
|
* @param statusA - The first Status
|
||||||
* @param statusB The second Status
|
* @param statusB - The second Status
|
||||||
*/
|
*/
|
||||||
export function getRandomStatus(statusA: Status | null, statusB: Status | null): Status | null {
|
export function getRandomStatus(statusA: Status | null, statusB: Status | null): Status | null {
|
||||||
if (!statusA || statusA.effect === StatusEffect.NONE || statusA.effect === StatusEffect.FAINT) {
|
if (!statusA || statusA.effect === StatusEffect.NONE || statusA.effect === StatusEffect.FAINT) {
|
||||||
@ -172,7 +172,7 @@ export function getNonVolatileStatusEffects(): Array<StatusEffect> {
|
|||||||
/**
|
/**
|
||||||
* Returns whether a status effect is non volatile.
|
* Returns whether a status effect is non volatile.
|
||||||
* Non-volatile status condition is a status that remains after being switched out.
|
* Non-volatile status condition is a status that remains after being switched out.
|
||||||
* @param status The status to check
|
* @param status - The status to check
|
||||||
*/
|
*/
|
||||||
export function isNonVolatileStatusEffect(status: StatusEffect): boolean {
|
export function isNonVolatileStatusEffect(status: StatusEffect): boolean {
|
||||||
return getNonVolatileStatusEffects().includes(status);
|
return getNonVolatileStatusEffects().includes(status);
|
||||||
|
@ -64,7 +64,7 @@ export class TrainerAI {
|
|||||||
public instantTeras: number[];
|
public instantTeras: number[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param canTerastallize Whether this trainer is allowed to tera
|
* @param canTerastallize - Whether this trainer is allowed to tera
|
||||||
*/
|
*/
|
||||||
constructor(teraMode: TeraAIMode = TeraAIMode.NO_TERA) {
|
constructor(teraMode: TeraAIMode = TeraAIMode.NO_TERA) {
|
||||||
this.teraMode = teraMode;
|
this.teraMode = teraMode;
|
||||||
@ -81,7 +81,7 @@ export class TrainerAI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a pokemon on this AI to just instantly Tera on first move used
|
* Sets a pokemon on this AI to just instantly Tera on first move used
|
||||||
* @param index The index of the pokemon to instantly tera.
|
* @param index - The index of the pokemon to instantly tera.
|
||||||
*/
|
*/
|
||||||
public setInstantTera(index: number) {
|
public setInstantTera(index: number) {
|
||||||
this.teraMode = TeraAIMode.INSTANT_TERA;
|
this.teraMode = TeraAIMode.INSTANT_TERA;
|
||||||
@ -280,8 +280,8 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the configuration for trainers with genders, including the female name and encounter background music (BGM).
|
* Sets the configuration for trainers with genders, including the female name and encounter background music (BGM).
|
||||||
* @param {string} [nameFemale] The name of the female trainer. If 'Ivy', a localized name will be assigned.
|
* @param [nameFemale] - The name of the female trainer. If 'Ivy', a localized name will be assigned.
|
||||||
* @param {TrainerType | string} [femaleEncounterBgm] The encounter BGM for the female trainer, which can be a TrainerType or a string.
|
* @param [femaleEncounterBgm] - The encounter BGM for the female trainer, which can be a TrainerType or a string.
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig {
|
setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig {
|
||||||
@ -318,8 +318,8 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the configuration for trainers with double battles, including the name of the double trainer and the encounter BGM.
|
* Sets the configuration for trainers with double battles, including the name of the double trainer and the encounter BGM.
|
||||||
* @param nameDouble The name of the double trainer (e.g., "Ace Duo" for Trainer Class Doubles or "red_blue_double" for NAMED trainer doubles).
|
* @param nameDouble - The name of the double trainer (e.g., "Ace Duo" for Trainer Class Doubles or "red_blue_double" for NAMED trainer doubles).
|
||||||
* @param doubleEncounterBgm The encounter BGM for the double trainer, which can be a TrainerType or a string.
|
* @param doubleEncounterBgm - The encounter BGM for the double trainer, which can be a TrainerType or a string.
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
*/
|
*/
|
||||||
setHasDouble(nameDouble: string, doubleEncounterBgm?: TrainerType | string): TrainerConfig {
|
setHasDouble(nameDouble: string, doubleEncounterBgm?: TrainerType | string): TrainerConfig {
|
||||||
@ -336,7 +336,7 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the trainer type for double battles.
|
* Sets the trainer type for double battles.
|
||||||
* @param trainerTypeDouble The TrainerType of the partner in a double battle.
|
* @param trainerTypeDouble - The TrainerType of the partner in a double battle.
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
*/
|
*/
|
||||||
setDoubleTrainerType(trainerTypeDouble: TrainerType): TrainerConfig {
|
setDoubleTrainerType(trainerTypeDouble: TrainerType): TrainerConfig {
|
||||||
@ -361,7 +361,7 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the title for double trainers
|
* Sets the title for double trainers
|
||||||
* @param titleDouble The key for the title in the i18n file. (e.g., "champion_double").
|
* @param titleDouble - The key for the title in the i18n file. (e.g., "champion_double").
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
*/
|
*/
|
||||||
setDoubleTitle(titleDouble: string): TrainerConfig {
|
setDoubleTitle(titleDouble: string): TrainerConfig {
|
||||||
@ -470,8 +470,8 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets random pokemon from the trainer's team to instant tera. Also sets Tera type to specialty type and checks for Shedinja as appropriate.
|
* Sets random pokemon from the trainer's team to instant tera. Also sets Tera type to specialty type and checks for Shedinja as appropriate.
|
||||||
* @param count A callback (yucky) to see how many teras should be used
|
* @param count - A callback (yucky) to see how many teras should be used
|
||||||
* @param slot Optional, a specified slot that should be terastallized. Wraps to match party size (-1 will get the last slot and so on).
|
* @param slot - Optional, a specified slot that should be terastallized. Wraps to match party size (-1 will get the last slot and so on).
|
||||||
* @returns this
|
* @returns this
|
||||||
*/
|
*/
|
||||||
setRandomTeraModifiers(count: () => number, slot?: number): TrainerConfig {
|
setRandomTeraModifiers(count: () => number, slot?: number): TrainerConfig {
|
||||||
@ -497,7 +497,7 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a specific pokemon to instantly Tera
|
* Sets a specific pokemon to instantly Tera
|
||||||
* @param index The index within the team to have instant Tera.
|
* @param index - The index within the team to have instant Tera.
|
||||||
* @returns this
|
* @returns this
|
||||||
*/
|
*/
|
||||||
setInstantTera(index: number): TrainerConfig {
|
setInstantTera(index: number): TrainerConfig {
|
||||||
@ -528,10 +528,10 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for an evil team admin.
|
* Initializes the trainer configuration for an evil team admin.
|
||||||
* @param title The title of the evil team admin.
|
* @param title - The title of the evil team admin.
|
||||||
* @param poolName The evil team the admin belongs to.
|
* @param poolName - The evil team the admin belongs to.
|
||||||
* @param {Species | Species[]} signatureSpecies The signature species for the evil team leader.
|
* @param signatureSpecies - The signature species for the evil team leader.
|
||||||
* @param specialtyType The specialty Type of the admin, if they have one
|
* @param specialtyType - The specialty Type of the admin, if they have one
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
* **/
|
* **/
|
||||||
initForEvilTeamAdmin(
|
initForEvilTeamAdmin(
|
||||||
@ -575,7 +575,7 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for a Stat Trainer, as part of the Trainer's Test Mystery Encounter.
|
* Initializes the trainer configuration for a Stat Trainer, as part of the Trainer's Test Mystery Encounter.
|
||||||
* @param _isMale Whether the stat trainer is Male or Female (for localization of the title).
|
* @param _isMale - Whether the stat trainer is Male or Female (for localization of the title).
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
initForStatTrainer(_isMale = false): TrainerConfig {
|
initForStatTrainer(_isMale = false): TrainerConfig {
|
||||||
@ -600,9 +600,9 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for an evil team leader. Temporarily hardcoding evil leader teams though.
|
* Initializes the trainer configuration for an evil team leader. Temporarily hardcoding evil leader teams though.
|
||||||
* @param {Species | Species[]} signatureSpecies The signature species for the evil team leader.
|
* @param signatureSpecies - The signature species for the evil team leader.
|
||||||
* @param {PokemonType} specialtyType The specialty type for the evil team Leader.
|
* @param specialtyType - The specialty type for the evil team Leader.
|
||||||
* @param boolean Whether or not this is the rematch fight
|
* @param boolean - Whether or not this is the rematch fight
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
* **/
|
* **/
|
||||||
initForEvilTeamLeader(
|
initForEvilTeamLeader(
|
||||||
@ -644,11 +644,11 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for a Gym Leader.
|
* Initializes the trainer configuration for a Gym Leader.
|
||||||
* @param {Species | Species[]} signatureSpecies The signature species for the Gym Leader. Added to party in reverse order.
|
* @param signatureSpecies - The signature species for the Gym Leader. Added to party in reverse order.
|
||||||
* @param isMale Whether the Gym Leader is Male or Not (for localization of the title).
|
* @param isMale - Whether the Gym Leader is Male or Not (for localization of the title).
|
||||||
* @param {PokemonType} specialtyType The specialty type for the Gym Leader.
|
* @param specialtyType - The specialty type for the Gym Leader.
|
||||||
* @param ignoreMinTeraWave Whether the Gym Leader always uses Tera (true), or only Teras after {@linkcode GYM_LEADER_TERA_WAVE} (false). Defaults to false.
|
* @param ignoreMinTeraWave - Whether the Gym Leader always uses Tera (true), or only Teras after {@linkcode GYM_LEADER_TERA_WAVE} (false). Defaults to false.
|
||||||
* @param teraSlot Optional, sets the party member in this slot to Terastallize. Wraps based on party size.
|
* @param teraSlot - Optional, sets the party member in this slot to Terastallize. Wraps based on party size.
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
* **/
|
* **/
|
||||||
initForGymLeader(
|
initForGymLeader(
|
||||||
@ -707,11 +707,11 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for an Elite Four member.
|
* Initializes the trainer configuration for an Elite Four member.
|
||||||
* @param {Species | Species[]} signatureSpecies The signature species for the Elite Four member.
|
* @param signatureSpecies - The signature species for the Elite Four member
|
||||||
* @param isMale Whether the Elite Four Member is Male or Female (for localization of the title).
|
* @param isMale - Whether the Elite Four Member is Male or Female (for localization of the title)
|
||||||
* @param specialtyType {PokemonType} The specialty type for the Elite Four member.
|
* @param specialtyType - The specialty type for the Elite Four member
|
||||||
* @param teraSlot Optional, sets the party member in this slot to Terastallize.
|
* @param teraSlot - Optional, sets the party member in this slot to Terastallize
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
initForEliteFour(
|
initForEliteFour(
|
||||||
signatureSpecies: (Species | Species[])[],
|
signatureSpecies: (Species | Species[])[],
|
||||||
@ -769,8 +769,8 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for a Champion.
|
* Initializes the trainer configuration for a Champion.
|
||||||
* @param {Species | Species[]} signatureSpecies The signature species for the Champion.
|
* @param signatureSpecies - The signature species for the Champion.
|
||||||
* @param isMale Whether the Champion is Male or Female (for localization of the title).
|
* @param isMale - Whether the Champion is Male or Female (for localization of the title).
|
||||||
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
initForChampion(isMale: boolean): TrainerConfig {
|
initForChampion(isMale: boolean): TrainerConfig {
|
||||||
@ -819,8 +819,8 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the title for the trainer based on the provided trainer slot and variant.
|
* Retrieves the title for the trainer based on the provided trainer slot and variant.
|
||||||
* @param {TrainerSlot} trainerSlot - The slot to determine which title to use. Defaults to TrainerSlot.NONE.
|
* @param trainerSlot - The slot to determine which title to use. Defaults to TrainerSlot.NONE.
|
||||||
* @param {TrainerVariant} variant - The variant of the trainer to determine the specific title.
|
* @param variant - The variant of the trainer to determine the specific title.
|
||||||
* @returns {string} - The title of the trainer.
|
* @returns {string} - The title of the trainer.
|
||||||
**/
|
**/
|
||||||
getTitle(trainerSlot: TrainerSlot = TrainerSlot.NONE, variant: TrainerVariant): string {
|
getTitle(trainerSlot: TrainerSlot = TrainerSlot.NONE, variant: TrainerVariant): string {
|
||||||
|
@ -41,8 +41,8 @@ export type TempBattleStat = typeof TEMP_BATTLE_STATS[number];
|
|||||||
/**
|
/**
|
||||||
* Provides the translation key corresponding to the amount of stat stages and whether those stat stages
|
* Provides the translation key corresponding to the amount of stat stages and whether those stat stages
|
||||||
* are positive or negative.
|
* are positive or negative.
|
||||||
* @param stages the amount of stages
|
* @param stages - the amount of stages
|
||||||
* @param isIncrease dictates a negative (`false`) or a positive (`true`) stat stage change
|
* @param isIncrease - dictates a negative (`false`) or a positive (`true`) stat stage change
|
||||||
* @returns the translation key fitting the conditions described by {@linkcode stages} and {@linkcode isIncrease}
|
* @returns the translation key fitting the conditions described by {@linkcode stages} and {@linkcode isIncrease}
|
||||||
*/
|
*/
|
||||||
export function getStatStageChangeDescriptionKey(stages: number, isIncrease: boolean) {
|
export function getStatStageChangeDescriptionKey(stages: number, isIncrease: boolean) {
|
||||||
@ -60,7 +60,7 @@ export function getStatStageChangeDescriptionKey(stages: number, isIncrease: boo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the translation key corresponding to a given stat which can be translated into its full name.
|
* Provides the translation key corresponding to a given stat which can be translated into its full name.
|
||||||
* @param stat the {@linkcode Stat} to be translated
|
* @param stat - the {@linkcode Stat} to be translated
|
||||||
* @returns the translation key corresponding to the given {@linkcode Stat}
|
* @returns the translation key corresponding to the given {@linkcode Stat}
|
||||||
*/
|
*/
|
||||||
export function getStatKey(stat: Stat) {
|
export function getStatKey(stat: Stat) {
|
||||||
@ -69,7 +69,7 @@ export function getStatKey(stat: Stat) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the translation key corresponding to a given stat which can be translated into its shortened name.
|
* Provides the translation key corresponding to a given stat which can be translated into its shortened name.
|
||||||
* @param stat the {@linkcode Stat} to be translated
|
* @param stat - the {@linkcode Stat} to be translated
|
||||||
* @returns the translation key corresponding to the given {@linkcode Stat}
|
* @returns the translation key corresponding to the given {@linkcode Stat}
|
||||||
*/
|
*/
|
||||||
export function getShortenedStatKey(stat: PermanentStat) {
|
export function getShortenedStatKey(stat: PermanentStat) {
|
||||||
|
@ -18,7 +18,6 @@ export enum ArenaEventType {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Base container class for all {@linkcode ArenaEventType} events
|
* Base container class for all {@linkcode ArenaEventType} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class ArenaEvent extends Event {
|
export class ArenaEvent extends Event {
|
||||||
/** The total duration of the {@linkcode ArenaEventType} */
|
/** The total duration of the {@linkcode ArenaEventType} */
|
||||||
@ -31,7 +30,6 @@ export class ArenaEvent extends Event {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode ArenaEventType.WEATHER_CHANGED} events
|
* Container class for {@linkcode ArenaEventType.WEATHER_CHANGED} events
|
||||||
* @extends ArenaEvent
|
|
||||||
*/
|
*/
|
||||||
export class WeatherChangedEvent extends ArenaEvent {
|
export class WeatherChangedEvent extends ArenaEvent {
|
||||||
/** The {@linkcode WeatherType} being overridden */
|
/** The {@linkcode WeatherType} being overridden */
|
||||||
@ -47,7 +45,6 @@ export class WeatherChangedEvent extends ArenaEvent {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode ArenaEventType.TERRAIN_CHANGED} events
|
* Container class for {@linkcode ArenaEventType.TERRAIN_CHANGED} events
|
||||||
* @extends ArenaEvent
|
|
||||||
*/
|
*/
|
||||||
export class TerrainChangedEvent extends ArenaEvent {
|
export class TerrainChangedEvent extends ArenaEvent {
|
||||||
/** The {@linkcode TerrainType} being overridden */
|
/** The {@linkcode TerrainType} being overridden */
|
||||||
@ -64,7 +61,6 @@ export class TerrainChangedEvent extends ArenaEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode ArenaEventType.TAG_ADDED} events
|
* Container class for {@linkcode ArenaEventType.TAG_ADDED} events
|
||||||
* @extends ArenaEvent
|
|
||||||
*/
|
*/
|
||||||
export class TagAddedEvent extends ArenaEvent {
|
export class TagAddedEvent extends ArenaEvent {
|
||||||
/** The {@linkcode ArenaTagType} being added */
|
/** The {@linkcode ArenaTagType} being added */
|
||||||
@ -93,7 +89,6 @@ export class TagAddedEvent extends ArenaEvent {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode ArenaEventType.TAG_REMOVED} events
|
* Container class for {@linkcode ArenaEventType.TAG_REMOVED} events
|
||||||
* @extends ArenaEvent
|
|
||||||
*/
|
*/
|
||||||
export class TagRemovedEvent extends ArenaEvent {
|
export class TagRemovedEvent extends ArenaEvent {
|
||||||
/** The {@linkcode ArenaTagType} being removed */
|
/** The {@linkcode ArenaTagType} being removed */
|
||||||
|
@ -45,7 +45,6 @@ export enum BattleSceneEventType {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode BattleSceneEventType.CANDY_UPGRADE_NOTIFICATION_CHANGED} events
|
* Container class for {@linkcode BattleSceneEventType.CANDY_UPGRADE_NOTIFICATION_CHANGED} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class CandyUpgradeNotificationChangedEvent extends Event {
|
export class CandyUpgradeNotificationChangedEvent extends Event {
|
||||||
/** The new value the setting was changed to */
|
/** The new value the setting was changed to */
|
||||||
@ -59,7 +58,6 @@ export class CandyUpgradeNotificationChangedEvent extends Event {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode BattleSceneEventType.MOVE_USED} events
|
* Container class for {@linkcode BattleSceneEventType.MOVE_USED} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class MoveUsedEvent extends Event {
|
export class MoveUsedEvent extends Event {
|
||||||
/** The ID of the {@linkcode Pokemon} that used the {@linkcode Move} */
|
/** The ID of the {@linkcode Pokemon} that used the {@linkcode Move} */
|
||||||
@ -78,7 +76,6 @@ export class MoveUsedEvent extends Event {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode BattleSceneEventType.BERRY_USED} events
|
* Container class for {@linkcode BattleSceneEventType.BERRY_USED} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class BerryUsedEvent extends Event {
|
export class BerryUsedEvent extends Event {
|
||||||
/** The {@linkcode BerryModifier} being used */
|
/** The {@linkcode BerryModifier} being used */
|
||||||
@ -92,7 +89,6 @@ export class BerryUsedEvent extends Event {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode BattleSceneEventType.ENCOUNTER_PHASE} events
|
* Container class for {@linkcode BattleSceneEventType.ENCOUNTER_PHASE} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class EncounterPhaseEvent extends Event {
|
export class EncounterPhaseEvent extends Event {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -101,7 +97,6 @@ export class EncounterPhaseEvent extends Event {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode BattleSceneEventType.TURN_INIT} events
|
* Container class for {@linkcode BattleSceneEventType.TURN_INIT} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class TurnInitEvent extends Event {
|
export class TurnInitEvent extends Event {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -110,7 +105,6 @@ export class TurnInitEvent extends Event {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode BattleSceneEventType.TURN_END} events
|
* Container class for {@linkcode BattleSceneEventType.TURN_END} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class TurnEndEvent extends Event {
|
export class TurnEndEvent extends Event {
|
||||||
/** The amount of turns in the current battle */
|
/** The amount of turns in the current battle */
|
||||||
@ -123,7 +117,6 @@ export class TurnEndEvent extends Event {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode BattleSceneEventType.NEW_ARENA} events
|
* Container class for {@linkcode BattleSceneEventType.NEW_ARENA} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class NewArenaEvent extends Event {
|
export class NewArenaEvent extends Event {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -8,7 +8,6 @@ export enum EggEventType {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Container class for {@linkcode EggEventType.EGG_COUNT_CHANGED} events
|
* Container class for {@linkcode EggEventType.EGG_COUNT_CHANGED} events
|
||||||
* @extends Event
|
|
||||||
*/
|
*/
|
||||||
export class EggCountChangedEvent extends Event {
|
export class EggCountChangedEvent extends Event {
|
||||||
/** The updated egg count. */
|
/** The updated egg count. */
|
||||||
|
@ -202,8 +202,8 @@ export function cos(index: number, amplitude: number): number {
|
|||||||
/**
|
/**
|
||||||
* Play the shiny sparkle animation and sound effect for the given sprite
|
* Play the shiny sparkle animation and sound effect for the given sprite
|
||||||
* First ensures that the animation has been properly initialized
|
* First ensures that the animation has been properly initialized
|
||||||
* @param sparkleSprite the Sprite to play the animation on
|
* @param sparkleSprite - the Sprite to play the animation on
|
||||||
* @param variant which shiny {@linkcode variant} to play the animation for
|
* @param variant - which shiny {@linkcode variant} to play the animation for
|
||||||
*/
|
*/
|
||||||
export function doShinySparkleAnim(sparkleSprite: Phaser.GameObjects.Sprite, variant: Variant) {
|
export function doShinySparkleAnim(sparkleSprite: Phaser.GameObjects.Sprite, variant: Variant) {
|
||||||
const keySuffix = variant ? `_${variant + 1}` : "";
|
const keySuffix = variant ? `_${variant + 1}` : "";
|
||||||
|
@ -292,7 +292,7 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets weather to the override specified in overrides.ts
|
* Sets weather to the override specified in overrides.ts
|
||||||
* @param weather new {@linkcode WeatherType} to set
|
* @param weather - new {@linkcode WeatherType} to set
|
||||||
* @returns true to force trySetWeather to return true
|
* @returns true to force trySetWeather to return true
|
||||||
*/
|
*/
|
||||||
trySetWeatherOverride(weather: WeatherType): boolean {
|
trySetWeatherOverride(weather: WeatherType): boolean {
|
||||||
@ -309,8 +309,8 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to set a new weather to the battle
|
* Attempts to set a new weather to the battle
|
||||||
* @param weather {@linkcode WeatherType} new {@linkcode WeatherType} to set
|
* @param weather - new {@linkcode WeatherType} to set
|
||||||
* @param user {@linkcode Pokemon} that caused the weather effect
|
* @param user - that caused the weather effect
|
||||||
* @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use
|
* @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use
|
||||||
*/
|
*/
|
||||||
trySetWeather(weather: WeatherType, user?: Pokemon): boolean {
|
trySetWeather(weather: WeatherType, user?: Pokemon): boolean {
|
||||||
@ -404,9 +404,9 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to set a new terrain effect to the battle
|
* Attempts to set a new terrain effect to the battle
|
||||||
* @param terrain {@linkcode TerrainType} new {@linkcode TerrainType} to set
|
* @param terrain - new {@linkcode TerrainType} to set
|
||||||
* @param ignoreAnim boolean if the terrain animation should be ignored
|
* @param ignoreAnim - boolean if the terrain animation should be ignored
|
||||||
* @param user {@linkcode Pokemon} that caused the terrain effect
|
* @param user - that caused the terrain effect
|
||||||
* @returns true if new terrain set, false if no terrain provided or attempting to set the same terrain as currently in use
|
* @returns true if new terrain set, false if no terrain provided or attempting to set the same terrain as currently in use
|
||||||
*/
|
*/
|
||||||
trySetTerrain(terrain: TerrainType, ignoreAnim = false, user?: Pokemon): boolean {
|
trySetTerrain(terrain: TerrainType, ignoreAnim = false, user?: Pokemon): boolean {
|
||||||
@ -638,10 +638,10 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies each `ArenaTag` in this Arena, based on which side (self, enemy, or both) is passed in as a parameter
|
* Applies each `ArenaTag` in this Arena, based on which side (self, enemy, or both) is passed in as a parameter
|
||||||
* @param tagType Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply
|
* @param tagType - Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply
|
||||||
* @param side {@linkcode ArenaTagSide} which side's arena tags to apply
|
* @param side - which side's arena tags to apply
|
||||||
* @param simulated if `true`, this applies arena tags without changing game state
|
* @param simulated - if `true`, this applies arena tags without changing game state
|
||||||
* @param args array of parameters that the called upon tags may need
|
* @param args - array of parameters that the called upon tags may need
|
||||||
*/
|
*/
|
||||||
applyTagsForSide(
|
applyTagsForSide(
|
||||||
tagType: ArenaTagType | Constructor<ArenaTag>,
|
tagType: ArenaTagType | Constructor<ArenaTag>,
|
||||||
@ -662,9 +662,9 @@ export class Arena {
|
|||||||
/**
|
/**
|
||||||
* Applies the specified tag to both sides (ie: both user and trainer's tag that match the Tag specified)
|
* Applies the specified tag to both sides (ie: both user and trainer's tag that match the Tag specified)
|
||||||
* by calling {@linkcode applyTagsForSide()}
|
* by calling {@linkcode applyTagsForSide()}
|
||||||
* @param tagType Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply
|
* @param tagType - Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply
|
||||||
* @param simulated if `true`, this applies arena tags without changing game state
|
* @param simulated - if `true`, this applies arena tags without changing game state
|
||||||
* @param args array of parameters that the called upon tags may need
|
* @param args - array of parameters that the called upon tags may need
|
||||||
*/
|
*/
|
||||||
applyTags(tagType: ArenaTagType | Constructor<ArenaTag>, simulated: boolean, ...args: unknown[]): void {
|
applyTags(tagType: ArenaTagType | Constructor<ArenaTag>, simulated: boolean, ...args: unknown[]): void {
|
||||||
this.applyTagsForSide(tagType, ArenaTagSide.BOTH, simulated, ...args);
|
this.applyTagsForSide(tagType, ArenaTagSide.BOTH, simulated, ...args);
|
||||||
@ -672,13 +672,13 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new tag to the arena
|
* Adds a new tag to the arena
|
||||||
* @param tagType {@linkcode ArenaTagType} the tag being added
|
* @param tagType - the tag being added
|
||||||
* @param turnCount How many turns the tag lasts
|
* @param turnCount - How many turns the tag lasts
|
||||||
* @param sourceMove {@linkcode Moves} the move the tag came from, or `undefined` if not from a move
|
* @param sourceMove - the move the tag came from, or `undefined` if not from a move
|
||||||
* @param sourceId The ID of the pokemon in play the tag came from (see {@linkcode BattleScene.getPokemonById})
|
* @param sourceId - The ID of the pokemon in play the tag came from (see {@linkcode BattleScene.getPokemonById})
|
||||||
* @param side {@linkcode ArenaTagSide} which side(s) the tag applies to
|
* @param side - which side(s) the tag applies to
|
||||||
* @param quiet If a message should be queued on screen to announce the tag being added
|
* @param quiet - If a message should be queued on screen to announce the tag being added
|
||||||
* @param targetIndex The {@linkcode BattlerIndex} of the target pokemon
|
* @param targetIndex - The {@linkcode BattlerIndex} of the target pokemon
|
||||||
* @returns `false` if there already exists a tag of this type in the Arena
|
* @returns `false` if there already exists a tag of this type in the Arena
|
||||||
*/
|
*/
|
||||||
addTag(
|
addTag(
|
||||||
@ -720,7 +720,7 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to get a tag from the Arena via {@linkcode getTagOnSide} that applies to both sides
|
* Attempts to get a tag from the Arena via {@linkcode getTagOnSide} that applies to both sides
|
||||||
* @param tagType The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get
|
* @param tagType - The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get
|
||||||
* @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there
|
* @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there
|
||||||
*/
|
*/
|
||||||
getTag(tagType: ArenaTagType | Constructor<ArenaTag>): ArenaTag | undefined {
|
getTag(tagType: ArenaTagType | Constructor<ArenaTag>): ArenaTag | undefined {
|
||||||
@ -735,8 +735,8 @@ export class Arena {
|
|||||||
* Attempts to get a tag from the Arena from a specific side (the tag passed in has to either apply to both sides, or the specific side only)
|
* Attempts to get a tag from the Arena from a specific side (the tag passed in has to either apply to both sides, or the specific side only)
|
||||||
*
|
*
|
||||||
* eg: `MIST` only applies to the user's side, while `MUD_SPORT` applies to both user and enemy side
|
* eg: `MIST` only applies to the user's side, while `MUD_SPORT` applies to both user and enemy side
|
||||||
* @param tagType The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get
|
* @param tagType - The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get
|
||||||
* @param side The {@linkcode ArenaTagSide} to look at
|
* @param side - The {@linkcode ArenaTagSide} to look at
|
||||||
* @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there
|
* @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there
|
||||||
*/
|
*/
|
||||||
getTagOnSide(tagType: ArenaTagType | Constructor<ArenaTag>, side: ArenaTagSide): ArenaTag | undefined {
|
getTagOnSide(tagType: ArenaTagType | Constructor<ArenaTag>, side: ArenaTagSide): ArenaTag | undefined {
|
||||||
@ -751,7 +751,7 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses {@linkcode findTagsOnSide} to filter (using the parameter function) for specific tags that apply to both sides
|
* Uses {@linkcode findTagsOnSide} to filter (using the parameter function) for specific tags that apply to both sides
|
||||||
* @param tagPredicate a function mapping {@linkcode ArenaTag}s to `boolean`s
|
* @param tagPredicate - a function mapping {@linkcode ArenaTag}s to `boolean`s
|
||||||
* @returns array of {@linkcode ArenaTag}s from which the Arena's tags return true and apply to both sides
|
* @returns array of {@linkcode ArenaTag}s from which the Arena's tags return true and apply to both sides
|
||||||
*/
|
*/
|
||||||
findTags(tagPredicate: (t: ArenaTag) => boolean): ArenaTag[] {
|
findTags(tagPredicate: (t: ArenaTag) => boolean): ArenaTag[] {
|
||||||
@ -760,8 +760,8 @@ export class Arena {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns specific tags from the arena that pass the `tagPredicate` function passed in as a parameter, and apply to the given side
|
* Returns specific tags from the arena that pass the `tagPredicate` function passed in as a parameter, and apply to the given side
|
||||||
* @param tagPredicate a function mapping {@linkcode ArenaTag}s to `boolean`s
|
* @param tagPredicate - a function mapping {@linkcode ArenaTag}s to `boolean`s
|
||||||
* @param side The {@linkcode ArenaTagSide} to look at
|
* @param side - The {@linkcode ArenaTagSide} to look at
|
||||||
* @returns array of {@linkcode ArenaTag}s from which the Arena's tags return `true` and apply to the given side
|
* @returns array of {@linkcode ArenaTag}s from which the Arena's tags return `true` and apply to the given side
|
||||||
*/
|
*/
|
||||||
findTagsOnSide(tagPredicate: (t: ArenaTag) => boolean, side: ArenaTagSide): ArenaTag[] {
|
findTagsOnSide(tagPredicate: (t: ArenaTag) => boolean, side: ArenaTagSide): ArenaTag[] {
|
||||||
|
@ -327,9 +327,9 @@ export default class MysteryEncounterIntroVisuals extends Phaser.GameObjects.Con
|
|||||||
/**
|
/**
|
||||||
* Attempts to animate a given set of {@linkcode Phaser.GameObjects.Sprite}
|
* Attempts to animate a given set of {@linkcode Phaser.GameObjects.Sprite}
|
||||||
* @see {@linkcode Phaser.GameObjects.Sprite.play}
|
* @see {@linkcode Phaser.GameObjects.Sprite.play}
|
||||||
* @param sprite {@linkcode Phaser.GameObjects.Sprite} to animate
|
* @param sprite - to animate
|
||||||
* @param tintSprite {@linkcode Phaser.GameObjects.Sprite} placed on top of the sprite to add a color tint
|
* @param tintSprite - placed on top of the sprite to add a color tint
|
||||||
* @param animConfig {@linkcode Phaser.Types.Animations.PlayAnimationConfig} to pass to {@linkcode Phaser.GameObjects.Sprite.play}
|
* @param animConfig - to pass to {@linkcode Phaser.GameObjects.Sprite.play}
|
||||||
* @returns true if the sprite was able to be animated
|
* @returns true if the sprite was able to be animated
|
||||||
*/
|
*/
|
||||||
tryPlaySprite(
|
tryPlaySprite(
|
||||||
|
@ -539,7 +539,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the fake name or the real name of the Pokemon (for Illusion ability).
|
* @param useIllusion - Whether we want the fake name or the real name of the Pokemon (for Illusion ability).
|
||||||
*/
|
*/
|
||||||
getNameToRender(useIllusion: boolean = true) {
|
getNameToRender(useIllusion: boolean = true) {
|
||||||
const name: string = (!useIllusion && !!this.summonData?.illusion) ? this.summonData?.illusion.basePokemon!.name : this.name;
|
const name: string = (!useIllusion && !!this.summonData?.illusion) ? this.summonData?.illusion.basePokemon!.name : this.name;
|
||||||
@ -618,7 +618,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Checks if a pokemon is fainted (ie: its `hp <= 0`).
|
* Checks if a pokemon is fainted (ie: its `hp <= 0`).
|
||||||
* It's usually better to call {@linkcode isAllowedInBattle()}
|
* It's usually better to call {@linkcode isAllowedInBattle()}
|
||||||
* @param checkStatus `true` to also check that the pokemon's status is {@linkcode StatusEffect.FAINT}
|
* @param checkStatus - `true` to also check that the pokemon's status is {@linkcode StatusEffect.FAINT}
|
||||||
* @returns `true` if the pokemon is fainted
|
* @returns `true` if the pokemon is fainted
|
||||||
*/
|
*/
|
||||||
public isFainted(checkStatus = false): boolean {
|
public isFainted(checkStatus = false): boolean {
|
||||||
@ -653,7 +653,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the pokemon is allowed in battle (ie: not fainted, and allowed under any active challenges).
|
* Checks if the pokemon is allowed in battle (ie: not fainted, and allowed under any active challenges).
|
||||||
* @param onField `true` to also check if the pokemon is currently on the field, defaults to `false`
|
* @param onField - `true` to also check if the pokemon is currently on the field, defaults to `false`
|
||||||
* @returns `true` if the pokemon is "active". Returns `false` if there is no active {@linkcode BattleScene}
|
* @returns `true` if the pokemon is "active". Returns `false` if there is no active {@linkcode BattleScene}
|
||||||
*/
|
*/
|
||||||
public isActive(onField = false): boolean {
|
public isActive(onField = false): boolean {
|
||||||
@ -886,11 +886,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Gracefully handle errors loading a variant sprite. Log if it fails and attempt to fall back on
|
* Gracefully handle errors loading a variant sprite. Log if it fails and attempt to fall back on
|
||||||
* non-experimental sprites before giving up.
|
* non-experimental sprites before giving up.
|
||||||
*
|
*
|
||||||
* @param cacheKey the cache key for the variant color sprite
|
* @param cacheKey - the cache key for the variant color sprite
|
||||||
* @param attemptedSpritePath the sprite path that failed to load
|
* @param attemptedSpritePath - the sprite path that failed to load
|
||||||
* @param useExpSprite was the attempted sprite experimental
|
* @param useExpSprite - was the attempted sprite experimental
|
||||||
* @param battleSpritePath the filename of the sprite
|
* @param battleSpritePath - the filename of the sprite
|
||||||
* @param optionalParams any additional params to log
|
* @param optionalParams - any additional params to log
|
||||||
*/
|
*/
|
||||||
async fallbackVariantColor(
|
async fallbackVariantColor(
|
||||||
cacheKey: string,
|
cacheKey: string,
|
||||||
@ -908,9 +908,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Attempt to process variant sprite.
|
* Attempt to process variant sprite.
|
||||||
*
|
*
|
||||||
* @param cacheKey the cache key for the variant color sprite
|
* @param cacheKey - the cache key for the variant color sprite
|
||||||
* @param useExpSprite should the experimental sprite be used
|
* @param useExpSprite - should the experimental sprite be used
|
||||||
* @param battleSpritePath the filename of the sprite
|
* @param battleSpritePath - the filename of the sprite
|
||||||
*/
|
*/
|
||||||
async populateVariantColorCache(
|
async populateVariantColorCache(
|
||||||
cacheKey: string,
|
cacheKey: string,
|
||||||
@ -1103,7 +1103,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the speciesForm of the illusion or not.
|
* @param useIllusion - Whether we want the speciesForm of the illusion or not.
|
||||||
*/
|
*/
|
||||||
getSpeciesForm(ignoreOverride?: boolean, useIllusion: boolean = false): PokemonSpeciesForm {
|
getSpeciesForm(ignoreOverride?: boolean, useIllusion: boolean = false): PokemonSpeciesForm {
|
||||||
const species: PokemonSpecies = useIllusion && !!this.summonData?.illusion ? getPokemonSpecies(this.summonData?.illusion.species) : this.species;
|
const species: PokemonSpecies = useIllusion && !!this.summonData?.illusion ? getPokemonSpecies(this.summonData?.illusion.species) : this.species;
|
||||||
@ -1120,7 +1120,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the fusionSpeciesForm of the illusion or not.
|
* @param useIllusion - Whether we want the fusionSpeciesForm of the illusion or not.
|
||||||
*/
|
*/
|
||||||
getFusionSpeciesForm(ignoreOverride?: boolean, useIllusion: boolean = false): PokemonSpeciesForm {
|
getFusionSpeciesForm(ignoreOverride?: boolean, useIllusion: boolean = false): PokemonSpeciesForm {
|
||||||
const fusionSpecies: PokemonSpecies = useIllusion && !!this.summonData?.illusion ? this.summonData?.illusion.fusionSpecies! : this.fusionSpecies!;
|
const fusionSpecies: PokemonSpecies = useIllusion && !!this.summonData?.illusion ? this.summonData?.illusion.fusionSpecies! : this.fusionSpecies!;
|
||||||
@ -1218,9 +1218,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Attempts to animate a given {@linkcode Phaser.GameObjects.Sprite}
|
* Attempts to animate a given {@linkcode Phaser.GameObjects.Sprite}
|
||||||
* @see {@linkcode Phaser.GameObjects.Sprite.play}
|
* @see {@linkcode Phaser.GameObjects.Sprite.play}
|
||||||
* @param sprite {@linkcode Phaser.GameObjects.Sprite} to animate
|
* @param sprite - to animate
|
||||||
* @param tintSprite {@linkcode Phaser.GameObjects.Sprite} placed on top of the sprite to add a color tint
|
* @param tintSprite - placed on top of the sprite to add a color tint
|
||||||
* @param animConfig {@linkcode String} to pass to {@linkcode Phaser.GameObjects.Sprite.play}
|
* @param animConfig - to pass to {@linkcode Phaser.GameObjects.Sprite.play}
|
||||||
* @returns true if the sprite was able to be animated
|
* @returns true if the sprite was able to be animated
|
||||||
*/
|
*/
|
||||||
tryPlaySprite(
|
tryPlaySprite(
|
||||||
@ -1358,7 +1358,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the entire set of stats of the {@linkcode Pokemon}.
|
* Retrieves the entire set of stats of the {@linkcode Pokemon}.
|
||||||
* @param bypassSummonData prefer actual stats (`true` by default) or in-battle overriden stats (`false`)
|
* @param bypassSummonData - prefer actual stats (`true` by default) or in-battle overriden stats (`false`)
|
||||||
* @returns the numeric values of the {@linkcode Pokemon}'s stats
|
* @returns the numeric values of the {@linkcode Pokemon}'s stats
|
||||||
*/
|
*/
|
||||||
getStats(bypassSummonData = true): number[] {
|
getStats(bypassSummonData = true): number[] {
|
||||||
@ -1370,8 +1370,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the corresponding {@linkcode PermanentStat} of the {@linkcode Pokemon}.
|
* Retrieves the corresponding {@linkcode PermanentStat} of the {@linkcode Pokemon}.
|
||||||
* @param stat the desired {@linkcode PermanentStat}
|
* @param stat - the desired {@linkcode PermanentStat}
|
||||||
* @param bypassSummonData prefer actual stats (`true` by default) or in-battle overridden stats (`false`)
|
* @param bypassSummonData - prefer actual stats (`true` by default) or in-battle overridden stats (`false`)
|
||||||
* @returns the numeric value of the desired {@linkcode Stat}
|
* @returns the numeric value of the desired {@linkcode Stat}
|
||||||
*/
|
*/
|
||||||
getStat(stat: PermanentStat, bypassSummonData = true): number {
|
getStat(stat: PermanentStat, bypassSummonData = true): number {
|
||||||
@ -1389,9 +1389,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Writes the value to the corrseponding {@linkcode PermanentStat} of the {@linkcode Pokemon}.
|
* Writes the value to the corrseponding {@linkcode PermanentStat} of the {@linkcode Pokemon}.
|
||||||
*
|
*
|
||||||
* Note that this does nothing if {@linkcode value} is less than 0.
|
* Note that this does nothing if {@linkcode value} is less than 0.
|
||||||
* @param stat the desired {@linkcode PermanentStat} to be overwritten
|
* @param stat - the desired {@linkcode PermanentStat} to be overwritten
|
||||||
* @param value the desired numeric value
|
* @param value - the desired numeric value
|
||||||
* @param bypassSummonData write to actual stats (`true` by default) or in-battle overridden stats (`false`)
|
* @param bypassSummonData - write to actual stats (`true` by default) or in-battle overridden stats (`false`)
|
||||||
*/
|
*/
|
||||||
setStat(stat: PermanentStat, value: number, bypassSummonData = true): void {
|
setStat(stat: PermanentStat, value: number, bypassSummonData = true): void {
|
||||||
if (value >= 0) {
|
if (value >= 0) {
|
||||||
@ -1413,7 +1413,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the in-battle stage of the specified {@linkcode BattleStat}.
|
* Retrieves the in-battle stage of the specified {@linkcode BattleStat}.
|
||||||
* @param stat the {@linkcode BattleStat} whose stage is desired
|
* @param stat - the {@linkcode BattleStat} whose stage is desired
|
||||||
* @returns the stage of the desired {@linkcode BattleStat} if available, 0 otherwise
|
* @returns the stage of the desired {@linkcode BattleStat} if available, 0 otherwise
|
||||||
*/
|
*/
|
||||||
getStatStage(stat: BattleStat): number {
|
getStatStage(stat: BattleStat): number {
|
||||||
@ -1424,8 +1424,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Writes the value to the in-battle stage of the corresponding {@linkcode BattleStat} of the {@linkcode Pokemon}.
|
* Writes the value to the in-battle stage of the corresponding {@linkcode BattleStat} of the {@linkcode Pokemon}.
|
||||||
*
|
*
|
||||||
* Note that, if the value is not within a range of [-6, 6], it will be forced to the closest range bound.
|
* Note that, if the value is not within a range of [-6, 6], it will be forced to the closest range bound.
|
||||||
* @param stat the {@linkcode BattleStat} whose stage is to be overwritten
|
* @param stat - the {@linkcode BattleStat} whose stage is to be overwritten
|
||||||
* @param value the desired numeric value
|
* @param value - the desired numeric value
|
||||||
*/
|
*/
|
||||||
setStatStage(stat: BattleStat, value: number): void {
|
setStatStage(stat: BattleStat, value: number): void {
|
||||||
if (this.summonData) {
|
if (this.summonData) {
|
||||||
@ -1441,8 +1441,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Calculate the critical-hit stage of a move used against this pokemon by
|
* Calculate the critical-hit stage of a move used against this pokemon by
|
||||||
* the given source
|
* the given source
|
||||||
*
|
*
|
||||||
* @param source the {@linkcode Pokemon} who using the move
|
* @param source - the {@linkcode Pokemon} who using the move
|
||||||
* @param move the {@linkcode Move} being used
|
* @param move - the {@linkcode Move} being used
|
||||||
* @returns the final critical-hit stage value
|
* @returns the final critical-hit stage value
|
||||||
*/
|
*/
|
||||||
getCritStage(source: Pokemon, move: Move): number {
|
getCritStage(source: Pokemon, move: Move): number {
|
||||||
@ -1479,15 +1479,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Calculates and retrieves the final value of a stat considering any held
|
* Calculates and retrieves the final value of a stat considering any held
|
||||||
* items, move effects, opponent abilities, and whether there was a critical
|
* items, move effects, opponent abilities, and whether there was a critical
|
||||||
* hit.
|
* hit.
|
||||||
* @param stat the desired {@linkcode EffectiveStat}
|
* @param stat - the desired {@linkcode EffectiveStat}
|
||||||
* @param opponent the target {@linkcode Pokemon}
|
* @param opponent - the target {@linkcode Pokemon}
|
||||||
* @param move the {@linkcode Move} being used
|
* @param move - the {@linkcode Move} being used
|
||||||
* @param ignoreAbility determines whether this Pokemon's abilities should be ignored during the stat calculation
|
* @param ignoreAbility - determines whether this Pokemon's abilities should be ignored during the stat calculation
|
||||||
* @param ignoreOppAbility during an attack, determines whether the opposing Pokemon's abilities should be ignored during the stat calculation.
|
* @param ignoreOppAbility - during an attack, determines whether the opposing Pokemon's abilities should be ignored during the stat calculation.
|
||||||
* @param ignoreAllyAbility during an attack, determines whether the ally Pokemon's abilities should be ignored during the stat calculation.
|
* @param ignoreAllyAbility - during an attack, determines whether the ally Pokemon's abilities should be ignored during the stat calculation.
|
||||||
* @param isCritical determines whether a critical hit has occurred or not (`false` by default)
|
* @param isCritical - determines whether a critical hit has occurred or not (`false` by default)
|
||||||
* @param simulated if `true`, nullifies any effects that produce any changes to game state from triggering
|
* @param simulated - if `true`, nullifies any effects that produce any changes to game state from triggering
|
||||||
* @param ignoreHeldItems determines whether this Pokemon's held items should be ignored during the stat calculation, default `false`
|
* @param ignoreHeldItems - determines whether this Pokemon's held items should be ignored during the stat calculation, default `false`
|
||||||
* @returns the final in-battle value of a stat
|
* @returns the final in-battle value of a stat
|
||||||
*/
|
*/
|
||||||
getEffectiveStat(
|
getEffectiveStat(
|
||||||
@ -1792,7 +1792,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the fake or real gender (illusion ability).
|
* @param useIllusion - Whether we want the fake or real gender (illusion ability).
|
||||||
*/
|
*/
|
||||||
getGender(ignoreOverride?: boolean, useIllusion: boolean = false): Gender {
|
getGender(ignoreOverride?: boolean, useIllusion: boolean = false): Gender {
|
||||||
if (useIllusion && !!this.summonData?.illusion) {
|
if (useIllusion && !!this.summonData?.illusion) {
|
||||||
@ -1804,7 +1804,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the fake or real gender (illusion ability).
|
* @param useIllusion - Whether we want the fake or real gender (illusion ability).
|
||||||
*/
|
*/
|
||||||
getFusionGender(ignoreOverride?: boolean, useIllusion: boolean = false): Gender {
|
getFusionGender(ignoreOverride?: boolean, useIllusion: boolean = false): Gender {
|
||||||
if (useIllusion && !!this.summonData?.illusion) {
|
if (useIllusion && !!this.summonData?.illusion) {
|
||||||
@ -1816,7 +1816,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the fake or real shininess (illusion ability).
|
* @param useIllusion - Whether we want the fake or real shininess (illusion ability).
|
||||||
*/
|
*/
|
||||||
isShiny(useIllusion: boolean = false): boolean {
|
isShiny(useIllusion: boolean = false): boolean {
|
||||||
if (!useIllusion && !!this.summonData?.illusion) {
|
if (!useIllusion && !!this.summonData?.illusion) {
|
||||||
@ -1840,7 +1840,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the fake or real variant (illusion ability).
|
* @param useIllusion - Whether we want the fake or real variant (illusion ability).
|
||||||
*/
|
*/
|
||||||
getVariant(useIllusion: boolean = false): Variant {
|
getVariant(useIllusion: boolean = false): Variant {
|
||||||
if (!useIllusion && !!this.summonData?.illusion) {
|
if (!useIllusion && !!this.summonData?.illusion) {
|
||||||
@ -1877,7 +1877,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} useIllusion - Whether we want the fake name or the real name of the Pokemon (for Illusion ability).
|
* @param useIllusion - Whether we want the fake name or the real name of the Pokemon (for Illusion ability).
|
||||||
*/
|
*/
|
||||||
getName(useIllusion: boolean = false): string {
|
getName(useIllusion: boolean = false): string {
|
||||||
return (!useIllusion && !!this.summonData?.illusion && this.summonData?.illusion.basePokemon)
|
return (!useIllusion && !!this.summonData?.illusion && this.summonData?.illusion.basePokemon)
|
||||||
@ -1887,7 +1887,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the {@linkcode Pokemon} has a fusion with the specified {@linkcode Species}.
|
* Checks if the {@linkcode Pokemon} has a fusion with the specified {@linkcode Species}.
|
||||||
* @param species the pokemon {@linkcode Species} to check
|
* @param species - the pokemon {@linkcode Species} to check
|
||||||
* @returns `true` if the {@linkcode Pokemon} has a fusion with the specified {@linkcode Species}, `false` otherwise
|
* @returns `true` if the {@linkcode Pokemon} has a fusion with the specified {@linkcode Species}, `false` otherwise
|
||||||
*/
|
*/
|
||||||
hasFusionSpecies(species: Species): boolean {
|
hasFusionSpecies(species: Species): boolean {
|
||||||
@ -1896,8 +1896,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the {@linkcode Pokemon} has is the specified {@linkcode Species} or is fused with it.
|
* Checks if the {@linkcode Pokemon} has is the specified {@linkcode Species} or is fused with it.
|
||||||
* @param species the pokemon {@linkcode Species} to check
|
* @param species - the pokemon {@linkcode Species} to check
|
||||||
* @param formKey If provided, requires the species to be in that form
|
* @param formKey - If provided, requires the species to be in that form
|
||||||
* @returns `true` if the pokemon is the species or is fused with it, `false` otherwise
|
* @returns `true` if the pokemon is the species or is fused with it, `false` otherwise
|
||||||
*/
|
*/
|
||||||
hasSpecies(species: Species, formKey?: string): boolean {
|
hasSpecies(species: Species, formKey?: string): boolean {
|
||||||
@ -2246,7 +2246,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Sets the {@linkcode Pokemon}'s ability and activates it if it normally activates on summon
|
* Sets the {@linkcode Pokemon}'s ability and activates it if it normally activates on summon
|
||||||
*
|
*
|
||||||
* Also clears primal weather if it is from the ability being changed
|
* Also clears primal weather if it is from the ability being changed
|
||||||
* @param ability New Ability
|
* @param ability - New Ability
|
||||||
*/
|
*/
|
||||||
public setTempAbility(ability: Ability, passive = false): void {
|
public setTempAbility(ability: Ability, passive = false): void {
|
||||||
applyOnLoseAbAttrs(this, passive);
|
applyOnLoseAbAttrs(this, passive);
|
||||||
@ -2311,7 +2311,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Checks whether an ability of a pokemon can be currently applied. This should rarely be
|
* Checks whether an ability of a pokemon can be currently applied. This should rarely be
|
||||||
* directly called, as {@linkcode hasAbility} and {@linkcode hasAbilityWithAttr} already call this.
|
* directly called, as {@linkcode hasAbility} and {@linkcode hasAbilityWithAttr} already call this.
|
||||||
* @see {@linkcode hasAbility} {@linkcode hasAbilityWithAttr} Intended ways to check abilities in most cases
|
* @see {@linkcode hasAbility} {@linkcode hasAbilityWithAttr} Intended ways to check abilities in most cases
|
||||||
* @param passive If true, check if passive can be applied instead of non-passive
|
* @param passive - If true, check if passive can be applied instead of non-passive
|
||||||
* @returns `true` if the ability can be applied
|
* @returns `true` if the ability can be applied
|
||||||
*/
|
*/
|
||||||
public canApplyAbility(passive = false): boolean {
|
public canApplyAbility(passive = false): boolean {
|
||||||
@ -2372,9 +2372,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Checks whether a pokemon has the specified ability and it's in effect. Accounts for all the various
|
* Checks whether a pokemon has the specified ability and it's in effect. Accounts for all the various
|
||||||
* effects which can affect whether an ability will be present or in effect, and both passive and
|
* effects which can affect whether an ability will be present or in effect, and both passive and
|
||||||
* non-passive. This is the primary way to check whether a pokemon has a particular ability.
|
* non-passive. This is the primary way to check whether a pokemon has a particular ability.
|
||||||
* @param {Abilities} ability The ability to check for
|
* @param ability - The ability to check for
|
||||||
* @param {boolean} canApply If false, it doesn't check whether the ability is currently active
|
* @param canApply - If false, it doesn't check whether the ability is currently active
|
||||||
* @param {boolean} ignoreOverride If true, it ignores ability changing effects
|
* @param ignoreOverride - If true, it ignores ability changing effects
|
||||||
* @returns {boolean} Whether the ability is present and active
|
* @returns {boolean} Whether the ability is present and active
|
||||||
*/
|
*/
|
||||||
public hasAbility(
|
public hasAbility(
|
||||||
@ -2403,9 +2403,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Accounts for all the various effects which can affect whether an ability will be present or
|
* Accounts for all the various effects which can affect whether an ability will be present or
|
||||||
* in effect, and both passive and non-passive. This is one of the two primary ways to check
|
* in effect, and both passive and non-passive. This is one of the two primary ways to check
|
||||||
* whether a pokemon has a particular ability.
|
* whether a pokemon has a particular ability.
|
||||||
* @param {AbAttr} attrType The ability attribute to check for
|
* @param attrType - The ability attribute to check for
|
||||||
* @param {boolean} canApply If false, it doesn't check whether the ability is currently active
|
* @param canApply - If false, it doesn't check whether the ability is currently active
|
||||||
* @param {boolean} ignoreOverride If true, it ignores ability changing effects
|
* @param ignoreOverride - If true, it ignores ability changing effects
|
||||||
* @returns {boolean} Whether an ability with that attribute is present and active
|
* @returns {boolean} Whether an ability with that attribute is present and active
|
||||||
*/
|
*/
|
||||||
public hasAbilityWithAttr(
|
public hasAbilityWithAttr(
|
||||||
@ -2578,11 +2578,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Calculates the effectiveness of a move against the Pokémon.
|
* Calculates the effectiveness of a move against the Pokémon.
|
||||||
* This includes modifiers from move and ability attributes.
|
* This includes modifiers from move and ability attributes.
|
||||||
* @param source {@linkcode Pokemon} The attacking Pokémon.
|
* @param source - The attacking Pokémon.
|
||||||
* @param move {@linkcode Move} The move being used by the attacking Pokémon.
|
* @param move - The move being used by the attacking Pokémon.
|
||||||
* @param ignoreAbility Whether to ignore abilities that might affect type effectiveness or immunity (defaults to `false`).
|
* @param ignoreAbility - Whether to ignore abilities that might affect type effectiveness or immunity (defaults to `false`).
|
||||||
* @param simulated Whether to apply abilities via simulated calls (defaults to `true`)
|
* @param simulated - Whether to apply abilities via simulated calls (defaults to `true`)
|
||||||
* @param cancelled {@linkcode BooleanHolder} Stores whether the move was cancelled by a non-type-based immunity.
|
* @param cancelled - Stores whether the move was cancelled by a non-type-based immunity.
|
||||||
* @param useIllusion - Whether we want the attack move effectiveness on the illusion or not
|
* @param useIllusion - Whether we want the attack move effectiveness on the illusion or not
|
||||||
* Currently only used by {@linkcode Pokemon.apply} to determine whether a "No effect" message should be shown.
|
* Currently only used by {@linkcode Pokemon.apply} to determine whether a "No effect" message should be shown.
|
||||||
* @returns The type damage multiplier, indicating the effectiveness of the move
|
* @returns The type damage multiplier, indicating the effectiveness of the move
|
||||||
@ -2714,11 +2714,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the move's type effectiveness multiplier based on the target's type/s.
|
* Calculates the move's type effectiveness multiplier based on the target's type/s.
|
||||||
* @param moveType {@linkcode PokemonType} the type of the move being used
|
* @param moveType - the type of the move being used
|
||||||
* @param source {@linkcode Pokemon} the Pokemon using the move
|
* @param source - the Pokemon using the move
|
||||||
* @param ignoreStrongWinds whether or not this ignores strong winds (anticipation, forewarn, stealth rocks)
|
* @param ignoreStrongWinds - whether or not this ignores strong winds (anticipation, forewarn, stealth rocks)
|
||||||
* @param simulated tag to only apply the strong winds effect message when the move is used
|
* @param simulated - tag to only apply the strong winds effect message when the move is used
|
||||||
* @param move (optional) the move whose type effectiveness is to be checked. Used for applying {@linkcode VariableMoveTypeChartAttr}
|
* @param move - (optional) the move whose type effectiveness is to be checked. Used for applying {@linkcode VariableMoveTypeChartAttr}
|
||||||
* @param useIllusion - Whether we want the attack type effectiveness on the illusion or not
|
* @param useIllusion - Whether we want the attack type effectiveness on the illusion or not
|
||||||
* @returns a multiplier for the type effectiveness
|
* @returns a multiplier for the type effectiveness
|
||||||
*/
|
*/
|
||||||
@ -2827,7 +2827,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Computes the given Pokemon's matchup score against this Pokemon.
|
* Computes the given Pokemon's matchup score against this Pokemon.
|
||||||
* In most cases, this score ranges from near-zero to 16, but the maximum possible matchup score is 64.
|
* In most cases, this score ranges from near-zero to 16, but the maximum possible matchup score is 64.
|
||||||
* @param opponent {@linkcode Pokemon} The Pokemon to compare this Pokemon against
|
* @param opponent - The Pokemon to compare this Pokemon against
|
||||||
* @returns A score value based on how favorable this Pokemon is when fighting the given Pokemon
|
* @returns A score value based on how favorable this Pokemon is when fighting the given Pokemon
|
||||||
*/
|
*/
|
||||||
getMatchupScore(opponent: Pokemon): number {
|
getMatchupScore(opponent: Pokemon): number {
|
||||||
@ -2920,10 +2920,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all level up moves in a given range for a particular pokemon.
|
* Gets all level up moves in a given range for a particular pokemon.
|
||||||
* @param {number} startingLevel Don't include moves below this level
|
* @param startingLevel - Don't include moves below this level
|
||||||
* @param {boolean} includeEvolutionMoves Whether to include evolution moves
|
* @param includeEvolutionMoves - Whether to include evolution moves
|
||||||
* @param {boolean} simulateEvolutionChain Whether to include moves from prior evolutions
|
* @param simulateEvolutionChain - Whether to include moves from prior evolutions
|
||||||
* @param {boolean} includeRelearnerMoves Whether to include moves that would require a relearner. Note the move relearner inherently allows evolution moves
|
* @param includeRelearnerMoves - Whether to include moves that would require a relearner. Note the move relearner inherently allows evolution moves
|
||||||
* @returns {LevelMoves} A list of moves and the levels they can be learned at
|
* @returns {LevelMoves} A list of moves and the levels they can be learned at
|
||||||
*/
|
*/
|
||||||
getLevelMoves(
|
getLevelMoves(
|
||||||
@ -3079,8 +3079,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* Finds all non-duplicate items from the input, and pushes them into the output.
|
* Finds all non-duplicate items from the input, and pushes them into the output.
|
||||||
* Two items count as duplicate if they have the same Move, regardless of level.
|
* Two items count as duplicate if they have the same Move, regardless of level.
|
||||||
*
|
*
|
||||||
* @param levelMoves the input array to search for non-duplicates from
|
* @param levelMoves - the input array to search for non-duplicates from
|
||||||
* @param ret the output array to be pushed into.
|
* @param ret - the output array to be pushed into.
|
||||||
*/
|
*/
|
||||||
private getUniqueMoves(levelMoves: LevelMoves, ret: LevelMoves): void {
|
private getUniqueMoves(levelMoves: LevelMoves, ret: LevelMoves): void {
|
||||||
const uniqueMoves: Moves[] = [];
|
const uniqueMoves: Moves[] = [];
|
||||||
@ -3120,7 +3120,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* F is calculated as the XOR of the first 16 bits of the Pokemon's ID with the last 16 bits.
|
* F is calculated as the XOR of the first 16 bits of the Pokemon's ID with the last 16 bits.
|
||||||
* The XOR of E and F are then compared to the {@linkcode shinyThreshold} (or {@linkcode thresholdOverride} if set) to see whether or not to generate a shiny.
|
* The XOR of E and F are then compared to the {@linkcode shinyThreshold} (or {@linkcode thresholdOverride} if set) to see whether or not to generate a shiny.
|
||||||
* The base shiny odds are {@linkcode BASE_SHINY_CHANCE} / 65536
|
* The base shiny odds are {@linkcode BASE_SHINY_CHANCE} / 65536
|
||||||
* @param thresholdOverride number that is divided by 2^16 (65536) to get the shiny chance, overrides {@linkcode shinyThreshold} if set (bypassing shiny rate modifiers such as Shiny Charm)
|
* @param thresholdOverride - number that is divided by 2^16 (65536) to get the shiny chance, overrides {@linkcode shinyThreshold} if set (bypassing shiny rate modifiers such as Shiny Charm)
|
||||||
* @returns true if the Pokemon has been set as a shiny, false otherwise
|
* @returns true if the Pokemon has been set as a shiny, false otherwise
|
||||||
*/
|
*/
|
||||||
trySetShiny(thresholdOverride?: number): boolean {
|
trySetShiny(thresholdOverride?: number): boolean {
|
||||||
@ -3173,8 +3173,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* If it rolls shiny, also sets a random variant and give the Pokemon the associated luck.
|
* If it rolls shiny, also sets a random variant and give the Pokemon the associated luck.
|
||||||
*
|
*
|
||||||
* The base shiny odds are {@linkcode BASE_SHINY_CHANCE} / `65536`
|
* The base shiny odds are {@linkcode BASE_SHINY_CHANCE} / `65536`
|
||||||
* @param thresholdOverride number that is divided by `2^16` (`65536`) to get the shiny chance, overrides {@linkcode shinyThreshold} if set (bypassing shiny rate modifiers such as Shiny Charm)
|
* @param thresholdOverride - number that is divided by `2^16` (`65536`) to get the shiny chance, overrides {@linkcode shinyThreshold} if set (bypassing shiny rate modifiers such as Shiny Charm)
|
||||||
* @param applyModifiersToOverride If {@linkcode thresholdOverride} is set and this is true, will apply Shiny Charm and event modifiers to {@linkcode thresholdOverride}
|
* @param applyModifiersToOverride - If {@linkcode thresholdOverride} is set and this is true, will apply Shiny Charm and event modifiers to {@linkcode thresholdOverride}
|
||||||
* @returns `true` if the Pokemon has been set as a shiny, `false` otherwise
|
* @returns `true` if the Pokemon has been set as a shiny, `false` otherwise
|
||||||
*/
|
*/
|
||||||
public trySetShinySeed(
|
public trySetShinySeed(
|
||||||
@ -3258,8 +3258,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* For manual use only, usually to roll a Pokemon's hidden ability chance a second time.
|
* For manual use only, usually to roll a Pokemon's hidden ability chance a second time.
|
||||||
*
|
*
|
||||||
* The base hidden ability odds are {@linkcode BASE_HIDDEN_ABILITY_CHANCE} / `65536`
|
* The base hidden ability odds are {@linkcode BASE_HIDDEN_ABILITY_CHANCE} / `65536`
|
||||||
* @param thresholdOverride number that is divided by `2^16` (`65536`) to get the HA chance, overrides {@linkcode haThreshold} if set (bypassing HA rate modifiers such as Ability Charm)
|
* @param thresholdOverride - number that is divided by `2^16` (`65536`) to get the HA chance, overrides {@linkcode haThreshold} if set (bypassing HA rate modifiers such as Ability Charm)
|
||||||
* @param applyModifiersToOverride If {@linkcode thresholdOverride} is set and this is true, will apply Ability Charm to {@linkcode thresholdOverride}
|
* @param applyModifiersToOverride - If {@linkcode thresholdOverride} is set and this is true, will apply Ability Charm to {@linkcode thresholdOverride}
|
||||||
* @returns `true` if the Pokemon has been set to have its hidden ability, `false` otherwise
|
* @returns `true` if the Pokemon has been set to have its hidden ability, `false` otherwise
|
||||||
*/
|
*/
|
||||||
public tryRerollHiddenAbilitySeed(
|
public tryRerollHiddenAbilitySeed(
|
||||||
@ -3807,8 +3807,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds experience to this PlayerPokemon, subject to wave based level caps.
|
* Adds experience to this PlayerPokemon, subject to wave based level caps.
|
||||||
* @param exp The amount of experience to add
|
* @param exp - The amount of experience to add
|
||||||
* @param ignoreLevelCap Whether to ignore level caps when adding experience (defaults to false)
|
* @param ignoreLevelCap - Whether to ignore level caps when adding experience (defaults to false)
|
||||||
*/
|
*/
|
||||||
addExp(exp: number, ignoreLevelCap = false) {
|
addExp(exp: number, ignoreLevelCap = false) {
|
||||||
const maxExpLevel = globalScene.getMaxExpLevel(ignoreLevelCap);
|
const maxExpLevel = globalScene.getMaxExpLevel(ignoreLevelCap);
|
||||||
@ -3837,7 +3837,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares if `this` and {@linkcode target} are on the same team.
|
* Compares if `this` and {@linkcode target} are on the same team.
|
||||||
* @param target the {@linkcode Pokemon} to compare against.
|
* @param target - the {@linkcode Pokemon} to compare against.
|
||||||
* @returns `true` if the two pokemon are allies, `false` otherwise
|
* @returns `true` if the two pokemon are allies, `false` otherwise
|
||||||
*/
|
*/
|
||||||
public isOpponent(target: Pokemon): boolean {
|
public isOpponent(target: Pokemon): boolean {
|
||||||
@ -3899,13 +3899,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
*
|
*
|
||||||
* Note that this does not apply to evasion or accuracy
|
* Note that this does not apply to evasion or accuracy
|
||||||
* @see {@linkcode getAccuracyMultiplier}
|
* @see {@linkcode getAccuracyMultiplier}
|
||||||
* @param stat the desired {@linkcode EffectiveStat}
|
* @param stat - the desired {@linkcode EffectiveStat}
|
||||||
* @param opponent the target {@linkcode Pokemon}
|
* @param opponent - the target {@linkcode Pokemon}
|
||||||
* @param move the {@linkcode Move} being used
|
* @param move - the {@linkcode Move} being used
|
||||||
* @param ignoreOppAbility determines whether the effects of the opponent's abilities (i.e. Unaware) should be ignored (`false` by default)
|
* @param ignoreOppAbility - determines whether the effects of the opponent's abilities (i.e. Unaware) should be ignored (`false` by default)
|
||||||
* @param isCritical determines whether a critical hit has occurred or not (`false` by default)
|
* @param isCritical - determines whether a critical hit has occurred or not (`false` by default)
|
||||||
* @param simulated determines whether effects are applied without altering game state (`true` by default)
|
* @param simulated - determines whether effects are applied without altering game state (`true` by default)
|
||||||
* @param ignoreHeldItems determines whether this Pokemon's held items should be ignored during the stat calculation, default `false`
|
* @param ignoreHeldItems - determines whether this Pokemon's held items should be ignored during the stat calculation, default `false`
|
||||||
* @return the stat stage multiplier to be used for effective stat calculation
|
* @return the stat stage multiplier to be used for effective stat calculation
|
||||||
*/
|
*/
|
||||||
getStatStageMultiplier(
|
getStatStageMultiplier(
|
||||||
@ -3977,8 +3977,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* This method considers various factors such as the user's accuracy level, the target's evasion level,
|
* This method considers various factors such as the user's accuracy level, the target's evasion level,
|
||||||
* abilities, and modifiers to compute the final accuracy multiplier.
|
* abilities, and modifiers to compute the final accuracy multiplier.
|
||||||
*
|
*
|
||||||
* @param target {@linkcode Pokemon} - The target Pokémon against which the move is used.
|
* @param target - The target Pokémon against which the move is used.
|
||||||
* @param sourceMove {@linkcode Move} - The move being used by the user.
|
* @param sourceMove - - The move being used by the user.
|
||||||
* @returns The calculated accuracy multiplier.
|
* @returns The calculated accuracy multiplier.
|
||||||
*/
|
*/
|
||||||
getAccuracyMultiplier(target: Pokemon, sourceMove: Move): number {
|
getAccuracyMultiplier(target: Pokemon, sourceMove: Move): number {
|
||||||
@ -4073,15 +4073,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Calculates the base damage of the given move against this Pokemon when attacked by the given source.
|
* Calculates the base damage of the given move against this Pokemon when attacked by the given source.
|
||||||
* Used during damage calculation and for Shell Side Arm's forecasting effect.
|
* Used during damage calculation and for Shell Side Arm's forecasting effect.
|
||||||
* @param source the attacking {@linkcode Pokemon}.
|
* @param source - the attacking {@linkcode Pokemon}.
|
||||||
* @param move the {@linkcode Move} used in the attack.
|
* @param move - the {@linkcode Move} used in the attack.
|
||||||
* @param moveCategory the move's {@linkcode MoveCategory} after variable-category effects are applied.
|
* @param moveCategory - the move's {@linkcode MoveCategory} after variable-category effects are applied.
|
||||||
* @param ignoreAbility if `true`, ignores this Pokemon's defensive ability effects (defaults to `false`).
|
* @param ignoreAbility - if `true`, ignores this Pokemon's defensive ability effects (defaults to `false`).
|
||||||
* @param ignoreSourceAbility if `true`, ignore's the attacking Pokemon's ability effects (defaults to `false`).
|
* @param ignoreSourceAbility - if `true`, ignore's the attacking Pokemon's ability effects (defaults to `false`).
|
||||||
* @param ignoreAllyAbility if `true`, ignores the ally Pokemon's ability effects (defaults to `false`).
|
* @param ignoreAllyAbility - if `true`, ignores the ally Pokemon's ability effects (defaults to `false`).
|
||||||
* @param ignoreSourceAllyAbility if `true`, ignores the attacking Pokemon's ally's ability effects (defaults to `false`).
|
* @param ignoreSourceAllyAbility - if `true`, ignores the attacking Pokemon's ally's ability effects (defaults to `false`).
|
||||||
* @param isCritical if `true`, calculates effective stats as if the hit were critical (defaults to `false`).
|
* @param isCritical - if `true`, calculates effective stats as if the hit were critical (defaults to `false`).
|
||||||
* @param simulated if `true`, suppresses changes to game state during calculation (defaults to `true`).
|
* @param simulated - if `true`, suppresses changes to game state during calculation (defaults to `true`).
|
||||||
* @returns The move's base damage against this Pokemon when used by the source Pokemon.
|
* @returns The move's base damage against this Pokemon when used by the source Pokemon.
|
||||||
*/
|
*/
|
||||||
getBaseDamage(
|
getBaseDamage(
|
||||||
@ -4219,14 +4219,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the damage of an attack made by another Pokemon against this Pokemon
|
* Calculates the damage of an attack made by another Pokemon against this Pokemon
|
||||||
* @param source {@linkcode Pokemon} the attacking Pokemon
|
* @param source - the attacking Pokemon
|
||||||
* @param move {@linkcode Pokemon} the move used in the attack
|
* @param move - the move used in the attack
|
||||||
* @param ignoreAbility If `true`, ignores this Pokemon's defensive ability effects
|
* @param ignoreAbility - If `true`, ignores this Pokemon's defensive ability effects
|
||||||
* @param ignoreSourceAbility If `true`, ignores the attacking Pokemon's ability effects
|
* @param ignoreSourceAbility - If `true`, ignores the attacking Pokemon's ability effects
|
||||||
* @param ignoreAllyAbility If `true`, ignores the ally Pokemon's ability effects
|
* @param ignoreAllyAbility - If `true`, ignores the ally Pokemon's ability effects
|
||||||
* @param ignoreSourceAllyAbility If `true`, ignores the ability effects of the attacking pokemon's ally
|
* @param ignoreSourceAllyAbility - If `true`, ignores the ability effects of the attacking pokemon's ally
|
||||||
* @param isCritical If `true`, calculates damage for a critical hit.
|
* @param isCritical - If `true`, calculates damage for a critical hit.
|
||||||
* @param simulated If `true`, suppresses changes to game state during the calculation.
|
* @param simulated - If `true`, suppresses changes to game state during the calculation.
|
||||||
* @returns a {@linkcode DamageCalculationResult} object with three fields:
|
* @returns a {@linkcode DamageCalculationResult} object with three fields:
|
||||||
* - `cancelled`: `true` if the move was cancelled by another effect.
|
* - `cancelled`: `true` if the move was cancelled by another effect.
|
||||||
* - `result`: {@linkcode HitResult} indicates the attack's type effectiveness.
|
* - `result`: {@linkcode HitResult} indicates the attack's type effectiveness.
|
||||||
@ -4565,8 +4565,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies the results of a move to this pokemon
|
* Applies the results of a move to this pokemon
|
||||||
* @param source The {@linkcode Pokemon} using the move
|
* @param source - The {@linkcode Pokemon} using the move
|
||||||
* @param move The {@linkcode Move} being used
|
* @param move - The {@linkcode Move} being used
|
||||||
* @returns The {@linkcode HitResult} of the attack
|
* @returns The {@linkcode HitResult} of the attack
|
||||||
*/
|
*/
|
||||||
apply(source: Pokemon, move: Move): HitResult {
|
apply(source: Pokemon, move: Move): HitResult {
|
||||||
@ -4772,10 +4772,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by damageAndUpdate()
|
* Called by damageAndUpdate()
|
||||||
* @param damage integer
|
* @param damage - integer
|
||||||
* @param ignoreSegments boolean, not currently used
|
* @param ignoreSegments - boolean, not currently used
|
||||||
* @param preventEndure used to update damage if endure or sturdy
|
* @param preventEndure - used to update damage if endure or sturdy
|
||||||
* @param ignoreFaintPhase flag on wheter to add FaintPhase if pokemon after applying damage faints
|
* @param ignoreFaintPhase - flag on wheter to add FaintPhase if pokemon after applying damage faints
|
||||||
* @returns integer representing damage
|
* @returns integer representing damage
|
||||||
*/
|
*/
|
||||||
damage(
|
damage(
|
||||||
@ -4833,12 +4833,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Called by apply(), given the damage, adds a new DamagePhase and actually updates HP values, etc.
|
* Called by apply(), given the damage, adds a new DamagePhase and actually updates HP values, etc.
|
||||||
* Checks for 'Indirect' HitResults to account for Endure/Reviver Seed applying correctly
|
* Checks for 'Indirect' HitResults to account for Endure/Reviver Seed applying correctly
|
||||||
* @param damage integer - passed to damage()
|
* @param damage - integer - passed to damage()
|
||||||
* @param result an enum if it's super effective, not very, etc.
|
* @param result - an enum if it's super effective, not very, etc.
|
||||||
* @param isCritical boolean if move is a critical hit
|
* @param isCritical - boolean if move is a critical hit
|
||||||
* @param ignoreSegments boolean, passed to damage() and not used currently
|
* @param ignoreSegments - boolean, passed to damage() and not used currently
|
||||||
* @param preventEndure boolean, ignore endure properties of pokemon, passed to damage()
|
* @param preventEndure - boolean, ignore endure properties of pokemon, passed to damage()
|
||||||
* @param ignoreFaintPhase boolean to ignore adding a FaintPhase, passsed to damage()
|
* @param ignoreFaintPhase - boolean to ignore adding a FaintPhase, passsed to damage()
|
||||||
* @returns integer of damage done
|
* @returns integer of damage done
|
||||||
*/
|
*/
|
||||||
damageAndUpdate(damage: number,
|
damageAndUpdate(damage: number,
|
||||||
@ -5099,7 +5099,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transferring stat changes and Tags
|
* Transferring stat changes and Tags
|
||||||
* @param source {@linkcode Pokemon} the pokemon whose stats/Tags are to be passed on from, ie: the Pokemon using Baton Pass
|
* @param source - the pokemon whose stats/Tags are to be passed on from, ie: the Pokemon using Baton Pass
|
||||||
*/
|
*/
|
||||||
transferSummon(source: Pokemon): void {
|
transferSummon(source: Pokemon): void {
|
||||||
// Copy all stat stages
|
// Copy all stat stages
|
||||||
@ -5134,7 +5134,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Gets whether the given move is currently disabled for this Pokemon.
|
* Gets whether the given move is currently disabled for this Pokemon.
|
||||||
*
|
*
|
||||||
* @param {Moves} moveId {@linkcode Moves} ID of the move to check
|
* @param moveId - ID of the move to check
|
||||||
* @returns {boolean} `true` if the move is disabled for this Pokemon, otherwise `false`
|
* @returns {boolean} `true` if the move is disabled for this Pokemon, otherwise `false`
|
||||||
*
|
*
|
||||||
* @see {@linkcode MoveRestrictionBattlerTag}
|
* @see {@linkcode MoveRestrictionBattlerTag}
|
||||||
@ -5146,9 +5146,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Gets whether the given move is currently disabled for the user based on the player's target selection
|
* Gets whether the given move is currently disabled for the user based on the player's target selection
|
||||||
*
|
*
|
||||||
* @param {Moves} moveId {@linkcode Moves} ID of the move to check
|
* @param moveId - ID of the move to check
|
||||||
* @param {Pokemon} user {@linkcode Pokemon} the move user
|
* @param user - the move user
|
||||||
* @param {Pokemon} target {@linkcode Pokemon} the target of the move
|
* @param target - the target of the move
|
||||||
*
|
*
|
||||||
* @returns {boolean} `true` if the move is disabled for this Pokemon due to the player's target selection
|
* @returns {boolean} `true` if the move is disabled for this Pokemon due to the player's target selection
|
||||||
*
|
*
|
||||||
@ -5178,9 +5178,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Gets the {@link MoveRestrictionBattlerTag} that is restricting a move, if it exists.
|
* Gets the {@link MoveRestrictionBattlerTag} that is restricting a move, if it exists.
|
||||||
*
|
*
|
||||||
* @param {Moves} moveId {@linkcode Moves} ID of the move to check
|
* @param moveId - ID of the move to check
|
||||||
* @param {Pokemon} user {@linkcode Pokemon} the move user, optional and used when the target is a factor in the move's restricted status
|
* @param user - the move user, optional and used when the target is a factor in the move's restricted status
|
||||||
* @param {Pokemon} target {@linkcode Pokemon} the target of the move, optional and used when the target is a factor in the move's restricted status
|
* @param target - the target of the move, optional and used when the target is a factor in the move's restricted status
|
||||||
* @returns {MoveRestrictionBattlerTag | null} the first tag on this Pokemon that restricts the move, or `null` if the move is not restricted.
|
* @returns {MoveRestrictionBattlerTag | null} the first tag on this Pokemon that restricts the move, or `null` if the move is not restricted.
|
||||||
*/
|
*/
|
||||||
getRestrictingTag(
|
getRestrictingTag(
|
||||||
@ -5224,7 +5224,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Returns a list of the most recent move entries in this Pokemon's move history.
|
* Returns a list of the most recent move entries in this Pokemon's move history.
|
||||||
* The retrieved move entries are sorted in order from NEWEST to OLDEST.
|
* The retrieved move entries are sorted in order from NEWEST to OLDEST.
|
||||||
* @param moveCount The number of move entries to retrieve.
|
* @param moveCount - The number of move entries to retrieve.
|
||||||
* If negative, retrieve the Pokemon's entire move history (equivalent to reversing the output of {@linkcode getMoveHistory()}).
|
* If negative, retrieve the Pokemon's entire move history (equivalent to reversing the output of {@linkcode getMoveHistory()}).
|
||||||
* Default is `1`.
|
* Default is `1`.
|
||||||
* @returns A list of {@linkcode TurnMove}, as specified above.
|
* @returns A list of {@linkcode TurnMove}, as specified above.
|
||||||
@ -5245,7 +5245,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* If this Pokemon is using a multi-hit move, cancels all subsequent strikes
|
* If this Pokemon is using a multi-hit move, cancels all subsequent strikes
|
||||||
* @param {Pokemon} target If specified, this only cancels subsequent strikes against the given target
|
* @param target - If specified, this only cancels subsequent strikes against the given target
|
||||||
*/
|
*/
|
||||||
stopMultiHit(target?: Pokemon): void {
|
stopMultiHit(target?: Pokemon): void {
|
||||||
const effectPhase = globalScene.getCurrentPhase();
|
const effectPhase = globalScene.getCurrentPhase();
|
||||||
@ -5519,11 +5519,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Checks if a status effect can be applied to the Pokemon.
|
* Checks if a status effect can be applied to the Pokemon.
|
||||||
*
|
*
|
||||||
* @param effect The {@linkcode StatusEffect} whose applicability is being checked
|
* @param effect - The {@linkcode StatusEffect} whose applicability is being checked
|
||||||
* @param quiet Whether in-battle messages should trigger or not
|
* @param quiet - Whether in-battle messages should trigger or not
|
||||||
* @param overrideStatus Whether the Pokemon's current status can be overriden
|
* @param overrideStatus - Whether the Pokemon's current status can be overriden
|
||||||
* @param sourcePokemon The Pokemon that is setting the status effect
|
* @param sourcePokemon - The Pokemon that is setting the status effect
|
||||||
* @param ignoreField Whether any field effects (weather, terrain, etc.) should be considered
|
* @param ignoreField - Whether any field effects (weather, terrain, etc.) should be considered
|
||||||
*/
|
*/
|
||||||
canSetStatus(
|
canSetStatus(
|
||||||
effect: StatusEffect | undefined,
|
effect: StatusEffect | undefined,
|
||||||
@ -5725,9 +5725,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the status of a pokemon.
|
* Resets the status of a pokemon.
|
||||||
* @param revive Whether revive should be cured; defaults to true.
|
* @param revive - Whether revive should be cured; defaults to true.
|
||||||
* @param confusion Whether resetStatus should include confusion or not; defaults to false.
|
* @param confusion - Whether resetStatus should include confusion or not; defaults to false.
|
||||||
* @param reloadAssets Whether to reload the assets or not; defaults to false.
|
* @param reloadAssets - Whether to reload the assets or not; defaults to false.
|
||||||
*/
|
*/
|
||||||
resetStatus(revive = true, confusion = false, reloadAssets = false): void {
|
resetStatus(revive = true, confusion = false, reloadAssets = false): void {
|
||||||
const lastStatus = this.status?.effect;
|
const lastStatus = this.status?.effect;
|
||||||
@ -5739,7 +5739,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this Pokemon is protected by Safeguard
|
* Checks if this Pokemon is protected by Safeguard
|
||||||
* @param attacker the {@linkcode Pokemon} inflicting status on this Pokemon
|
* @param attacker - the {@linkcode Pokemon} inflicting status on this Pokemon
|
||||||
* @returns `true` if this Pokemon is protected by Safeguard; `false` otherwise.
|
* @returns `true` if this Pokemon is protected by Safeguard; `false` otherwise.
|
||||||
*/
|
*/
|
||||||
isSafeguarded(attacker: Pokemon): boolean {
|
isSafeguarded(attacker: Pokemon): boolean {
|
||||||
@ -6321,8 +6321,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* which calls {@linkcode randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts`,
|
* which calls {@linkcode randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts`,
|
||||||
* or it directly calls {@linkcode randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts` if there is no current battle
|
* or it directly calls {@linkcode randSeedInt randSeedInt}({@linkcode range}, {@linkcode min}) in `src/utils.ts` if there is no current battle
|
||||||
*
|
*
|
||||||
* @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
* @param range - How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
||||||
* @param min The minimum integer to pick, default `0`
|
* @param min - The minimum integer to pick, default `0`
|
||||||
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
||||||
*/
|
*/
|
||||||
randSeedInt(range: number, min = 0): number {
|
randSeedInt(range: number, min = 0): number {
|
||||||
@ -6333,8 +6333,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a random number using the current battle's seed, or the global seed if `globalScene.currentBattle` is falsy
|
* Generates a random number using the current battle's seed, or the global seed if `globalScene.currentBattle` is falsy
|
||||||
* @param min The minimum integer to generate
|
* @param min - The minimum integer to generate
|
||||||
* @param max The maximum integer to generate
|
* @param max - The maximum integer to generate
|
||||||
* @returns a random integer between {@linkcode min} and {@linkcode max} inclusive
|
* @returns a random integer between {@linkcode min} and {@linkcode max} inclusive
|
||||||
*/
|
*/
|
||||||
randSeedIntRange(min: number, max: number): number {
|
randSeedIntRange(min: number, max: number): number {
|
||||||
@ -6343,9 +6343,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Causes a Pokemon to leave the field (such as in preparation for a switch out/escape).
|
* Causes a Pokemon to leave the field (such as in preparation for a switch out/escape).
|
||||||
* @param clearEffects Indicates if effects should be cleared (true) or passed
|
* @param clearEffects - Indicates if effects should be cleared (true) or passed
|
||||||
* to the next pokemon, such as during a baton pass (false)
|
* to the next pokemon, such as during a baton pass (false)
|
||||||
* @param hideInfo Indicates if this should also play the animation to hide the Pokemon's
|
* @param hideInfo - Indicates if this should also play the animation to hide the Pokemon's
|
||||||
* info container.
|
* info container.
|
||||||
*/
|
*/
|
||||||
leaveField(clearEffects = true, hideInfo = true, destroy = false) {
|
leaveField(clearEffects = true, hideInfo = true, destroy = false) {
|
||||||
@ -6386,7 +6386,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether or not the Pokemon's root form has the same ability
|
* Checks whether or not the Pokemon's root form has the same ability
|
||||||
* @param abilityIndex the given ability index we are checking
|
* @param abilityIndex - the given ability index we are checking
|
||||||
* @returns true if the abilities are the same
|
* @returns true if the abilities are the same
|
||||||
*/
|
*/
|
||||||
hasSameAbilityInRootForm(abilityIndex: number): boolean {
|
hasSameAbilityInRootForm(abilityIndex: number): boolean {
|
||||||
@ -6401,7 +6401,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Helper function to check if the player already owns the starter data of the Pokemon's
|
* Helper function to check if the player already owns the starter data of the Pokemon's
|
||||||
* current ability
|
* current ability
|
||||||
* @param ownedAbilityAttrs the owned abilityAttr of this Pokemon's root form
|
* @param ownedAbilityAttrs - the owned abilityAttr of this Pokemon's root form
|
||||||
* @returns true if the player already has it, false otherwise
|
* @returns true if the player already has it, false otherwise
|
||||||
*/
|
*/
|
||||||
checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs: number): boolean {
|
checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs: number): boolean {
|
||||||
@ -6420,8 +6420,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Reduces one of this Pokemon's held item stacks by 1, and removes the item if applicable.
|
* Reduces one of this Pokemon's held item stacks by 1, and removes the item if applicable.
|
||||||
* Does nothing if this Pokemon is somehow not the owner of the held item.
|
* Does nothing if this Pokemon is somehow not the owner of the held item.
|
||||||
* @param heldItem The item stack to be reduced by 1.
|
* @param heldItem - The item stack to be reduced by 1.
|
||||||
* @param forBattle If `false`, do not trigger in-battle effects (such as Unburden) from losing the item. For example, set this to `false` if the Pokemon is giving away the held item for a Mystery Encounter. Default is `true`.
|
* @param forBattle - If `false`, do not trigger in-battle effects (such as Unburden) from losing the item. For example, set this to `false` if the Pokemon is giving away the held item for a Mystery Encounter. Default is `true`.
|
||||||
* @returns `true` if the item was removed successfully, `false` otherwise.
|
* @returns `true` if the item was removed successfully, `false` otherwise.
|
||||||
*/
|
*/
|
||||||
public loseHeldItem(
|
public loseHeldItem(
|
||||||
@ -6577,7 +6577,7 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
/**
|
/**
|
||||||
* Causes this mon to leave the field (via {@linkcode leaveField}) and then
|
* Causes this mon to leave the field (via {@linkcode leaveField}) and then
|
||||||
* opens the party switcher UI to switch a new mon in
|
* opens the party switcher UI to switch a new mon in
|
||||||
* @param switchType the {@linkcode SwitchType} for this switch-out. If this is
|
* @param switchType - the {@linkcode SwitchType} for this switch-out. If this is
|
||||||
* `BATON_PASS` or `SHED_TAIL`, this Pokemon's effects are not cleared upon leaving
|
* `BATON_PASS` or `SHED_TAIL`, this Pokemon's effects are not cleared upon leaving
|
||||||
* the field.
|
* the field.
|
||||||
*/
|
*/
|
||||||
@ -6962,7 +6962,7 @@ export class PlayerPokemon extends Pokemon {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a Promise to fuse two PlayerPokemon together
|
* Returns a Promise to fuse two PlayerPokemon together
|
||||||
* @param pokemon The PlayerPokemon to fuse to this one
|
* @param pokemon - The PlayerPokemon to fuse to this one
|
||||||
*/
|
*/
|
||||||
fuse(pokemon: PlayerPokemon): void {
|
fuse(pokemon: PlayerPokemon): void {
|
||||||
this.fusionSpecies = pokemon.species;
|
this.fusionSpecies = pokemon.species;
|
||||||
@ -7173,8 +7173,8 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
* Sets the pokemons boss status. If true initializes the boss segments either from the arguments
|
* Sets the pokemons boss status. If true initializes the boss segments either from the arguments
|
||||||
* or through the the Scene.getEncounterBossSegments function
|
* or through the the Scene.getEncounterBossSegments function
|
||||||
*
|
*
|
||||||
* @param boss if the pokemon is a boss
|
* @param boss - if the pokemon is a boss
|
||||||
* @param bossSegments amount of boss segments (health-bar segments)
|
* @param bossSegments - amount of boss segments (health-bar segments)
|
||||||
*/
|
*/
|
||||||
setBoss(boss = true, bossSegments = 0): void {
|
setBoss(boss = true, bossSegments = 0): void {
|
||||||
if (boss) {
|
if (boss) {
|
||||||
@ -7453,7 +7453,7 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines the Pokemon the given move would target if used by this Pokemon
|
* Determines the Pokemon the given move would target if used by this Pokemon
|
||||||
* @param moveId {@linkcode Moves} The move to be used
|
* @param moveId - The move to be used
|
||||||
* @returns The indexes of the Pokemon the given move would target
|
* @returns The indexes of the Pokemon the given move would target
|
||||||
*/
|
*/
|
||||||
getNextTargets(moveId: Moves): BattlerIndex[] {
|
getNextTargets(moveId: Moves): BattlerIndex[] {
|
||||||
@ -7651,7 +7651,7 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
* The base boost is 1 to a random stat that's not already maxed out per broken shield
|
* The base boost is 1 to a random stat that's not already maxed out per broken shield
|
||||||
* For Pokemon with 3 health segments or more, breaking the last shield gives +2 instead
|
* For Pokemon with 3 health segments or more, breaking the last shield gives +2 instead
|
||||||
* For Pokemon with 5 health segments or more, breaking the last two shields give +2 each
|
* For Pokemon with 5 health segments or more, breaking the last two shields give +2 each
|
||||||
* @param segmentIndex index of the segment to get down to (0 = no shield left, 1 = 1 shield left, etc.)
|
* @param segmentIndex - index of the segment to get down to (0 = no shield left, 1 = 1 shield left, etc.)
|
||||||
*/
|
*/
|
||||||
handleBossSegmentCleared(segmentIndex: number): void {
|
handleBossSegmentCleared(segmentIndex: number): void {
|
||||||
while (
|
while (
|
||||||
@ -7720,8 +7720,8 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
/**
|
/**
|
||||||
* Add a new pokemon to the player's party (at `slotIndex` if set).
|
* Add a new pokemon to the player's party (at `slotIndex` if set).
|
||||||
* The new pokemon's visibility will be set to `false`.
|
* The new pokemon's visibility will be set to `false`.
|
||||||
* @param pokeballType the type of pokeball the pokemon was caught with
|
* @param pokeballType - the type of pokeball the pokemon was caught with
|
||||||
* @param slotIndex an optional index to place the pokemon in the party
|
* @param slotIndex - an optional index to place the pokemon in the party
|
||||||
* @returns the pokemon that was added or null if the pokemon could not be added
|
* @returns the pokemon that was added or null if the pokemon could not be added
|
||||||
*/
|
*/
|
||||||
addToParty(pokeballType: PokeballType, slotIndex = -1) {
|
addToParty(pokeballType: PokeballType, slotIndex = -1) {
|
||||||
@ -7986,9 +7986,9 @@ export class PokemonMove {
|
|||||||
* Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets.
|
* Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets.
|
||||||
* The move is unusable if it is out of PP, restricted by an effect, or unimplemented.
|
* The move is unusable if it is out of PP, restricted by an effect, or unimplemented.
|
||||||
*
|
*
|
||||||
* @param {Pokemon} pokemon {@linkcode Pokemon} that would be using this move
|
* @param pokemon - that would be using this move
|
||||||
* @param {boolean} ignorePp If `true`, skips the PP check
|
* @param ignorePp - If `true`, skips the PP check
|
||||||
* @param {boolean} ignoreRestrictionTags If `true`, skips the check for move restriction tags (see {@link MoveRestrictionBattlerTag})
|
* @param ignoreRestrictionTags - If `true`, skips the check for move restriction tags (see {@link MoveRestrictionBattlerTag})
|
||||||
* @returns `true` if the move can be selected and used by the Pokemon, otherwise `false`.
|
* @returns `true` if the move can be selected and used by the Pokemon, otherwise `false`.
|
||||||
*/
|
*/
|
||||||
isUsable(
|
isUsable(
|
||||||
@ -8019,7 +8019,7 @@ export class PokemonMove {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets {@link ppUsed} for this move and ensures the value does not exceed {@link getMovePp}
|
* Sets {@link ppUsed} for this move and ensures the value does not exceed {@link getMovePp}
|
||||||
* @param {number} count Amount of PP to use
|
* @param count - Amount of PP to use
|
||||||
*/
|
*/
|
||||||
usePp(count = 1) {
|
usePp(count = 1) {
|
||||||
this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp());
|
this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp());
|
||||||
@ -8042,7 +8042,7 @@ export class PokemonMove {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies an existing move or creates a valid PokemonMove object from json representing one
|
* Copies an existing move or creates a valid PokemonMove object from json representing one
|
||||||
* @param {PokemonMove | any} source The data for the move to copy
|
* @param source - The data for the move to copy
|
||||||
* @return {PokemonMove} A valid pokemonmove object
|
* @return {PokemonMove} A valid pokemonmove object
|
||||||
*/
|
*/
|
||||||
static loadMove(source: PokemonMove | any): PokemonMove {
|
static loadMove(source: PokemonMove | any): PokemonMove {
|
||||||
|
@ -159,8 +159,8 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the trainer based on the provided trainer slot and the option to include a title.
|
* Returns the name of the trainer based on the provided trainer slot and the option to include a title.
|
||||||
* @param {TrainerSlot} trainerSlot - The slot to determine which name to use. Defaults to TrainerSlot.NONE.
|
* @param trainerSlot - The slot to determine which name to use. Defaults to TrainerSlot.NONE.
|
||||||
* @param {boolean} includeTitle - Whether to include the title in the returned name. Defaults to false.
|
* @param includeTitle - Whether to include the title in the returned name. Defaults to false.
|
||||||
* @returns {string} - The formatted name of the trainer.
|
* @returns {string} - The formatted name of the trainer.
|
||||||
**/
|
**/
|
||||||
getName(trainerSlot: TrainerSlot = TrainerSlot.NONE, includeTitle = false): string {
|
getName(trainerSlot: TrainerSlot = TrainerSlot.NONE, includeTitle = false): string {
|
||||||
@ -677,9 +677,9 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Attempts to animate a given set of {@linkcode Phaser.GameObjects.Sprite}
|
* Attempts to animate a given set of {@linkcode Phaser.GameObjects.Sprite}
|
||||||
* @see {@linkcode Phaser.GameObjects.Sprite.play}
|
* @see {@linkcode Phaser.GameObjects.Sprite.play}
|
||||||
* @param sprite {@linkcode Phaser.GameObjects.Sprite} to animate
|
* @param sprite - to animate
|
||||||
* @param tintSprite {@linkcode Phaser.GameObjects.Sprite} placed on top of the sprite to add a color tint
|
* @param tintSprite - placed on top of the sprite to add a color tint
|
||||||
* @param animConfig {@linkcode Phaser.Types.Animations.PlayAnimationConfig} to pass to {@linkcode Phaser.GameObjects.Sprite.play}
|
* @param animConfig - to pass to {@linkcode Phaser.GameObjects.Sprite.play}
|
||||||
* @returns true if the sprite was able to be animated
|
* @returns true if the sprite was able to be animated
|
||||||
*/
|
*/
|
||||||
tryPlaySprite(
|
tryPlaySprite(
|
||||||
@ -789,7 +789,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether a Trainer should Terastallize their Pokemon
|
* Determines whether a Trainer should Terastallize their Pokemon
|
||||||
* @param pokemon {@linkcode EnemyPokemon} Trainer Pokemon in question
|
* @param pokemon - Trainer Pokemon in question
|
||||||
* @returns boolean Whether the EnemyPokemon should Terastalize this turn
|
* @returns boolean Whether the EnemyPokemon should Terastalize this turn
|
||||||
*/
|
*/
|
||||||
shouldTera(pokemon: EnemyPokemon): boolean {
|
shouldTera(pokemon: EnemyPokemon): boolean {
|
||||||
|
@ -70,8 +70,8 @@ export class GameMode implements GameModeConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables challenges if they are disabled and sets the specified challenge's value
|
* Enables challenges if they are disabled and sets the specified challenge's value
|
||||||
* @param challenge The challenge to set
|
* @param challenge - The challenge to set
|
||||||
* @param value The value to give the challenge. Impact depends on the specific challenge
|
* @param value - The value to give the challenge. Impact depends on the specific challenge
|
||||||
*/
|
*/
|
||||||
setChallengeValue(challenge: Challenges, value: number) {
|
setChallengeValue(challenge: Challenges, value: number) {
|
||||||
if (!this.isChallenge) {
|
if (!this.isChallenge) {
|
||||||
@ -83,7 +83,7 @@ export class GameMode implements GameModeConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to see if a GameMode has a specific challenge type
|
* Helper function to see if a GameMode has a specific challenge type
|
||||||
* @param challenge the Challenges it looks for
|
* @param challenge - the Challenges it looks for
|
||||||
* @returns true if the game mode has that challenge
|
* @returns true if the game mode has that challenge
|
||||||
*/
|
*/
|
||||||
hasChallenge(challenge: Challenges): boolean {
|
hasChallenge(challenge: Challenges): boolean {
|
||||||
@ -150,9 +150,9 @@ export class GameMode implements GameModeConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether or not to generate a trainer
|
* Determine whether or not to generate a trainer
|
||||||
* @param waveIndex the current floor the player is on (trainer sprites fail to generate on X1 floors)
|
* @param waveIndex - The current floor the player is on (trainer sprites fail to generate on X1 floors)
|
||||||
* @param arena the current {@linkcode Arena}
|
* @param arena - The current {@linkcode Arena}
|
||||||
* @returns `true` if a trainer should be generated, `false` otherwise
|
* @returns `true` if a trainer should be generated, `false` otherwise
|
||||||
*/
|
*/
|
||||||
isWaveTrainer(waveIndex: number, arena: Arena): boolean {
|
isWaveTrainer(waveIndex: number, arena: Arena): boolean {
|
||||||
@ -231,7 +231,7 @@ export class GameMode implements GameModeConfig {
|
|||||||
/**
|
/**
|
||||||
* Checks if wave provided is the final for current or specified game mode
|
* Checks if wave provided is the final for current or specified game mode
|
||||||
* @param waveIndex
|
* @param waveIndex
|
||||||
* @param modeId game mode
|
* @param modeId - game mode
|
||||||
* @returns if the current wave is final for classic or daily OR a minor boss in endless
|
* @returns if the current wave is final for classic or daily OR a minor boss in endless
|
||||||
*/
|
*/
|
||||||
isWaveFinal(waveIndex: number, modeId: GameModes = this.modeId): boolean {
|
isWaveFinal(waveIndex: number, modeId: GameModes = this.modeId): boolean {
|
||||||
@ -291,7 +291,7 @@ export class GameMode implements GameModeConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether there is a fixed battle on this gamemode on a given wave.
|
* Checks whether there is a fixed battle on this gamemode on a given wave.
|
||||||
* @param {number} waveIndex The wave to check.
|
* @param waveIndex - The wave to check.
|
||||||
* @returns {boolean} If this game mode has a fixed battle on this wave
|
* @returns {boolean} If this game mode has a fixed battle on this wave
|
||||||
*/
|
*/
|
||||||
isFixedBattle(waveIndex: number): boolean {
|
isFixedBattle(waveIndex: number): boolean {
|
||||||
@ -304,7 +304,7 @@ export class GameMode implements GameModeConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the config for the fixed battle for a particular wave.
|
* Returns the config for the fixed battle for a particular wave.
|
||||||
* @param {number} waveIndex The wave to check.
|
* @param waveIndex - The wave to check.
|
||||||
* @returns {boolean} The fixed battle for this wave.
|
* @returns {boolean} The fixed battle for this wave.
|
||||||
*/
|
*/
|
||||||
getFixedBattle(waveIndex: number): FixedBattleConfig {
|
getFixedBattle(waveIndex: number): FixedBattleConfig {
|
||||||
|
@ -229,7 +229,7 @@ export class InputsController {
|
|||||||
/**
|
/**
|
||||||
* Initializes the chosen gamepad by setting its identifier in the local storage and updating the UI to reflect the chosen gamepad.
|
* Initializes the chosen gamepad by setting its identifier in the local storage and updating the UI to reflect the chosen gamepad.
|
||||||
* If a gamepad name is provided, it uses that as the chosen gamepad; otherwise, it defaults to the currently chosen gamepad.
|
* If a gamepad name is provided, it uses that as the chosen gamepad; otherwise, it defaults to the currently chosen gamepad.
|
||||||
* @param gamepadName Optional parameter to specify the name of the gamepad to initialize as chosen.
|
* @param gamepadName - Optional parameter to specify the name of the gamepad to initialize as chosen.
|
||||||
*/
|
*/
|
||||||
initChosenGamepad(gamepadName?: string): void {
|
initChosenGamepad(gamepadName?: string): void {
|
||||||
if (gamepadName) {
|
if (gamepadName) {
|
||||||
@ -242,7 +242,7 @@ export class InputsController {
|
|||||||
/**
|
/**
|
||||||
* Initializes the chosen keyboard layout by setting its identifier in the local storage and updating the UI to reflect the chosen layout.
|
* Initializes the chosen keyboard layout by setting its identifier in the local storage and updating the UI to reflect the chosen layout.
|
||||||
* If a layout name is provided, it uses that as the chosen layout; otherwise, it defaults to the currently chosen layout.
|
* If a layout name is provided, it uses that as the chosen layout; otherwise, it defaults to the currently chosen layout.
|
||||||
* @param layoutKeyboard Optional parameter to specify the name of the keyboard layout to initialize as chosen.
|
* @param layoutKeyboard - Optional parameter to specify the name of the keyboard layout to initialize as chosen.
|
||||||
*/
|
*/
|
||||||
initChosenLayoutKeyboard(layoutKeyboard?: string): void {
|
initChosenLayoutKeyboard(layoutKeyboard?: string): void {
|
||||||
if (layoutKeyboard) {
|
if (layoutKeyboard) {
|
||||||
@ -258,7 +258,7 @@ export class InputsController {
|
|||||||
* disconnections, it would be impossible to determine the connection status of gamepads. This method ensures
|
* disconnections, it would be impossible to determine the connection status of gamepads. This method ensures
|
||||||
* that disconnected gamepads are recognized and can be appropriately hidden in the gamepad selection menu.
|
* that disconnected gamepads are recognized and can be appropriately hidden in the gamepad selection menu.
|
||||||
*
|
*
|
||||||
* @param thisGamepad The gamepad that has been disconnected.
|
* @param thisGamepad - The gamepad that has been disconnected.
|
||||||
*/
|
*/
|
||||||
onDisconnect(thisGamepad: Phaser.Input.Gamepad.Gamepad): void {
|
onDisconnect(thisGamepad: Phaser.Input.Gamepad.Gamepad): void {
|
||||||
this.disconnectedGamepads.push(thisGamepad.id);
|
this.disconnectedGamepads.push(thisGamepad.id);
|
||||||
@ -269,7 +269,7 @@ export class InputsController {
|
|||||||
* It removes the reconnected gamepad's identifier from the `disconnectedGamepads` array,
|
* It removes the reconnected gamepad's identifier from the `disconnectedGamepads` array,
|
||||||
* effectively updating its status to connected.
|
* effectively updating its status to connected.
|
||||||
*
|
*
|
||||||
* @param thisGamepad The gamepad that has been reconnected.
|
* @param thisGamepad - The gamepad that has been reconnected.
|
||||||
*/
|
*/
|
||||||
onReconnect(thisGamepad: Phaser.Input.Gamepad.Gamepad): void {
|
onReconnect(thisGamepad: Phaser.Input.Gamepad.Gamepad): void {
|
||||||
this.disconnectedGamepads = this.disconnectedGamepads.filter(g => g !== thisGamepad.id);
|
this.disconnectedGamepads = this.disconnectedGamepads.filter(g => g !== thisGamepad.id);
|
||||||
@ -281,7 +281,7 @@ export class InputsController {
|
|||||||
* and ensures these configurations are saved. If the connected gamepad is the currently chosen one,
|
* and ensures these configurations are saved. If the connected gamepad is the currently chosen one,
|
||||||
* it reinitializes the chosen gamepad settings.
|
* it reinitializes the chosen gamepad settings.
|
||||||
*
|
*
|
||||||
* @param thisGamepad The gamepad that is being set up.
|
* @param thisGamepad - The gamepad that is being set up.
|
||||||
*/
|
*/
|
||||||
setupGamepad(_thisGamepad: Phaser.Input.Gamepad.Gamepad): void {
|
setupGamepad(_thisGamepad: Phaser.Input.Gamepad.Gamepad): void {
|
||||||
const allGamepads = this.getGamepadsName();
|
const allGamepads = this.getGamepadsName();
|
||||||
@ -343,7 +343,7 @@ export class InputsController {
|
|||||||
/**
|
/**
|
||||||
* Handles the keydown event for the keyboard.
|
* Handles the keydown event for the keyboard.
|
||||||
*
|
*
|
||||||
* @param event The keyboard event.
|
* @param event - The keyboard event.
|
||||||
*/
|
*/
|
||||||
keyboardKeyDown(event): void {
|
keyboardKeyDown(event): void {
|
||||||
this.lastSource = "keyboard";
|
this.lastSource = "keyboard";
|
||||||
@ -371,7 +371,7 @@ export class InputsController {
|
|||||||
/**
|
/**
|
||||||
* Handles the keyup event for the keyboard.
|
* Handles the keyup event for the keyboard.
|
||||||
*
|
*
|
||||||
* @param event The keyboard event.
|
* @param event - The keyboard event.
|
||||||
*/
|
*/
|
||||||
keyboardKeyUp(event): void {
|
keyboardKeyUp(event): void {
|
||||||
this.lastSource = "keyboard";
|
this.lastSource = "keyboard";
|
||||||
@ -392,9 +392,9 @@ export class InputsController {
|
|||||||
* It checks if gamepad support is enabled and if the event comes from the chosen gamepad. If so, it maps the button press to a specific
|
* It checks if gamepad support is enabled and if the event comes from the chosen gamepad. If so, it maps the button press to a specific
|
||||||
* action using a custom configuration, emits an event for the button press, and records the time of the action.
|
* action using a custom configuration, emits an event for the button press, and records the time of the action.
|
||||||
*
|
*
|
||||||
* @param pad The gamepad on which the button was pressed.
|
* @param pad - The gamepad on which the button was pressed.
|
||||||
* @param button The specific button that was pressed.
|
* @param button - The specific button that was pressed.
|
||||||
* @param value The intensity or value of the button press, if applicable.
|
* @param value - The intensity or value of the button press, if applicable.
|
||||||
*/
|
*/
|
||||||
gamepadButtonDown(pad: Phaser.Input.Gamepad.Gamepad, button: Phaser.Input.Gamepad.Button, _value: number): void {
|
gamepadButtonDown(pad: Phaser.Input.Gamepad.Gamepad, button: Phaser.Input.Gamepad.Button, _value: number): void {
|
||||||
if (!this.configs[this.selectedDevice[Device.KEYBOARD]]?.padID) {
|
if (!this.configs[this.selectedDevice[Device.KEYBOARD]]?.padID) {
|
||||||
@ -444,9 +444,9 @@ export class InputsController {
|
|||||||
* If conditions are met, it identifies the configured action for the button, emits an event signaling the button release,
|
* If conditions are met, it identifies the configured action for the button, emits an event signaling the button release,
|
||||||
* and clears the record of the button.
|
* and clears the record of the button.
|
||||||
*
|
*
|
||||||
* @param pad The gamepad from which the button was released.
|
* @param pad - The gamepad from which the button was released.
|
||||||
* @param button The specific button that was released.
|
* @param button - The specific button that was released.
|
||||||
* @param value The intensity or value of the button release, if applicable.
|
* @param value - The intensity or value of the button release, if applicable.
|
||||||
*/
|
*/
|
||||||
gamepadButtonUp(pad: Phaser.Input.Gamepad.Gamepad, button: Phaser.Input.Gamepad.Button, _value: number): void {
|
gamepadButtonUp(pad: Phaser.Input.Gamepad.Gamepad, button: Phaser.Input.Gamepad.Button, _value: number): void {
|
||||||
if (!pad) {
|
if (!pad) {
|
||||||
@ -473,7 +473,7 @@ export class InputsController {
|
|||||||
* based on substrings in the identifier and returns predefined configurations for recognized models.
|
* based on substrings in the identifier and returns predefined configurations for recognized models.
|
||||||
* If no specific configuration matches, it defaults to a generic gamepad configuration.
|
* If no specific configuration matches, it defaults to a generic gamepad configuration.
|
||||||
*
|
*
|
||||||
* @param id The identifier string of the gamepad.
|
* @param id - The identifier string of the gamepad.
|
||||||
* @returns InterfaceConfig The configuration object corresponding to the identified gamepad type.
|
* @returns InterfaceConfig The configuration object corresponding to the identified gamepad type.
|
||||||
*/
|
*/
|
||||||
getConfig(id: string): InterfaceConfig {
|
getConfig(id: string): InterfaceConfig {
|
||||||
@ -498,7 +498,7 @@ export class InputsController {
|
|||||||
/**
|
/**
|
||||||
* Retrieves the configuration object for a keyboard layout based on its identifier.
|
* Retrieves the configuration object for a keyboard layout based on its identifier.
|
||||||
*
|
*
|
||||||
* @param id The identifier string of the keyboard layout.
|
* @param id - The identifier string of the keyboard layout.
|
||||||
* @returns InterfaceConfig The configuration object corresponding to the identified keyboard layout.
|
* @returns InterfaceConfig The configuration object corresponding to the identified keyboard layout.
|
||||||
*/
|
*/
|
||||||
getConfigKeyboard(id: string): InterfaceConfig {
|
getConfigKeyboard(id: string): InterfaceConfig {
|
||||||
@ -563,8 +563,8 @@ export class InputsController {
|
|||||||
* Injects a custom mapping configuration into the configuration for a specific gamepad.
|
* Injects a custom mapping configuration into the configuration for a specific gamepad.
|
||||||
* If the device does not have an existing configuration, it initializes one first.
|
* If the device does not have an existing configuration, it initializes one first.
|
||||||
*
|
*
|
||||||
* @param selectedDevice The identifier of the device to configure.
|
* @param selectedDevice - The identifier of the device to configure.
|
||||||
* @param mappingConfigs The mapping configuration to apply to the device.
|
* @param mappingConfigs - The mapping configuration to apply to the device.
|
||||||
*/
|
*/
|
||||||
injectConfig(selectedDevice: string, mappingConfigs): void {
|
injectConfig(selectedDevice: string, mappingConfigs): void {
|
||||||
if (!this.configs[selectedDevice]) {
|
if (!this.configs[selectedDevice]) {
|
||||||
@ -593,9 +593,9 @@ export class InputsController {
|
|||||||
/**
|
/**
|
||||||
* Swaps a binding in the configuration.
|
* Swaps a binding in the configuration.
|
||||||
*
|
*
|
||||||
* @param config The configuration object.
|
* @param config - The configuration object.
|
||||||
* @param settingName The name of the setting to swap.
|
* @param settingName - The name of the setting to swap.
|
||||||
* @param pressedButton The button that was pressed.
|
* @param pressedButton - The button that was pressed.
|
||||||
*/
|
*/
|
||||||
assignBinding(config, settingName, pressedButton): boolean {
|
assignBinding(config, settingName, pressedButton): boolean {
|
||||||
this.deactivatePressedKey();
|
this.deactivatePressedKey();
|
||||||
|
@ -5,8 +5,8 @@ import i18next from "i18next";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the Pokemon's name, potentially with an affix indicating its role (wild or foe) in the current battle context, translated
|
* Retrieves the Pokemon's name, potentially with an affix indicating its role (wild or foe) in the current battle context, translated
|
||||||
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance
|
* @param pokemon - name and battle context will be retrieved from this instance
|
||||||
* @param {boolean} useIllusion - Whether we want the name of the illusion or not. Default value : true
|
* @param useIllusion - Whether we want the name of the illusion or not. Default value : true
|
||||||
* @returns {string} ex: "Wild Gengar", "Ectoplasma sauvage"
|
* @returns {string} ex: "Wild Gengar", "Ectoplasma sauvage"
|
||||||
*/
|
*/
|
||||||
export function getPokemonNameWithAffix(pokemon: Pokemon | undefined, useIllusion = true): string {
|
export function getPokemonNameWithAffix(pokemon: Pokemon | undefined, useIllusion = true): string {
|
||||||
|
@ -230,10 +230,10 @@ export class ModifierType {
|
|||||||
* It checks the weight of the item and will use the first tier for which the weight is greater than 0
|
* It checks the weight of the item and will use the first tier for which the weight is greater than 0
|
||||||
* This is to allow items to be in multiple item pools depending on the conditions, for example for events
|
* This is to allow items to be in multiple item pools depending on the conditions, for example for events
|
||||||
* If all tiers have a weight of 0 for the item, the first tier where the item was found is used
|
* If all tiers have a weight of 0 for the item, the first tier where the item was found is used
|
||||||
* @param poolType Default 'ModifierPoolType.PLAYER'. Which pool to lookup item tier from
|
* @param poolType - Default 'ModifierPoolType.PLAYER'. Which pool to lookup item tier from
|
||||||
* @param party optional. Needed to check the weight of modifiers with conditional weight (see {@linkcode WeightedModifierTypeWeightFunc})
|
* @param party - optional. Needed to check the weight of modifiers with conditional weight (see {@linkcode WeightedModifierTypeWeightFunc})
|
||||||
* if not provided or empty, the weight check will be ignored
|
* if not provided or empty, the weight check will be ignored
|
||||||
* @param rerollCount Default `0`. Used to check the weight of modifiers with conditional weight (see {@linkcode WeightedModifierTypeWeightFunc})
|
* @param rerollCount - Default `0`. Used to check the weight of modifiers with conditional weight (see {@linkcode WeightedModifierTypeWeightFunc})
|
||||||
*/
|
*/
|
||||||
withTierFromPool(
|
withTierFromPool(
|
||||||
poolType: ModifierPoolType = ModifierPoolType.PLAYER,
|
poolType: ModifierPoolType = ModifierPoolType.PLAYER,
|
||||||
@ -863,7 +863,6 @@ export type SpeciesStatBoosterItem = keyof typeof SpeciesStatBoosterModifierType
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Modifier type for {@linkcode SpeciesStatBoosterModifier}
|
* Modifier type for {@linkcode SpeciesStatBoosterModifier}
|
||||||
* @extends PokemonHeldItemModifierType
|
|
||||||
* @implements GeneratedPersistentModifierType
|
* @implements GeneratedPersistentModifierType
|
||||||
*/
|
*/
|
||||||
export class SpeciesStatBoosterModifierType
|
export class SpeciesStatBoosterModifierType
|
||||||
@ -1428,7 +1427,6 @@ class TempStatStageBoosterModifierTypeGenerator extends ModifierTypeGenerator {
|
|||||||
* Modifier type generator for {@linkcode SpeciesStatBoosterModifierType}, which
|
* Modifier type generator for {@linkcode SpeciesStatBoosterModifierType}, which
|
||||||
* encapsulates the logic for weighting the most useful held item from
|
* encapsulates the logic for weighting the most useful held item from
|
||||||
* the current list of {@linkcode items}.
|
* the current list of {@linkcode items}.
|
||||||
* @extends ModifierTypeGenerator
|
|
||||||
*/
|
*/
|
||||||
class SpeciesStatBoosterModifierTypeGenerator extends ModifierTypeGenerator {
|
class SpeciesStatBoosterModifierTypeGenerator extends ModifierTypeGenerator {
|
||||||
/** Object comprised of the currently available species-based stat boosting held items */
|
/** Object comprised of the currently available species-based stat boosting held items */
|
||||||
@ -1788,7 +1786,7 @@ function skipInClassicAfterWave(wave: number, defaultWeight: number): WeightedMo
|
|||||||
/**
|
/**
|
||||||
* High order function that returns a WeightedModifierTypeWeightFunc that will only be applied on
|
* High order function that returns a WeightedModifierTypeWeightFunc that will only be applied on
|
||||||
* classic and it will skip a ModifierType if it is the last wave pull.
|
* classic and it will skip a ModifierType if it is the last wave pull.
|
||||||
* @param defaultWeight ModifierType default weight
|
* @param defaultWeight - ModifierType default weight
|
||||||
* @returns A WeightedModifierTypeWeightFunc
|
* @returns A WeightedModifierTypeWeightFunc
|
||||||
*/
|
*/
|
||||||
function skipInLastClassicWaveOrDefault(defaultWeight: number): WeightedModifierTypeWeightFunc {
|
function skipInLastClassicWaveOrDefault(defaultWeight: number): WeightedModifierTypeWeightFunc {
|
||||||
@ -1798,8 +1796,8 @@ function skipInLastClassicWaveOrDefault(defaultWeight: number): WeightedModifier
|
|||||||
/**
|
/**
|
||||||
* High order function that returns a WeightedModifierTypeWeightFunc to ensure Lures don't spawn on Classic 199
|
* High order function that returns a WeightedModifierTypeWeightFunc to ensure Lures don't spawn on Classic 199
|
||||||
* or if the lure still has over 60% of its duration left
|
* or if the lure still has over 60% of its duration left
|
||||||
* @param maxBattles The max battles the lure type in question lasts. 10 for green, 15 for Super, 30 for Max
|
* @param maxBattles - The max battles the lure type in question lasts. 10 for green, 15 for Super, 30 for Max
|
||||||
* @param weight The desired weight for the lure when it does spawn
|
* @param weight - The desired weight for the lure when it does spawn
|
||||||
* @returns A WeightedModifierTypeWeightFunc
|
* @returns A WeightedModifierTypeWeightFunc
|
||||||
*/
|
*/
|
||||||
function lureWeightFunc(maxBattles: number, weight: number): WeightedModifierTypeWeightFunc {
|
function lureWeightFunc(maxBattles: number, weight: number): WeightedModifierTypeWeightFunc {
|
||||||
@ -2399,7 +2397,7 @@ interface ModifierPool {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to check if the player has max of a given ball type in Classic
|
* Used to check if the player has max of a given ball type in Classic
|
||||||
* @param ballType The {@linkcode PokeballType} being checked
|
* @param ballType - The {@linkcode PokeballType} being checked
|
||||||
* @returns boolean: true if the player has the maximum of a given ball type
|
* @returns boolean: true if the player has the maximum of a given ball type
|
||||||
*/
|
*/
|
||||||
function hasMaximumBalls(ballType: PokeballType): boolean {
|
function hasMaximumBalls(ballType: PokeballType): boolean {
|
||||||
@ -3287,10 +3285,10 @@ export function getModifierTypeFuncById(id: string): ModifierTypeFunc {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates modifier options for a {@linkcode SelectModifierPhase}
|
* Generates modifier options for a {@linkcode SelectModifierPhase}
|
||||||
* @param count Determines the number of items to generate
|
* @param count - Determines the number of items to generate
|
||||||
* @param party Party is required for generating proper modifier pools
|
* @param party - Party is required for generating proper modifier pools
|
||||||
* @param modifierTiers (Optional) If specified, rolls items in the specified tiers. Commonly used for tier-locking with Lock Capsule.
|
* @param modifierTiers - (Optional) If specified, rolls items in the specified tiers. Commonly used for tier-locking with Lock Capsule.
|
||||||
* @param customModifierSettings (Optional) If specified, can customize the item shop rewards further.
|
* @param customModifierSettings - (Optional) If specified, can customize the item shop rewards further.
|
||||||
* - `guaranteedModifierTypeOptions?: ModifierTypeOption[]` If specified, will override the first X items to be specific modifier options (these should be pre-genned).
|
* - `guaranteedModifierTypeOptions?: ModifierTypeOption[]` If specified, will override the first X items to be specific modifier options (these should be pre-genned).
|
||||||
* - `guaranteedModifierTypeFuncs?: ModifierTypeFunc[]` If specified, will override the next X items to be auto-generated from specific modifier functions (these don't have to be pre-genned).
|
* - `guaranteedModifierTypeFuncs?: ModifierTypeFunc[]` If specified, will override the next X items to be auto-generated from specific modifier functions (these don't have to be pre-genned).
|
||||||
* - `guaranteedModifierTiers?: ModifierTier[]` If specified, will override the next X items to be the specified tier. These can upgrade with luck.
|
* - `guaranteedModifierTiers?: ModifierTier[]` If specified, will override the next X items to be the specified tier. These can upgrade with luck.
|
||||||
@ -3375,11 +3373,11 @@ export function getPlayerModifierTypeOptions(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Will generate a {@linkcode ModifierType} from the {@linkcode ModifierPoolType.PLAYER} pool, attempting to retry duplicated items up to retryCount
|
* Will generate a {@linkcode ModifierType} from the {@linkcode ModifierPoolType.PLAYER} pool, attempting to retry duplicated items up to retryCount
|
||||||
* @param existingOptions Currently generated options
|
* @param existingOptions - Currently generated options
|
||||||
* @param retryCount How many times to retry before allowing a dupe item
|
* @param retryCount - How many times to retry before allowing a dupe item
|
||||||
* @param party Current player party, used to calculate items in the pool
|
* @param party - Current player party, used to calculate items in the pool
|
||||||
* @param tier If specified will generate item of tier
|
* @param tier - If specified will generate item of tier
|
||||||
* @param allowLuckUpgrades `true` to allow items to upgrade tiers (the little animation that plays and is affected by luck)
|
* @param allowLuckUpgrades - `true` to allow items to upgrade tiers (the little animation that plays and is affected by luck)
|
||||||
*/
|
*/
|
||||||
function getModifierTypeOptionWithRetry(
|
function getModifierTypeOptionWithRetry(
|
||||||
existingOptions: ModifierTypeOption[],
|
existingOptions: ModifierTypeOption[],
|
||||||
@ -3412,8 +3410,8 @@ function getModifierTypeOptionWithRetry(
|
|||||||
* Replaces the {@linkcode ModifierType} of the entries within {@linkcode options} with any
|
* Replaces the {@linkcode ModifierType} of the entries within {@linkcode options} with any
|
||||||
* {@linkcode ModifierOverride} entries listed in {@linkcode Overrides.ITEM_REWARD_OVERRIDE}
|
* {@linkcode ModifierOverride} entries listed in {@linkcode Overrides.ITEM_REWARD_OVERRIDE}
|
||||||
* up to the smallest amount of entries between {@linkcode options} and the override array.
|
* up to the smallest amount of entries between {@linkcode options} and the override array.
|
||||||
* @param options Array of naturally rolled {@linkcode ModifierTypeOption}s
|
* @param options - Array of naturally rolled {@linkcode ModifierTypeOption}s
|
||||||
* @param party Array of the player's current party
|
* @param party - Array of the player's current party
|
||||||
*/
|
*/
|
||||||
export function overridePlayerModifierTypeOptions(options: ModifierTypeOption[], party: PlayerPokemon[]) {
|
export function overridePlayerModifierTypeOptions(options: ModifierTypeOption[], party: PlayerPokemon[]) {
|
||||||
const minLength = Math.min(options.length, Overrides.ITEM_REWARD_OVERRIDE.length);
|
const minLength = Math.min(options.length, Overrides.ITEM_REWARD_OVERRIDE.length);
|
||||||
@ -3553,12 +3551,12 @@ export function getDailyRunStarterModifiers(party: PlayerPokemon[]): PokemonHeld
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a ModifierType from the specified pool
|
* Generates a ModifierType from the specified pool
|
||||||
* @param party party of the trainer using the item
|
* @param party - party of the trainer using the item
|
||||||
* @param poolType PLAYER/WILD/TRAINER
|
* @param poolType - PLAYER/WILD/TRAINER
|
||||||
* @param tier If specified, will override the initial tier of an item (can still upgrade with luck)
|
* @param tier - If specified, will override the initial tier of an item (can still upgrade with luck)
|
||||||
* @param upgradeCount If defined, means that this is a new ModifierType being generated to override another via luck upgrade. Used for recursive logic
|
* @param upgradeCount - If defined, means that this is a new ModifierType being generated to override another via luck upgrade. Used for recursive logic
|
||||||
* @param retryCount Max allowed tries before the next tier down is checked for a valid ModifierType
|
* @param retryCount - Max allowed tries before the next tier down is checked for a valid ModifierType
|
||||||
* @param allowLuckUpgrades Default true. If false, will not allow ModifierType to randomly upgrade to next tier
|
* @param allowLuckUpgrades - Default true. If false, will not allow ModifierType to randomly upgrade to next tier
|
||||||
*/
|
*/
|
||||||
function getNewModifierTypeOption(
|
function getNewModifierTypeOption(
|
||||||
party: Pokemon[],
|
party: Pokemon[],
|
||||||
@ -3700,7 +3698,7 @@ export class ModifierTypeOption {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the team's luck value.
|
* Calculates the team's luck value.
|
||||||
* @param party The player's party.
|
* @param party - The player's party.
|
||||||
* @returns A number between 0 and 14 based on the party's total luck value, or a random number between 0 and 14 if the player is in Daily Run mode.
|
* @returns A number between 0 and 14 based on the party's total luck value, or a random number between 0 and 14 if the player is in Daily Run mode.
|
||||||
*/
|
*/
|
||||||
export function getPartyLuckValue(party: Pokemon[]): number {
|
export function getPartyLuckValue(party: Pokemon[]): number {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -234,9 +234,9 @@ export class EggHatchPhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function that animates egg shaking
|
* Function that animates egg shaking
|
||||||
* @param intensity of horizontal shaking. Doubled on the first call (where count is 0)
|
* @param intensity - of horizontal shaking. Doubled on the first call (where count is 0)
|
||||||
* @param repeatCount the number of times this function should be called (asynchronous recursion?!?)
|
* @param repeatCount - the number of times this function should be called (asynchronous recursion?!?)
|
||||||
* @param count the current number of times this function has been called.
|
* @param count - the current number of times this function has been called.
|
||||||
* @returns nothing since it's a Promise<void>
|
* @returns nothing since it's a Promise<void>
|
||||||
*/
|
*/
|
||||||
doEggShake(intensity: number, repeatCount?: number, count?: number): Promise<void> {
|
doEggShake(intensity: number, repeatCount?: number, count?: number): Promise<void> {
|
||||||
@ -408,8 +408,8 @@ export class EggHatchPhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to generate sine. (Why is this not a Utils?!?)
|
* Helper function to generate sine. (Why is this not a Utils?!?)
|
||||||
* @param index random number from 0-7 being passed in to scale pi/128
|
* @param index - random number from 0-7 being passed in to scale pi/128
|
||||||
* @param amplitude Scaling
|
* @param amplitude - Scaling
|
||||||
* @returns a number
|
* @returns a number
|
||||||
*/
|
*/
|
||||||
sin(index: number, amplitude: number): number {
|
sin(index: number, amplitude: number): number {
|
||||||
@ -418,8 +418,8 @@ export class EggHatchPhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Animates spraying
|
* Animates spraying
|
||||||
* @param intensity number of times this is repeated (this is a badly named variable)
|
* @param intensity - number of times this is repeated (this is a badly named variable)
|
||||||
* @param offsetY how much to offset the Y coordinates
|
* @param offsetY - how much to offset the Y coordinates
|
||||||
*/
|
*/
|
||||||
doSpray(intensity: number, offsetY?: number) {
|
doSpray(intensity: number, offsetY?: number) {
|
||||||
globalScene.tweens.addCounter({
|
globalScene.tweens.addCounter({
|
||||||
@ -433,8 +433,8 @@ export class EggHatchPhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Animates a particle used in the spray animation
|
* Animates a particle used in the spray animation
|
||||||
* @param trigIndex Used to modify the particle's vertical speed, is a random number from 0-7
|
* @param trigIndex - Used to modify the particle's vertical speed, is a random number from 0-7
|
||||||
* @param offsetY how much to offset the Y coordinate
|
* @param offsetY - how much to offset the Y coordinate
|
||||||
*/
|
*/
|
||||||
doSprayParticle(trigIndex: number, offsetY: number) {
|
doSprayParticle(trigIndex: number, offsetY: number) {
|
||||||
const initialX = this.eggHatchBg.displayWidth / 2;
|
const initialX = this.eggHatchBg.displayWidth / 2;
|
||||||
|
@ -77,7 +77,7 @@ export class EggLapsePhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Hatches eggs normally one by one, showing animations
|
* Hatches eggs normally one by one, showing animations
|
||||||
* @param eggsToHatch list of eggs to hatch
|
* @param eggsToHatch - list of eggs to hatch
|
||||||
*/
|
*/
|
||||||
hatchEggsRegular(eggsToHatch: Egg[]) {
|
hatchEggsRegular(eggsToHatch: Egg[]) {
|
||||||
let eggsToHatchCount: number = eggsToHatch.length;
|
let eggsToHatchCount: number = eggsToHatch.length;
|
||||||
@ -89,7 +89,7 @@ export class EggLapsePhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Hatches eggs with no animations
|
* Hatches eggs with no animations
|
||||||
* @param eggsToHatch list of eggs to hatch
|
* @param eggsToHatch - list of eggs to hatch
|
||||||
*/
|
*/
|
||||||
hatchEggsSkipped(eggsToHatch: Egg[]) {
|
hatchEggsSkipped(eggsToHatch: Egg[]) {
|
||||||
for (const egg of eggsToHatch) {
|
for (const egg of eggsToHatch) {
|
||||||
@ -105,7 +105,7 @@ export class EggLapsePhase extends Phase {
|
|||||||
/**
|
/**
|
||||||
* Hatches an egg and stores it in the local EggHatchData array without animations
|
* Hatches an egg and stores it in the local EggHatchData array without animations
|
||||||
* Also validates the achievements for the hatched pokemon and removes the egg
|
* Also validates the achievements for the hatched pokemon and removes the egg
|
||||||
* @param egg egg to hatch
|
* @param egg - egg to hatch
|
||||||
*/
|
*/
|
||||||
hatchEggSilently(egg: Egg) {
|
hatchEggSilently(egg: Egg) {
|
||||||
const eggIndex = globalScene.gameData.eggs.findIndex(e => e.id === egg.id);
|
const eggIndex = globalScene.gameData.eggs.findIndex(e => e.id === egg.id);
|
||||||
@ -136,7 +136,7 @@ export class EggLapsePhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a Pokemon and creates a new EggHatchData instance for the given egg
|
* Generates a Pokemon and creates a new EggHatchData instance for the given egg
|
||||||
* @param egg the egg to hatch
|
* @param egg - the egg to hatch
|
||||||
* @returns the hatched PlayerPokemon
|
* @returns the hatched PlayerPokemon
|
||||||
*/
|
*/
|
||||||
generatePokemon(egg: Egg): EggHatchData {
|
generatePokemon(egg: Egg): EggHatchData {
|
||||||
|
@ -72,8 +72,8 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
* > [Pokemon] wants to learn the move [MoveName]
|
* > [Pokemon] wants to learn the move [MoveName]
|
||||||
* > However, [Pokemon] already knows four moves.
|
* > However, [Pokemon] already knows four moves.
|
||||||
* > Should a move be forgotten and replaced with [MoveName]? --> `Mode.CONFIRM` -> Yes: Go to `this.forgetMoveProcess()`, No: Go to `this.rejectMoveAndEnd()`
|
* > Should a move be forgotten and replaced with [MoveName]? --> `Mode.CONFIRM` -> Yes: Go to `this.forgetMoveProcess()`, No: Go to `this.rejectMoveAndEnd()`
|
||||||
* @param move The Move to be learned
|
* @param move - The Move to be learned
|
||||||
* @param Pokemon The Pokemon learning the move
|
* @param Pokemon - The Pokemon learning the move
|
||||||
*/
|
*/
|
||||||
async replaceMoveCheck(move: Move, pokemon: Pokemon) {
|
async replaceMoveCheck(move: Move, pokemon: Pokemon) {
|
||||||
const learnMovePrompt = i18next.t("battle:learnMovePrompt", {
|
const learnMovePrompt = i18next.t("battle:learnMovePrompt", {
|
||||||
@ -108,8 +108,8 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
* The game then goes `Mode.SUMMARY` to select a move to be forgotten.
|
* The game then goes `Mode.SUMMARY` to select a move to be forgotten.
|
||||||
* If a player does not select a move or chooses the new move (`moveIndex === 4`), the game goes to `this.rejectMoveAndEnd()`.
|
* If a player does not select a move or chooses the new move (`moveIndex === 4`), the game goes to `this.rejectMoveAndEnd()`.
|
||||||
* If an old move is selected, the function then passes the `moveIndex` to `this.learnMove()`
|
* If an old move is selected, the function then passes the `moveIndex` to `this.learnMove()`
|
||||||
* @param move The Move to be learned
|
* @param move - The Move to be learned
|
||||||
* @param Pokemon The Pokemon learning the move
|
* @param Pokemon - The Pokemon learning the move
|
||||||
*/
|
*/
|
||||||
async forgetMoveProcess(move: Move, pokemon: Pokemon) {
|
async forgetMoveProcess(move: Move, pokemon: Pokemon) {
|
||||||
globalScene.ui.setMode(this.messageMode);
|
globalScene.ui.setMode(this.messageMode);
|
||||||
@ -143,8 +143,8 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
*
|
*
|
||||||
* If the player wishes to not teach the Pokemon the move, it displays a message and ends the phase.
|
* If the player wishes to not teach the Pokemon the move, it displays a message and ends the phase.
|
||||||
* If the player reconsiders, it repeats the process for a Pokemon with a full moveset once again.
|
* If the player reconsiders, it repeats the process for a Pokemon with a full moveset once again.
|
||||||
* @param move The Move to be learned
|
* @param move - The Move to be learned
|
||||||
* @param Pokemon The Pokemon learning the move
|
* @param Pokemon - The Pokemon learning the move
|
||||||
*/
|
*/
|
||||||
async rejectMoveAndEnd(move: Move, pokemon: Pokemon) {
|
async rejectMoveAndEnd(move: Move, pokemon: Pokemon) {
|
||||||
await globalScene.ui.showTextPromise(
|
await globalScene.ui.showTextPromise(
|
||||||
@ -186,8 +186,8 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
|||||||
* > [Pokemon] forgot how to use [MoveName]
|
* > [Pokemon] forgot how to use [MoveName]
|
||||||
* > And...
|
* > And...
|
||||||
* > [Pokemon] learned [MoveName]!
|
* > [Pokemon] learned [MoveName]!
|
||||||
* @param move The Move to be learned
|
* @param move - The Move to be learned
|
||||||
* @param Pokemon The Pokemon learning the move
|
* @param Pokemon - The Pokemon learning the move
|
||||||
*/
|
*/
|
||||||
async learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) {
|
async learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) {
|
||||||
if (this.learnMoveType === LearnMoveType.TM) {
|
if (this.learnMoveType === LearnMoveType.TM) {
|
||||||
|
@ -13,7 +13,6 @@ import { MoveEndPhase } from "#app/phases/move-end-phase";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Phase for the "charging turn" of two-turn moves (e.g. Dig).
|
* Phase for the "charging turn" of two-turn moves (e.g. Dig).
|
||||||
* @extends {@linkcode PokemonPhase}
|
|
||||||
*/
|
*/
|
||||||
export class MoveChargePhase extends PokemonPhase {
|
export class MoveChargePhase extends PokemonPhase {
|
||||||
/** The move instance that this phase applies */
|
/** The move instance that this phase applies */
|
||||||
|
@ -78,7 +78,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
protected reflected = false;
|
protected reflected = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param reflected Indicates that the move was reflected by the user due to magic coat or magic bounce
|
* @param reflected - Indicates that the move was reflected by the user due to magic coat or magic bounce
|
||||||
*/
|
*/
|
||||||
constructor(battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove, reflected = false) {
|
constructor(battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove, reflected = false) {
|
||||||
super(battlerIndex);
|
super(battlerIndex);
|
||||||
|
@ -87,9 +87,9 @@ export class MovePhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param followUp Indicates that the move being used is a "follow-up" - for example, a move being used by Metronome or Dancer.
|
* @param followUp - Indicates that the move being used is a "follow-up" - for example, a move being used by Metronome or Dancer.
|
||||||
* Follow-ups bypass a few failure conditions, including flinches, sleep/paralysis/freeze and volatile status checks, etc.
|
* Follow-ups bypass a few failure conditions, including flinches, sleep/paralysis/freeze and volatile status checks, etc.
|
||||||
* @param reflected Indicates that the move was reflected by Magic Coat or Magic Bounce.
|
* @param reflected - Indicates that the move was reflected by Magic Coat or Magic Bounce.
|
||||||
* Reflected moves cannot be reflected again and will not trigger Dancer.
|
* Reflected moves cannot be reflected again and will not trigger Dancer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the pokemon is active, if the move is usable, and that the move is targetting something.
|
* Checks if the pokemon is active, if the move is usable, and that the move is targetting something.
|
||||||
* @param ignoreDisableTags `true` to not check if the move is disabled
|
* @param ignoreDisableTags - `true` to not check if the move is disabled
|
||||||
* @returns `true` if all the checks pass
|
* @returns `true` if all the checks pass
|
||||||
*/
|
*/
|
||||||
public canMove(ignoreDisableTags = false): boolean {
|
public canMove(ignoreDisableTags = false): boolean {
|
||||||
|
@ -43,7 +43,7 @@ export class MysteryEncounterPhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Mostly useful for having repeated queries during a single encounter, where the queries and options may differ each time
|
* Mostly useful for having repeated queries during a single encounter, where the queries and options may differ each time
|
||||||
* @param optionSelectSettings allows overriding the typical options of an encounter with new ones
|
* @param optionSelectSettings - allows overriding the typical options of an encounter with new ones
|
||||||
*/
|
*/
|
||||||
constructor(optionSelectSettings?: OptionSelectSettings) {
|
constructor(optionSelectSettings?: OptionSelectSettings) {
|
||||||
super();
|
super();
|
||||||
|
@ -36,7 +36,7 @@ export class SelectStarterPhase extends Phase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize starters before starting the first battle
|
* Initialize starters before starting the first battle
|
||||||
* @param starters {@linkcode Pokemon} with which to start the first battle
|
* @param starters - with which to start the first battle
|
||||||
*/
|
*/
|
||||||
initBattle(starters: Starter[]) {
|
initBattle(starters: Starter[]) {
|
||||||
const party = globalScene.getPlayerParty();
|
const party = globalScene.getPlayerParty();
|
||||||
|
@ -18,11 +18,11 @@ export class SwitchPhase extends BattlePhase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new SwitchPhase
|
* Creates a new SwitchPhase
|
||||||
* @param switchType {@linkcode SwitchType} The type of switch logic this phase implements
|
* @param switchType - The type of switch logic this phase implements
|
||||||
* @param fieldIndex Field index to switch out
|
* @param fieldIndex - Field index to switch out
|
||||||
* @param isModal Indicates if the switch should be forced (true) or is
|
* @param isModal - Indicates if the switch should be forced (true) or is
|
||||||
* optional (false).
|
* optional (false).
|
||||||
* @param doReturn Indicates if the party member on the field should be
|
* @param doReturn - Indicates if the party member on the field should be
|
||||||
* recalled to ball or has already left the field. Passed to {@linkcode SwitchSummonPhase}.
|
* recalled to ball or has already left the field. Passed to {@linkcode SwitchSummonPhase}.
|
||||||
*/
|
*/
|
||||||
constructor(switchType: SwitchType, fieldIndex: number, isModal: boolean, doReturn: boolean) {
|
constructor(switchType: SwitchType, fieldIndex: number, isModal: boolean, doReturn: boolean) {
|
||||||
|
@ -20,7 +20,7 @@ export abstract class ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a GET request.
|
* Send a GET request.
|
||||||
* @param path The path to send the request to.
|
* @param path - The path to send the request to.
|
||||||
*/
|
*/
|
||||||
protected async doGet(path: string) {
|
protected async doGet(path: string) {
|
||||||
return this.doFetch(path, { method: "GET" });
|
return this.doFetch(path, { method: "GET" });
|
||||||
@ -28,9 +28,9 @@ export abstract class ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a POST request.
|
* Send a POST request.
|
||||||
* @param path THe path to send the request to.
|
* @param path - THe path to send the request to.
|
||||||
* @param bodyData The body-data to send.
|
* @param bodyData - The body-data to send.
|
||||||
* @param dataType The data-type of the {@linkcode bodyData}.
|
* @param dataType - The data-type of the {@linkcode bodyData}.
|
||||||
*/
|
*/
|
||||||
protected async doPost<D = undefined>(path: string, bodyData?: D, dataType: DataType = "json") {
|
protected async doPost<D = undefined>(path: string, bodyData?: D, dataType: DataType = "json") {
|
||||||
let body: string | undefined = undefined;
|
let body: string | undefined = undefined;
|
||||||
@ -59,8 +59,8 @@ export abstract class ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A generic request helper.
|
* A generic request helper.
|
||||||
* @param path The path to send the request to.
|
* @param path - The path to send the request to.
|
||||||
* @param config The request {@linkcode RequestInit | Configuration}.
|
* @param config - The request {@linkcode RequestInit | Configuration}.
|
||||||
*/
|
*/
|
||||||
protected async doFetch(path: string, config: RequestInit): Promise<Response> {
|
protected async doFetch(path: string, config: RequestInit): Promise<Response> {
|
||||||
config.headers = {
|
config.headers = {
|
||||||
@ -80,7 +80,7 @@ export abstract class ApiBase {
|
|||||||
* Helper to transform data to {@linkcode URLSearchParams}
|
* Helper to transform data to {@linkcode URLSearchParams}
|
||||||
* Any key with a value of `undefined` will be ignored.
|
* Any key with a value of `undefined` will be ignored.
|
||||||
* Any key with a value of `null` will be included.
|
* Any key with a value of `null` will be included.
|
||||||
* @param data the data to transform to {@linkcode URLSearchParams}
|
* @param data - the data to transform to {@linkcode URLSearchParams}
|
||||||
* @returns a {@linkcode URLSearchParams} representaton of {@linkcode data}
|
* @returns a {@linkcode URLSearchParams} representaton of {@linkcode data}
|
||||||
*/
|
*/
|
||||||
protected toUrlSearchParams<D extends Record<string, any>>(data: D) {
|
protected toUrlSearchParams<D extends Record<string, any>>(data: D) {
|
||||||
|
@ -36,7 +36,7 @@ export class PokerogueAccountApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a new account.
|
* Register a new account.
|
||||||
* @param registerData The {@linkcode AccountRegisterRequest} to send
|
* @param registerData - The {@linkcode AccountRegisterRequest} to send
|
||||||
* @returns An error message if something went wrong
|
* @returns An error message if something went wrong
|
||||||
*/
|
*/
|
||||||
public async register(registerData: AccountRegisterRequest) {
|
public async register(registerData: AccountRegisterRequest) {
|
||||||
@ -57,7 +57,7 @@ export class PokerogueAccountApi extends ApiBase {
|
|||||||
/**
|
/**
|
||||||
* Send a login request.
|
* Send a login request.
|
||||||
* Sets the session cookie on success.
|
* Sets the session cookie on success.
|
||||||
* @param loginData The {@linkcode AccountLoginRequest} to send
|
* @param loginData - The {@linkcode AccountLoginRequest} to send
|
||||||
* @returns An error message if something went wrong
|
* @returns An error message if something went wrong
|
||||||
*/
|
*/
|
||||||
public async login(loginData: AccountLoginRequest) {
|
public async login(loginData: AccountLoginRequest) {
|
||||||
|
@ -13,7 +13,7 @@ export class PokerogueAdminApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Links an account to a discord id.
|
* Links an account to a discord id.
|
||||||
* @param params The {@linkcode LinkAccountToDiscordIdRequest} to send
|
* @param params - The {@linkcode LinkAccountToDiscordIdRequest} to send
|
||||||
* @returns `null` if successful, error message if not
|
* @returns `null` if successful, error message if not
|
||||||
*/
|
*/
|
||||||
public async linkAccountToDiscord(params: LinkAccountToDiscordIdRequest) {
|
public async linkAccountToDiscord(params: LinkAccountToDiscordIdRequest) {
|
||||||
@ -37,7 +37,7 @@ export class PokerogueAdminApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlinks an account from a discord id.
|
* Unlinks an account from a discord id.
|
||||||
* @param params The {@linkcode UnlinkAccountFromDiscordIdRequest} to send
|
* @param params - The {@linkcode UnlinkAccountFromDiscordIdRequest} to send
|
||||||
* @returns `null` if successful, error message if not
|
* @returns `null` if successful, error message if not
|
||||||
*/
|
*/
|
||||||
public async unlinkAccountFromDiscord(params: UnlinkAccountFromDiscordIdRequest) {
|
public async unlinkAccountFromDiscord(params: UnlinkAccountFromDiscordIdRequest) {
|
||||||
@ -61,7 +61,7 @@ export class PokerogueAdminApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Links an account to a google id.
|
* Links an account to a google id.
|
||||||
* @param params The {@linkcode LinkAccountToGoogledIdRequest} to send
|
* @param params - The {@linkcode LinkAccountToGoogledIdRequest} to send
|
||||||
* @returns `null` if successful, error message if not
|
* @returns `null` if successful, error message if not
|
||||||
*/
|
*/
|
||||||
public async linkAccountToGoogleId(params: LinkAccountToGoogledIdRequest) {
|
public async linkAccountToGoogleId(params: LinkAccountToGoogledIdRequest) {
|
||||||
@ -85,7 +85,7 @@ export class PokerogueAdminApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlinks an account from a google id.
|
* Unlinks an account from a google id.
|
||||||
* @param params The {@linkcode UnlinkAccountFromGoogledIdRequest} to send
|
* @param params - The {@linkcode UnlinkAccountFromGoogledIdRequest} to send
|
||||||
* @returns `null` if successful, error message if not
|
* @returns `null` if successful, error message if not
|
||||||
*/
|
*/
|
||||||
public async unlinkAccountFromGoogleId(params: UnlinkAccountFromGoogledIdRequest) {
|
public async unlinkAccountFromGoogleId(params: UnlinkAccountFromGoogledIdRequest) {
|
||||||
@ -109,7 +109,7 @@ export class PokerogueAdminApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Search an account.
|
* Search an account.
|
||||||
* @param params The {@linkcode SearchAccountRequest} to send
|
* @param params - The {@linkcode SearchAccountRequest} to send
|
||||||
* @returns an array of {@linkcode SearchAccountResponse} and error. Both can be `undefined`
|
* @returns an array of {@linkcode SearchAccountResponse} and error. Both can be `undefined`
|
||||||
*/
|
*/
|
||||||
public async searchAccount(params: SearchAccountRequest): Promise<[data?: SearchAccountResponse, error?: string]> {
|
public async searchAccount(params: SearchAccountRequest): Promise<[data?: SearchAccountResponse, error?: string]> {
|
||||||
|
@ -24,7 +24,7 @@ export class PokerogueDailyApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the daily rankings for a {@linkcode ScoreboardCategory}.
|
* Get the daily rankings for a {@linkcode ScoreboardCategory}.
|
||||||
* @param params The {@linkcode GetDailyRankingsRequest} to send
|
* @param params - The {@linkcode GetDailyRankingsRequest} to send
|
||||||
*/
|
*/
|
||||||
public async getRankings(params: GetDailyRankingsRequest) {
|
public async getRankings(params: GetDailyRankingsRequest) {
|
||||||
try {
|
try {
|
||||||
@ -40,7 +40,7 @@ export class PokerogueDailyApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the page count of the daily rankings for a {@linkcode ScoreboardCategory}.
|
* Get the page count of the daily rankings for a {@linkcode ScoreboardCategory}.
|
||||||
* @param params The {@linkcode GetDailyRankingsPageCountRequest} to send.
|
* @param params - The {@linkcode GetDailyRankingsPageCountRequest} to send.
|
||||||
*/
|
*/
|
||||||
public async getRankingsPageCount(params: GetDailyRankingsPageCountRequest) {
|
public async getRankingsPageCount(params: GetDailyRankingsPageCountRequest) {
|
||||||
try {
|
try {
|
||||||
|
@ -23,7 +23,7 @@ export class PokerogueSavedataApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update all savedata
|
* Update all savedata
|
||||||
* @param bodyData The {@linkcode UpdateAllSavedataRequest | request data} to send
|
* @param bodyData - The {@linkcode UpdateAllSavedataRequest | request data} to send
|
||||||
* @returns An error message if something went wrong
|
* @returns An error message if something went wrong
|
||||||
*/
|
*/
|
||||||
public async updateAll(bodyData: UpdateAllSavedataRequest) {
|
public async updateAll(bodyData: UpdateAllSavedataRequest) {
|
||||||
|
@ -18,7 +18,7 @@ export class PokerogueSessionSavedataApi extends ApiBase {
|
|||||||
/**
|
/**
|
||||||
* Mark a session as cleared aka "newclear".\
|
* Mark a session as cleared aka "newclear".\
|
||||||
* *This is **NOT** the same as {@linkcode clear | clear()}.*
|
* *This is **NOT** the same as {@linkcode clear | clear()}.*
|
||||||
* @param params The {@linkcode NewClearSessionSavedataRequest} to send
|
* @param params - The {@linkcode NewClearSessionSavedataRequest} to send
|
||||||
* @returns The raw savedata as `string`.
|
* @returns The raw savedata as `string`.
|
||||||
*/
|
*/
|
||||||
public async newclear(params: NewClearSessionSavedataRequest) {
|
public async newclear(params: NewClearSessionSavedataRequest) {
|
||||||
@ -36,7 +36,7 @@ export class PokerogueSessionSavedataApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a session savedata.
|
* Get a session savedata.
|
||||||
* @param params The {@linkcode GetSessionSavedataRequest} to send
|
* @param params - The {@linkcode GetSessionSavedataRequest} to send
|
||||||
* @returns The session as `string`
|
* @returns The session as `string`
|
||||||
*/
|
*/
|
||||||
public async get(params: GetSessionSavedataRequest) {
|
public async get(params: GetSessionSavedataRequest) {
|
||||||
@ -53,8 +53,8 @@ export class PokerogueSessionSavedataApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a session savedata.
|
* Update a session savedata.
|
||||||
* @param params The {@linkcode UpdateSessionSavedataRequest} to send
|
* @param params - The {@linkcode UpdateSessionSavedataRequest} to send
|
||||||
* @param rawSavedata The raw savedata (as `string`)
|
* @param rawSavedata - The raw savedata (as `string`)
|
||||||
* @returns An error message if something went wrong
|
* @returns An error message if something went wrong
|
||||||
*/
|
*/
|
||||||
public async update(params: UpdateSessionSavedataRequest, rawSavedata: string) {
|
public async update(params: UpdateSessionSavedataRequest, rawSavedata: string) {
|
||||||
@ -72,7 +72,7 @@ export class PokerogueSessionSavedataApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a session savedata slot.
|
* Delete a session savedata slot.
|
||||||
* @param params The {@linkcode DeleteSessionSavedataRequest} to send
|
* @param params - The {@linkcode DeleteSessionSavedataRequest} to send
|
||||||
* @returns An error message if something went wrong
|
* @returns An error message if something went wrong
|
||||||
*/
|
*/
|
||||||
public async delete(params: DeleteSessionSavedataRequest) {
|
public async delete(params: DeleteSessionSavedataRequest) {
|
||||||
@ -93,8 +93,8 @@ export class PokerogueSessionSavedataApi extends ApiBase {
|
|||||||
/**
|
/**
|
||||||
* Clears the session savedata of the given slot.\
|
* Clears the session savedata of the given slot.\
|
||||||
* *This is **NOT** the same as {@linkcode newclear | newclear()}.*
|
* *This is **NOT** the same as {@linkcode newclear | newclear()}.*
|
||||||
* @param params The {@linkcode ClearSessionSavedataRequest} to send
|
* @param params - The {@linkcode ClearSessionSavedataRequest} to send
|
||||||
* @param sessionData The {@linkcode SessionSaveData} object
|
* @param sessionData - The {@linkcode SessionSaveData} object
|
||||||
*/
|
*/
|
||||||
public async clear(params: ClearSessionSavedataRequest, sessionData: SessionSaveData) {
|
public async clear(params: ClearSessionSavedataRequest, sessionData: SessionSaveData) {
|
||||||
try {
|
try {
|
||||||
|
@ -14,7 +14,7 @@ export class PokerogueSystemSavedataApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a system savedata.
|
* Get a system savedata.
|
||||||
* @param params The {@linkcode GetSystemSavedataRequest} to send
|
* @param params - The {@linkcode GetSystemSavedataRequest} to send
|
||||||
* @returns The system savedata as `string` or `null` on error
|
* @returns The system savedata as `string` or `null` on error
|
||||||
*/
|
*/
|
||||||
public async get(params: GetSystemSavedataRequest) {
|
public async get(params: GetSystemSavedataRequest) {
|
||||||
@ -33,7 +33,7 @@ export class PokerogueSystemSavedataApi extends ApiBase {
|
|||||||
/**
|
/**
|
||||||
* Verify if the session is valid.
|
* Verify if the session is valid.
|
||||||
* If not the {@linkcode SystemSaveData} is returned.
|
* If not the {@linkcode SystemSaveData} is returned.
|
||||||
* @param params The {@linkcode VerifySystemSavedataRequest} to send
|
* @param params - The {@linkcode VerifySystemSavedataRequest} to send
|
||||||
* @returns A {@linkcode SystemSaveData} if **NOT** valid, otherwise `null`.
|
* @returns A {@linkcode SystemSaveData} if **NOT** valid, otherwise `null`.
|
||||||
*
|
*
|
||||||
* TODO: add handling for errors
|
* TODO: add handling for errors
|
||||||
@ -58,8 +58,8 @@ export class PokerogueSystemSavedataApi extends ApiBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a system savedata.
|
* Update a system savedata.
|
||||||
* @param params The {@linkcode UpdateSystemSavedataRequest} to send
|
* @param params - The {@linkcode UpdateSystemSavedataRequest} to send
|
||||||
* @param rawSystemData The raw {@linkcode SystemSaveData}
|
* @param rawSystemData - The raw {@linkcode SystemSaveData}
|
||||||
* @returns An error message if something went wrong
|
* @returns An error message if something went wrong
|
||||||
*/
|
*/
|
||||||
public async update(params: UpdateSystemSavedataRequest, rawSystemData: string) {
|
public async update(params: UpdateSystemSavedataRequest, rawSystemData: string) {
|
||||||
|
@ -125,7 +125,7 @@ async function initFonts(language: string | undefined) {
|
|||||||
* *If you don't want the BBCode tag applied, just use 'number' formatter*
|
* *If you don't want the BBCode tag applied, just use 'number' formatter*
|
||||||
* @example Input: `{{myMoneyValue, money}}`
|
* @example Input: `{{myMoneyValue, money}}`
|
||||||
* Output: `@[MONEY]{₽100,000,000}`
|
* Output: `@[MONEY]{₽100,000,000}`
|
||||||
* @param amount the money amount
|
* @param amount - the money amount
|
||||||
* @returns a money formatted string
|
* @returns a money formatted string
|
||||||
*/
|
*/
|
||||||
function i18nMoneyFormatter(amount: any): string {
|
function i18nMoneyFormatter(amount: any): string {
|
||||||
|
@ -4,8 +4,8 @@ import type { Plugin as VitePlugin } from "vite";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Crawl a directory (recursively if wanted) for json files and minifies found ones.
|
* Crawl a directory (recursively if wanted) for json files and minifies found ones.
|
||||||
* @param dir the directory to crawl
|
* @param dir - the directory to crawl
|
||||||
* @param recursive if true, will crawl subdirectories
|
* @param recursive - if true, will crawl subdirectories
|
||||||
*/
|
*/
|
||||||
function applyToDir(dir: string, recursive?: boolean) {
|
function applyToDir(dir: string, recursive?: boolean) {
|
||||||
const files = fs.readdirSync(dir).filter(file => !/^\..*/.test(file));
|
const files = fs.readdirSync(dir).filter(file => !/^\..*/.test(file));
|
||||||
@ -27,8 +27,8 @@ function applyToDir(dir: string, recursive?: boolean) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin to mnify json files in the build folder after the bundling is done.
|
* Plugin to mnify json files in the build folder after the bundling is done.
|
||||||
* @param basePath base path/es starting inside the build dir (e.g. will always start with "/dist" if dist is the build dir)
|
* @param basePath - base path/es starting inside the build dir (e.g. will always start with "/dist" if dist is the build dir)
|
||||||
* @param recursive if true, will crawl subdirectories
|
* @param recursive - if true, will crawl subdirectories
|
||||||
*/
|
*/
|
||||||
export function minifyJsonPlugin(basePath: string | string[], recursive?: boolean): VitePlugin {
|
export function minifyJsonPlugin(basePath: string | string[], recursive?: boolean): VitePlugin {
|
||||||
let buildDir = "dist"; // Default build dir
|
let buildDir = "dist"; // Default build dir
|
||||||
|
@ -204,7 +204,7 @@ export class ChallengeAchv extends Achv {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the description of an achievement from the localization file with all the necessary variables filled in
|
* Get the description of an achievement from the localization file with all the necessary variables filled in
|
||||||
* @param localizationKey The localization key of the achievement
|
* @param localizationKey - The localization key of the achievement
|
||||||
* @returns The description of the achievement
|
* @returns The description of the achievement
|
||||||
*/
|
*/
|
||||||
export function getAchievementDescription(localizationKey: string): string {
|
export function getAchievementDescription(localizationKey: string): string {
|
||||||
|
@ -409,7 +409,7 @@ export class GameData {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if an `Unlockable` has been unlocked.
|
* Checks if an `Unlockable` has been unlocked.
|
||||||
* @param unlockable The Unlockable to check
|
* @param unlockable - The Unlockable to check
|
||||||
* @returns `true` if the player has unlocked this `Unlockable` or an override has enabled it
|
* @returns `true` if the player has unlocked this `Unlockable` or an override has enabled it
|
||||||
*/
|
*/
|
||||||
public isUnlocked(unlockable: Unlockables): boolean {
|
public isUnlocked(unlockable: Unlockables): boolean {
|
||||||
@ -663,8 +663,8 @@ export class GameData {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a new entry to Run History
|
* Saves a new entry to Run History
|
||||||
* @param runEntry: most recent SessionSaveData of the run
|
* @param runEntry: - most recent SessionSaveData of the run
|
||||||
* @param isVictory: result of the run
|
* @param isVictory: - result of the run
|
||||||
* Arbitrary limit of 25 runs per player - Will delete runs, starting with the oldest one, if needed
|
* Arbitrary limit of 25 runs per player - Will delete runs, starting with the oldest one, if needed
|
||||||
*/
|
*/
|
||||||
async saveRunHistory(runEntry: SessionSaveData, isVictory: boolean): Promise<boolean> {
|
async saveRunHistory(runEntry: SessionSaveData, isVictory: boolean): Promise<boolean> {
|
||||||
@ -773,8 +773,8 @@ export class GameData {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a setting to localStorage
|
* Saves a setting to localStorage
|
||||||
* @param setting string ideally of SettingKeys
|
* @param setting - string ideally of SettingKeys
|
||||||
* @param valueIndex index of the setting's option
|
* @param valueIndex - index of the setting's option
|
||||||
* @returns true
|
* @returns true
|
||||||
*/
|
*/
|
||||||
public saveSetting(setting: string, valueIndex: number): boolean {
|
public saveSetting(setting: string, valueIndex: number): boolean {
|
||||||
@ -1234,7 +1234,7 @@ export class GameData {
|
|||||||
/**
|
/**
|
||||||
* Delete the session data at the given slot when overwriting a save file
|
* Delete the session data at the given slot when overwriting a save file
|
||||||
* For deleting the session of a finished run, use {@linkcode tryClearSession}
|
* For deleting the session of a finished run, use {@linkcode tryClearSession}
|
||||||
* @param slotId the slot to clear
|
* @param slotId - the slot to clear
|
||||||
* @returns Promise with result `true` if the session was deleted successfully, `false` otherwise
|
* @returns Promise with result `true` if the session was deleted successfully, `false` otherwise
|
||||||
*/
|
*/
|
||||||
deleteSession(slotId: number): Promise<boolean> {
|
deleteSession(slotId: number): Promise<boolean> {
|
||||||
@ -1971,8 +1971,8 @@ export class GameData {
|
|||||||
*
|
*
|
||||||
* @param species
|
* @param species
|
||||||
* @param eggMoveIndex
|
* @param eggMoveIndex
|
||||||
* @param showMessage Default true. If true, will display message for unlocked egg move
|
* @param showMessage - Default true. If true, will display message for unlocked egg move
|
||||||
* @param prependSpeciesToMessage Default false. If true, will change message from "X Egg Move Unlocked!" to "Bulbasaur X Egg Move Unlocked!"
|
* @param prependSpeciesToMessage - Default false. If true, will change message from "X Egg Move Unlocked!" to "Bulbasaur X Egg Move Unlocked!"
|
||||||
*/
|
*/
|
||||||
setEggMoveUnlocked(
|
setEggMoveUnlocked(
|
||||||
species: PokemonSpecies,
|
species: PokemonSpecies,
|
||||||
|
@ -709,7 +709,7 @@ if (isLocal) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the index of a Setting
|
* Return the index of a Setting
|
||||||
* @param key SettingKey
|
* @param key - SettingKey
|
||||||
* @returns index or -1 if doesn't exist
|
* @returns index or -1 if doesn't exist
|
||||||
*/
|
*/
|
||||||
export function settingIndex(key: string) {
|
export function settingIndex(key: string) {
|
||||||
@ -727,8 +727,8 @@ export function resetSettings() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a setting
|
* Updates a setting
|
||||||
* @param setting string ideally from SettingKeys
|
* @param setting - string ideally from SettingKeys
|
||||||
* @param value value to update setting with
|
* @param value - value to update setting with
|
||||||
* @returns true if successful, false if not
|
* @returns true if successful, false if not
|
||||||
*/
|
*/
|
||||||
export function setSetting(setting: string, value: number): boolean {
|
export function setSetting(setting: string, value: number): boolean {
|
||||||
|
@ -110,7 +110,7 @@ const applyMigrators = (migrators: readonly SaveMigrator[], data: SaveData, save
|
|||||||
* Note that no transforms act on the {@linkcode data} if its version matches
|
* Note that no transforms act on the {@linkcode data} if its version matches
|
||||||
* the current version or if there are no migrations made between its version up
|
* the current version or if there are no migrations made between its version up
|
||||||
* to the current version.
|
* to the current version.
|
||||||
* @param data {@linkcode SystemSaveData}
|
* @param data
|
||||||
* @see {@link SystemVersionConverter}
|
* @see {@link SystemVersionConverter}
|
||||||
*/
|
*/
|
||||||
export function applySystemVersionMigration(data: SystemSaveData) {
|
export function applySystemVersionMigration(data: SystemSaveData) {
|
||||||
@ -130,7 +130,7 @@ export function applySystemVersionMigration(data: SystemSaveData) {
|
|||||||
* Note that no transforms act on the {@linkcode data} if its version matches
|
* Note that no transforms act on the {@linkcode data} if its version matches
|
||||||
* the current version or if there are no migrations made between its version up
|
* the current version or if there are no migrations made between its version up
|
||||||
* to the current version.
|
* to the current version.
|
||||||
* @param data {@linkcode SessionSaveData}
|
* @param data
|
||||||
* @see {@link SessionVersionConverter}
|
* @see {@link SessionVersionConverter}
|
||||||
*/
|
*/
|
||||||
export function applySessionVersionMigration(data: SessionSaveData) {
|
export function applySessionVersionMigration(data: SessionSaveData) {
|
||||||
@ -153,7 +153,7 @@ export function applySessionVersionMigration(data: SessionSaveData) {
|
|||||||
* Note that no transforms act on the {@linkcode data} if its version matches
|
* Note that no transforms act on the {@linkcode data} if its version matches
|
||||||
* the current version or if there are no migrations made between its version up
|
* the current version or if there are no migrations made between its version up
|
||||||
* to the current version.
|
* to the current version.
|
||||||
* @param data Settings data object
|
* @param data - Settings data object
|
||||||
* @see {@link SettingsVersionConverter}
|
* @see {@link SettingsVersionConverter}
|
||||||
*/
|
*/
|
||||||
// biome-ignore lint/complexity/noBannedTypes: TODO - refactor settings
|
// biome-ignore lint/complexity/noBannedTypes: TODO - refactor settings
|
||||||
|
@ -488,7 +488,7 @@ export class TimedEventManager {
|
|||||||
/**
|
/**
|
||||||
* Gets all the modifier types associated with a certain wave during an event
|
* Gets all the modifier types associated with a certain wave during an event
|
||||||
* @see EventWaveReward
|
* @see EventWaveReward
|
||||||
* @param wave the wave to check for associated rewards
|
* @param wave - the wave to check for associated rewards
|
||||||
* @returns array of strings of the event modifier reward types
|
* @returns array of strings of the event modifier reward types
|
||||||
*/
|
*/
|
||||||
getFixedBattleEventRewards(wave: number): string[] {
|
getFixedBattleEventRewards(wave: number): string[] {
|
||||||
|
@ -143,7 +143,7 @@ export default class TouchControl {
|
|||||||
* {@link https://stackoverflow.com/a/39778831/4622620|Source}
|
* {@link https://stackoverflow.com/a/39778831/4622620|Source}
|
||||||
*
|
*
|
||||||
* Prevent zoom on specified element
|
* Prevent zoom on specified element
|
||||||
* @param {HTMLElement} element
|
* @param element
|
||||||
*/
|
*/
|
||||||
preventElementZoom(element: HTMLElement | null): void {
|
preventElementZoom(element: HTMLElement | null): void {
|
||||||
if (!element) {
|
if (!element) {
|
||||||
|
@ -123,7 +123,7 @@ const tutorialHandlers = {
|
|||||||
* Run through the specified tutorial if it hasn't been seen before and mark it as seen once done
|
* Run through the specified tutorial if it hasn't been seen before and mark it as seen once done
|
||||||
* This will show a tutorial overlay if defined in the current {@linkcode AwaitableUiHandler}
|
* This will show a tutorial overlay if defined in the current {@linkcode AwaitableUiHandler}
|
||||||
* The main menu will also get disabled while the tutorial is running
|
* The main menu will also get disabled while the tutorial is running
|
||||||
* @param tutorial the {@linkcode Tutorial} to play
|
* @param tutorial - the {@linkcode Tutorial} to play
|
||||||
* @returns a promise with result `true` if the tutorial was run and finished, `false` otherwise
|
* @returns a promise with result `true` if the tutorial was run and finished, `false` otherwise
|
||||||
*/
|
*/
|
||||||
export async function handleTutorial(tutorial: Tutorial): Promise<boolean> {
|
export async function handleTutorial(tutorial: Tutorial): Promise<boolean> {
|
||||||
@ -160,7 +160,7 @@ export async function handleTutorial(tutorial: Tutorial): Promise<boolean> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the tutorial overlay if there is one
|
* Show the tutorial overlay if there is one
|
||||||
* @param handler the current UiHandler
|
* @param handler - the current UiHandler
|
||||||
* @returns `true` once the overlay has finished appearing, or if there is no overlay
|
* @returns `true` once the overlay has finished appearing, or if there is no overlay
|
||||||
*/
|
*/
|
||||||
async function showTutorialOverlay(handler: UiHandler) {
|
async function showTutorialOverlay(handler: UiHandler) {
|
||||||
@ -181,7 +181,7 @@ async function showTutorialOverlay(handler: UiHandler) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide the tutorial overlay if there is one
|
* Hide the tutorial overlay if there is one
|
||||||
* @param handler the current UiHandler
|
* @param handler - the current UiHandler
|
||||||
* @returns `true` once the overlay has finished disappearing, or if there is no overlay
|
* @returns `true` once the overlay has finished disappearing, or if there is no overlay
|
||||||
*/
|
*/
|
||||||
async function hideTutorialOverlay(handler: UiHandler) {
|
async function hideTutorialOverlay(handler: UiHandler) {
|
||||||
|
@ -368,7 +368,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
|
|||||||
/**
|
/**
|
||||||
* setScrollCursor(scrollCursor: number) : boolean
|
* setScrollCursor(scrollCursor: number) : boolean
|
||||||
* scrollCursor refers to the page's position within the entire sum of the data, unlike cursor, which refers to a user's position within displayed data
|
* scrollCursor refers to the page's position within the entire sum of the data, unlike cursor, which refers to a user's position within displayed data
|
||||||
* @param scrollCursor takes a value that has been updated based on user behavior
|
* @param scrollCursor - takes a value that has been updated based on user behavior
|
||||||
* @returns returns a boolean that indicates whether the updated scrollCursor led to an update in the data displayed.
|
* @returns returns a boolean that indicates whether the updated scrollCursor led to an update in the data displayed.
|
||||||
*/
|
*/
|
||||||
setScrollCursor(scrollCursor: number): boolean {
|
setScrollCursor(scrollCursor: number): boolean {
|
||||||
|
@ -272,7 +272,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the {@linkcode Event} being passed and updates the state of the fieldEffectInfo array
|
* Parses the {@linkcode Event} being passed and updates the state of the fieldEffectInfo array
|
||||||
* @param event {@linkcode Event} being sent
|
* @param event - being sent
|
||||||
*/
|
*/
|
||||||
private onFieldEffectChanged(event: Event) {
|
private onFieldEffectChanged(event: Event) {
|
||||||
const arenaEffectChangedEvent = event as ArenaEvent;
|
const arenaEffectChangedEvent = event as ArenaEvent;
|
||||||
@ -375,7 +375,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates through the fieldEffectInfo array and decrements the duration of each item
|
* Iterates through the fieldEffectInfo array and decrements the duration of each item
|
||||||
* @param event {@linkcode Event} being sent
|
* @param event - being sent
|
||||||
*/
|
*/
|
||||||
private onTurnEnd(event: Event) {
|
private onTurnEnd(event: Event) {
|
||||||
const turnEndEvent = event as TurnEndEvent;
|
const turnEndEvent = event as TurnEndEvent;
|
||||||
@ -405,7 +405,7 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Animates the flyout to either show or hide it by applying a fade and translation
|
* Animates the flyout to either show or hide it by applying a fade and translation
|
||||||
* @param visible Should the flyout be shown?
|
* @param visible - Should the flyout be shown?
|
||||||
*/
|
*/
|
||||||
public toggleFlyout(visible: boolean): void {
|
public toggleFlyout(visible: boolean): void {
|
||||||
globalScene.tweens.add({
|
globalScene.tweens.add({
|
||||||
|
@ -28,7 +28,7 @@ export default abstract class AwaitableUiHandler extends UiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a semi transparent overlay that will get shown during tutorials
|
* Create a semi transparent overlay that will get shown during tutorials
|
||||||
* @param container the container to add the overlay to
|
* @param container - the container to add the overlay to
|
||||||
*/
|
*/
|
||||||
initTutorialOverlay(container: Phaser.GameObjects.Container) {
|
initTutorialOverlay(container: Phaser.GameObjects.Container) {
|
||||||
if (!this.tutorialOverlay) {
|
if (!this.tutorialOverlay) {
|
||||||
|
@ -124,7 +124,7 @@ export default class BattleFlyout extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Links the given {@linkcode Pokemon} and subscribes to the {@linkcode BattleSceneEventType.MOVE_USED} event
|
* Links the given {@linkcode Pokemon} and subscribes to the {@linkcode BattleSceneEventType.MOVE_USED} event
|
||||||
* @param pokemon {@linkcode Pokemon} to link to this flyout
|
* @param pokemon - to link to this flyout
|
||||||
*/
|
*/
|
||||||
initInfo(pokemon: Pokemon) {
|
initInfo(pokemon: Pokemon) {
|
||||||
this.pokemon = pokemon;
|
this.pokemon = pokemon;
|
||||||
|
@ -52,7 +52,7 @@ export default class BgmBar extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the BGM Name to the BGM bar.
|
* Set the BGM Name to the BGM bar.
|
||||||
* @param {string} bgmName The name of the BGM to set.
|
* @param bgmName - The name of the BGM to set.
|
||||||
*/
|
*/
|
||||||
setBgmToBgmBar(bgmName: string): void {
|
setBgmToBgmBar(bgmName: string): void {
|
||||||
this.musicText.setText(`${i18next.t("bgmName:music")}${this.getRealBgmName(bgmName)}`);
|
this.musicText.setText(`${i18next.t("bgmName:music")}${this.getRealBgmName(bgmName)}`);
|
||||||
@ -70,7 +70,7 @@ export default class BgmBar extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Show or hide the BGM bar.
|
Show or hide the BGM bar.
|
||||||
@param {boolean} visible Whether to show or hide the BGM bar.
|
@param visible Whether to show or hide the BGM bar.
|
||||||
*/
|
*/
|
||||||
public toggleBgmBar(visible: boolean): void {
|
public toggleBgmBar(visible: boolean): void {
|
||||||
/*
|
/*
|
||||||
|
@ -222,7 +222,7 @@ export default class GameChallengesUiHandler extends UiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the default text color to the description text
|
* Adds the default text color to the description text
|
||||||
* @param text text to set to the BBCode description
|
* @param text - text to set to the BBCode description
|
||||||
*/
|
*/
|
||||||
setDescription(text: string): void {
|
setDescription(text: string): void {
|
||||||
this.descriptionText.setText(`[color=${Color.ORANGE}][shadow=${ShadowColor.ORANGE}]${text}`);
|
this.descriptionText.setText(`[color=${Color.ORANGE}][shadow=${ShadowColor.ORANGE}]${text}`);
|
||||||
|
@ -44,7 +44,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Sets the updating state and updates button states accordingly.
|
* Sets the updating state and updates button states accordingly.
|
||||||
* If value is true (updating), disables the buttons; if false, enables the buttons.
|
* If value is true (updating), disables the buttons; if false, enables the buttons.
|
||||||
* @param {boolean} value - The new updating state.
|
* @param value - The new updating state.
|
||||||
*/
|
*/
|
||||||
set isUpdating(value) {
|
set isUpdating(value) {
|
||||||
this._isUpdating = value;
|
this._isUpdating = value;
|
||||||
@ -208,8 +208,8 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
|||||||
* The method fetches the total page count if necessary, followed by fetching the rankings for the specified category
|
* The method fetches the total page count if necessary, followed by fetching the rankings for the specified category
|
||||||
* and page. It updates the UI with the fetched rankings or shows an appropriate message if no rankings are found.
|
* and page. It updates the UI with the fetched rankings or shows an appropriate message if no rankings are found.
|
||||||
*
|
*
|
||||||
* @param {ScoreboardCategory} [category=this.category] - The category to fetch rankings for. Defaults to the current category.
|
* @param [category=this.category] - The category to fetch rankings for. Defaults to the current category.
|
||||||
* @param {number} [page=this.page] - The page number to fetch. Defaults to the current page.
|
* @param [page=this.page] - The page number to fetch. Defaults to the current page.
|
||||||
*/
|
*/
|
||||||
update(category: ScoreboardCategory = this.category, page: number = this.page) {
|
update(category: ScoreboardCategory = this.category, page: number = this.page) {
|
||||||
if (this.isUpdating) {
|
if (this.isUpdating) {
|
||||||
@ -255,7 +255,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the state of the navigation buttons.
|
* Sets the state of the navigation buttons.
|
||||||
* @param {boolean} [enabled=true] - Whether the buttons should be enabled or disabled.
|
* @param [enabled=true] - Whether the buttons should be enabled or disabled.
|
||||||
*/
|
*/
|
||||||
setButtonsState(enabled = true) {
|
setButtonsState(enabled = true) {
|
||||||
const buttons = [
|
const buttons = [
|
||||||
|
@ -96,8 +96,8 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
|||||||
* Initialize the toggle icon based on the provided DropDownType
|
* Initialize the toggle icon based on the provided DropDownType
|
||||||
* For DropDownType.SINGLE: uses a cursor arrow icon
|
* For DropDownType.SINGLE: uses a cursor arrow icon
|
||||||
* For other types: uses a candy icon
|
* For other types: uses a candy icon
|
||||||
* @param type the DropDownType to use
|
* @param type - the DropDownType to use
|
||||||
* @param visible whether the icon should be visible or not
|
* @param visible - whether the icon should be visible or not
|
||||||
*/
|
*/
|
||||||
setupToggleIcon(type: DropDownType, visible: boolean): void {
|
setupToggleIcon(type: DropDownType, visible: boolean): void {
|
||||||
if (type === DropDownType.SINGLE) {
|
if (type === DropDownType.SINGLE) {
|
||||||
@ -157,7 +157,7 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the option to the given state and update visuals
|
* Set the option to the given state and update visuals
|
||||||
* @param newState the state to switch to
|
* @param newState - the state to switch to
|
||||||
* @returns the new DropDownState
|
* @returns the new DropDownState
|
||||||
*/
|
*/
|
||||||
public setOptionState(newState: DropDownState): DropDownState {
|
public setOptionState(newState: DropDownState): DropDownState {
|
||||||
@ -173,7 +173,7 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the option state to the one at the given index and update visuals
|
* Change the option state to the one at the given index and update visuals
|
||||||
* @param index index of the state to switch to
|
* @param index - index of the state to switch to
|
||||||
* @returns the new DropDownState
|
* @returns the new DropDownState
|
||||||
*/
|
*/
|
||||||
private setCurrentLabel(index: number): DropDownState {
|
private setCurrentLabel(index: number): DropDownState {
|
||||||
@ -205,7 +205,7 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the current SortDirection to the provided value and update icon accordingly
|
* Set the current SortDirection to the provided value and update icon accordingly
|
||||||
* @param SortDirection the new SortDirection to use
|
* @param SortDirection - the new SortDirection to use
|
||||||
*/
|
*/
|
||||||
public setDirection(dir: SortDirection): void {
|
public setDirection(dir: SortDirection): void {
|
||||||
this.dir = dir;
|
this.dir = dir;
|
||||||
@ -221,8 +221,8 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Place the label elements (text and sprite if there is one) to the provided x and y position
|
* Place the label elements (text and sprite if there is one) to the provided x and y position
|
||||||
* @param x the horizontal position
|
* @param x - the horizontal position
|
||||||
* @param y the vertical position
|
* @param y - the vertical position
|
||||||
*/
|
*/
|
||||||
setLabelPosition(x: number, y: number) {
|
setLabelPosition(x: number, y: number) {
|
||||||
let textX = x;
|
let textX = x;
|
||||||
@ -244,8 +244,8 @@ export class DropDownOption extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Place the toggle icon at the provided position
|
* Place the toggle icon at the provided position
|
||||||
* @param x the horizontal position
|
* @param x - the horizontal position
|
||||||
* @param y the vertical position
|
* @param y - the vertical position
|
||||||
*/
|
*/
|
||||||
setTogglePosition(x: number, y: number) {
|
setTogglePosition(x: number, y: number) {
|
||||||
if (this.toggle) {
|
if (this.toggle) {
|
||||||
@ -494,7 +494,7 @@ export class DropDown extends Phaser.GameObjects.Container {
|
|||||||
* Update accordingly the other options if needed:
|
* Update accordingly the other options if needed:
|
||||||
* - if "all" is toggled, also update all other options
|
* - if "all" is toggled, also update all other options
|
||||||
* - for DropDownType.SINGLE, unselect the previously selected option if applicable
|
* - for DropDownType.SINGLE, unselect the previously selected option if applicable
|
||||||
* @param index the index of the option for which to update the state
|
* @param index - the index of the option for which to update the state
|
||||||
*/
|
*/
|
||||||
toggleOptionState(index: number = this.cursor): void {
|
toggleOptionState(index: number = this.cursor): void {
|
||||||
const option: DropDownOption = this.options[index];
|
const option: DropDownOption = this.options[index];
|
||||||
@ -665,7 +665,7 @@ export class DropDown extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set all options to a specific state
|
* Set all options to a specific state
|
||||||
* @param state the DropDownState to assign to each option
|
* @param state - the DropDownState to assign to each option
|
||||||
*/
|
*/
|
||||||
private setAllOptions(state: DropDownState): void {
|
private setAllOptions(state: DropDownState): void {
|
||||||
// For single type dropdown, setting all options is not relevant
|
// For single type dropdown, setting all options is not relevant
|
||||||
|
@ -7,7 +7,6 @@ import type EggHatchSceneHandler from "./egg-hatch-scene-handler";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A container that displays the count of hatching eggs.
|
* A container that displays the count of hatching eggs.
|
||||||
* @extends Phaser.GameObjects.Container
|
|
||||||
*/
|
*/
|
||||||
export default class EggCounterContainer extends Phaser.GameObjects.Container {
|
export default class EggCounterContainer extends Phaser.GameObjects.Container {
|
||||||
private readonly WINDOW_DEFAULT_WIDTH = 37;
|
private readonly WINDOW_DEFAULT_WIDTH = 37;
|
||||||
@ -63,7 +62,7 @@ export default class EggCounterContainer extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Handles window size, the egg count to show, and whether it should be displayed.
|
* Handles window size, the egg count to show, and whether it should be displayed.
|
||||||
*
|
*
|
||||||
* @param event {@linkcode Event} being sent
|
* @param event - being sent
|
||||||
*/
|
*/
|
||||||
private onEggCountChanged(event: Event): void {
|
private onEggCountChanged(event: Event): void {
|
||||||
const eggCountChangedEvent = event as EggCountChangedEvent;
|
const eggCountChangedEvent = event as EggCountChangedEvent;
|
||||||
|
@ -165,7 +165,7 @@ export default class EggListUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the information panel with the information of the given egg
|
* Update the information panel with the information of the given egg
|
||||||
* @param index which egg in the list to display the info for
|
* @param index - which egg in the list to display the info for
|
||||||
*/
|
*/
|
||||||
private setEggDetails(index: number): void {
|
private setEggDetails(index: number): void {
|
||||||
const egg = globalScene.gameData.eggs[index];
|
const egg = globalScene.gameData.eggs[index];
|
||||||
|
@ -140,7 +140,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args EggHatchData[][]
|
* @param args - EggHatchData[][]
|
||||||
* args[0]: list of EggHatchData for each egg/pokemon hatched
|
* args[0]: list of EggHatchData for each egg/pokemon hatched
|
||||||
*/
|
*/
|
||||||
show(args: EggHatchData[][]): boolean {
|
show(args: EggHatchData[][]): boolean {
|
||||||
|
@ -60,9 +60,9 @@ export class FilterBar extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new filter to the FilterBar, as long that a unique DropDownColumn is provided
|
* Add a new filter to the FilterBar, as long that a unique DropDownColumn is provided
|
||||||
* @param column the DropDownColumn that will be used to access the filter values
|
* @param column - the DropDownColumn that will be used to access the filter values
|
||||||
* @param title the string that will get displayed in the filter bar
|
* @param title - the string that will get displayed in the filter bar
|
||||||
* @param dropDown the DropDown with all options for this filter
|
* @param dropDown - the DropDown with all options for this filter
|
||||||
* @returns true if successful, false if the provided column was already in use for another filter
|
* @returns true if successful, false if the provided column was already in use for another filter
|
||||||
*/
|
*/
|
||||||
addFilter(column: DropDownColumn, title: string, dropDown: DropDown): boolean {
|
addFilter(column: DropDownColumn, title: string, dropDown: DropDown): boolean {
|
||||||
@ -87,7 +87,7 @@ export class FilterBar extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the DropDown associated to a given filter
|
* Get the DropDown associated to a given filter
|
||||||
* @param col the DropDownColumn used to register the filter to retrieve
|
* @param col - the DropDownColumn used to register the filter to retrieve
|
||||||
* @returns the associated DropDown if it exists, undefined otherwise
|
* @returns the associated DropDown if it exists, undefined otherwise
|
||||||
*/
|
*/
|
||||||
getFilter(col: DropDownColumn): DropDown {
|
getFilter(col: DropDownColumn): DropDown {
|
||||||
@ -96,7 +96,7 @@ export class FilterBar extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the DropDownColumn associated to a given index
|
* Get the DropDownColumn associated to a given index
|
||||||
* @param index the index of the column to retrieve
|
* @param index - the index of the column to retrieve
|
||||||
* @returns the associated DropDownColumn if it exists, undefined otherwise
|
* @returns the associated DropDownColumn if it exists, undefined otherwise
|
||||||
*/
|
*/
|
||||||
public getColumn(index: number): DropDownColumn {
|
public getColumn(index: number): DropDownColumn {
|
||||||
@ -214,7 +214,7 @@ export class FilterBar extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the nearest filter to the provided container
|
* Find the nearest filter to the provided container
|
||||||
* @param container the StarterContainer to compare position against
|
* @param container - the StarterContainer to compare position against
|
||||||
* @returns the index of the closest filter
|
* @returns the index of the closest filter
|
||||||
*/
|
*/
|
||||||
getNearestFilter(container: StarterContainer): number {
|
getNearestFilter(container: StarterContainer): number {
|
||||||
|
@ -83,9 +83,9 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new filter to the FilterBar, as long that a unique DropDownColumn is provided
|
* Add a new filter to the FilterBar, as long that a unique DropDownColumn is provided
|
||||||
* @param column the DropDownColumn that will be used to access the filter values
|
* @param column - the DropDownColumn that will be used to access the filter values
|
||||||
* @param title the string that will get displayed in the filter bar
|
* @param title - the string that will get displayed in the filter bar
|
||||||
* @param dropDown the DropDown with all options for this filter
|
* @param dropDown - the DropDown with all options for this filter
|
||||||
* @returns true if successful, false if the provided column was already in use for another filter
|
* @returns true if successful, false if the provided column was already in use for another filter
|
||||||
*/
|
*/
|
||||||
addFilter(row: FilterTextRow, title: string): boolean {
|
addFilter(row: FilterTextRow, title: string): boolean {
|
||||||
@ -206,7 +206,7 @@ export class FilterText extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the nearest filter to the provided container on the y-axis
|
* Find the nearest filter to the provided container on the y-axis
|
||||||
* @param container the StarterContainer to compare position against
|
* @param container - the StarterContainer to compare position against
|
||||||
* @returns the index of the closest filter
|
* @returns the index of the closest filter
|
||||||
*/
|
*/
|
||||||
getNearestFilter(container: StarterContainer): number {
|
getNearestFilter(container: StarterContainer): number {
|
||||||
|
@ -21,9 +21,9 @@ export class HatchedPokemonContainer extends Phaser.GameObjects.Container {
|
|||||||
public eggMoveIcon: Phaser.GameObjects.Image;
|
public eggMoveIcon: Phaser.GameObjects.Image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param x x position
|
* @param x - x position
|
||||||
* @param y y position
|
* @param y - y position
|
||||||
* @param hatchData the {@linkcode EggHatchData} to load the icons and sprites for
|
* @param hatchData - the {@linkcode EggHatchData} to load the icons and sprites for
|
||||||
*/
|
*/
|
||||||
constructor(x: number, y: number, hatchData: EggHatchData) {
|
constructor(x: number, y: number, hatchData: EggHatchData) {
|
||||||
super(globalScene, x, y);
|
super(globalScene, x, y);
|
||||||
@ -80,8 +80,8 @@ export class HatchedPokemonContainer extends Phaser.GameObjects.Container {
|
|||||||
* Update the Pokemon's sprite and icons based on new hatch data
|
* Update the Pokemon's sprite and icons based on new hatch data
|
||||||
* Animates the pokemon icon if it has a new form or shiny variant
|
* Animates the pokemon icon if it has a new form or shiny variant
|
||||||
*
|
*
|
||||||
* @param hatchData the {@linkcode EggHatchData} to base the icons on
|
* @param hatchData - the {@linkcode EggHatchData} to base the icons on
|
||||||
* @param iconAnimHandler the {@linkcode PokemonIconAnimHandler} to use to animate the sprites
|
* @param iconAnimHandler - the {@linkcode PokemonIconAnimHandler} to use to animate the sprites
|
||||||
*/
|
*/
|
||||||
updateAndAnimate(hatchData: EggHatchData, iconAnimHandler: PokemonIconAnimHandler) {
|
updateAndAnimate(hatchData: EggHatchData, iconAnimHandler: PokemonIconAnimHandler) {
|
||||||
const displayPokemon = hatchData.pokemon;
|
const displayPokemon = hatchData.pokemon;
|
||||||
@ -120,10 +120,10 @@ export class HatchedPokemonContainer extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the given Pokemon icon exists, otherwise replace it with a default one
|
* Check if the given Pokemon icon exists, otherwise replace it with a default one
|
||||||
* @param female `true` to get the female icon
|
* @param female - `true` to get the female icon
|
||||||
* @param formIndex the form index
|
* @param formIndex - the form index
|
||||||
* @param shiny whether the Pokemon is shiny
|
* @param shiny - whether the Pokemon is shiny
|
||||||
* @param variant the shiny variant
|
* @param variant - the shiny variant
|
||||||
*/
|
*/
|
||||||
private checkIconId(female: boolean, formIndex: number, shiny: boolean, variant: number) {
|
private checkIconId(female: boolean, formIndex: number, shiny: boolean, variant: number) {
|
||||||
if (this.icon.frame.name !== this.species.getIconId(female, formIndex, shiny, variant)) {
|
if (this.icon.frame.name !== this.species.getIconId(female, formIndex, shiny, variant)) {
|
||||||
|
@ -759,7 +759,7 @@ export default class MenuUiHandler extends MessageUiHandler {
|
|||||||
* Switch the message window style and size when we are replaying dialog for debug purposes
|
* Switch the message window style and size when we are replaying dialog for debug purposes
|
||||||
* In "dialog test mode", the window takes the whole width of the screen and the text
|
* In "dialog test mode", the window takes the whole width of the screen and the text
|
||||||
* is set up to wrap around the same way as the dialogue during the game
|
* is set up to wrap around the same way as the dialogue during the game
|
||||||
* @param isDialogMode whether to use the dialog test
|
* @param isDialogMode - whether to use the dialog test
|
||||||
*/
|
*/
|
||||||
setDialogTestMode(isDialogMode: boolean) {
|
setDialogTestMode(isDialogMode: boolean) {
|
||||||
this.menuMessageBox.setVisible(!isDialogMode);
|
this.menuMessageBox.setVisible(!isDialogMode);
|
||||||
|
@ -19,7 +19,7 @@ export default abstract class MessageUiHandler extends AwaitableUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the sprite to be displayed at the end of messages with prompts
|
* Add the sprite to be displayed at the end of messages with prompts
|
||||||
* @param container the container to add the sprite to
|
* @param container - the container to add the sprite to
|
||||||
*/
|
*/
|
||||||
initPromptSprite(container: Phaser.GameObjects.Container) {
|
initPromptSprite(container: Phaser.GameObjects.Container) {
|
||||||
if (!this.prompt) {
|
if (!this.prompt) {
|
||||||
|
@ -181,7 +181,7 @@ export abstract class ModalUiHandler extends UiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a hover effect to a game object which changes the cursor to a `pointer` and tints it slighly
|
* Adds a hover effect to a game object which changes the cursor to a `pointer` and tints it slighly
|
||||||
* @param gameObject the game object to add hover events/effects to
|
* @param gameObject - the game object to add hover events/effects to
|
||||||
*/
|
*/
|
||||||
protected addInteractionHoverEffect(
|
protected addInteractionHoverEffect(
|
||||||
gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.NineSlice | Phaser.GameObjects.Sprite,
|
gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.NineSlice | Phaser.GameObjects.Sprite,
|
||||||
|
@ -207,7 +207,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* For consistency reasons, this looks like the above filters. However this is used only internally and is always enforced for switching.
|
* For consistency reasons, this looks like the above filters. However this is used only internally and is always enforced for switching.
|
||||||
* @param pokemon The pokemon to check.
|
* @param pokemon - The pokemon to check.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
private FilterChallengeLegal = (pokemon: PlayerPokemon) => {
|
private FilterChallengeLegal = (pokemon: PlayerPokemon) => {
|
||||||
|
@ -937,8 +937,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
* Check whether a given form is caught for a given species.
|
* Check whether a given form is caught for a given species.
|
||||||
* All forms that can be reached through a form change during battle are considered caught and show up in the dex as such.
|
* All forms that can be reached through a form change during battle are considered caught and show up in the dex as such.
|
||||||
*
|
*
|
||||||
* @param otherSpecies The species to check; defaults to current species
|
* @param otherSpecies - The species to check; defaults to current species
|
||||||
* @param otherFormIndex The form index of the form to check; defaults to current form
|
* @param otherFormIndex - The form index of the form to check; defaults to current form
|
||||||
* @returns StarterAttributes for the species
|
* @returns StarterAttributes for the species
|
||||||
*/
|
*/
|
||||||
isFormCaught(otherSpecies?: PokemonSpecies, otherFormIndex?: number | undefined): boolean {
|
isFormCaught(otherSpecies?: PokemonSpecies, otherFormIndex?: number | undefined): boolean {
|
||||||
@ -970,7 +970,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
* If somehow a preference is set for a form, variant, gender, ability or nature
|
* If somehow a preference is set for a form, variant, gender, ability or nature
|
||||||
* that wasn't actually unlocked or is invalid it will be cleared here
|
* that wasn't actually unlocked or is invalid it will be cleared here
|
||||||
*
|
*
|
||||||
* @param species The species to get Starter Preferences for
|
* @param species - The species to get Starter Preferences for
|
||||||
* @returns StarterAttributes for the species
|
* @returns StarterAttributes for the species
|
||||||
*/
|
*/
|
||||||
initStarterPrefs(): StarterAttributes {
|
initStarterPrefs(): StarterAttributes {
|
||||||
@ -1078,7 +1078,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* If the pokemon is an evolution, find speciesId of its starter.
|
* If the pokemon is an evolution, find speciesId of its starter.
|
||||||
* @param speciesId the id of the species to check
|
* @param speciesId - the id of the species to check
|
||||||
* @returns the id of the corresponding starter
|
* @returns the id of the corresponding starter
|
||||||
*/
|
*/
|
||||||
getStarterSpeciesId(speciesId): number {
|
getStarterSpeciesId(speciesId): number {
|
||||||
@ -2691,7 +2691,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
/**
|
/**
|
||||||
* Creates a temporary dex attr props that will be used to display the correct shiny, variant, and form based on this.starterAttributes
|
* Creates a temporary dex attr props that will be used to display the correct shiny, variant, and form based on this.starterAttributes
|
||||||
*
|
*
|
||||||
* @param speciesId the id of the species to get props for
|
* @param speciesId - the id of the species to get props for
|
||||||
* @returns the dex props
|
* @returns the dex props
|
||||||
*/
|
*/
|
||||||
getCurrentDexProps(speciesId: number): bigint {
|
getCurrentDexProps(speciesId: number): bigint {
|
||||||
|
@ -131,7 +131,7 @@ const speciesContainerX = 143;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the starter position for a Pokemon of a given UI index
|
* Calculates the starter position for a Pokemon of a given UI index
|
||||||
* @param index UI index to calculate the starter position of
|
* @param index - UI index to calculate the starter position of
|
||||||
* @returns An interface with an x and y property
|
* @returns An interface with an x and y property
|
||||||
*/
|
*/
|
||||||
function calcStarterPosition(index: number): { x: number; y: number } {
|
function calcStarterPosition(index: number): { x: number; y: number } {
|
||||||
@ -655,7 +655,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
|||||||
* If somehow a preference is set for a form, variant, gender, ability or nature
|
* If somehow a preference is set for a form, variant, gender, ability or nature
|
||||||
* that wasn't actually unlocked or is invalid it will be cleared here
|
* that wasn't actually unlocked or is invalid it will be cleared here
|
||||||
*
|
*
|
||||||
* @param species The species to get Starter Preferences for
|
* @param species - The species to get Starter Preferences for
|
||||||
* @returns StarterAttributes for the species
|
* @returns StarterAttributes for the species
|
||||||
*/
|
*/
|
||||||
initStarterPrefs(species: PokemonSpecies): StarterAttributes {
|
initStarterPrefs(species: PokemonSpecies): StarterAttributes {
|
||||||
@ -814,7 +814,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a passive upgrade is available for the given species ID
|
* Determines if a passive upgrade is available for the given species ID
|
||||||
* @param speciesId The ID of the species to check the passive of
|
* @param speciesId - The ID of the species to check the passive of
|
||||||
* @returns true if the user has enough candies and a passive has not been unlocked already
|
* @returns true if the user has enough candies and a passive has not been unlocked already
|
||||||
*/
|
*/
|
||||||
isPassiveAvailable(speciesId: number): boolean {
|
isPassiveAvailable(speciesId: number): boolean {
|
||||||
@ -829,7 +829,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a value reduction upgrade is available for the given species ID
|
* Determines if a value reduction upgrade is available for the given species ID
|
||||||
* @param speciesId The ID of the species to check the value reduction of
|
* @param speciesId - The ID of the species to check the value reduction of
|
||||||
* @returns true if the user has enough candies and all value reductions have not been unlocked already
|
* @returns true if the user has enough candies and all value reductions have not been unlocked already
|
||||||
*/
|
*/
|
||||||
isValueReductionAvailable(speciesId: number): boolean {
|
isValueReductionAvailable(speciesId: number): boolean {
|
||||||
@ -846,7 +846,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if an same species egg can be bought for the given species ID
|
* Determines if an same species egg can be bought for the given species ID
|
||||||
* @param speciesId The ID of the species to check the value reduction of
|
* @param speciesId - The ID of the species to check the value reduction of
|
||||||
* @returns true if the user has enough candies
|
* @returns true if the user has enough candies
|
||||||
*/
|
*/
|
||||||
isSameSpeciesEggAvailable(speciesId: number): boolean {
|
isSameSpeciesEggAvailable(speciesId: number): boolean {
|
||||||
@ -860,9 +860,9 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a bounce animation if enabled and the Pokemon has an upgrade
|
* Sets a bounce animation if enabled and the Pokemon has an upgrade
|
||||||
* @param icon {@linkcode Phaser.GameObjects.GameObject} to animate
|
* @param icon - to animate
|
||||||
* @param species {@linkcode PokemonSpecies} of the icon used to check for upgrades
|
* @param species - of the icon used to check for upgrades
|
||||||
* @param startPaused Should this animation be paused after it is added?
|
* @param startPaused - Should this animation be paused after it is added?
|
||||||
*/
|
*/
|
||||||
setUpgradeAnimation(icon: Phaser.GameObjects.Sprite, species: PokemonSpecies, startPaused = false): void {
|
setUpgradeAnimation(icon: Phaser.GameObjects.Sprite, species: PokemonSpecies, startPaused = false): void {
|
||||||
globalScene.tweens.killTweensOf(icon);
|
globalScene.tweens.killTweensOf(icon);
|
||||||
@ -951,7 +951,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the display of candy upgrade icons or animations for the given PokedexMonContainer
|
* Update the display of candy upgrade icons or animations for the given PokedexMonContainer
|
||||||
* @param pokemonContainer the container for the Pokemon to update
|
* @param pokemonContainer - the container for the Pokemon to update
|
||||||
*/
|
*/
|
||||||
updateCandyUpgradeDisplay(pokemonContainer: PokedexMonContainer) {
|
updateCandyUpgradeDisplay(pokemonContainer: PokedexMonContainer) {
|
||||||
if (this.isUpgradeIconEnabled()) {
|
if (this.isUpgradeIconEnabled()) {
|
||||||
@ -2295,7 +2295,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
|||||||
* Creates a temporary dex attr props that will be used to
|
* Creates a temporary dex attr props that will be used to
|
||||||
* display the correct shiny, variant, and form based on the StarterPreferences
|
* display the correct shiny, variant, and form based on the StarterPreferences
|
||||||
*
|
*
|
||||||
* @param speciesId the id of the species to get props for
|
* @param speciesId - the id of the species to get props for
|
||||||
* @returns the dex props
|
* @returns the dex props
|
||||||
*/
|
*/
|
||||||
getCurrentDexProps(speciesId: number): bigint {
|
getCurrentDexProps(speciesId: number): bigint {
|
||||||
|
@ -142,7 +142,7 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer {
|
|||||||
/**
|
/**
|
||||||
* Updates the info container with the appropriate dex data and starter entry from the hatchInfo
|
* Updates the info container with the appropriate dex data and starter entry from the hatchInfo
|
||||||
* Also updates the displayed name, number, egg moves and main animated sprite for the pokemon
|
* Also updates the displayed name, number, egg moves and main animated sprite for the pokemon
|
||||||
* @param hatchInfo The EggHatchData of the pokemon / new hatch to show
|
* @param hatchInfo - The EggHatchData of the pokemon / new hatch to show
|
||||||
*/
|
*/
|
||||||
showHatchInfo(hatchInfo: EggHatchData) {
|
showHatchInfo(hatchInfo: EggHatchData) {
|
||||||
this.pokemonEggMovesContainer.setVisible(true);
|
this.pokemonEggMovesContainer.setVisible(true);
|
||||||
|
@ -82,7 +82,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This takes a run's RunEntry and uses the information provided to display essential information about the player's run.
|
* This takes a run's RunEntry and uses the information provided to display essential information about the player's run.
|
||||||
* @param args[0] : a RunEntry object
|
* @param args[0] - : a RunEntry object
|
||||||
*
|
*
|
||||||
* show() creates these UI objects in order -
|
* show() creates these UI objects in order -
|
||||||
* A solid-color background used to hide RunHistoryUiHandler
|
* A solid-color background used to hide RunHistoryUiHandler
|
||||||
@ -461,7 +461,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
/**
|
/**
|
||||||
* This loads the enemy sprites, positions, and scales them according to the current display mode of the RunInfo UI and then adds them to the container parameter.
|
* This loads the enemy sprites, positions, and scales them according to the current display mode of the RunInfo UI and then adds them to the container parameter.
|
||||||
* Used by {@linkcode parseRunStatus} and {@linkcode parseTrainerDefeat}
|
* Used by {@linkcode parseRunStatus} and {@linkcode parseTrainerDefeat}
|
||||||
* @param enemyContainer a Phaser Container that should hold enemy sprites
|
* @param enemyContainer - a Phaser Container that should hold enemy sprites
|
||||||
*/
|
*/
|
||||||
private showTrainerSprites(enemyContainer: Phaser.GameObjects.Container) {
|
private showTrainerSprites(enemyContainer: Phaser.GameObjects.Container) {
|
||||||
// Creating the trainer sprite and adding it to enemyContainer
|
// Creating the trainer sprite and adding it to enemyContainer
|
||||||
@ -549,7 +549,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
* Shows information about the run like the run's mode, duration, luck, money, and player held items
|
* Shows information about the run like the run's mode, duration, luck, money, and player held items
|
||||||
* The values for luck and money are from the end of the run, not the player's luck at the start of the run.
|
* The values for luck and money are from the end of the run, not the player's luck at the start of the run.
|
||||||
* @param windowX
|
* @param windowX
|
||||||
* @param windowY These two params are the coordinates of the window's bottom right corner. This is used to dynamically position Luck based on its length, creating a nice layout regardless of language / luck value.
|
* @param windowY - These two params are the coordinates of the window's bottom right corner. This is used to dynamically position Luck based on its length, creating a nice layout regardless of language / luck value.
|
||||||
*/
|
*/
|
||||||
private async parseRunInfo(windowX: number, windowY: number) {
|
private async parseRunInfo(windowX: number, windowY: number) {
|
||||||
// Parsing and displaying the mode.
|
// Parsing and displaying the mode.
|
||||||
@ -940,7 +940,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes what is displayed of the Pokemon's held items
|
* Changes what is displayed of the Pokemon's held items
|
||||||
* @param partyVisible {boolean}
|
* @param partyVisible
|
||||||
* True -> Shows the Pokemon's default information and hides held items
|
* True -> Shows the Pokemon's default information and hides held items
|
||||||
* False -> Shows the Pokemon's held items and hides default information
|
* False -> Shows the Pokemon's held items and hides default information
|
||||||
*/
|
*/
|
||||||
|
@ -255,8 +255,8 @@ export default class SaveSlotSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the cursor to a new position and update the view accordingly
|
* Move the cursor to a new position and update the view accordingly
|
||||||
* @param cursor the new cursor position, between `0` and `SLOTS_ON_SCREEN - 1`
|
* @param cursor - the new cursor position, between `0` and `SLOTS_ON_SCREEN - 1`
|
||||||
* @param prevSlotIndex index of the previous session occupied by the cursor, between `0` and `SESSION_SLOTS_COUNT - 1` - optional
|
* @param prevSlotIndex - index of the previous session occupied by the cursor, between `0` and `SESSION_SLOTS_COUNT - 1` - optional
|
||||||
* @returns `true` if the cursor position has changed | `false` if it has not
|
* @returns `true` if the cursor position has changed | `false` if it has not
|
||||||
*/
|
*/
|
||||||
override setCursor(cursor: number, prevSlotIndex?: number): boolean {
|
override setCursor(cursor: number, prevSlotIndex?: number): boolean {
|
||||||
@ -316,7 +316,7 @@ export default class SaveSlotSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function that checks if the session slot involved holds data or not
|
* Helper function that checks if the session slot involved holds data or not
|
||||||
* @param hasData `true` if session slot contains data | 'false' if not
|
* @param hasData - `true` if session slot contains data | 'false' if not
|
||||||
*/
|
*/
|
||||||
setArrowVisibility(hasData: boolean): void {
|
setArrowVisibility(hasData: boolean): void {
|
||||||
if (this.cursorObj) {
|
if (this.cursorObj) {
|
||||||
@ -327,8 +327,8 @@ export default class SaveSlotSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the scrolling cursor to a new position and update the view accordingly
|
* Move the scrolling cursor to a new position and update the view accordingly
|
||||||
* @param scrollCursor the new cursor position, between `0` and `SESSION_SLOTS_COUNT - SLOTS_ON_SCREEN`
|
* @param scrollCursor - the new cursor position, between `0` and `SESSION_SLOTS_COUNT - SLOTS_ON_SCREEN`
|
||||||
* @param prevSlotIndex index of the previous slot occupied by the cursor, between `0` and `SESSION_SLOTS_COUNT-1` - optional
|
* @param prevSlotIndex - index of the previous slot occupied by the cursor, between `0` and `SESSION_SLOTS_COUNT-1` - optional
|
||||||
* @returns `true` if the cursor position has changed | `false` if it has not
|
* @returns `true` if the cursor position has changed | `false` if it has not
|
||||||
*/
|
*/
|
||||||
setScrollCursor(scrollCursor: number, prevSlotIndex?: number): boolean {
|
setScrollCursor(scrollCursor: number, prevSlotIndex?: number): boolean {
|
||||||
|
@ -13,11 +13,11 @@ export class ScrollBar extends Phaser.GameObjects.Container {
|
|||||||
private maxRows: number;
|
private maxRows: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param x the scrollbar's x position (origin: top left)
|
* @param x - the scrollbar's x position (origin: top left)
|
||||||
* @param y the scrollbar's y position (origin: top left)
|
* @param y - the scrollbar's y position (origin: top left)
|
||||||
* @param width the scrollbar's width
|
* @param width - the scrollbar's width
|
||||||
* @param height the scrollbar's height
|
* @param height - the scrollbar's height
|
||||||
* @param maxRows the maximum number of rows that can be shown at once
|
* @param maxRows - the maximum number of rows that can be shown at once
|
||||||
*/
|
*/
|
||||||
constructor(x: number, y: number, width: number, height: number, maxRows: number) {
|
constructor(x: number, y: number, width: number, height: number, maxRows: number) {
|
||||||
super(globalScene, x, y);
|
super(globalScene, x, y);
|
||||||
@ -56,7 +56,7 @@ export class ScrollBar extends Phaser.GameObjects.Container {
|
|||||||
/**
|
/**
|
||||||
* Set the current row that is displayed
|
* Set the current row that is displayed
|
||||||
* Moves the bar handle up or down accordingly
|
* Moves the bar handle up or down accordingly
|
||||||
* @param scrollCursor how many times the view was scrolled down
|
* @param scrollCursor - how many times the view was scrolled down
|
||||||
*/
|
*/
|
||||||
setScrollCursor(scrollCursor: number): void {
|
setScrollCursor(scrollCursor: number): void {
|
||||||
this.currentRow = scrollCursor;
|
this.currentRow = scrollCursor;
|
||||||
@ -67,7 +67,7 @@ export class ScrollBar extends Phaser.GameObjects.Container {
|
|||||||
* Set the total number of rows to display
|
* Set the total number of rows to display
|
||||||
* If it's smaller than the maximum number of rows on screen the bar will get hidden
|
* If it's smaller than the maximum number of rows on screen the bar will get hidden
|
||||||
* Otherwise the scrollbar handle gets resized based on the ratio to the maximum number of rows
|
* Otherwise the scrollbar handle gets resized based on the ratio to the maximum number of rows
|
||||||
* @param rows how many rows of data there are in total
|
* @param rows - how many rows of data there are in total
|
||||||
*/
|
*/
|
||||||
setTotalRows(rows: number): void {
|
setTotalRows(rows: number): void {
|
||||||
this.totalRows = rows;
|
this.totalRows = rows;
|
||||||
|
@ -30,8 +30,8 @@ export default class ScrollableGridUiHandler {
|
|||||||
private updateDetailsCallback?: UpdateDetailsCallbackFunction;
|
private updateDetailsCallback?: UpdateDetailsCallbackFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param rows the maximum number of rows shown at once
|
* @param rows - the maximum number of rows shown at once
|
||||||
* @param columns the maximum number of columns shown at once
|
* @param columns - the maximum number of columns shown at once
|
||||||
*/
|
*/
|
||||||
constructor(handler: UiHandler, rows: number, columns: number) {
|
constructor(handler: UiHandler, rows: number, columns: number) {
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
@ -44,7 +44,7 @@ export default class ScrollableGridUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a scrollBar to get updated with the scrolling
|
* Set a scrollBar to get updated with the scrolling
|
||||||
* @param scrollBar {@linkcode ScrollBar}
|
* @param scrollBar
|
||||||
* @returns this
|
* @returns this
|
||||||
*/
|
*/
|
||||||
withScrollBar(scrollBar: ScrollBar): ScrollableGridUiHandler {
|
withScrollBar(scrollBar: ScrollBar): ScrollableGridUiHandler {
|
||||||
@ -55,7 +55,7 @@ export default class ScrollableGridUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set function that will get called if the whole grid needs to get updated
|
* Set function that will get called if the whole grid needs to get updated
|
||||||
* @param callback {@linkcode UpdateGridCallbackFunction}
|
* @param callback
|
||||||
* @returns this
|
* @returns this
|
||||||
*/
|
*/
|
||||||
withUpdateGridCallBack(callback: UpdateGridCallbackFunction): ScrollableGridUiHandler {
|
withUpdateGridCallBack(callback: UpdateGridCallbackFunction): ScrollableGridUiHandler {
|
||||||
@ -65,7 +65,7 @@ export default class ScrollableGridUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set function that will get called if a single element in the grid needs to get updated
|
* Set function that will get called if a single element in the grid needs to get updated
|
||||||
* @param callback {@linkcode UpdateDetailsCallbackFunction}
|
* @param callback
|
||||||
* @returns this
|
* @returns this
|
||||||
*/
|
*/
|
||||||
withUpdateSingleElementCallback(callback: UpdateDetailsCallbackFunction): ScrollableGridUiHandler {
|
withUpdateSingleElementCallback(callback: UpdateDetailsCallbackFunction): ScrollableGridUiHandler {
|
||||||
@ -74,7 +74,7 @@ export default class ScrollableGridUiHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param totalElements the total number of elements that the grid needs to display
|
* @param totalElements - the total number of elements that the grid needs to display
|
||||||
*/
|
*/
|
||||||
setTotalElements(totalElements: number) {
|
setTotalElements(totalElements: number) {
|
||||||
this.totalElements = totalElements;
|
this.totalElements = totalElements;
|
||||||
@ -93,7 +93,7 @@ export default class ScrollableGridUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the cursor and scrollCursor based on user input
|
* Update the cursor and scrollCursor based on user input
|
||||||
* @param button the button that was pressed
|
* @param button - the button that was pressed
|
||||||
* @returns `true` if either the cursor or scrollCursor was updated
|
* @returns `true` if either the cursor or scrollCursor was updated
|
||||||
*/
|
*/
|
||||||
processInput(button: Button): boolean {
|
processInput(button: Button): boolean {
|
||||||
|
@ -341,7 +341,7 @@ export default class AbstractSettingsUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate the specified setting if it is activatable.
|
* Activate the specified setting if it is activatable.
|
||||||
* @param setting The setting to activate.
|
* @param setting - The setting to activate.
|
||||||
* @returns Whether the setting was successfully activated.
|
* @returns Whether the setting was successfully activated.
|
||||||
*/
|
*/
|
||||||
activateSetting(setting: Setting): boolean {
|
activateSetting(setting: Setting): boolean {
|
||||||
|
@ -63,7 +63,7 @@ export default class MoveTouchControlsHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the state of the touch controls to the given orientation.
|
* Changes the state of the touch controls to the given orientation.
|
||||||
* @param isLandscapeMode Whether the screen is in landscape mode.
|
* @param isLandscapeMode - Whether the screen is in landscape mode.
|
||||||
*/
|
*/
|
||||||
private async changeOrientation(isLandscapeMode: boolean) {
|
private async changeOrientation(isLandscapeMode: boolean) {
|
||||||
this.isLandscapeMode = isLandscapeMode;
|
this.isLandscapeMode = isLandscapeMode;
|
||||||
@ -157,15 +157,15 @@ export default class MoveTouchControlsHandler {
|
|||||||
/**
|
/**
|
||||||
* Elements that are inside the left div are anchored to the left boundary of the screen.
|
* Elements that are inside the left div are anchored to the left boundary of the screen.
|
||||||
* The x value of the positions are considered offsets to their respective boundaries.
|
* The x value of the positions are considered offsets to their respective boundaries.
|
||||||
* @param element Either an element in the left div or the right div.
|
* @param element - Either an element in the left div or the right div.
|
||||||
* @returns Whether the given element is inside the left div.
|
* @returns Whether the given element is inside the left div.
|
||||||
*/
|
*/
|
||||||
private isLeft = (element: HTMLElement) => document.querySelector("#touchControls .left")?.contains(element);
|
private isLeft = (element: HTMLElement) => document.querySelector("#touchControls .left")?.contains(element);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start dragging the given button.
|
* Start dragging the given button.
|
||||||
* @param controlGroup The button that is being dragged.
|
* @param controlGroup - The button that is being dragged.
|
||||||
* @param touch The touch event that started the drag.
|
* @param touch - The touch event that started the drag.
|
||||||
*/
|
*/
|
||||||
private startDrag = (controlGroup: HTMLElement): void => {
|
private startDrag = (controlGroup: HTMLElement): void => {
|
||||||
this.draggingElement = controlGroup;
|
this.draggingElement = controlGroup;
|
||||||
@ -173,8 +173,8 @@ export default class MoveTouchControlsHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Drags the currently dragged element to the given touch position.
|
* Drags the currently dragged element to the given touch position.
|
||||||
* @param touch The touch event that is currently happening.
|
* @param touch - The touch event that is currently happening.
|
||||||
* @param isLeft Whether the dragged element is a left button.
|
* @param isLeft - Whether the dragged element is a left button.
|
||||||
*/
|
*/
|
||||||
private drag = (touch: Touch): void => {
|
private drag = (touch: Touch): void => {
|
||||||
if (!this.draggingElement) {
|
if (!this.draggingElement) {
|
||||||
@ -242,7 +242,7 @@ export default class MoveTouchControlsHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the positions of the touch controls.
|
* Updates the positions of the touch controls.
|
||||||
* @param positions The new positions of the touch controls.
|
* @param positions - The new positions of the touch controls.
|
||||||
*/
|
*/
|
||||||
private setPositions(positions: ControlPosition[]) {
|
private setPositions(positions: ControlPosition[]) {
|
||||||
this.resetPositions();
|
this.resetPositions();
|
||||||
@ -258,8 +258,8 @@ export default class MoveTouchControlsHandler {
|
|||||||
* E.g. For left elements, (0, 0) is the bottom left corner of the screen and
|
* E.g. For left elements, (0, 0) is the bottom left corner of the screen and
|
||||||
* for right elements, (0, 0) is the bottom right corner of the screen.
|
* for right elements, (0, 0) is the bottom right corner of the screen.
|
||||||
* @param controlElement
|
* @param controlElement
|
||||||
* @param x Either an offset to the left or right boundary of the screen.
|
* @param x - Either an offset to the left or right boundary of the screen.
|
||||||
* @param y An offset to the bottom boundary of the screen.
|
* @param y - An offset to the bottom boundary of the screen.
|
||||||
*/
|
*/
|
||||||
private setPosition(controlElement: HTMLElement, x: number, y: number) {
|
private setPosition(controlElement: HTMLElement, x: number, y: number) {
|
||||||
const rect = controlElement.getBoundingClientRect();
|
const rect = controlElement.getBoundingClientRect();
|
||||||
@ -298,7 +298,7 @@ export default class MoveTouchControlsHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the event listeners for the configuration mode.
|
* Creates the event listeners for the configuration mode.
|
||||||
* @param controlGroups The elements that can be dragged around the screen.
|
* @param controlGroups - The elements that can be dragged around the screen.
|
||||||
* @returns The event listeners for the configuration mode.
|
* @returns The event listeners for the configuration mode.
|
||||||
*/
|
*/
|
||||||
private createConfigurationEventListeners(controlGroups: HTMLDivElement[]): ConfigurationEventListeners {
|
private createConfigurationEventListeners(controlGroups: HTMLDivElement[]): ConfigurationEventListeners {
|
||||||
@ -324,7 +324,7 @@ export default class MoveTouchControlsHandler {
|
|||||||
/**
|
/**
|
||||||
* Creates an overlay that covers the screen and allows the user to drag the touch controls around.
|
* Creates an overlay that covers the screen and allows the user to drag the touch controls around.
|
||||||
* Also enables the toolbar for saving, resetting, and canceling the changes.
|
* Also enables the toolbar for saving, resetting, and canceling the changes.
|
||||||
* @param ui The UI of the game.
|
* @param ui - The UI of the game.
|
||||||
*/
|
*/
|
||||||
private createOverlay(ui: UI) {
|
private createOverlay(ui: UI) {
|
||||||
const container = new Phaser.GameObjects.Container(globalScene, 0, 0);
|
const container = new Phaser.GameObjects.Container(globalScene, 0, 0);
|
||||||
@ -348,7 +348,7 @@ export default class MoveTouchControlsHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the user to configure the touch controls by dragging buttons around the screen.
|
* Allows the user to configure the touch controls by dragging buttons around the screen.
|
||||||
* @param ui The UI of the game.
|
* @param ui - The UI of the game.
|
||||||
*/
|
*/
|
||||||
public enableConfigurationMode(ui: UI) {
|
public enableConfigurationMode(ui: UI) {
|
||||||
if (this.inConfigurationMode) {
|
if (this.inConfigurationMode) {
|
||||||
|
@ -60,7 +60,7 @@ export class NavigationManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigates modes based on given direction
|
* Navigates modes based on given direction
|
||||||
* @param direction LEFT or RIGHT
|
* @param direction - LEFT or RIGHT
|
||||||
*/
|
*/
|
||||||
public navigate(direction) {
|
public navigate(direction) {
|
||||||
const pos = this.modes.indexOf(this.selectedMode);
|
const pos = this.modes.indexOf(this.selectedMode);
|
||||||
@ -109,8 +109,8 @@ export default class NavigationMenu extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of NavigationMenu.
|
* Creates an instance of NavigationMenu.
|
||||||
* @param x The x position of the NavigationMenu.
|
* @param x - The x position of the NavigationMenu.
|
||||||
* @param y The y position of the NavigationMenu.
|
* @param y - The y position of the NavigationMenu.
|
||||||
*/
|
*/
|
||||||
constructor(x: number, y: number) {
|
constructor(x: number, y: number) {
|
||||||
super(globalScene, x, y);
|
super(globalScene, x, y);
|
||||||
@ -200,7 +200,7 @@ export default class NavigationMenu extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles navigation based on the button pressed.
|
* Handles navigation based on the button pressed.
|
||||||
* @param button The button pressed for navigation.
|
* @param button - The button pressed for navigation.
|
||||||
* @returns A boolean indicating if the navigation was handled.
|
* @returns A boolean indicating if the navigation was handled.
|
||||||
*/
|
*/
|
||||||
navigate(button: Button): boolean {
|
navigate(button: Button): boolean {
|
||||||
|
@ -20,7 +20,6 @@ import { globalScene } from "#app/global-scene";
|
|||||||
/**
|
/**
|
||||||
* Class representing the settings UI handler for gamepads.
|
* Class representing the settings UI handler for gamepads.
|
||||||
*
|
*
|
||||||
* @extends AbstractControlSettingsUiHandler
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default class SettingsGamepadUiHandler extends AbstractControlSettingsUiHandler {
|
export default class SettingsGamepadUiHandler extends AbstractControlSettingsUiHandler {
|
||||||
|
@ -20,7 +20,6 @@ import { globalScene } from "#app/global-scene";
|
|||||||
/**
|
/**
|
||||||
* Class representing the settings UI handler for keyboards.
|
* Class representing the settings UI handler for keyboards.
|
||||||
*
|
*
|
||||||
* @extends AbstractControlSettingsUiHandler
|
|
||||||
*/
|
*/
|
||||||
export default class SettingsKeyboardUiHandler extends AbstractControlSettingsUiHandler {
|
export default class SettingsKeyboardUiHandler extends AbstractControlSettingsUiHandler {
|
||||||
/**
|
/**
|
||||||
|
@ -171,7 +171,7 @@ const randomSelectionWindowHeight = 20;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the starter position for a Pokemon of a given UI index
|
* Calculates the starter position for a Pokemon of a given UI index
|
||||||
* @param index UI index to calculate the starter position of
|
* @param index - UI index to calculate the starter position of
|
||||||
* @returns An interface with an x and y property
|
* @returns An interface with an x and y property
|
||||||
*/
|
*/
|
||||||
function calcStarterPosition(index: number, scrollCursor = 0): { x: number; y: number } {
|
function calcStarterPosition(index: number, scrollCursor = 0): { x: number; y: number } {
|
||||||
@ -185,7 +185,7 @@ function calcStarterPosition(index: number, scrollCursor = 0): { x: number; y: n
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the y position for the icon of stater pokemon selected for the team
|
* Calculates the y position for the icon of stater pokemon selected for the team
|
||||||
* @param index index of the Pokemon in the team (0-5)
|
* @param index - index of the Pokemon in the team (0-5)
|
||||||
* @returns the y position to use for the icon
|
* @returns the y position to use for the icon
|
||||||
*/
|
*/
|
||||||
function calcStarterIconY(index: number) {
|
function calcStarterIconY(index: number) {
|
||||||
@ -196,8 +196,8 @@ function calcStarterIconY(index: number) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the index of the team Pokemon closest vertically to the given y position
|
* Finds the index of the team Pokemon closest vertically to the given y position
|
||||||
* @param y the y position to find closest starter Pokemon
|
* @param y - the y position to find closest starter Pokemon
|
||||||
* @param teamSize how many Pokemon are in the team (0-6)
|
* @param teamSize - how many Pokemon are in the team (0-6)
|
||||||
* @returns index of the closest Pokemon in the team container
|
* @returns index of the closest Pokemon in the team container
|
||||||
*/
|
*/
|
||||||
function findClosestStarterIndex(y: number, teamSize = 6): number {
|
function findClosestStarterIndex(y: number, teamSize = 6): number {
|
||||||
@ -215,8 +215,8 @@ function findClosestStarterIndex(y: number, teamSize = 6): number {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the row of the filtered Pokemon closest vertically to the given Pokemon in the team
|
* Finds the row of the filtered Pokemon closest vertically to the given Pokemon in the team
|
||||||
* @param index index of the Pokemon in the team (0-5)
|
* @param index - index of the Pokemon in the team (0-5)
|
||||||
* @param numberOfRows the number of rows to check against
|
* @param numberOfRows - the number of rows to check against
|
||||||
* @returns index of the row closest vertically to the given Pokemon
|
* @returns index of the row closest vertically to the given Pokemon
|
||||||
*/
|
*/
|
||||||
function findClosestStarterRow(index: number, numberOfRows: number) {
|
function findClosestStarterRow(index: number, numberOfRows: number) {
|
||||||
@ -1227,7 +1227,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
* If somehow a preference is set for a form, variant, gender, ability or nature
|
* If somehow a preference is set for a form, variant, gender, ability or nature
|
||||||
* that wasn't actually unlocked or is invalid it will be cleared here
|
* that wasn't actually unlocked or is invalid it will be cleared here
|
||||||
*
|
*
|
||||||
* @param species The species to get Starter Preferences for
|
* @param species - The species to get Starter Preferences for
|
||||||
* @returns StarterAttributes for the species
|
* @returns StarterAttributes for the species
|
||||||
*/
|
*/
|
||||||
initStarterPrefs(species: PokemonSpecies): StarterAttributes {
|
initStarterPrefs(species: PokemonSpecies): StarterAttributes {
|
||||||
@ -1386,7 +1386,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a passive upgrade is available for the given species ID
|
* Determines if a passive upgrade is available for the given species ID
|
||||||
* @param speciesId The ID of the species to check the passive of
|
* @param speciesId - The ID of the species to check the passive of
|
||||||
* @returns true if the user has enough candies and a passive has not been unlocked already
|
* @returns true if the user has enough candies and a passive has not been unlocked already
|
||||||
*/
|
*/
|
||||||
isPassiveAvailable(speciesId: number): boolean {
|
isPassiveAvailable(speciesId: number): boolean {
|
||||||
@ -1401,7 +1401,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a value reduction upgrade is available for the given species ID
|
* Determines if a value reduction upgrade is available for the given species ID
|
||||||
* @param speciesId The ID of the species to check the value reduction of
|
* @param speciesId - The ID of the species to check the value reduction of
|
||||||
* @returns true if the user has enough candies and all value reductions have not been unlocked already
|
* @returns true if the user has enough candies and all value reductions have not been unlocked already
|
||||||
*/
|
*/
|
||||||
isValueReductionAvailable(speciesId: number): boolean {
|
isValueReductionAvailable(speciesId: number): boolean {
|
||||||
@ -1417,7 +1417,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if an same species egg can be bought for the given species ID
|
* Determines if an same species egg can be bought for the given species ID
|
||||||
* @param speciesId The ID of the species to check the value reduction of
|
* @param speciesId - The ID of the species to check the value reduction of
|
||||||
* @returns true if the user has enough candies
|
* @returns true if the user has enough candies
|
||||||
*/
|
*/
|
||||||
isSameSpeciesEggAvailable(speciesId: number): boolean {
|
isSameSpeciesEggAvailable(speciesId: number): boolean {
|
||||||
@ -1429,9 +1429,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a bounce animation if enabled and the Pokemon has an upgrade
|
* Sets a bounce animation if enabled and the Pokemon has an upgrade
|
||||||
* @param icon {@linkcode Phaser.GameObjects.GameObject} to animate
|
* @param icon - to animate
|
||||||
* @param species {@linkcode PokemonSpecies} of the icon used to check for upgrades
|
* @param species - of the icon used to check for upgrades
|
||||||
* @param startPaused Should this animation be paused after it is added?
|
* @param startPaused - Should this animation be paused after it is added?
|
||||||
*/
|
*/
|
||||||
setUpgradeAnimation(icon: Phaser.GameObjects.Sprite, species: PokemonSpecies, startPaused = false): void {
|
setUpgradeAnimation(icon: Phaser.GameObjects.Sprite, species: PokemonSpecies, startPaused = false): void {
|
||||||
globalScene.tweens.killTweensOf(icon);
|
globalScene.tweens.killTweensOf(icon);
|
||||||
@ -1520,7 +1520,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the display of candy upgrade icons or animations for the given StarterContainer
|
* Update the display of candy upgrade icons or animations for the given StarterContainer
|
||||||
* @param starterContainer the container for the Pokemon to update
|
* @param starterContainer - the container for the Pokemon to update
|
||||||
*/
|
*/
|
||||||
updateCandyUpgradeDisplay(starterContainer: StarterContainer) {
|
updateCandyUpgradeDisplay(starterContainer: StarterContainer) {
|
||||||
if (this.isUpgradeIconEnabled()) {
|
if (this.isUpgradeIconEnabled()) {
|
||||||
@ -1533,7 +1533,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes an {@linkcode CandyUpgradeNotificationChangedEvent} sent when the corresponding setting changes
|
* Processes an {@linkcode CandyUpgradeNotificationChangedEvent} sent when the corresponding setting changes
|
||||||
* @param event {@linkcode Event} sent by the callback
|
* @param event - sent by the callback
|
||||||
*/
|
*/
|
||||||
onCandyUpgradeDisplayChanged(event: Event): void {
|
onCandyUpgradeDisplayChanged(event: Event): void {
|
||||||
const candyUpgradeDisplayEvent = event as CandyUpgradeNotificationChangedEvent;
|
const candyUpgradeDisplayEvent = event as CandyUpgradeNotificationChangedEvent;
|
||||||
@ -4400,7 +4400,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
* Creates a temporary dex attr props that will be used to check whether a pokemon is valid for a challenge
|
* Creates a temporary dex attr props that will be used to check whether a pokemon is valid for a challenge
|
||||||
* and to display the correct shiny, variant, and form based on the StarterPreferences
|
* and to display the correct shiny, variant, and form based on the StarterPreferences
|
||||||
*
|
*
|
||||||
* @param speciesId the id of the species to get props for
|
* @param speciesId - the id of the species to get props for
|
||||||
* @returns the dex props
|
* @returns the dex props
|
||||||
*/
|
*/
|
||||||
getCurrentDexProps(speciesId: number): bigint {
|
getCurrentDexProps(speciesId: number): bigint {
|
||||||
|
@ -66,8 +66,8 @@ export default class TargetSelectUiHandler extends UiHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines what value to assign the main cursor based on the previous turn's target or the user's status
|
* Determines what value to assign the main cursor based on the previous turn's target or the user's status
|
||||||
* @param cursorN the cursor associated with the user's field index
|
* @param cursorN - the cursor associated with the user's field index
|
||||||
* @param user the Pokemon using the move
|
* @param user - the Pokemon using the move
|
||||||
*/
|
*/
|
||||||
resetCursor(cursorN: number, user: Pokemon): void {
|
resetCursor(cursorN: number, user: Pokemon): void {
|
||||||
if (!isNullOrUndefined(cursorN)) {
|
if (!isNullOrUndefined(cursorN)) {
|
||||||
|
@ -286,10 +286,10 @@ export function getBBCodeFrag(content: string, textStyle: TextStyle, uiTheme: Ui
|
|||||||
* - "blue text" with TextStyle.SUMMARY_BLUE applied
|
* - "blue text" with TextStyle.SUMMARY_BLUE applied
|
||||||
* - " primaryStyle text " with primaryStyle TextStyle applied
|
* - " primaryStyle text " with primaryStyle TextStyle applied
|
||||||
* - "red text" with TextStyle.SUMMARY_RED applied
|
* - "red text" with TextStyle.SUMMARY_RED applied
|
||||||
* @param content string with styling that need to be applied for BBCodeTextObject
|
* @param content - string with styling that need to be applied for BBCodeTextObject
|
||||||
* @param primaryStyle Primary style is required in order to escape BBCode styling properly.
|
* @param primaryStyle - Primary style is required in order to escape BBCode styling properly.
|
||||||
* @param uiTheme the {@linkcode UiTheme} to get TextStyle for
|
* @param uiTheme - the {@linkcode UiTheme} to get TextStyle for
|
||||||
* @param forWindow set to `true` if the text is to be displayed in a window ({@linkcode BattleScene.addWindow})
|
* @param forWindow - set to `true` if the text is to be displayed in a window ({@linkcode BattleScene.addWindow})
|
||||||
* it will replace all instances of the default MONEY TextStyle by {@linkcode TextStyle.MONEY_WINDOW}
|
* it will replace all instances of the default MONEY TextStyle by {@linkcode TextStyle.MONEY_WINDOW}
|
||||||
*/
|
*/
|
||||||
export function getTextWithColors(
|
export function getTextWithColors(
|
||||||
|
@ -149,7 +149,7 @@ export default class TimeOfDayWidget extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Grabs the current time of day from the arena and calls {@linkcode tweenTimeOfDayIcon}
|
* Grabs the current time of day from the arena and calls {@linkcode tweenTimeOfDayIcon}
|
||||||
* @param _event {@linkcode Event} being sent
|
* @param _event - being sent
|
||||||
*/
|
*/
|
||||||
private onEncounterPhase(_event: Event) {
|
private onEncounterPhase(_event: Event) {
|
||||||
const newTime = globalScene.arena.getTimeOfDay();
|
const newTime = globalScene.arena.getTimeOfDay();
|
||||||
|
@ -13,7 +13,7 @@ export default abstract class UiHandler {
|
|||||||
public active = false;
|
public active = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mode The mode of the UI element. These should be unique.
|
* @param mode - The mode of the UI element. These should be unique.
|
||||||
*/
|
*/
|
||||||
constructor(mode: UiMode | null = null) {
|
constructor(mode: UiMode | null = null) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
@ -53,7 +53,7 @@ export default abstract class UiHandler {
|
|||||||
/**
|
/**
|
||||||
* Changes the style of the mouse cursor.
|
* Changes the style of the mouse cursor.
|
||||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor}
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor}
|
||||||
* @param cursorStyle cursor style to apply
|
* @param cursorStyle - cursor style to apply
|
||||||
*/
|
*/
|
||||||
protected setMouseCursorStyle(cursorStyle: "pointer" | "default") {
|
protected setMouseCursorStyle(cursorStyle: "pointer" | "default") {
|
||||||
globalScene.input.manager.canvas.style.cursor = cursorStyle;
|
globalScene.input.manager.canvas.style.cursor = cursorStyle;
|
||||||
|
@ -250,7 +250,7 @@ export default class UI extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a player input of a button (delivering it to the current UI handler for processing)
|
* Process a player input of a button (delivering it to the current UI handler for processing)
|
||||||
* @param button The {@linkcode Button} being inputted
|
* @param button - The {@linkcode Button} being inputted
|
||||||
* @returns true if the input attempt succeeds
|
* @returns true if the input attempt succeeds
|
||||||
*/
|
*/
|
||||||
processInput(button: Button): boolean {
|
processInput(button: Button): boolean {
|
||||||
|
@ -76,8 +76,8 @@ export function padInt(value: number, length: number, padWith?: string): string
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a random integer between min and min + range
|
* Returns a random integer between min and min + range
|
||||||
* @param range The amount of possible numbers
|
* @param range - The amount of possible numbers
|
||||||
* @param min The starting number
|
* @param min - The starting number
|
||||||
*/
|
*/
|
||||||
export function randInt(range: number, min = 0): number {
|
export function randInt(range: number, min = 0): number {
|
||||||
if (range === 1) {
|
if (range === 1) {
|
||||||
@ -88,8 +88,8 @@ export function randInt(range: number, min = 0): number {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a random number using the global seed, or the current battle's seed if called via `Battle.randSeedInt`
|
* Generates a random number using the global seed, or the current battle's seed if called via `Battle.randSeedInt`
|
||||||
* @param range How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
* @param range - How large of a range of random numbers to choose from. If {@linkcode range} <= 1, returns {@linkcode min}
|
||||||
* @param min The minimum integer to pick, default `0`
|
* @param min - The minimum integer to pick, default `0`
|
||||||
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
* @returns A random integer between {@linkcode min} and ({@linkcode min} + {@linkcode range} - 1)
|
||||||
*/
|
*/
|
||||||
export function randSeedInt(range: number, min = 0): number {
|
export function randSeedInt(range: number, min = 0): number {
|
||||||
@ -101,8 +101,8 @@ export function randSeedInt(range: number, min = 0): number {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a random integer between min and max (non-inclusive)
|
* Returns a random integer between min and max (non-inclusive)
|
||||||
* @param min The lowest number
|
* @param min - The lowest number
|
||||||
* @param max The highest number
|
* @param max - The highest number
|
||||||
*/
|
*/
|
||||||
export function randIntRange(min: number, max: number): number {
|
export function randIntRange(min: number, max: number): number {
|
||||||
return randInt(max - min, min);
|
return randInt(max - min, min);
|
||||||
@ -122,7 +122,7 @@ export function randSeedWeightedItem<T>(items: T[]): T {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Shuffle a list using the seeded rng. Utilises the Fisher-Yates algorithm.
|
* Shuffle a list using the seeded rng. Utilises the Fisher-Yates algorithm.
|
||||||
* @param {Array} items An array of items.
|
* @param items - An array of items.
|
||||||
* @returns {Array} A new shuffled array of items.
|
* @returns {Array} A new shuffled array of items.
|
||||||
*/
|
*/
|
||||||
export function randSeedShuffle<T>(items: T[]): T[] {
|
export function randSeedShuffle<T>(items: T[]): T[] {
|
||||||
@ -160,7 +160,7 @@ export function getPlayTimeString(totalSeconds: number): string {
|
|||||||
/**
|
/**
|
||||||
* Generates IVs from a given {@linkcode id} by extracting 5 bits at a time
|
* Generates IVs from a given {@linkcode id} by extracting 5 bits at a time
|
||||||
* starting from the least significant bit up to the 30th most significant bit.
|
* starting from the least significant bit up to the 30th most significant bit.
|
||||||
* @param id 32-bit number
|
* @param id - 32-bit number
|
||||||
* @returns An array of six numbers corresponding to 5-bit chunks from {@linkcode id}
|
* @returns An array of six numbers corresponding to 5-bit chunks from {@linkcode id}
|
||||||
*/
|
*/
|
||||||
export function getIvsFromId(id: number): number[] {
|
export function getIvsFromId(id: number): number[] {
|
||||||
@ -322,7 +322,7 @@ export function fixedInt(value: number): number {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Formats a string to title case
|
* Formats a string to title case
|
||||||
* @param unformattedText Text to be formatted
|
* @param unformattedText - Text to be formatted
|
||||||
* @returns the formatted string
|
* @returns the formatted string
|
||||||
*/
|
*/
|
||||||
export function formatText(unformattedText: string): string {
|
export function formatText(unformattedText: string): string {
|
||||||
@ -354,8 +354,8 @@ export function rgbToHsv(r: number, g: number, b: number) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare color difference in RGB
|
* Compare color difference in RGB
|
||||||
* @param {Array} rgb1 First RGB color in array
|
* @param rgb1 - First RGB color in array
|
||||||
* @param {Array} rgb2 Second RGB color in array
|
* @param rgb2 - Second RGB color in array
|
||||||
*/
|
*/
|
||||||
export function deltaRgb(rgb1: number[], rgb2: number[]): number {
|
export function deltaRgb(rgb1: number[], rgb2: number[]): number {
|
||||||
const [r1, g1, b1] = rgb1;
|
const [r1, g1, b1] = rgb1;
|
||||||
@ -390,9 +390,9 @@ export function rgbaToInt(rgba: number[]): number {
|
|||||||
* HSV color's corresponding hex code.
|
* HSV color's corresponding hex code.
|
||||||
*
|
*
|
||||||
* Sourced from {@link https://stackoverflow.com/a/44134328}.
|
* Sourced from {@link https://stackoverflow.com/a/44134328}.
|
||||||
* @param h Hue in degrees, must be in a range of [0, 360]
|
* @param h - Hue in degrees, must be in a range of [0, 360]
|
||||||
* @param s Saturation percentage, must be in a range of [0, 1]
|
* @param s - Saturation percentage, must be in a range of [0, 1]
|
||||||
* @param l Ligthness percentage, must be in a range of [0, 1]
|
* @param l - Ligthness percentage, must be in a range of [0, 1]
|
||||||
* @returns a string of the corresponding color hex code with a "#" prefix
|
* @returns a string of the corresponding color hex code with a "#" prefix
|
||||||
*/
|
*/
|
||||||
export function hslToHex(h: number, s: number, l: number): string {
|
export function hslToHex(h: number, s: number, l: number): string {
|
||||||
@ -440,7 +440,7 @@ export function hasAllLocalizedSprites(lang?: string): boolean {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the type and name of all game objects in a container for debugging purposes
|
* Prints the type and name of all game objects in a container for debugging purposes
|
||||||
* @param container container with game objects inside it
|
* @param container - container with game objects inside it
|
||||||
*/
|
*/
|
||||||
export function printContainerList(container: Phaser.GameObjects.Container): void {
|
export function printContainerList(container: Phaser.GameObjects.Container): void {
|
||||||
console.log(
|
console.log(
|
||||||
@ -542,7 +542,7 @@ export function toDmgValue(value: number, minValue = 1) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to localize a sprite key (e.g. for types)
|
* Helper method to localize a sprite key (e.g. for types)
|
||||||
* @param baseKey the base key of the sprite (e.g. `type`)
|
* @param baseKey - the base key of the sprite (e.g. `type`)
|
||||||
* @returns the localized sprite key
|
* @returns the localized sprite key
|
||||||
*/
|
*/
|
||||||
export function getLocalizedSpriteKey(baseKey: string) {
|
export function getLocalizedSpriteKey(baseKey: string) {
|
||||||
@ -551,9 +551,9 @@ export function getLocalizedSpriteKey(baseKey: string) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a number is **inclusive** between two numbers
|
* Check if a number is **inclusive** between two numbers
|
||||||
* @param num the number to check
|
* @param num - the number to check
|
||||||
* @param min the minimum value (included)
|
* @param min - the minimum value (included)
|
||||||
* @param max the maximum value (included)
|
* @param max - the maximum value (included)
|
||||||
* @returns `true` if number is **inclusive** between min and max
|
* @returns `true` if number is **inclusive** between min and max
|
||||||
*/
|
*/
|
||||||
export function isBetween(num: number, min: number, max: number): boolean {
|
export function isBetween(num: number, min: number, max: number): boolean {
|
||||||
@ -563,7 +563,7 @@ export function isBetween(num: number, min: number, max: number): boolean {
|
|||||||
/**
|
/**
|
||||||
* Helper method to return the animation filename for a given move
|
* Helper method to return the animation filename for a given move
|
||||||
*
|
*
|
||||||
* @param move the move for which the animation filename is needed
|
* @param move - the move for which the animation filename is needed
|
||||||
*/
|
*/
|
||||||
export function animationFileName(move: Moves): string {
|
export function animationFileName(move: Moves): string {
|
||||||
return Moves[move].toLowerCase().replace(/\_/g, "-");
|
return Moves[move].toLowerCase().replace(/\_/g, "-");
|
||||||
@ -571,7 +571,7 @@ export function animationFileName(move: Moves): string {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transforms a camelCase string into a kebab-case string
|
* Transforms a camelCase string into a kebab-case string
|
||||||
* @param str The camelCase string
|
* @param str - The camelCase string
|
||||||
* @returns A kebab-case string
|
* @returns A kebab-case string
|
||||||
*
|
*
|
||||||
* @source {@link https://stackoverflow.com/a/67243723/}
|
* @source {@link https://stackoverflow.com/a/67243723/}
|
||||||
|
Loading…
Reference in New Issue
Block a user