diff --git a/docs/enemy-ai.md b/docs/enemy-ai.md index 46482f56a90..8edf5a3f10e 100644 --- a/docs/enemy-ai.md +++ b/docs/enemy-ai.md @@ -80,8 +80,8 @@ As part of the move selection process, the enemy Pokémon must compute a **targe A move's UBS and TBS are computed with the respective functions in the `Move` class: ```ts -getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer; -getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer; +getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number; +getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): number; ``` Logically, these functions are very similar – they add up their respective benefit scores from each of the move's attributes (as determined by `attr.getUserBenefitScore`, and `attr.getTargetBenefitScore`, respectively) and return the total benefit score. However, there are two key functional differences in how the UBS and TBS of a move are handled: diff --git a/src/data/ability.ts b/src/data/ability.ts index 9c1fa385b8a..5020123622e 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2861,7 +2861,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr { * @returns A boolean indicating the result of the status application. */ applyPreSetStatus(pokemon: Pokemon, passive: boolean, simulated: boolean, effect: StatusEffect, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (this.immuneEffects.length < 1 || this.immuneEffects.includes(effect)) { + if (effect !== StatusEffect.FAINT && this.immuneEffects.length < 1 || this.immuneEffects.includes(effect)) { cancelled.value = true; return true; } diff --git a/src/data/balance/biomes.ts b/src/data/balance/biomes.ts index 8da0a57b20e..5b5e69b4042 100644 --- a/src/data/balance/biomes.ts +++ b/src/data/balance/biomes.ts @@ -7728,8 +7728,7 @@ export function initBiomes() { uncatchableSpecies.push(speciesId); } - // prepares new array in catchableSpecies to host available biomes - //TODO: this must be improved to only make arrays for starters + // array of biome options for the current species catchableSpecies[speciesId] = []; for (const b of biomeEntries) { diff --git a/src/data/balance/passives.ts b/src/data/balance/passives.ts index f7370c46794..3b30a629a4b 100644 --- a/src/data/balance/passives.ts +++ b/src/data/balance/passives.ts @@ -5,7 +5,7 @@ export interface PassiveAbilities { [key: number]: Abilities } -export interface StarterPassiveAbilities { +interface StarterPassiveAbilities { [key: number]: PassiveAbilities } diff --git a/src/data/balance/tms.ts b/src/data/balance/tms.ts index d942cc6365c..788ffd4f273 100644 --- a/src/data/balance/tms.ts +++ b/src/data/balance/tms.ts @@ -68437,7 +68437,7 @@ interface SpeciesTmMoves { [key: number]: (Moves | [string | Species, Moves])[]; } -function flipTmSpecies(tmSpecies: TmSpecies): SpeciesTmMoves { +function transposeTmSpecies(): SpeciesTmMoves { const flipped: SpeciesTmMoves = {}; for (const move in tmSpecies) { @@ -68471,7 +68471,7 @@ function flipTmSpecies(tmSpecies: TmSpecies): SpeciesTmMoves { return flipped; } -export const speciesTmMoves: SpeciesTmMoves = flipTmSpecies(tmSpecies); +export const speciesTmMoves: SpeciesTmMoves = transposeTmSpecies(); interface TmPoolTiers { [key: number]: ModifierTier diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 384a648ea03..99e9e82d4a6 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -347,17 +347,17 @@ abstract class AnimTimedBgEvent extends AnimTimedEvent { public bgX: number = 0; public bgY: number = 0; public opacity: number = 0; - /*public colorRed: integer = 0; - public colorGreen: integer = 0; - public colorBlue: integer = 0; - public colorAlpha: integer = 0;*/ + /*public colorRed: number = 0; + public colorGreen: number = 0; + public colorBlue: number = 0; + public colorAlpha: number = 0;*/ public duration: number = 0; - /*public flashScope: integer = 0; - public flashRed: integer = 0; - public flashGreen: integer = 0; - public flashBlue: integer = 0; - public flashAlpha: integer = 0; - public flashDuration: integer = 0;*/ + /*public flashScope: number = 0; + public flashRed: number = 0; + public flashGreen: number = 0; + public flashBlue: number = 0; + public flashAlpha: number = 0; + public flashDuration: number = 0;*/ constructor(frameIndex: number, resourceName: string, source: any) { super(frameIndex, resourceName); diff --git a/src/data/move.ts b/src/data/move.ts index 91eac33dc89..6d327ec5dc1 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1435,7 +1435,7 @@ export class MatchHpAttr extends FixedDamageAttr { } // TODO - /*getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { + /*getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number { return 0; }*/ } diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 802db582ecc..8a3c61e00fe 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -718,7 +718,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali * 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. * @param strength {@linkcode PartyMemberStrength} The strength of the party member in question - * @returns {@linkcode integer} 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 { switch (Math.min(strength, PartyMemberStrength.STRONGER)) { diff --git a/src/system/game-stats.ts b/src/system/game-stats.ts index b8d2b13fc42..5553a0332fc 100644 --- a/src/system/game-stats.ts +++ b/src/system/game-stats.ts @@ -1,4 +1,4 @@ -// public (.*?): integer; +// public (.*?): number; // this.$1 = source?.$1 || 0; export class GameStats { diff --git a/src/test/abilities/shields_down.test.ts b/src/test/abilities/shields_down.test.ts index 6ffc28c37ab..ca6d945824e 100644 --- a/src/test/abilities/shields_down.test.ts +++ b/src/test/abilities/shields_down.test.ts @@ -189,4 +189,19 @@ describe("Abilities - SHIELDS DOWN", () => { } ); + test("should not prevent minior from receiving the fainted status effect in trainer battles", async () => { + game.override.enemyMoveset([ Moves.TACKLE ]); + game.override.moveset([ Moves.THUNDERBOLT ]); + game.override.startingLevel(100); + game.override.startingWave(5); + game.override.enemySpecies(Species.MINIOR); + await game.classicMode.startBattle([ Species.REGIELEKI ]); + const minior = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.THUNDERBOLT); + await game.toNextTurn(); + expect(minior.isFainted()).toBe(true); + expect(minior.status?.effect).toBe(StatusEffect.FAINT); + }); + }); diff --git a/src/ui/achvs-ui-handler.ts b/src/ui/achvs-ui-handler.ts index a75b0ca635f..74a121c231b 100644 --- a/src/ui/achvs-ui-handler.ts +++ b/src/ui/achvs-ui-handler.ts @@ -340,9 +340,9 @@ export default class AchvsUiHandler extends MessageUiHandler { } /** - * setScrollCursor(scrollCursor: integer) : 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 - * @param takes a scrollCursor 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. */ setScrollCursor(scrollCursor: number): boolean {