mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 23:13:42 +02:00
Cleanup docs in challenge.ts
This commit is contained in:
parent
e0976656a0
commit
8b1c1d922c
@ -56,7 +56,7 @@ export abstract class Challenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param id {@link Challenges} The enum value for the challenge
|
* @param id - The enum value for 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;
|
||||||
@ -85,9 +85,9 @@ export abstract class Challenge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for unlockable challenges to check if they're unlocked.
|
* Check if an unlockable challenge is unlocked
|
||||||
* @param data {@link GameData} The save data.
|
* @param data - The save data
|
||||||
* @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));
|
||||||
@ -95,8 +95,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an unlock condition to this challenge.
|
* Adds 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);
|
||||||
@ -105,7 +105,7 @@ 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`);
|
||||||
@ -132,7 +132,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 Returns true if the value changed
|
||||||
*/
|
*/
|
||||||
increaseValue(): boolean {
|
increaseValue(): boolean {
|
||||||
if (this.value < this.maxValue) {
|
if (this.value < this.maxValue) {
|
||||||
@ -144,7 +144,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 Returns true if the value changed
|
||||||
*/
|
*/
|
||||||
decreaseValue(): boolean {
|
decreaseValue(): boolean {
|
||||||
if (this.value > 0) {
|
if (this.value > 0) {
|
||||||
@ -163,7 +163,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 Returns true if the value changed
|
||||||
*/
|
*/
|
||||||
decreaseSeverity(): boolean {
|
decreaseSeverity(): boolean {
|
||||||
if (this.severity > 0) {
|
if (this.severity > 0) {
|
||||||
@ -175,7 +175,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 Returns true if the value changed
|
||||||
*/
|
*/
|
||||||
increaseSeverity(): boolean {
|
increaseSeverity(): boolean {
|
||||||
if (this.severity < this.maxSeverity) {
|
if (this.severity < this.maxSeverity) {
|
||||||
@ -187,7 +187,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the "difficulty" value of this challenge.
|
* Gets the "difficulty" value of this challenge.
|
||||||
* @returns {@link integer} The difficulty value.
|
* @returns The difficulty value.
|
||||||
*/
|
*/
|
||||||
getDifficulty(): number {
|
getDifficulty(): number {
|
||||||
return this.value;
|
return this.value;
|
||||||
@ -195,7 +195,7 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the minimum difficulty added by this challenge.
|
* Gets the minimum difficulty added by this challenge.
|
||||||
* @returns {@link integer} The difficulty value.
|
* @returns The difficulty value.
|
||||||
*/
|
*/
|
||||||
getMinDifficulty(): number {
|
getMinDifficulty(): number {
|
||||||
return 0;
|
return 0;
|
||||||
@ -203,7 +203,7 @@ 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 {
|
||||||
@ -212,10 +212,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 Pokémon 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 whether the Pokémon is valid or not
|
||||||
* @param _dexAttr {@link DexAttrProps} The dex attributes of the pokemon.
|
* @param _dexAttr - The dex attributes of the Pokémon
|
||||||
* @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;
|
||||||
@ -223,8 +223,8 @@ 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 - Holder for amount of starter points the user has to spend
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyStarterPoints(_points: NumberHolder): boolean {
|
applyStarterPoints(_points: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -232,9 +232,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 SpeciesId} The pokemon to change the cost of.
|
* @param _species - The pokémon to change the cost of
|
||||||
* @param _cost {@link NumberHolder} The cost of the starter.
|
* @param _cost - Holder for the cost of the starter Pokémon
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyStarterCost(_species: SpeciesId, _cost: NumberHolder): boolean {
|
applyStarterCost(_species: SpeciesId, _cost: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -242,8 +242,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for STARTER_SELECT_MODIFY challenges. Derived classes should alter this.
|
* An apply function for STARTER_SELECT_MODIFY challenges. Derived classes should alter this.
|
||||||
* @param _pokemon {@link Pokemon} The starter pokemon to modify.
|
* @param _pokemon - The starter Pokémon to modify.
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyStarterSelectModify(_speciesId: SpeciesId, _dexEntry: DexEntry, _starterDataEntry: StarterDataEntry): boolean {
|
applyStarterSelectModify(_speciesId: SpeciesId, _dexEntry: DexEntry, _starterDataEntry: StarterDataEntry): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -251,8 +251,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 Pokémon 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;
|
||||||
@ -260,9 +260,9 @@ 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 Pokémon 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 - Holds a boolean that will be set to false if the Pokémon isn't allowed
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyPokemonInBattle(_pokemon: Pokemon, _valid: BooleanHolder): boolean {
|
applyPokemonInBattle(_pokemon: Pokemon, _valid: BooleanHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -270,9 +270,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;
|
||||||
@ -280,8 +280,8 @@ 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 {
|
||||||
return false;
|
return false;
|
||||||
@ -291,9 +291,9 @@ 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 - The generated level.
|
* @param _level - The generated level.
|
||||||
* @param _levelCap - The current level cap.
|
* @param _levelCap - The current level cap.
|
||||||
* @param _isTrainer - Whether this is a trainer pokemon.
|
* @param _isTrainer - Whether this is a trainer Pokémon
|
||||||
* @param _isBoss - Whether this is a non-trainer boss pokemon.
|
* @param _isBoss - Whether this is a non-trainer boss Pokémon
|
||||||
* @returns - 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;
|
||||||
@ -301,9 +301,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 - The pokemon that is being considered.
|
* @param _pokemon - The Pokémon that is being considered
|
||||||
* @param moveSlots - The amount of move slots.
|
* @param _moveSlots - The amount of move slots
|
||||||
* @returns 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;
|
||||||
@ -311,9 +311,9 @@ 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 - The pokemon to change.
|
* @param _pokemon - The Pokémon to change
|
||||||
* @param _hasPassive - Whether it should have its passive.
|
* @param _hasPassive - Whether it should have its passive
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyPassiveAccess(_pokemon: Pokemon, _hasPassive: BooleanHolder): boolean {
|
applyPassiveAccess(_pokemon: Pokemon, _hasPassive: BooleanHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -321,7 +321,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;
|
||||||
@ -329,11 +329,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 Pokémon would learn the move
|
||||||
* @param _moveSource {@link MoveSourceType} What source the pokemon would get the move from.
|
* @param _moveSource - What source the Pokémon would get the move from
|
||||||
* @param _move {@link MoveId} 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: MoveId, _level: NumberHolder): boolean {
|
applyMoveAccessLevel(_pokemon: Pokemon, _moveSource: MoveSourceType, _move: MoveId, _level: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
@ -341,21 +341,21 @@ 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 Pokémon would learn the move
|
||||||
* @param _moveSource {@link MoveSourceType} What source the pokemon would get the move from.
|
* @param _moveSource - What source the Pokémon would get the move from
|
||||||
* @param _move {@link MoveId} 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: MoveId, _level: NumberHolder): boolean {
|
applyMoveWeight(_pokemon: Pokemon, _moveSource: MoveSourceType, _move: MoveId, _weight: NumberHolder): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 Pokémon 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;
|
||||||
@ -381,8 +381,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for POKEMON_ADD_TO_PARTY. Derived classes should alter this.
|
* An apply function for POKEMON_ADD_TO_PARTY. Derived classes should alter this.
|
||||||
* @param _pokemon - The pokemon being caught
|
* @param _pokemon - The Pokémon being caught
|
||||||
* @param _status - Whether the pokemon can be added to the party or not
|
* @param _status - Whether the Pokémon can be added to the party or not
|
||||||
* @returns Whether this function did anything
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyPokemonAddToParty(_pokemon: EnemyPokemon, _status: BooleanHolder): boolean {
|
applyPokemonAddToParty(_pokemon: EnemyPokemon, _status: BooleanHolder): boolean {
|
||||||
@ -391,8 +391,8 @@ export abstract class Challenge {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An apply function for POKEMON_FUSION. Derived classes should alter this.
|
* An apply function for POKEMON_FUSION. Derived classes should alter this.
|
||||||
* @param _pokemon - The pokemon being checked
|
* @param _pokemon - The Pokémon being checked
|
||||||
* @param _status - Whether the selected pokemon is allowed to fuse or not
|
* @param _status - Whether the selected Pokémon is allowed to fuse or not
|
||||||
* @returns Whether this function did anything
|
* @returns Whether this function did anything
|
||||||
*/
|
*/
|
||||||
applyPokemonFusion(_pokemon: PlayerPokemon, _status: BooleanHolder): boolean {
|
applyPokemonFusion(_pokemon: PlayerPokemon, _status: BooleanHolder): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user