mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-10 10:22:18 +02:00
Compare commits
No commits in common. "a8c9065d5796eb12b371d64b8419ef56e2fdcd6e" and "de29c1f02bfc46edbd1c13d6cedf861df2b390a5" have entirely different histories.
a8c9065d57
...
de29c1f02b
Binary file not shown.
Before Width: | Height: | Size: 370 KiB After Width: | Height: | Size: 372 KiB |
@ -2209,7 +2209,7 @@ export function getDefaultModifierTypeForTier(tier: ModifierTier): ModifierType
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ModifierTypeOption {
|
export class ModifierTypeOption {
|
||||||
public type: ModifierType;
|
public type: ModifierType | null;
|
||||||
public upgradeCount: integer;
|
public upgradeCount: integer;
|
||||||
public cost: integer;
|
public cost: integer;
|
||||||
|
|
||||||
|
@ -5580,7 +5580,7 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
} else if (lockRarities) {
|
} else if (lockRarities) {
|
||||||
const tierValues = [50, 125, 300, 750, 2000];
|
const tierValues = [50, 125, 300, 750, 2000];
|
||||||
for (const opt of typeOptions) {
|
for (const opt of typeOptions) {
|
||||||
baseValue += tierValues[opt.type.tier ?? 0];
|
baseValue += opt.type?.tier ? tierValues[opt.type.tier] : 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
baseValue = 250;
|
baseValue = 250;
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
import GameManager from "#test/utils/gameManager";
|
|
||||||
import Phase from "phaser";
|
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
||||||
import { Abilities } from "#app/enums/abilities.js";
|
|
||||||
import { Moves } from "#app/enums/moves.js";
|
|
||||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
|
||||||
import { SelectModifierPhase } from "#app/phases.js";
|
|
||||||
import { ModifierTypeOption, modifierTypes } from "#app/modifier/modifier-type.js";
|
|
||||||
|
|
||||||
describe("Items - Lock Capsule", () => {
|
|
||||||
let phaserGame: Phaser.Game;
|
|
||||||
let game: GameManager;
|
|
||||||
|
|
||||||
beforeAll(() => {
|
|
||||||
phaserGame = new Phase.Game({
|
|
||||||
type: Phaser.HEADLESS,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
game.phaseInterceptor.restoreOg();
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
game = new GameManager(phaserGame);
|
|
||||||
|
|
||||||
game.override
|
|
||||||
.battleType("single")
|
|
||||||
.startingLevel(200)
|
|
||||||
.moveset([Moves.SURF])
|
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
|
||||||
.startingModifier([{name: "LOCK_CAPSULE"}]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("doesn't set the cost of common tier items to 0", async() => {
|
|
||||||
await game.startBattle();
|
|
||||||
|
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SURF));
|
|
||||||
await game.phaseInterceptor.to(SelectModifierPhase, false);
|
|
||||||
|
|
||||||
const rewards = game.scene.getCurrentPhase() as SelectModifierPhase;
|
|
||||||
const potion = new ModifierTypeOption(modifierTypes.POTION(), 0, 40); // Common tier item
|
|
||||||
const rerollCost = rewards.getRerollCost([potion, potion, potion], true);
|
|
||||||
|
|
||||||
expect(rerollCost).toBe(150);
|
|
||||||
}, 20000);
|
|
||||||
});
|
|
@ -84,17 +84,6 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Override the player's starting modifiers
|
|
||||||
* @param modifiers the modifiers to set
|
|
||||||
* @returns this
|
|
||||||
*/
|
|
||||||
startingModifier(modifiers: ModifierOverride[]): this {
|
|
||||||
vi.spyOn(Overrides, "STARTING_MODIFIER_OVERRIDE", "get").mockReturnValue(modifiers);
|
|
||||||
this.log(`Player starting modifiers set to: ${modifiers}`);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override the player (pokemon) {@linkcode Abilities | ability}
|
* Override the player (pokemon) {@linkcode Abilities | ability}
|
||||||
* @param ability the (pokemon) {@linkcode Abilities | ability} to set
|
* @param ability the (pokemon) {@linkcode Abilities | ability} to set
|
||||||
|
@ -28,7 +28,7 @@ const timedEvents: TimedEvent[] = [
|
|||||||
eventType: EventType.SHINY,
|
eventType: EventType.SHINY,
|
||||||
shinyMultiplier: 2,
|
shinyMultiplier: 2,
|
||||||
startDate: new Date(Date.UTC(2024, 7, 16, 0)),
|
startDate: new Date(Date.UTC(2024, 7, 16, 0)),
|
||||||
endDate: new Date(Date.UTC(2024, 7, 22, 0)),
|
endDate: new Date(Date.UTC(2024, 7, 21, 0)),
|
||||||
bannerFilename: "august-variant-update"
|
bannerFilename: "august-variant-update"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user