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