Fixed shell bell in ability.ts (why is it here?)

This commit is contained in:
Wlowscha 2025-06-09 10:42:11 +02:00
parent 34864b51b8
commit 565d75225a
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -35,7 +35,7 @@ import {
} from "#app/data/moves/move"; } from "#app/data/moves/move";
import { allMoves } from "../data-lists"; import { allMoves } from "../data-lists";
import { ArenaTagSide } from "#app/data/arena-tag"; import { ArenaTagSide } from "#app/data/arena-tag";
import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "#app/modifier/modifier"; import { BerryModifier, PokemonHeldItemModifier } from "#app/modifier/modifier";
import { TerrainType } from "#app/data/terrain"; import { TerrainType } from "#app/data/terrain";
import { import {
SpeciesFormChangeAbilityTrigger, SpeciesFormChangeAbilityTrigger,
@ -90,6 +90,7 @@ import type { BattlerIndex } from "#app/battle";
import type Move from "#app/data/moves/move"; import type Move from "#app/data/moves/move";
import type { ArenaTrapTag, SuppressAbilitiesTag } from "#app/data/arena-tag"; import type { ArenaTrapTag, SuppressAbilitiesTag } from "#app/data/arena-tag";
import { noAbilityTypeOverrideMoves } from "../moves/invalid-moves"; import { noAbilityTypeOverrideMoves } from "../moves/invalid-moves";
import { HeldItemId } from "#enums/held-item-id";
export class BlockRecoilDamageAttr extends AbAttr { export class BlockRecoilDamageAttr extends AbAttr {
constructor() { constructor() {
@ -7413,11 +7414,9 @@ class ForceSwitchOutHelper {
* @returns The amount of health recovered by Shell Bell. * @returns The amount of health recovered by Shell Bell.
*/ */
function calculateShellBellRecovery(pokemon: Pokemon): number { function calculateShellBellRecovery(pokemon: Pokemon): number {
const shellBellModifier = pokemon.getHeldItems().find(m => m instanceof HitHealModifier); // Returns 0 if no Shell Bell is present
if (shellBellModifier) { const shellBellStack = pokemon.heldItemManager.getStack(HeldItemId.SHELL_BELL);
return toDmgValue(pokemon.turnData.totalDamageDealt / 8) * shellBellModifier.stackCount; return toDmgValue(pokemon.turnData.totalDamageDealt / 8) * shellBellStack;
}
return 0;
} }
/** /**