Merge branch 'beta' of https://github.com/Wlowscha/pokerogue into internal-pokedex

This commit is contained in:
Wlowscha 2025-02-05 02:13:36 +01:00
commit ad689a7340
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
11 changed files with 37 additions and 23 deletions

View File

@ -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: A move's UBS and TBS are computed with the respective functions in the `Move` class:
```ts ```ts
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer; getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number;
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer; 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: 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:

View File

@ -2861,7 +2861,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
* @returns A boolean indicating the result of the status application. * @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 { 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; cancelled.value = true;
return true; return true;
} }

View File

@ -7728,8 +7728,7 @@ export function initBiomes() {
uncatchableSpecies.push(speciesId); uncatchableSpecies.push(speciesId);
} }
// prepares new array in catchableSpecies to host available biomes // array of biome options for the current species
//TODO: this must be improved to only make arrays for starters
catchableSpecies[speciesId] = []; catchableSpecies[speciesId] = [];
for (const b of biomeEntries) { for (const b of biomeEntries) {

View File

@ -5,7 +5,7 @@ export interface PassiveAbilities {
[key: number]: Abilities [key: number]: Abilities
} }
export interface StarterPassiveAbilities { interface StarterPassiveAbilities {
[key: number]: PassiveAbilities [key: number]: PassiveAbilities
} }

View File

@ -68437,7 +68437,7 @@ interface SpeciesTmMoves {
[key: number]: (Moves | [string | Species, Moves])[]; [key: number]: (Moves | [string | Species, Moves])[];
} }
function flipTmSpecies(tmSpecies: TmSpecies): SpeciesTmMoves { function transposeTmSpecies(): SpeciesTmMoves {
const flipped: SpeciesTmMoves = {}; const flipped: SpeciesTmMoves = {};
for (const move in tmSpecies) { for (const move in tmSpecies) {
@ -68471,7 +68471,7 @@ function flipTmSpecies(tmSpecies: TmSpecies): SpeciesTmMoves {
return flipped; return flipped;
} }
export const speciesTmMoves: SpeciesTmMoves = flipTmSpecies(tmSpecies); export const speciesTmMoves: SpeciesTmMoves = transposeTmSpecies();
interface TmPoolTiers { interface TmPoolTiers {
[key: number]: ModifierTier [key: number]: ModifierTier

View File

@ -347,17 +347,17 @@ abstract class AnimTimedBgEvent extends AnimTimedEvent {
public bgX: number = 0; public bgX: number = 0;
public bgY: number = 0; public bgY: number = 0;
public opacity: number = 0; public opacity: number = 0;
/*public colorRed: integer = 0; /*public colorRed: number = 0;
public colorGreen: integer = 0; public colorGreen: number = 0;
public colorBlue: integer = 0; public colorBlue: number = 0;
public colorAlpha: integer = 0;*/ public colorAlpha: number = 0;*/
public duration: number = 0; public duration: number = 0;
/*public flashScope: integer = 0; /*public flashScope: number = 0;
public flashRed: integer = 0; public flashRed: number = 0;
public flashGreen: integer = 0; public flashGreen: number = 0;
public flashBlue: integer = 0; public flashBlue: number = 0;
public flashAlpha: integer = 0; public flashAlpha: number = 0;
public flashDuration: integer = 0;*/ public flashDuration: number = 0;*/
constructor(frameIndex: number, resourceName: string, source: any) { constructor(frameIndex: number, resourceName: string, source: any) {
super(frameIndex, resourceName); super(frameIndex, resourceName);

View File

@ -1435,7 +1435,7 @@ export class MatchHpAttr extends FixedDamageAttr {
} }
// TODO // TODO
/*getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { /*getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
return 0; return 0;
}*/ }*/
} }

View File

@ -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. * 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 {@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 { private getStrengthLevelDiff(strength: PartyMemberStrength): number {
switch (Math.min(strength, PartyMemberStrength.STRONGER)) { switch (Math.min(strength, PartyMemberStrength.STRONGER)) {

View File

@ -1,4 +1,4 @@
// public (.*?): integer; // public (.*?): number;
// this.$1 = source?.$1 || 0; // this.$1 = source?.$1 || 0;
export class GameStats { export class GameStats {

View File

@ -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);
});
}); });

View File

@ -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 * 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. * @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 {