diff --git a/src/data/ability.ts b/src/data/ability.ts index 40ccfcf56a1..25cfbdcd0c9 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -4231,7 +4231,7 @@ export class FormBlockDamageAbAttr extends ReceivedMoveDamageMultiplierAbAttr { (args[0] as Utils.NumberHolder).value = this.multiplier; pokemon.removeTag(this.tagType); if (this.recoilDamageFunc) { - pokemon.damageAndUpdate(this.recoilDamageFunc(pokemon), HitResult.OTHER); + pokemon.damageAndUpdate(this.recoilDamageFunc(pokemon), HitResult.OTHER, false, false, true, true); } } return true; diff --git a/src/overrides.ts b/src/overrides.ts index 1c1d78b3c55..8b3d628e05e 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -12,7 +12,6 @@ import { type PokeballCounts } from "./battle-scene"; import { Gender } from "./data/gender"; import { allSpecies } from "./data/pokemon-species"; // eslint-disable-line @typescript-eslint/no-unused-vars import { Variant } from "./data/variant"; -import { Stat } from "./enums/stat"; import { type ModifierOverride } from "./modifier/modifier-type"; /** @@ -30,9 +29,7 @@ import { type ModifierOverride } from "./modifier/modifier-type"; * } * ``` */ -const overrides = { - ITEM_REWARD_OVERRIDE: [{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }, { name: "BASE_STAT_BOOSTER" }, { name: "DIRE_HIT" }] -} satisfies Partial>; +const overrides = {} satisfies Partial>; /** * If you need to add Overrides values for local testing do that inside {@linkcode overrides} diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index 05bd1045e9e..10ab7093f4c 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -207,4 +207,18 @@ describe("Abilities - Disguise", () => { expect(mimikyu1.formIndex).toBe(disguisedForm); }, TIMEOUT); + + it("doesn't faint twice when fainting due to Disguise break damage, nor prevent faint from Disguise break damage if using Endure", async () => { + game.override.enemyMoveset(Array(4).fill(Moves.ENDURE)); + await game.startBattle(); + + const mimikyu = game.scene.getEnemyPokemon()!; + mimikyu.hp = 1; + + game.move.select(Moves.SHADOW_SNEAK); + await game.toNextWave(); + + expect(game.scene.getCurrentPhase()?.constructor.name).toBe("CommandPhase"); + expect(game.scene.currentBattle.waveIndex).toBe(2); + }, TIMEOUT); }); diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 97064cd9061..250f097c2fc 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -131,6 +131,8 @@ const starterCandyCosts: { passive: integer, costReduction: [integer, integer], { passive: 10, costReduction: [5, 15], egg: 10 }, // 10 Cost ]; +const valueReductionMax = 2; + // Position of UI elements const filterBarHeight = 17; const speciesContainerX = 109; // if team on the RIGHT: 109 / if on the LEFT: 143 @@ -1009,11 +1011,11 @@ export default class StarterSelectUiHandler extends MessageUiHandler { const starterData = this.scene.gameData.starterData[speciesId]; return starterData.candyCount >= getValueReductionCandyCounts(speciesStarters[speciesId])[starterData.valueReduction] - && starterData.valueReduction < 2; + && starterData.valueReduction < valueReductionMax; } /** - * Determines if an same species egg can be baught for the given species ID + * Determines if an same species egg can be bought for the given species ID * @param speciesId The ID of the species to check the value reduction of * @returns true if the user has enough candies */ @@ -1062,15 +1064,18 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } ],}; - const passiveAvailable = this.isPassiveAvailable(species.speciesId); - // 'Only Passives' mode + const isPassiveAvailable = this.isPassiveAvailable(species.speciesId); + const isValueReductionAvailable = this.isValueReductionAvailable(species.speciesId); + const isSameSpeciesEggAvailable = this.isSameSpeciesEggAvailable(species.speciesId); + + // 'Passives Only' mode if (this.scene.candyUpgradeNotification === 1) { - if (passiveAvailable) { + if (isPassiveAvailable) { this.scene.tweens.chain(tweenChain).paused = startPaused; } // 'On' mode } else if (this.scene.candyUpgradeNotification === 2) { - if (passiveAvailable || this.isValueReductionAvailable(species.speciesId)) { + if (isPassiveAvailable || isValueReductionAvailable || isSameSpeciesEggAvailable) { this.scene.tweens.chain(tweenChain).paused = startPaused; } } @@ -1089,16 +1094,19 @@ export default class StarterSelectUiHandler extends MessageUiHandler { return; } - const passiveAvailable = this.isPassiveAvailable(species.speciesId); - // 'Only Passive Unlocks' mode + const isPassiveAvailable = this.isPassiveAvailable(species.speciesId); + const isValueReductionAvailable = this.isValueReductionAvailable(species.speciesId); + const isSameSpeciesEggAvailable = this.isSameSpeciesEggAvailable(species.speciesId); + + // 'Passive Only' mode if (this.scene.candyUpgradeNotification === 1) { - starter.candyUpgradeIcon.setVisible(slotVisible && passiveAvailable); + starter.candyUpgradeIcon.setVisible(slotVisible && isPassiveAvailable); starter.candyUpgradeOverlayIcon.setVisible(slotVisible && starter.candyUpgradeIcon.visible); // 'On' mode } else if (this.scene.candyUpgradeNotification === 2) { starter.candyUpgradeIcon.setVisible( - slotVisible && ( passiveAvailable || this.isValueReductionAvailable(species.speciesId))); + slotVisible && ( isPassiveAvailable || isValueReductionAvailable || isSameSpeciesEggAvailable )); starter.candyUpgradeOverlayIcon.setVisible(slotVisible && starter.candyUpgradeIcon.visible); } } @@ -1630,7 +1638,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { }); } const valueReduction = starterData.valueReduction; - if (valueReduction < 2) { + if (valueReduction < valueReductionMax) { const reductionCost = getValueReductionCandyCounts(speciesStarters[this.lastSpecies.speciesId])[valueReduction]; options.push({ label: `x${reductionCost} ${i18next.t("starterSelectUiHandler:reduceCost")}`,