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 - Quick Powder", () => {
|
|
|
|
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("QUICK_POWDER activates in battle correctly", async() => {
|
2024-07-25 16:43:48 -07:00
|
|
|
game.override.startingHeldItems([{ name: "SPECIES_STAT_BOOSTER", type: "QUICK_POWDER" }]);
|
[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.DITTO
|
|
|
|
]);
|
|
|
|
|
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 Quick Powder 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.QUICK_POWDER.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.QUICK_POWDER.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).not.toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.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.QUICK_POWDER.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).toHaveBeenLastCalledWith("Applied", i18next.t("modifierType:SpeciesBoosterItem.QUICK_POWDER.name"), "");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("QUICK_POWDER held by DITTO", 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.DITTO
|
|
|
|
]);
|
|
|
|
|
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 spdStat = partyMember.getStat(Stat.SPD);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const spdValue = new Utils.NumberHolder(spdStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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([], [ "QUICK_POWDER" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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("QUICK_POWDER held by fused DITTO (base)", 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.DITTO,
|
|
|
|
Species.MAROWAK
|
|
|
|
]);
|
|
|
|
|
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 spdStat = partyMember.getStat(Stat.SPD);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const spdValue = new Utils.NumberHolder(spdStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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([], [ "QUICK_POWDER" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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("QUICK_POWDER held by fused DITTO (part)", 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,
|
|
|
|
Species.DITTO
|
|
|
|
]);
|
|
|
|
|
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 spdStat = partyMember.getStat(Stat.SPD);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const spdValue = new Utils.NumberHolder(spdStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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([], [ "QUICK_POWDER" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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("QUICK_POWDER not held by DITTO", 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 spdStat = partyMember.getStat(Stat.SPD);
|
|
|
|
|
|
|
|
// Making sure modifier is not applied without holding item
|
|
|
|
const spdValue = new Utils.NumberHolder(spdStat);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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([], [ "QUICK_POWDER" ])!.newModifier(partyMember), true);
|
2025-01-12 15:33:05 -08:00
|
|
|
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.SPD, spdValue);
|
[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(spdValue.value / spdStat).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
|
|
|
});
|