2024-09-02 22:12:34 -04:00
|
|
|
import { Stat } from "#enums/stat";
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
|
|
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
|
|
|
import i18next from "#app/plugins/i18n";
|
2024-07-25 16:43:48 -07:00
|
|
|
import * as Utils from "#app/utils";
|
|
|
|
import { Species } from "#enums/species";
|
2025-02-22 22:52:07 -06:00
|
|
|
import GameManager from "#test/testUtils/gameManager";
|
2024-07-25 16:43:48 -07:00
|
|
|
import Phase from "phaser";
|
|
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
describe("Items - Thick Club", () => {
|
|
|
|
let phaserGame: Phaser.Game;
|
|
|
|
let game: GameManager;
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
phaserGame = new Phase.Game({
|
|
|
|
type: Phaser.HEADLESS,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
game.phaseInterceptor.restoreOg();
|
|
|
|
});
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
game = new GameManager(phaserGame);
|
|
|
|
|
2024-07-25 14:48:48 -07:00
|
|
|
game.override.battleType("single");
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it("THICK_CLUB activates in battle correctly", async() => {
|
2024-07-25 16:43:48 -07:00
|
|
|
game.override.startingHeldItems([{ name: "SPECIES_STAT_BOOSTER", type: "THICK_CLUB" }]);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
const consoleSpy = vi.spyOn(console, "log");
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.classicMode.startBattle([
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
Species.CUBONE
|
|
|
|
]);
|
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const partyMember = game.scene.getPlayerParty()[0];
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
// Checking console log to make sure Thick Club is applied when getEffectiveStat (with the appropriate stat) is called
|
|
|
|
partyMember.getEffectiveStat(Stat.DEF);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), "");
|
|
|
|
|
|
|
|
// Printing dummy console messages along the way so subsequent checks don't pass because of the first
|
|
|
|
console.log("");
|
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
partyMember.getEffectiveStat(Stat.SPDEF);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), "");
|
|
|
|
|
|
|
|
console.log("");
|
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
partyMember.getEffectiveStat(Stat.ATK);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
expect(consoleSpy).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), "");
|
|
|
|
|
|
|
|
console.log("");
|
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
partyMember.getEffectiveStat(Stat.SPATK);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), "");
|
|
|
|
|
|
|
|
console.log("");
|
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
partyMember.getEffectiveStat(Stat.SPD);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
expect(consoleSpy).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.THICK_CLUB.name"), "");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("THICK_CLUB held by CUBONE", async() => {
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.classicMode.startBattle([
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
Species.CUBONE
|
|
|
|
]);
|
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const partyMember = game.scene.getPlayerParty()[0];
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
const atkStat = partyMember.getStat(Stat.ATK);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const atkValue = new Utils.NumberHolder(atkStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(1);
|
|
|
|
|
|
|
|
// Giving Eviolite to party member and testing if it applies
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.scene.addModifier(modifierTypes.SPECIES_STAT_BOOSTER().generateType([], [ "THICK_CLUB" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(2);
|
2025-02-01 01:29:25 -08:00
|
|
|
});
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
it("THICK_CLUB held by MAROWAK", async() => {
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.classicMode.startBattle([
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
Species.MAROWAK
|
|
|
|
]);
|
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const partyMember = game.scene.getPlayerParty()[0];
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
const atkStat = partyMember.getStat(Stat.ATK);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const atkValue = new Utils.NumberHolder(atkStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(1);
|
|
|
|
|
|
|
|
// Giving Eviolite to party member and testing if it applies
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.scene.addModifier(modifierTypes.SPECIES_STAT_BOOSTER().generateType([], [ "THICK_CLUB" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(2);
|
2025-02-01 01:29:25 -08:00
|
|
|
});
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
it("THICK_CLUB held by ALOLA_MAROWAK", async() => {
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.classicMode.startBattle([
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
Species.ALOLA_MAROWAK
|
|
|
|
]);
|
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const partyMember = game.scene.getPlayerParty()[0];
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
const atkStat = partyMember.getStat(Stat.ATK);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const atkValue = new Utils.NumberHolder(atkStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(1);
|
|
|
|
|
|
|
|
// Giving Eviolite to party member and testing if it applies
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.scene.addModifier(modifierTypes.SPECIES_STAT_BOOSTER().generateType([], [ "THICK_CLUB" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(2);
|
2025-02-01 01:29:25 -08:00
|
|
|
});
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
it("THICK_CLUB held by fused CUBONE line (base)", async() => {
|
|
|
|
// Randomly choose from the Cubone line
|
|
|
|
const species = [ Species.CUBONE, Species.MAROWAK, Species.ALOLA_MAROWAK ];
|
|
|
|
const randSpecies = Utils.randInt(species.length);
|
|
|
|
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.classicMode.startBattle([
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
species[randSpecies],
|
|
|
|
Species.PIKACHU
|
|
|
|
]);
|
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const partyMember = game.scene.getPlayerParty()[0];
|
|
|
|
const ally = game.scene.getPlayerParty()[1];
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
// Fuse party members (taken from PlayerPokemon.fuse(...) function)
|
|
|
|
partyMember.fusionSpecies = ally.species;
|
|
|
|
partyMember.fusionFormIndex = ally.formIndex;
|
|
|
|
partyMember.fusionAbilityIndex = ally.abilityIndex;
|
|
|
|
partyMember.fusionShiny = ally.shiny;
|
|
|
|
partyMember.fusionVariant = ally.variant;
|
|
|
|
partyMember.fusionGender = ally.gender;
|
|
|
|
partyMember.fusionLuck = ally.luck;
|
|
|
|
|
|
|
|
const atkStat = partyMember.getStat(Stat.ATK);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const atkValue = new Utils.NumberHolder(atkStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(1);
|
|
|
|
|
|
|
|
// Giving Eviolite to party member and testing if it applies
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.scene.addModifier(modifierTypes.SPECIES_STAT_BOOSTER().generateType([], [ "THICK_CLUB" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(2);
|
2025-02-01 01:29:25 -08:00
|
|
|
});
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
it("THICK_CLUB held by fused CUBONE line (part)", async() => {
|
|
|
|
// Randomly choose from the Cubone line
|
|
|
|
const species = [ Species.CUBONE, Species.MAROWAK, Species.ALOLA_MAROWAK ];
|
|
|
|
const randSpecies = Utils.randInt(species.length);
|
|
|
|
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.classicMode.startBattle([
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
Species.PIKACHU,
|
|
|
|
species[randSpecies]
|
|
|
|
]);
|
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const partyMember = game.scene.getPlayerParty()[0];
|
|
|
|
const ally = game.scene.getPlayerParty()[1];
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
// Fuse party members (taken from PlayerPokemon.fuse(...) function)
|
|
|
|
partyMember.fusionSpecies = ally.species;
|
|
|
|
partyMember.fusionFormIndex = ally.formIndex;
|
|
|
|
partyMember.fusionAbilityIndex = ally.abilityIndex;
|
|
|
|
partyMember.fusionShiny = ally.shiny;
|
|
|
|
partyMember.fusionVariant = ally.variant;
|
|
|
|
partyMember.fusionGender = ally.gender;
|
|
|
|
partyMember.fusionLuck = ally.luck;
|
|
|
|
|
|
|
|
const atkStat = partyMember.getStat(Stat.ATK);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const atkValue = new Utils.NumberHolder(atkStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(1);
|
|
|
|
|
|
|
|
// Giving Eviolite to party member and testing if it applies
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.scene.addModifier(modifierTypes.SPECIES_STAT_BOOSTER().generateType([], [ "THICK_CLUB" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(2);
|
2025-02-01 01:29:25 -08:00
|
|
|
});
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
it("THICK_CLUB not held by CUBONE", async() => {
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.classicMode.startBattle([
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
Species.PIKACHU
|
|
|
|
]);
|
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const partyMember = game.scene.getPlayerParty()[0];
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
const atkStat = partyMember.getStat(Stat.ATK);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const atkValue = new Utils.NumberHolder(atkStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(1);
|
|
|
|
|
|
|
|
// Giving Eviolite to party member and testing if it applies
|
2025-02-01 01:29:25 -08:00
|
|
|
await game.scene.addModifier(modifierTypes.SPECIES_STAT_BOOSTER().generateType([], [ "THICK_CLUB" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.ATK, atkValue);
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
|
|
|
|
expect(atkValue.value / atkStat).toBe(1);
|
2025-02-01 01:29:25 -08:00
|
|
|
});
|
[Item] Add Light Ball, Thick Club, Metal Powder, and Quick Powder (#1899)
* Add Light Ball, Thick Club, and Metal/Quick Powder
* Fix Typo, Account for Fusions
* Fix Errors with Fusions
* Group Items into Generator
* Refactor Generator and Type, Fix Localization (en)
* Adjust Generator, Add Override Type
* Fix Enum Import
* Localize for de, es, fr, it, ko, zh_CN, zh_TW
* Add Unit Tests
* Add Type
* Fix Items Atlas
* Change Cubone Passive Ability, Adjust Weight
2024-06-26 14:48:10 -04:00
|
|
|
});
|