mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
Crit override stuff
This commit is contained in:
parent
718d6f61cf
commit
7a3a847eda
@ -1,6 +1,7 @@
|
||||
VITE_BYPASS_LOGIN=1
|
||||
VITE_BYPASS_TUTORIAL=0
|
||||
VITE_SERVER_URL=http://localhost:8001
|
||||
# IDs for discord/google auth go unused due to VITE_BYPASS_LOGIN
|
||||
VITE_DISCORD_CLIENT_ID=1234567890
|
||||
VITE_GOOGLE_CLIENT_ID=1234567890
|
||||
VITE_I18N_DEBUG=0
|
||||
|
@ -48,7 +48,7 @@ async function promptTestType() {
|
||||
{
|
||||
type: "list",
|
||||
name: "selectedOption",
|
||||
message: "What type of test would you like to create:",
|
||||
message: "What type of test would you like to create?",
|
||||
choices: [...choices.map(choice => ({ name: choice.label, value: choice })), "EXIT"],
|
||||
},
|
||||
]);
|
||||
|
@ -24,7 +24,7 @@ describe("{{description}}", () => {
|
||||
game.override
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
|
@ -2094,12 +2094,15 @@ export default class BattleScene extends SceneBase {
|
||||
}
|
||||
|
||||
getMaxExpLevel(ignoreLevelCap = false): number {
|
||||
if (Overrides.LEVEL_CAP_OVERRIDE > 0) {
|
||||
return Overrides.LEVEL_CAP_OVERRIDE;
|
||||
const capOverride = Overrides.LEVEL_CAP_OVERRIDE ?? 0;
|
||||
if (capOverride > 0) {
|
||||
return capOverride;
|
||||
}
|
||||
if (ignoreLevelCap || Overrides.LEVEL_CAP_OVERRIDE < 0) {
|
||||
|
||||
if (ignoreLevelCap || capOverride < 0) {
|
||||
return Number.MAX_SAFE_INTEGER;
|
||||
}
|
||||
|
||||
const waveIndex = Math.ceil((this.currentBattle?.waveIndex || 1) / 10) * 10;
|
||||
const difficultyWaveIndex = this.gameMode.getWaveForDifficulty(waveIndex);
|
||||
const baseLevel = (1 + difficultyWaveIndex / 2 + Math.pow(difficultyWaveIndex / 25, 2)) * 1.2;
|
||||
@ -3492,17 +3495,13 @@ export default class BattleScene extends SceneBase {
|
||||
sessionEncounterRate +
|
||||
Math.min(currentRunDiffFromAvg * ANTI_VARIANCE_WEIGHT_MODIFIER, MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT / 2);
|
||||
|
||||
const successRate = isNullOrUndefined(Overrides.MYSTERY_ENCOUNTER_RATE_OVERRIDE)
|
||||
? favoredEncounterRate
|
||||
: Overrides.MYSTERY_ENCOUNTER_RATE_OVERRIDE!;
|
||||
const successRate = Overrides.MYSTERY_ENCOUNTER_RATE_OVERRIDE ?? favoredEncounterRate;
|
||||
|
||||
// If the most recent ME was 3 or fewer waves ago, can never spawn a ME
|
||||
// MEs can only spawn 3 or more waves after the previous ME, barring overrides
|
||||
const canSpawn =
|
||||
encounteredEvents.length === 0 ||
|
||||
waveIndex - encounteredEvents[encounteredEvents.length - 1].waveIndex > 3 ||
|
||||
!isNullOrUndefined(Overrides.MYSTERY_ENCOUNTER_RATE_OVERRIDE);
|
||||
encounteredEvents.length === 0 || waveIndex - encounteredEvents[encounteredEvents.length - 1].waveIndex > 3;
|
||||
|
||||
if (canSpawn) {
|
||||
if (canSpawn || Overrides.MYSTERY_ENCOUNTER_RATE_OVERRIDE !== null) {
|
||||
let roll = MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT;
|
||||
// Always rolls the check on the same offset to ensure no RNG changes from reloading session
|
||||
this.executeWithSeedOffset(
|
||||
|
@ -4616,7 +4616,7 @@ export class ConditionalUserFieldProtectStatAbAttr extends PreStatStageChangeAbA
|
||||
* @param stat The stat being affected
|
||||
* @param cancelled Holds whether the stat change was already prevented.
|
||||
* @param args Args[0] is the target pokemon of the stat change.
|
||||
* @returns
|
||||
* @returns `true` if the ability can be applied
|
||||
*/
|
||||
override canApplyPreStatStageChange(
|
||||
_pokemon: Pokemon,
|
||||
@ -4777,17 +4777,17 @@ export class BlockCritAbAttr extends AbAttr {
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the block crit ability by setting the value in the provided boolean holder to false
|
||||
* @param args - [0] is a boolean holder representing whether the attack can crit
|
||||
* Apply the block crit ability by setting the value in the provided boolean holder to `true`.
|
||||
* @param args `[0]` - A {@linkcode BooleanHolder} containing whether the attack is prevented from critting.
|
||||
*/
|
||||
override apply(
|
||||
_pokemon: Pokemon,
|
||||
_passive: boolean,
|
||||
_simulated: boolean,
|
||||
_cancelled: BooleanHolder,
|
||||
args: [BooleanHolder, ...any],
|
||||
args: [BooleanHolder],
|
||||
): void {
|
||||
args[0].value = false;
|
||||
args[0].value = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1356,8 +1356,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the critical-hit stage of a move used against this pokemon by
|
||||
* the given source
|
||||
* Calculate the critical-hit stage of a move used **against** this pokemon by
|
||||
* the given source.
|
||||
*
|
||||
* @param source - The {@linkcode Pokemon} using the move
|
||||
* @param move - The {@linkcode Move} being used
|
||||
* @returns The final critical-hit stage value
|
||||
@ -1370,11 +1371,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
applyAbAttrs("BonusCritAbAttr", source, null, false, critStage);
|
||||
const critBoostTag = source.getTag(CritBoostTag);
|
||||
if (critBoostTag) {
|
||||
if (critBoostTag instanceof DragonCheerTag) {
|
||||
critStage.value += critBoostTag.typesOnAdd.includes(PokemonType.DRAGON) ? 2 : 1;
|
||||
} else {
|
||||
critStage.value += 2;
|
||||
}
|
||||
// Dragon cheer only gives +1 crit stage to non-dragon types
|
||||
critStage.value +=
|
||||
critBoostTag instanceof DragonCheerTag && !critBoostTag.typesOnAdd.includes(PokemonType.DRAGON) ? 1 : 2;
|
||||
}
|
||||
|
||||
console.log(`crit stage: +${critStage.value}`);
|
||||
@ -3888,33 +3887,39 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
};
|
||||
}
|
||||
|
||||
/** Calculate whether the given move critically hits this pokemon
|
||||
/**
|
||||
* Determine whether the given move will score a critical hit **against** this Pokemon.
|
||||
* @param source - The {@linkcode Pokemon} using the move
|
||||
* @param move - The {@linkcode Move} being used
|
||||
* @param simulated - If `true`, suppresses changes to game state during calculation (defaults to `true`)
|
||||
* @returns whether the move critically hits the pokemon
|
||||
* @returns Whether the move will critically hit the defender.
|
||||
*/
|
||||
getCriticalHitResult(source: Pokemon, move: Move, simulated = true): boolean {
|
||||
const defendingSide = this.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY;
|
||||
const noCritTag = globalScene.arena.getTagOnSide(NoCritTag, defendingSide);
|
||||
if (noCritTag || Overrides.NEVER_CRIT_OVERRIDE || move.hasAttr("FixedDamageAttr")) {
|
||||
getCriticalHitResult(source: Pokemon, move: Move): boolean {
|
||||
if (move.hasAttr("FixedDamageAttr")) {
|
||||
// fixed damage moves (Dragon Rage, etc.) will nevet crit
|
||||
return false;
|
||||
}
|
||||
const isCritical = new BooleanHolder(false);
|
||||
|
||||
if (source.getTag(BattlerTagType.ALWAYS_CRIT)) {
|
||||
isCritical.value = true;
|
||||
}
|
||||
applyMoveAttrs("CritOnlyAttr", source, this, move, isCritical);
|
||||
applyAbAttrs("ConditionalCritAbAttr", source, null, simulated, isCritical, this, move);
|
||||
if (!isCritical.value) {
|
||||
const critChance = [24, 8, 2, 1][Math.max(0, Math.min(this.getCritStage(source, move), 3))];
|
||||
isCritical.value = critChance === 1 || !globalScene.randBattleSeedInt(critChance);
|
||||
}
|
||||
const alwaysCrit = new BooleanHolder(false);
|
||||
applyMoveAttrs("CritOnlyAttr", source, this, move, alwaysCrit);
|
||||
applyAbAttrs("ConditionalCritAbAttr", source, null, false, alwaysCrit, this, move);
|
||||
const alwaysCritTag = !!source.getTag(BattlerTagType.ALWAYS_CRIT);
|
||||
const critChance = [24, 8, 2, 1][Phaser.Math.Clamp(this.getCritStage(source, move), 0, 3)];
|
||||
|
||||
applyAbAttrs("BlockCritAbAttr", this, null, simulated, isCritical);
|
||||
let isCritical = alwaysCrit.value || alwaysCritTag || critChance === 1;
|
||||
|
||||
return isCritical.value;
|
||||
// If we aren't already guaranteed to crit, do a random roll & check overrides
|
||||
isCritical ||= Overrides.CRITICAL_HIT_OVERRIDE ?? globalScene.randBattleSeedInt(critChance) === 0;
|
||||
|
||||
// apply crit block effects from lucky chant & co., overridding previous effects
|
||||
const blockCrit = new BooleanHolder(false);
|
||||
applyAbAttrs("BlockCritAbAttr", this, null, false, blockCrit);
|
||||
const blockCritTag = globalScene.arena.getTagOnSide(
|
||||
NoCritTag,
|
||||
this.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY,
|
||||
);
|
||||
isCritical &&= !blockCritTag && !blockCrit.value; // need to roll a crit and not be blocked by either crit prevention effect
|
||||
|
||||
return isCritical;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,13 +90,14 @@ export class GameMode implements GameModeConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get starting level for game mode.
|
||||
* @returns either:
|
||||
* - override from overrides.ts
|
||||
* - starting level override from overrides.ts
|
||||
* - 20 for Daily Runs
|
||||
* - 5 for all other modes
|
||||
*/
|
||||
getStartingLevel(): number {
|
||||
if (Overrides.STARTING_LEVEL_OVERRIDE) {
|
||||
if (Overrides.STARTING_LEVEL_OVERRIDE && Overrides.STARTING_LEVEL_OVERRIDE > 0) {
|
||||
return Overrides.STARTING_LEVEL_OVERRIDE;
|
||||
}
|
||||
switch (this.modeId) {
|
||||
|
@ -80,7 +80,11 @@ class DefaultOverrides {
|
||||
/** Sets the level cap to this number during experience gain calculations. Set to `0` to disable override & use normal wave-based level caps,
|
||||
or any negative number to set it to 9 quadrillion (effectively disabling it). */
|
||||
readonly LEVEL_CAP_OVERRIDE: number = 0;
|
||||
readonly NEVER_CRIT_OVERRIDE: boolean = false;
|
||||
/**
|
||||
* If defined, overrides random critical hit rolls to always or never succeed.
|
||||
* Ignored if the move is guaranteed to always/never crit.
|
||||
*/
|
||||
readonly CRITICAL_HIT_OVERRIDE: boolean | null = null;
|
||||
/** default 1000 */
|
||||
readonly STARTING_MONEY_OVERRIDE: number = 0;
|
||||
/** Sets all shop item prices to 0 */
|
||||
@ -272,7 +276,7 @@ class DefaultOverrides {
|
||||
|
||||
/**
|
||||
* Set all non-scripted waves to use the selected battle type.
|
||||
*
|
||||
*
|
||||
* Ignored if set to {@linkcode BattleType.TRAINER} and `DISABLE_STANDARD_TRAINERS_OVERRIDE` is `true`.
|
||||
*/
|
||||
readonly BATTLE_TYPE_OVERRIDE: Exclude<BattleType, BattleType.CLEAR> | null = null;
|
||||
|
@ -797,7 +797,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
* @param effectiveness - The effectiveness of the move against the target
|
||||
*/
|
||||
protected applyMoveDamage(user: Pokemon, target: Pokemon, effectiveness: TypeDamageMultiplier): HitResult {
|
||||
const isCritical = target.getCriticalHitResult(user, this.move, false);
|
||||
const isCritical = target.getCriticalHitResult(user, this.move);
|
||||
|
||||
/*
|
||||
* Apply stat changes from {@linkcode move} and gives it to {@linkcode source}
|
||||
|
@ -27,7 +27,7 @@ describe("Ability Activation Order", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -27,7 +27,7 @@ describe("Abilities - Analytic", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.TACKLE])
|
||||
.ability(AbilityId.ANALYTIC)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.startingLevel(200)
|
||||
.enemyLevel(200)
|
||||
.enemySpecies(SpeciesId.SNORLAX)
|
||||
|
@ -35,7 +35,7 @@ describe("Abilities - Commander", () => {
|
||||
.moveset([MoveId.LIQUIDATION, MoveId.MEMENTO, MoveId.SPLASH, MoveId.FLIP_TURN])
|
||||
.ability(AbilityId.COMMANDER)
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.SNORLAX)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.TACKLE);
|
||||
|
@ -24,7 +24,7 @@ describe("Abilities - Corrosion", () => {
|
||||
game.override
|
||||
.moveset([MoveId.SPLASH])
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.GRIMER)
|
||||
.enemyAbility(AbilityId.CORROSION)
|
||||
.enemyMoveset(MoveId.TOXIC);
|
||||
|
@ -33,7 +33,7 @@ describe("Abilities - Cud Chew", () => {
|
||||
.startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS, count: 1 }])
|
||||
.ability(AbilityId.CUD_CHEW)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -23,7 +23,7 @@ describe("Abilities - Dry Skin", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemyAbility(AbilityId.DRY_SKIN)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.enemySpecies(SpeciesId.CHARMANDER)
|
||||
|
@ -28,7 +28,7 @@ describe("Abilities - Early Bird", () => {
|
||||
.moveset([MoveId.REST, MoveId.BELLY_DRUM, MoveId.SPLASH])
|
||||
.ability(AbilityId.EARLY_BIRD)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -32,7 +32,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.startingLevel(20)
|
||||
.enemyLevel(20)
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
it("immune to Fire-type moves", async () => {
|
||||
|
@ -32,7 +32,7 @@ describe("Abilities - Flower Veil", () => {
|
||||
.enemySpecies(SpeciesId.BULBASAUR)
|
||||
.ability(AbilityId.FLOWER_VEIL)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -33,7 +33,7 @@ describe("Abilities - Good As Gold", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.GOOD_AS_GOLD)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -41,7 +41,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.battleStyle("single")
|
||||
.moveset([MoveId.SURF, MoveId.DIVE, MoveId.SPLASH, MoveId.SUBSTITUTE])
|
||||
.enemySpecies(SpeciesId.SNORLAX)
|
||||
|
@ -47,7 +47,7 @@ describe("Abilities - Harvest", () => {
|
||||
.ability(AbilityId.HARVEST)
|
||||
.startingLevel(100)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.statusActivation(false) // Since we're using nuzzle to proc both enigma and sitrus berries
|
||||
.weather(WeatherType.SUNNY) // guaranteed recovery
|
||||
.enemyLevel(1)
|
||||
|
@ -33,7 +33,7 @@ describe("Abilities - Healer", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Heatproof", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.CHARMANDER)
|
||||
.enemyAbility(AbilityId.HEATPROOF)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
|
@ -29,7 +29,7 @@ describe("Abilities - Honey Gather", () => {
|
||||
.ability(AbilityId.HONEY_GATHER)
|
||||
.passiveAbility(AbilityId.RUN_AWAY)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Hustle", () => {
|
||||
game.override
|
||||
.ability(AbilityId.HUSTLE)
|
||||
.moveset([MoveId.TACKLE, MoveId.GIGA_DRAIN, MoveId.FISSURE])
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.battleStyle("single")
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.enemySpecies(SpeciesId.SHUCKLE)
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Immunity", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -31,7 +31,7 @@ describe("Abilities - Infiltrator", () => {
|
||||
.moveset([MoveId.TACKLE, MoveId.WATER_GUN, MoveId.SPORE, MoveId.BABY_DOLL_EYES])
|
||||
.ability(AbilityId.INFILTRATOR)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.SNORLAX)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Insomnia", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -27,7 +27,7 @@ describe("Abilities - Lightningrod", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.SHOCK_WAVE])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Limber", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -32,7 +32,7 @@ describe("Abilities - Magic Bounce", () => {
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.moveset([MoveId.GROWL, MoveId.SPLASH])
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.MAGIC_BOUNCE)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -89,7 +89,7 @@ describe("Abilities - Magic Guard", () => {
|
||||
});
|
||||
|
||||
it("ability effect should not persist when the ability is replaced", async () => {
|
||||
game.override.enemyMoveset([MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED]);
|
||||
game.override.enemyMoveset([MoveId.WORRY_SEED]);
|
||||
game.override.statusEffect(StatusEffect.POISON);
|
||||
|
||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Magma Armor", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Mimicry", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.MIMICRY)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ describe("Abilities - Mold Breaker", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.MOLD_BREAKER)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -25,7 +25,7 @@ describe("Abilities - Mummy", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.MUMMY)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.TACKLE);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Mycelium Might", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.SHUCKLE)
|
||||
.enemyAbility(AbilityId.CLEAR_BODY)
|
||||
|
||||
|
@ -31,7 +31,7 @@ describe("Abilities - Neutralizing Gas", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.NEUTRALIZING_GAS)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -29,7 +29,7 @@ describe("Abilities - Normalize", () => {
|
||||
.moveset([MoveId.TACKLE])
|
||||
.ability(AbilityId.NORMALIZE)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Oblivious", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Own Tempo", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -27,7 +27,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
game.override.ability(AbilityId.PARENTAL_BOND);
|
||||
game.override.enemySpecies(SpeciesId.SNORLAX);
|
||||
game.override.enemyAbility(AbilityId.FUR_COAT);
|
||||
|
@ -22,7 +22,7 @@ describe("Abilities - Perish Song", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
|
||||
game.override.enemySpecies(SpeciesId.MAGIKARP);
|
||||
game.override.enemyAbility(AbilityId.BALL_FETCH);
|
||||
|
@ -28,7 +28,7 @@ describe("Abilities - Protosynthesis", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.TACKLE])
|
||||
.ability(AbilityId.PROTOSYNTHESIS)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -23,7 +23,7 @@ describe("Abilities - Sand Spit", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
|
||||
game.override.enemySpecies(SpeciesId.MAGIKARP);
|
||||
game.override.enemyAbility(AbilityId.BALL_FETCH);
|
||||
|
@ -31,7 +31,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.ability(AbilityId.SAP_SIPPER)
|
||||
.enemySpecies(SpeciesId.RATTATA)
|
||||
.enemyAbility(AbilityId.SAP_SIPPER)
|
||||
|
@ -23,7 +23,7 @@ describe("Abilities - Seed Sower", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
|
||||
game.override.enemySpecies(SpeciesId.MAGIKARP);
|
||||
game.override.enemyAbility(AbilityId.BALL_FETCH);
|
||||
|
@ -24,7 +24,7 @@ describe("Abilities - Serene Grace", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.battleStyle("single")
|
||||
.ability(AbilityId.SERENE_GRACE)
|
||||
.moveset([MoveId.AIR_SLASH])
|
||||
|
@ -31,7 +31,7 @@ describe("Abilities - Sheer Force", () => {
|
||||
.enemySpecies(SpeciesId.ONIX)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset([MoveId.SPLASH])
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
const SHEER_FORCE_MULT = 1.3;
|
||||
|
69
test/abilities/shell-armor.test.ts
Normal file
69
test/abilities/shell-armor.test.ts
Normal file
@ -0,0 +1,69 @@
|
||||
import type Move from "#app/data/moves/move";
|
||||
import Pokemon from "#app/field/pokemon";
|
||||
import { AbilityId } from "#enums/ability-id";
|
||||
import { MoveId } from "#enums/move-id";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi, type MockInstance } from "vitest";
|
||||
|
||||
describe("Abilities - Shell Armor", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
let critSpy: MockInstance<(source: Pokemon, move: Move, simulated?: boolean) => boolean>;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.ability(AbilityId.SHELL_ARMOR)
|
||||
.battleStyle("single")
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.statusEffect(StatusEffect.POISON);
|
||||
|
||||
critSpy = vi.spyOn(Pokemon.prototype, "getCriticalHitResult");
|
||||
});
|
||||
|
||||
it("should prevent natural crit rolls from suceeding", async () => {
|
||||
game.override.criticalHits(true); // force random crit rolls to always succeed
|
||||
await game.classicMode.startBattle([SpeciesId.ABOMASNOW]);
|
||||
|
||||
game.move.use(MoveId.SPLASH);
|
||||
await game.move.forceEnemyMove(MoveId.TACKLE);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(critSpy).toHaveReturnedWith(false);
|
||||
});
|
||||
|
||||
it("should prevent guaranteed-crit moves from critting", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.ABOMASNOW]);
|
||||
|
||||
game.move.use(MoveId.SPLASH);
|
||||
await game.move.forceEnemyMove(MoveId.FLOWER_TRICK);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(critSpy).toHaveReturnedWith(false);
|
||||
});
|
||||
|
||||
it("should block Merciless guaranteed crits", async () => {
|
||||
game.override.enemyAbility(AbilityId.MERCILESS);
|
||||
await game.classicMode.startBattle([SpeciesId.ABOMASNOW]);
|
||||
|
||||
game.move.use(MoveId.SPLASH);
|
||||
await game.move.forceEnemyMove(MoveId.TACKLE);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(critSpy).toHaveReturnedWith(false);
|
||||
});
|
||||
});
|
@ -27,7 +27,7 @@ describe("Abilities - Stakeout", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.SURF])
|
||||
.ability(AbilityId.STAKEOUT)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.startingLevel(100)
|
||||
.enemyLevel(100)
|
||||
.enemySpecies(SpeciesId.SNORLAX)
|
||||
|
@ -24,7 +24,7 @@ describe("Abilities - Stall", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.REGIELEKI)
|
||||
.enemyAbility(AbilityId.STALL)
|
||||
.enemyMoveset(MoveId.QUICK_ATTACK)
|
||||
|
@ -27,7 +27,7 @@ describe("Abilities - Storm Drain", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.WATER_GUN])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Thermal Exchange", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Trace", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.TRACE)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Victory Star", () => {
|
||||
game.override
|
||||
.moveset([MoveId.TACKLE, MoveId.SPLASH])
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Vital Spirit", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -27,7 +27,7 @@ describe("Abilities - Volt Absorb", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
});
|
||||
|
||||
it("does not activate when CHARGE is used", async () => {
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Wandering Spirit", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.WANDERING_SPIRIT)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.TACKLE);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Water Bubble", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Abilities - Water Veil", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -39,7 +39,7 @@ describe("Abilities - Wimp Out", () => {
|
||||
.enemyLevel(70)
|
||||
.moveset([MoveId.SPLASH, MoveId.FALSE_SWIPE, MoveId.ENDURE])
|
||||
.enemyMoveset(MoveId.FALSE_SWIPE)
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
function confirmSwitch(): void {
|
||||
|
@ -27,7 +27,7 @@ describe("Abilities - ZEN MODE", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyLevel(5)
|
||||
|
@ -23,7 +23,7 @@ describe("Arena - Grassy Terrain", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemyLevel(1)
|
||||
.enemySpecies(SpeciesId.SHUCKLE)
|
||||
.enemyAbility(AbilityId.STURDY)
|
||||
|
@ -27,7 +27,7 @@ describe("Test Ability Swapping", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -32,7 +32,7 @@ describe("Battle Mechanics - Damage Calculation", () => {
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.startingLevel(100)
|
||||
.enemyLevel(100)
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.moveset([MoveId.TACKLE, MoveId.DRAGON_RAGE, MoveId.FISSURE, MoveId.JUMP_KICK]);
|
||||
});
|
||||
|
||||
|
@ -28,7 +28,7 @@ describe("Boss Pokemon / Shields", () => {
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableTrainerWaves()
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.RATTATA)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.enemyHeldItems([])
|
||||
|
@ -359,7 +359,7 @@ describe("Status Effects", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
@ -415,7 +415,7 @@ describe("Status Effects", () => {
|
||||
.moveset([MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.NUZZLE)
|
||||
|
@ -21,7 +21,7 @@ describe("Endless Boss", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.startingBiome(BiomeId.END).disableCrits();
|
||||
game.override.startingBiome(BiomeId.END).criticalHits(false);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -27,7 +27,7 @@ describe("Final Boss", () => {
|
||||
game.override
|
||||
.startingWave(FinalWave.Classic)
|
||||
.startingBiome(BiomeId.END)
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.moveset([MoveId.SPLASH, MoveId.WILL_O_WISP, MoveId.DRAGON_PULSE])
|
||||
.startingLevel(10000);
|
||||
|
@ -28,7 +28,7 @@ describe("Items - Multi Lens", () => {
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.startingHeldItems([{ name: "MULTI_LENS" }])
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.SNORLAX)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
|
@ -29,7 +29,7 @@ describe("Items - Reviver Seed", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.TACKLE, MoveId.ENDURE])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.startingHeldItems([{ name: "REVIVER_SEED" }])
|
||||
|
@ -26,7 +26,7 @@ describe("Moves - Alluring Voice", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.ICE_SCALES)
|
||||
.enemyMoveset(MoveId.HOWL)
|
||||
|
@ -30,7 +30,7 @@ describe("Moves - Assist", () => {
|
||||
game.override
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyLevel(100)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
|
@ -42,7 +42,7 @@ describe("Moves - Aurora Veil", () => {
|
||||
.enemyLevel(100)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyMoveset(MoveId.AURORA_VEIL)
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.weather(WeatherType.HAIL);
|
||||
});
|
||||
|
||||
|
@ -31,7 +31,7 @@ describe("Moves - Baton Pass", () => {
|
||||
.moveset([MoveId.BATON_PASS, MoveId.NASTY_PLOT, MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
it("transfers all stat stages when player uses it", async () => {
|
||||
|
@ -26,7 +26,7 @@ describe("Moves - Burning Jealousy", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.ICE_SCALES)
|
||||
.enemyMoveset([MoveId.HOWL])
|
||||
|
@ -28,7 +28,7 @@ describe("Moves - Camouflage", () => {
|
||||
.moveset([MoveId.CAMOUFLAGE])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.REGIELEKI)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.PSYCHIC_TERRAIN);
|
||||
|
@ -25,7 +25,7 @@ describe("Moves - Chloroblast", () => {
|
||||
game.override
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH);
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ describe("Moves - Copycat", () => {
|
||||
.moveset([MoveId.COPYCAT, MoveId.SPIKY_SHIELD, MoveId.SWORDS_DANCE, MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.starterSpecies(SpeciesId.FEEBAS)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
|
@ -26,7 +26,7 @@ describe("Moves - Defog", () => {
|
||||
.moveset([MoveId.MIST, MoveId.SAFEGUARD, MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.SHUCKLE)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset([MoveId.DEFOG, MoveId.GROWL]);
|
||||
|
@ -27,7 +27,7 @@ describe("Moves - Doodle", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.DOODLE])
|
||||
.ability(AbilityId.ADAPTABILITY)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -26,7 +26,7 @@ describe("Moves - Double Team", () => {
|
||||
game.override
|
||||
.battleStyle("single")
|
||||
.moveset([MoveId.DOUBLE_TEAM])
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.enemySpecies(SpeciesId.SHUCKLE)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
|
@ -52,7 +52,7 @@ describe("Moves - Dragon Rage", () => {
|
||||
});
|
||||
|
||||
it("ignores weaknesses", async () => {
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
vi.spyOn(enemyPokemon, "getTypes").mockReturnValue([PokemonType.DRAGON]);
|
||||
|
||||
game.move.select(MoveId.DRAGON_RAGE);
|
||||
@ -62,7 +62,7 @@ describe("Moves - Dragon Rage", () => {
|
||||
});
|
||||
|
||||
it("ignores resistances", async () => {
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
vi.spyOn(enemyPokemon, "getTypes").mockReturnValue([PokemonType.STEEL]);
|
||||
|
||||
game.move.select(MoveId.DRAGON_RAGE);
|
||||
@ -72,7 +72,7 @@ describe("Moves - Dragon Rage", () => {
|
||||
});
|
||||
|
||||
it("ignores SPATK stat stages", async () => {
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
partyPokemon.setStatStage(Stat.SPATK, 2);
|
||||
|
||||
game.move.select(MoveId.DRAGON_RAGE);
|
||||
@ -82,7 +82,7 @@ describe("Moves - Dragon Rage", () => {
|
||||
});
|
||||
|
||||
it("ignores stab", async () => {
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
vi.spyOn(partyPokemon, "getTypes").mockReturnValue([PokemonType.DRAGON]);
|
||||
|
||||
game.move.select(MoveId.DRAGON_RAGE);
|
||||
@ -101,7 +101,7 @@ describe("Moves - Dragon Rage", () => {
|
||||
});
|
||||
|
||||
it("ignores damage modification from abilities, for example ICE_SCALES", async () => {
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
game.override.enemyAbility(AbilityId.ICE_SCALES);
|
||||
|
||||
game.move.select(MoveId.DRAGON_RAGE);
|
||||
|
@ -32,20 +32,12 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
game.override
|
||||
.moveset(MoveId.DYNAMAX_CANNON)
|
||||
.startingLevel(200)
|
||||
.levelCap(10)
|
||||
.levelCap(100)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
||||
// Note that, for Waves 1-10, the level cap is 10
|
||||
game.override.startingWave(1);
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
|
||||
game.override.enemySpecies(SpeciesId.MAGIKARP);
|
||||
game.override.enemyMoveset([MoveId.SPLASH, MoveId.SPLASH, MoveId.SPLASH, MoveId.SPLASH]);
|
||||
|
||||
vi.spyOn(dynamaxCannon, "calculateBattlePower");
|
||||
});
|
||||
|
||||
@ -62,7 +54,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
}, 20000);
|
||||
|
||||
it("should return 100 power against an enemy at level cap", async () => {
|
||||
game.override.enemyLevel(10);
|
||||
game.override.enemyLevel(100);
|
||||
await game.classicMode.startBattle([SpeciesId.ETERNATUS]);
|
||||
|
||||
game.move.select(dynamaxCannon.id);
|
||||
|
@ -28,7 +28,7 @@ describe("Moves - Encore", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.ENCORE])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset([MoveId.SPLASH, MoveId.TACKLE])
|
||||
|
@ -26,7 +26,7 @@ describe("Moves - Endure", () => {
|
||||
.ability(AbilityId.SKILL_LINK)
|
||||
.startingLevel(100)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.NO_GUARD)
|
||||
.enemyMoveset(MoveId.ENDURE);
|
||||
|
@ -26,7 +26,7 @@ describe("Moves - Entrainment", () => {
|
||||
.moveset([MoveId.SPLASH, MoveId.ENTRAINMENT])
|
||||
.ability(AbilityId.ADAPTABILITY)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -27,7 +27,7 @@ describe("Moves - Fairy Lock", () => {
|
||||
.moveset([MoveId.FAIRY_LOCK, MoveId.SPLASH])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset([MoveId.SPLASH, MoveId.U_TURN]);
|
||||
|
@ -27,7 +27,7 @@ describe("Moves - Fake Out", () => {
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.enemyLevel(10)
|
||||
.startingLevel(1) // prevent LevelUpPhase from happening
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
it("should only work the first turn a pokemon is sent out in a battle", async () => {
|
||||
|
@ -27,7 +27,7 @@ describe("Moves - False Swipe", () => {
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.startingLevel(1000)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -30,7 +30,7 @@ describe("Moves - Fell Stinger", () => {
|
||||
.battleStyle("single")
|
||||
.moveset([MoveId.FELL_STINGER, MoveId.SALT_CURE, MoveId.BIND, MoveId.LEECH_SEED])
|
||||
.startingLevel(50)
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemyAbility(AbilityId.STURDY)
|
||||
.enemySpecies(SpeciesId.HYPNO)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
|
@ -29,7 +29,7 @@ describe("Moves - Fissure", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
|
||||
game.override.starterSpecies(SpeciesId.SNORLAX);
|
||||
game.override.moveset([MoveId.FISSURE]);
|
||||
|
@ -37,7 +37,7 @@ describe("Moves - Flame Burst", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([MoveId.FLAME_BURST, MoveId.SPLASH]);
|
||||
game.override.disableCrits();
|
||||
game.override.criticalHits(false);
|
||||
game.override.ability(AbilityId.UNNERVE);
|
||||
game.override.startingWave(4);
|
||||
game.override.enemySpecies(SpeciesId.SHUCKLE);
|
||||
|
@ -22,7 +22,7 @@ describe("Moves - Foresight", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.GASTLY)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.enemyLevel(5)
|
||||
|
@ -26,7 +26,7 @@ describe("Moves - Forest's Curse", () => {
|
||||
.moveset([MoveId.FORESTS_CURSE, MoveId.TRICK_OR_TREAT])
|
||||
.ability(AbilityId.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.criticalHits(false)
|
||||
.enemySpecies(SpeciesId.MAGIKARP)
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
@ -31,7 +31,7 @@ describe("Moves - Fusion Bolt", () => {
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.battleStyle("single")
|
||||
.startingWave(97)
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
it("should not make contact", async () => {
|
||||
|
@ -31,7 +31,7 @@ describe("Moves - Fusion Flare", () => {
|
||||
.enemyMoveset(MoveId.REST)
|
||||
.battleStyle("single")
|
||||
.startingWave(97)
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
it("should thaw freeze status condition", async () => {
|
||||
|
@ -40,7 +40,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
.enemyMoveset(MoveId.REST)
|
||||
.battleStyle("double")
|
||||
.startingWave(97)
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
|
||||
vi.spyOn(fusionFlare, "calculateBattlePower");
|
||||
vi.spyOn(fusionBolt, "calculateBattlePower");
|
||||
|
@ -29,7 +29,7 @@ describe("Moves - Gigaton Hammer", () => {
|
||||
.startingLevel(10)
|
||||
.enemyLevel(100)
|
||||
.enemyMoveset(MoveId.SPLASH)
|
||||
.disableCrits();
|
||||
.criticalHits(false);
|
||||
});
|
||||
|
||||
it("can't be used two turns in a row", async () => {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user