mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 06:42:20 +02:00
Merge branch 'beta' into EvilTeamChangesssss
This commit is contained in:
commit
4a60ede5af
@ -50,7 +50,8 @@
|
|||||||
"noUndeclaredVariables": "off",
|
"noUndeclaredVariables": "off",
|
||||||
"noUnusedVariables": "error",
|
"noUnusedVariables": "error",
|
||||||
"noSwitchDeclarations": "warn", // TODO: refactor and make this an error
|
"noSwitchDeclarations": "warn", // TODO: refactor and make this an error
|
||||||
"noVoidTypeReturn": "warn" // TODO: Refactor and make this an error
|
"noVoidTypeReturn": "warn", // TODO: Refactor and make this an error
|
||||||
|
"noUnusedImports": "error"
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"noVar": "error",
|
"noVar": "error",
|
||||||
|
@ -2151,6 +2151,21 @@ export class TypeBoostTag extends BattlerTag {
|
|||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
return lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
|
return lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override onAdd(pokemon: Pokemon): void {
|
||||||
|
globalScene.queueMessage(
|
||||||
|
i18next.t("abilityTriggers:typeImmunityPowerBoost", {
|
||||||
|
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||||
|
typeName: i18next.t(`pokemonInfo:Type.${PokemonType[this.boostedType]}`),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
override onOverlap(pokemon: Pokemon): void {
|
||||||
|
globalScene.queueMessage(
|
||||||
|
i18next.t("abilityTriggers:moveImmunity", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CritBoostTag extends BattlerTag {
|
export class CritBoostTag extends BattlerTag {
|
||||||
|
@ -905,7 +905,7 @@ export default class Move implements Localizable {
|
|||||||
SacrificialAttrOnHit
|
SacrificialAttrOnHit
|
||||||
];
|
];
|
||||||
|
|
||||||
// ...and cannot enhance these specific moves.
|
// ...and cannot enhance these specific moves
|
||||||
const exceptMoves: Moves[] = [
|
const exceptMoves: Moves[] = [
|
||||||
Moves.FLING,
|
Moves.FLING,
|
||||||
Moves.UPROAR,
|
Moves.UPROAR,
|
||||||
@ -914,10 +914,14 @@ export default class Move implements Localizable {
|
|||||||
Moves.ENDEAVOR
|
Moves.ENDEAVOR
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// ...and cannot enhance Pollen Puff when targeting an ally.
|
||||||
|
const exceptPollenPuffAlly: boolean = this.id === Moves.POLLEN_PUFF && targets.includes(user.getAlly().getBattlerIndex())
|
||||||
|
|
||||||
return (!restrictSpread || !isMultiTarget)
|
return (!restrictSpread || !isMultiTarget)
|
||||||
&& !this.isChargingMove()
|
&& !this.isChargingMove()
|
||||||
&& !exceptAttrs.some(attr => this.hasAttr(attr))
|
&& !exceptAttrs.some(attr => this.hasAttr(attr))
|
||||||
&& !exceptMoves.some(id => this.id === id)
|
&& !exceptMoves.some(id => this.id === id)
|
||||||
|
&& !exceptPollenPuffAlly
|
||||||
&& this.category !== MoveCategory.STATUS;
|
&& this.category !== MoveCategory.STATUS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1580,10 +1584,6 @@ export class SurviveDamageAttr extends ModifiedDamageAttr {
|
|||||||
return Math.min(damage, target.hp - 1);
|
return Math.min(damage, target.hp - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
getCondition(): MoveConditionFunc {
|
|
||||||
return (user, target, move) => target.hp > 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
||||||
return target.hp > 1 ? 0 : -20;
|
return target.hp > 1 ? 0 : -20;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode
|
|||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { getPokeballTintColor } from "#app/data/pokeball";
|
import { getPokeballTintColor } from "#app/data/pokeball";
|
||||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounters/theExpertPokemonBreeder";
|
const namespace = "mysteryEncounters/theExpertPokemonBreeder";
|
||||||
|
@ -332,7 +332,6 @@ export function initMysteryEncounters() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add ANY biome encounters to biome map
|
// Add ANY biome encounters to biome map
|
||||||
// eslint-disable-next-line
|
|
||||||
let _encounterBiomeTableLog = "";
|
let _encounterBiomeTableLog = "";
|
||||||
mysteryEncountersByBiome.forEach((biomeEncounters, biome) => {
|
mysteryEncountersByBiome.forEach((biomeEncounters, biome) => {
|
||||||
anyBiomeEncounters.forEach(encounter => {
|
anyBiomeEncounters.forEach(encounter => {
|
||||||
|
@ -7,7 +7,7 @@ import i18next from "i18next";
|
|||||||
import type { AnySound } from "#app/battle-scene";
|
import type { AnySound } from "#app/battle-scene";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { GameMode } from "#app/game-mode";
|
import type { GameMode } from "#app/game-mode";
|
||||||
import { DexAttr, DexEntry, type StarterMoveset } from "#app/system/game-data";
|
import { DexAttr, type StarterMoveset } from "#app/system/game-data";
|
||||||
import * as Utils from "#app/utils";
|
import * as Utils from "#app/utils";
|
||||||
import { uncatchableSpecies } from "#app/data/balance/biomes";
|
import { uncatchableSpecies } from "#app/data/balance/biomes";
|
||||||
import { speciesEggMoves } from "#app/data/balance/egg-moves";
|
import { speciesEggMoves } from "#app/data/balance/egg-moves";
|
||||||
|
@ -214,7 +214,7 @@ const commonSplashMessages = [
|
|||||||
"bornToBeAWinner",
|
"bornToBeAWinner",
|
||||||
"onARollout",
|
"onARollout",
|
||||||
"itsAlwaysNightDeepInTheAbyss",
|
"itsAlwaysNightDeepInTheAbyss",
|
||||||
"folksThisIsInsane"
|
"folksThisIsInsane",
|
||||||
];
|
];
|
||||||
|
|
||||||
//#region Seasonal Messages
|
//#region Seasonal Messages
|
||||||
@ -224,10 +224,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
name: "New Year's",
|
name: "New Year's",
|
||||||
start: "01-01",
|
start: "01-01",
|
||||||
end: "01-15",
|
end: "01-15",
|
||||||
messages: [
|
messages: ["newYears.happyNewYear", "newYears.andAHappyNewYear"],
|
||||||
"newYears.happyNewYear",
|
|
||||||
"newYears.andAHappyNewYear"
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Valentines",
|
name: "Valentines",
|
||||||
@ -239,7 +236,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"valentines.applinForYou",
|
"valentines.applinForYou",
|
||||||
"valentines.thePowerOfLoveIsThreeThirtyBST",
|
"valentines.thePowerOfLoveIsThreeThirtyBST",
|
||||||
"valentines.haveAHeartScale",
|
"valentines.haveAHeartScale",
|
||||||
"valentines.i<3You"
|
"valentines.i<3You",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -279,7 +276,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"aprilFools.nowWithQuickTimeEncounters",
|
"aprilFools.nowWithQuickTimeEncounters",
|
||||||
"aprilFools.timeYourInputsForHigherCatchrate",
|
"aprilFools.timeYourInputsForHigherCatchrate",
|
||||||
"aprilFools.certifiedButtonSimulator",
|
"aprilFools.certifiedButtonSimulator",
|
||||||
"aprilFools.iHopeYouGetSuckerPunched"
|
"aprilFools.iHopeYouGetSuckerPunched",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -293,7 +290,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"halloween.mayContainSpiders",
|
"halloween.mayContainSpiders",
|
||||||
"halloween.spookyScarySkeledirge",
|
"halloween.spookyScarySkeledirge",
|
||||||
"halloween.gourgeistUsedTrickOrTreat",
|
"halloween.gourgeistUsedTrickOrTreat",
|
||||||
"halloween.letsSnuggleForever"
|
"halloween.letsSnuggleForever",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -316,7 +313,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"winterHoliday.tisTheSeasonToBeSpeSpa",
|
"winterHoliday.tisTheSeasonToBeSpeSpa",
|
||||||
"winterHoliday.deckTheHalls",
|
"winterHoliday.deckTheHalls",
|
||||||
"winterHoliday.saveScummingGetsYouOnTheNaughtyList",
|
"winterHoliday.saveScummingGetsYouOnTheNaughtyList",
|
||||||
"winterHoliday.badTrainersGetRolycoly"
|
"winterHoliday.badTrainersGetRolycoly",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { ModifierTypeFunc } from "#app/modifier/modifier-type";
|
|
||||||
import { Mode } from "#app/ui/ui";
|
import { Mode } from "#app/ui/ui";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
||||||
|
@ -653,7 +653,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
this.applyOnHitEffects(user, target, firstHit, lastHit, firstTarget);
|
this.applyOnHitEffects(user, target, firstHit, lastHit, firstTarget);
|
||||||
this.applyOnGetHitAbEffects(user, target, hitResult);
|
this.applyOnGetHitAbEffects(user, target, hitResult);
|
||||||
applyPostAttackAbAttrs(PostAttackAbAttr, user, target, this.move.getMove(), hitResult);
|
applyPostAttackAbAttrs(PostAttackAbAttr, user, target, this.move.getMove(), hitResult);
|
||||||
if (this.move.getMove() instanceof AttackMove) {
|
if (this.move.getMove() instanceof AttackMove && hitResult !== HitResult.STATUS) {
|
||||||
globalScene.applyModifiers(ContactHeldItemTransferChanceModifier, this.player, user, target);
|
globalScene.applyModifiers(ContactHeldItemTransferChanceModifier, this.player, user, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { BattlerIndex } from "#app/battle";
|
|
||||||
import { BattlerTagLapseType } from "#app/data/battler-tags";
|
import { BattlerTagLapseType } from "#app/data/battler-tags";
|
||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { BattlerIndex } from "#app/battle";
|
|
||||||
import { applyAbAttrs, applyPostSummonAbAttrs, CommanderAbAttr, PostSummonAbAttr } from "#app/data/ability";
|
import { applyAbAttrs, applyPostSummonAbAttrs, CommanderAbAttr, PostSummonAbAttr } from "#app/data/ability";
|
||||||
import { ArenaTrapTag } from "#app/data/arena-tag";
|
import { ArenaTrapTag } from "#app/data/arena-tag";
|
||||||
import { StatusEffect } from "#app/enums/status-effect";
|
import { StatusEffect } from "#app/enums/status-effect";
|
||||||
|
@ -5,8 +5,8 @@ import type BattleScene from "#app/battle-scene";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
|
|
||||||
type FadeIn = typeof FadeIn;
|
type FadeInType = typeof FadeIn;
|
||||||
type FadeOut = typeof FadeOut;
|
type FadeOutType = typeof FadeOut;
|
||||||
|
|
||||||
export function initGameSpeed() {
|
export function initGameSpeed() {
|
||||||
const thisArg = this as BattleScene;
|
const thisArg = this as BattleScene;
|
||||||
@ -101,7 +101,7 @@ export function initGameSpeed() {
|
|||||||
|
|
||||||
const originalFadeOut = SoundFade.fadeOut;
|
const originalFadeOut = SoundFade.fadeOut;
|
||||||
SoundFade.fadeOut = ((_scene: Phaser.Scene, sound: Phaser.Sound.BaseSound, duration: number, destroy?: boolean) =>
|
SoundFade.fadeOut = ((_scene: Phaser.Scene, sound: Phaser.Sound.BaseSound, duration: number, destroy?: boolean) =>
|
||||||
originalFadeOut(globalScene, sound, transformValue(duration), destroy)) as FadeOut;
|
originalFadeOut(globalScene, sound, transformValue(duration), destroy)) as FadeOutType;
|
||||||
|
|
||||||
const originalFadeIn = SoundFade.fadeIn;
|
const originalFadeIn = SoundFade.fadeIn;
|
||||||
SoundFade.fadeIn = ((
|
SoundFade.fadeIn = ((
|
||||||
@ -110,5 +110,5 @@ export function initGameSpeed() {
|
|||||||
duration: number,
|
duration: number,
|
||||||
endVolume?: number,
|
endVolume?: number,
|
||||||
startVolume?: number,
|
startVolume?: number,
|
||||||
) => originalFadeIn(globalScene, sound, transformValue(duration), endVolume, startVolume)) as FadeIn;
|
) => originalFadeIn(globalScene, sound, transformValue(duration), endVolume, startVolume)) as FadeInType;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ import { Moves } from "#enums/moves";
|
|||||||
import type { Species } from "#enums/species";
|
import type { Species } from "#enums/species";
|
||||||
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
||||||
import type { PokemonType } from "#enums/pokemon-type";
|
import type { PokemonType } from "#enums/pokemon-type";
|
||||||
import { getSpeciesFormChangeMessage } from "#app/data/pokemon-forms";
|
|
||||||
|
|
||||||
export default class PokemonData {
|
export default class PokemonData {
|
||||||
public id: number;
|
public id: number;
|
||||||
|
@ -950,7 +950,7 @@ export function setSetting(setting: string, value: number): boolean {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Català",
|
label: "Català",
|
||||||
handler: () => changeLocaleHandler("ca-ES")
|
handler: () => changeLocaleHandler("ca-ES"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18next.t("settings:back"),
|
label: i18next.t("settings:back"),
|
||||||
|
@ -1150,8 +1150,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
});
|
});
|
||||||
this.blockInput = false;
|
this.blockInput = false;
|
||||||
} else {
|
} else {
|
||||||
ui.revertMode()
|
ui.revertMode().then(() => {
|
||||||
.then(() => {
|
|
||||||
console.log("exitCallback", this.exitCallback);
|
console.log("exitCallback", this.exitCallback);
|
||||||
if (this.exitCallback instanceof Function) {
|
if (this.exitCallback instanceof Function) {
|
||||||
const exitCallback = this.exitCallback;
|
const exitCallback = this.exitCallback;
|
||||||
|
@ -12,7 +12,7 @@ import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUN
|
|||||||
import { catchableSpecies } from "#app/data/balance/biomes";
|
import { catchableSpecies } from "#app/data/balance/biomes";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import type { DexAttrProps, DexEntry, StarterAttributes, StarterPreferences } from "#app/system/game-data";
|
import type { DexAttrProps, DexEntry, StarterAttributes, StarterPreferences } from "#app/system/game-data";
|
||||||
import { AbilityAttr, DexAttr, loadStarterPreferences, saveStarterPreferences } from "#app/system/game-data";
|
import { AbilityAttr, DexAttr, loadStarterPreferences } from "#app/system/game-data";
|
||||||
import MessageUiHandler from "#app/ui/message-ui-handler";
|
import MessageUiHandler from "#app/ui/message-ui-handler";
|
||||||
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler";
|
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler";
|
||||||
import { TextStyle, addTextObject } from "#app/ui/text";
|
import { TextStyle, addTextObject } from "#app/ui/text";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { CandyUpgradeNotificationChangedEvent } from "#app/events/battle-scene";
|
import type { CandyUpgradeNotificationChangedEvent } from "#app/events/battle-scene";
|
||||||
import { BattleSceneEventType } from "#app/events/battle-scene";
|
import { BattleSceneEventType } from "#app/events/battle-scene";
|
||||||
import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import type { Variant } from "#app/data/variant";
|
import type { Variant } from "#app/data/variant";
|
||||||
import { getVariantTint, getVariantIcon } from "#app/data/variant";
|
import { getVariantTint, getVariantIcon } from "#app/data/variant";
|
||||||
import { argbFromRgba } from "@material/material-color-utilities";
|
import { argbFromRgba } from "@material/material-color-utilities";
|
||||||
@ -19,7 +19,7 @@ import { pokemonFormChanges } from "#app/data/pokemon-forms";
|
|||||||
import type { LevelMoves } from "#app/data/balance/pokemon-level-moves";
|
import type { LevelMoves } from "#app/data/balance/pokemon-level-moves";
|
||||||
import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves";
|
import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves";
|
||||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||||
import { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, getPokerusStarters } from "#app/data/pokemon-species";
|
import { allSpecies, getPokemonSpeciesForm, getPokerusStarters } from "#app/data/pokemon-species";
|
||||||
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { GameModes } from "#app/game-mode";
|
import { GameModes } from "#app/game-mode";
|
||||||
|
@ -135,9 +135,7 @@ describe("Abilities - Desolate Land", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should lift after fleeing from a wild pokemon", async () => {
|
it("should lift after fleeing from a wild pokemon", async () => {
|
||||||
game.override
|
game.override.enemyAbility(Abilities.DESOLATE_LAND).ability(Abilities.BALL_FETCH);
|
||||||
.enemyAbility(Abilities.DESOLATE_LAND)
|
|
||||||
.ability(Abilities.BALL_FETCH);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
||||||
|
|
||||||
|
@ -40,7 +40,13 @@ describe("Abilities - Flower Gift", () => {
|
|||||||
*
|
*
|
||||||
* @returns Two numbers, the first being the damage done to the target without flower gift active, the second being the damage done with flower gift active
|
* @returns Two numbers, the first being the damage done to the target without flower gift active, the second being the damage done with flower gift active
|
||||||
*/
|
*/
|
||||||
const testDamageDealt = async (game: GameManager, move: Moves, allyAttacker: boolean, allyAbility = Abilities.BALL_FETCH, enemyAbility = Abilities.BALL_FETCH): Promise<[number, number]> => {
|
const testDamageDealt = async (
|
||||||
|
game: GameManager,
|
||||||
|
move: Moves,
|
||||||
|
allyAttacker: boolean,
|
||||||
|
allyAbility = Abilities.BALL_FETCH,
|
||||||
|
enemyAbility = Abilities.BALL_FETCH,
|
||||||
|
): Promise<[number, number]> => {
|
||||||
game.override.battleType("double");
|
game.override.battleType("double");
|
||||||
game.override.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]);
|
game.override.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]);
|
||||||
game.override.enemyMoveset([Moves.SPLASH, Moves.HEAL_PULSE]);
|
game.override.enemyMoveset([Moves.SPLASH, Moves.HEAL_PULSE]);
|
||||||
@ -82,7 +88,6 @@ describe("Abilities - Flower Gift", () => {
|
|||||||
return [damageWithoutGift, damageWithGift];
|
return [damageWithoutGift, damageWithGift];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
phaserGame = new Phaser.Game({
|
phaserGame = new Phaser.Game({
|
||||||
type: Phaser.HEADLESS,
|
type: Phaser.HEADLESS,
|
||||||
@ -144,7 +149,13 @@ describe("Abilities - Flower Gift", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not decrease the damage an ally takes from a mold breaker enemy using a special attack", async () => {
|
it("should not decrease the damage an ally takes from a mold breaker enemy using a special attack", async () => {
|
||||||
const [ damageWithoutGift, damageWithGift ] = await testDamageDealt(game, Moves.MUD_SLAP, false, Abilities.BALL_FETCH, Abilities.MOLD_BREAKER);
|
const [damageWithoutGift, damageWithGift] = await testDamageDealt(
|
||||||
|
game,
|
||||||
|
Moves.MUD_SLAP,
|
||||||
|
false,
|
||||||
|
Abilities.BALL_FETCH,
|
||||||
|
Abilities.MOLD_BREAKER,
|
||||||
|
);
|
||||||
expect(damageWithGift).toBe(damageWithoutGift);
|
expect(damageWithGift).toBe(damageWithoutGift);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -160,9 +160,7 @@ describe("Abilities - Neutralizing Gas", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should deactivate after fleeing from a wild pokemon", async () => {
|
it("should deactivate after fleeing from a wild pokemon", async () => {
|
||||||
game.override
|
game.override.enemyAbility(Abilities.NEUTRALIZING_GAS).ability(Abilities.BALL_FETCH);
|
||||||
.enemyAbility(Abilities.NEUTRALIZING_GAS)
|
|
||||||
.ability(Abilities.BALL_FETCH);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined();
|
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined();
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import { StatusEffect } from "#enums/status-effect";
|
|||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
|
||||||
describe("Abilities - Parental Bond", () => {
|
describe("Abilities - Parental Bond", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -426,4 +427,21 @@ describe("Abilities - Parental Bond", () => {
|
|||||||
// TODO: Update hit count to 1 once Future Sight is fixed to not activate abilities if user is off the field
|
// TODO: Update hit count to 1 once Future Sight is fixed to not activate abilities if user is off the field
|
||||||
expect(enemyPokemon.damageAndUpdate).toHaveBeenCalledTimes(2);
|
expect(enemyPokemon.damageAndUpdate).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should not allow Pollen Puff to heal ally more than once", async () => {
|
||||||
|
game.override.battleType("double").moveset([Moves.POLLEN_PUFF, Moves.ENDURE]);
|
||||||
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.OMANYTE]);
|
||||||
|
|
||||||
|
const [, rightPokemon] = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
rightPokemon.damageAndUpdate(rightPokemon.hp - 1);
|
||||||
|
|
||||||
|
game.move.select(Moves.POLLEN_PUFF, 0, BattlerIndex.PLAYER_2);
|
||||||
|
game.move.select(Moves.ENDURE, 1);
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
|
// Pollen Puff heals with a ratio of 0.5, as long as Pollen Puff triggers only once the pokemon will always be <= (0.5 * Max HP) + 1
|
||||||
|
expect(rightPokemon.hp).toBeLessThanOrEqual(0.5 * rightPokemon.getMaxHp() + 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { allAbilities } from "#app/data/ability";
|
|
||||||
import { allMoves } from "#app/data/moves/move";
|
import { allMoves } from "#app/data/moves/move";
|
||||||
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
|
@ -9,7 +9,7 @@ describe("Data - Splash Messages", () => {
|
|||||||
|
|
||||||
// Make sure to adjust this test if the weight is changed!
|
// Make sure to adjust this test if the weight is changed!
|
||||||
it("should add contain 15 `battlesWon` splash messages", () => {
|
it("should add contain 15 `battlesWon` splash messages", () => {
|
||||||
const battlesWonMessages = getSplashMessages().filter((message) => message === "splashMessages:battlesWon");
|
const battlesWonMessages = getSplashMessages().filter(message => message === "splashMessages:battlesWon");
|
||||||
expect(battlesWonMessages).toHaveLength(15);
|
expect(battlesWonMessages).toHaveLength(15);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -98,6 +98,31 @@ describe("Items - Grip Claw", () => {
|
|||||||
expect(enemy1HeldItemCountsAfter).toBe(enemy1HeldItemCount);
|
expect(enemy1HeldItemCountsAfter).toBe(enemy1HeldItemCount);
|
||||||
expect(enemy2HeldItemCountsAfter).toBe(enemy2HeldItemCount);
|
expect(enemy2HeldItemCountsAfter).toBe(enemy2HeldItemCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should not allow Pollen Puff to steal items when healing ally", async () => {
|
||||||
|
game.override
|
||||||
|
.battleType("double")
|
||||||
|
.moveset([Moves.POLLEN_PUFF, Moves.ENDURE])
|
||||||
|
.startingHeldItems([
|
||||||
|
{ name: "GRIP_CLAW", count: 1 },
|
||||||
|
{ name: "BERRY", type: BerryType.LUM, count: 1 },
|
||||||
|
]);
|
||||||
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.OMANYTE]);
|
||||||
|
|
||||||
|
const [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
const gripClaw = leftPokemon.getHeldItems()[0] as ContactHeldItemTransferChanceModifier;
|
||||||
|
vi.spyOn(gripClaw, "chance", "get").mockReturnValue(100);
|
||||||
|
|
||||||
|
const heldItemCountBefore = getHeldItemCount(rightPokemon);
|
||||||
|
|
||||||
|
game.move.select(Moves.POLLEN_PUFF, 0, BattlerIndex.PLAYER_2);
|
||||||
|
game.move.select(Moves.ENDURE, 1);
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
|
expect(getHeldItemCount(rightPokemon)).toBe(heldItemCountBefore);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -211,4 +211,21 @@ describe("Items - Multi Lens", () => {
|
|||||||
// TODO: Update hit count to 1 once Future Sight is fixed to not activate held items if user is off the field
|
// TODO: Update hit count to 1 once Future Sight is fixed to not activate held items if user is off the field
|
||||||
expect(enemyPokemon.damageAndUpdate).toHaveBeenCalledTimes(2);
|
expect(enemyPokemon.damageAndUpdate).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should not allow Pollen Puff to heal ally more than once", async () => {
|
||||||
|
game.override.battleType("double").moveset([Moves.POLLEN_PUFF, Moves.ENDURE]);
|
||||||
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.OMANYTE]);
|
||||||
|
|
||||||
|
const [, rightPokemon] = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
rightPokemon.damageAndUpdate(rightPokemon.hp - 1);
|
||||||
|
|
||||||
|
game.move.select(Moves.POLLEN_PUFF, 0, BattlerIndex.PLAYER_2);
|
||||||
|
game.move.select(Moves.ENDURE, 1);
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
|
||||||
|
// Pollen Puff heals with a ratio of 0.5, as long as Pollen Puff triggers only once the pokemon will always be <= (0.5 * Max HP) + 1
|
||||||
|
expect(rightPokemon.hp).toBeLessThanOrEqual(0.5 * rightPokemon.getMaxHp() + 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -47,12 +47,9 @@ describe("Items - Reviver Seed", () => {
|
|||||||
{ moveType: "Fixed Damage Move", move: Moves.SEISMIC_TOSS },
|
{ moveType: "Fixed Damage Move", move: Moves.SEISMIC_TOSS },
|
||||||
{ moveType: "Final Gambit", move: Moves.FINAL_GAMBIT },
|
{ moveType: "Final Gambit", move: Moves.FINAL_GAMBIT },
|
||||||
{ moveType: "Counter", move: Moves.COUNTER },
|
{ moveType: "Counter", move: Moves.COUNTER },
|
||||||
{ moveType: "OHKO", move: Moves.SHEER_COLD }
|
{ moveType: "OHKO", move: Moves.SHEER_COLD },
|
||||||
])("should activate the holder's reviver seed from a $moveType", async ({ move }) => {
|
])("should activate the holder's reviver seed from a $moveType", async ({ move }) => {
|
||||||
game.override
|
game.override.enemyLevel(100).startingLevel(1).enemyMoveset(move);
|
||||||
.enemyLevel(100)
|
|
||||||
.startingLevel(1)
|
|
||||||
.enemyMoveset(move);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
player.damageAndUpdate(player.hp - 1);
|
player.damageAndUpdate(player.hp - 1);
|
||||||
@ -67,10 +64,7 @@ describe("Items - Reviver Seed", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should activate the holder's reviver seed from confusion self-hit", async () => {
|
it("should activate the holder's reviver seed from confusion self-hit", async () => {
|
||||||
game.override
|
game.override.enemyLevel(1).startingLevel(100).enemyMoveset(Moves.SPLASH);
|
||||||
.enemyLevel(1)
|
|
||||||
.startingLevel(100)
|
|
||||||
.enemyMoveset(Moves.SPLASH);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
player.damageAndUpdate(player.hp - 1);
|
player.damageAndUpdate(player.hp - 1);
|
||||||
|
53
test/moves/false_swipe.test.ts
Normal file
53
test/moves/false_swipe.test.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
|
import { Abilities } from "#enums/abilities";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
describe("Moves - False Swipe", () => {
|
||||||
|
let phaserGame: Phaser.Game;
|
||||||
|
let game: GameManager;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
phaserGame = new Phaser.Game({
|
||||||
|
type: Phaser.HEADLESS,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
game.phaseInterceptor.restoreOg();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
game = new GameManager(phaserGame);
|
||||||
|
game.override
|
||||||
|
.moveset([Moves.FALSE_SWIPE])
|
||||||
|
.ability(Abilities.BALL_FETCH)
|
||||||
|
.startingLevel(1000)
|
||||||
|
.battleType("single")
|
||||||
|
.disableCrits()
|
||||||
|
.enemySpecies(Species.MAGIKARP)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
|
.enemyMoveset(Moves.SPLASH);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should reduce the target to 1 HP", async () => {
|
||||||
|
await game.classicMode.startBattle([Species.MILOTIC]);
|
||||||
|
|
||||||
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
game.move.select(Moves.FALSE_SWIPE);
|
||||||
|
await game.toNextTurn();
|
||||||
|
game.move.select(Moves.FALSE_SWIPE);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
|
expect(enemy.hp).toBe(1);
|
||||||
|
const falseSwipeHistory = player
|
||||||
|
.getMoveHistory()
|
||||||
|
.every(turnMove => turnMove.move === Moves.FALSE_SWIPE && turnMove.result === MoveResult.SUCCESS);
|
||||||
|
expect(falseSwipeHistory).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
@ -116,11 +116,7 @@ describe("Moves - Revival Blessing", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not summon multiple pokemon to the same slot when reviving the enemy ally in doubles", async () => {
|
it("should not summon multiple pokemon to the same slot when reviving the enemy ally in doubles", async () => {
|
||||||
game.override
|
game.override.battleType("double").enemyMoveset([Moves.REVIVAL_BLESSING]).moveset([Moves.SPLASH]).startingWave(25); // 2nd rival battle - must have 3+ pokemon
|
||||||
.battleType("double")
|
|
||||||
.enemyMoveset([ Moves.REVIVAL_BLESSING ])
|
|
||||||
.moveset([ Moves.SPLASH ])
|
|
||||||
.startingWave(25); // 2nd rival battle - must have 3+ pokemon
|
|
||||||
await game.classicMode.startBattle([Species.ARCEUS, Species.GIRATINA]);
|
await game.classicMode.startBattle([Species.ARCEUS, Species.GIRATINA]);
|
||||||
|
|
||||||
const enemyFainting = game.scene.getEnemyField()[0];
|
const enemyFainting = game.scene.getEnemyField()[0];
|
||||||
|
@ -1,31 +1,25 @@
|
|||||||
/* eslint-disable */
|
// @ts-nocheck - TODO: remove this
|
||||||
// @ts-nocheck
|
|
||||||
import BattleScene, * as battleScene from "#app/battle-scene";
|
import BattleScene, * as battleScene from "#app/battle-scene";
|
||||||
import { MoveAnim } from "#app/data/battle-anims";
|
import { MoveAnim } from "#app/data/battle-anims";
|
||||||
import Pokemon from "#app/field/pokemon";
|
import Pokemon from "#app/field/pokemon";
|
||||||
import * as Utils from "#app/utils";
|
import * as Utils from "#app/utils";
|
||||||
import { blobToString } from "#test/testUtils/gameManagerUtils";
|
import { blobToString } from "#test/testUtils/gameManagerUtils";
|
||||||
import { MockClock } from "#test/testUtils/mocks/mockClock";
|
import { MockClock } from "#test/testUtils/mocks/mockClock";
|
||||||
import { MockConsoleLog } from "#test/testUtils/mocks/mockConsoleLog";
|
|
||||||
import { MockFetch } from "#test/testUtils/mocks/mockFetch";
|
import { MockFetch } from "#test/testUtils/mocks/mockFetch";
|
||||||
import MockLoader from "#test/testUtils/mocks/mockLoader";
|
import MockLoader from "#test/testUtils/mocks/mockLoader";
|
||||||
import { mockLocalStorage } from "#test/testUtils/mocks/mockLocalStorage";
|
|
||||||
import { MockImage } from "#test/testUtils/mocks/mocksContainer/mockImage";
|
|
||||||
import MockTextureManager from "#test/testUtils/mocks/mockTextureManager";
|
import MockTextureManager from "#test/testUtils/mocks/mockTextureManager";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import InputText from "phaser3-rex-plugins/plugins/inputtext";
|
|
||||||
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
|
||||||
import { vi } from "vitest";
|
import { vi } from "vitest";
|
||||||
|
import { version } from "../../package.json";
|
||||||
import { MockGameObjectCreator } from "./mocks/mockGameObjectCreator";
|
import { MockGameObjectCreator } from "./mocks/mockGameObjectCreator";
|
||||||
|
import { MockTimedEventManager } from "./mocks/mockTimedEventManager";
|
||||||
import InputManager = Phaser.Input.InputManager;
|
import InputManager = Phaser.Input.InputManager;
|
||||||
import KeyboardManager = Phaser.Input.Keyboard.KeyboardManager;
|
import KeyboardManager = Phaser.Input.Keyboard.KeyboardManager;
|
||||||
import KeyboardPlugin = Phaser.Input.Keyboard.KeyboardPlugin;
|
import KeyboardPlugin = Phaser.Input.Keyboard.KeyboardPlugin;
|
||||||
import GamepadPlugin = Phaser.Input.Gamepad.GamepadPlugin;
|
import GamepadPlugin = Phaser.Input.Gamepad.GamepadPlugin;
|
||||||
import EventEmitter = Phaser.Events.EventEmitter;
|
import EventEmitter = Phaser.Events.EventEmitter;
|
||||||
import UpdateList = Phaser.GameObjects.UpdateList;
|
import UpdateList = Phaser.GameObjects.UpdateList;
|
||||||
import { version } from "../../package.json";
|
|
||||||
import { MockTimedEventManager } from "./mocks/mockTimedEventManager";
|
|
||||||
|
|
||||||
window.URL.createObjectURL = (blob: Blob) => {
|
window.URL.createObjectURL = (blob: Blob) => {
|
||||||
blobToString(blob).then((data: string) => {
|
blobToString(blob).then((data: string) => {
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
import type { Variant } from "#app/data/variant";
|
import type { Variant } from "#app/data/variant";
|
||||||
import { Weather } from "#app/data/weather";
|
import { Weather } from "#app/data/weather";
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import * as GameMode from "#app/game-mode";
|
|
||||||
import type { GameModes } from "#app/game-mode";
|
|
||||||
import { getGameMode } from "#app/game-mode";
|
|
||||||
import type { ModifierOverride } from "#app/modifier/modifier-type";
|
import type { ModifierOverride } from "#app/modifier/modifier-type";
|
||||||
import type { BattleStyle } from "#app/overrides";
|
import type { BattleStyle } from "#app/overrides";
|
||||||
import Overrides, { defaultOverrides } from "#app/overrides";
|
import Overrides, { defaultOverrides } from "#app/overrides";
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { off } from "process";
|
|
||||||
import type { MockGameObject } from "../mockGameObject";
|
import type { MockGameObject } from "../mockGameObject";
|
||||||
|
|
||||||
export default class MockRectangle implements MockGameObject {
|
export default class MockRectangle implements MockGameObject {
|
||||||
|
@ -1,17 +1,4 @@
|
|||||||
import "vitest-canvas-mock";
|
import "vitest-canvas-mock";
|
||||||
|
|
||||||
import { initLoggedInUser } from "#app/account";
|
|
||||||
import { initAbilities } from "#app/data/ability";
|
|
||||||
import { initBiomes } from "#app/data/balance/biomes";
|
|
||||||
import { initEggMoves } from "#app/data/balance/egg-moves";
|
|
||||||
import { initPokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
|
||||||
import { initMoves } from "#app/data/moves/move";
|
|
||||||
import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters";
|
|
||||||
import { initPokemonForms } from "#app/data/pokemon-forms";
|
|
||||||
import { initSpecies } from "#app/data/pokemon-species";
|
|
||||||
import { initAchievements } from "#app/system/achv";
|
|
||||||
import { initVouchers } from "#app/system/voucher";
|
|
||||||
import { initStatsKeys } from "#app/ui/game-stats-ui-handler";
|
|
||||||
import { afterAll, beforeAll, vi } from "vitest";
|
import { afterAll, beforeAll, vi } from "vitest";
|
||||||
|
|
||||||
import { initTestFile } from "./testUtils/testFileInitialization";
|
import { initTestFile } from "./testUtils/testFileInitialization";
|
||||||
@ -20,13 +7,11 @@ import { initTestFile } from "./testUtils/testFileInitialization";
|
|||||||
|
|
||||||
/** Mock the override import to always return default values, ignoring any custom overrides. */
|
/** Mock the override import to always return default values, ignoring any custom overrides. */
|
||||||
vi.mock("#app/overrides", async importOriginal => {
|
vi.mock("#app/overrides", async importOriginal => {
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
||||||
const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>();
|
const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
default: defaultOverrides,
|
default: defaultOverrides,
|
||||||
defaultOverrides,
|
defaultOverrides,
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
||||||
} satisfies typeof import("#app/overrides");
|
} satisfies typeof import("#app/overrides");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user