[Bug] [Ability] Fix cute charm (#6399)

Fix cute charm not working
This commit is contained in:
Sirz Benjie 2025-08-24 17:49:28 -05:00 committed by GitHub
parent a85d8cd5de
commit 6fac1a5052
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1263,17 +1263,17 @@ export class PostDefendContactApplyTagChanceAbAttr extends PostDefendAbAttr {
this.turnCount = turnCount; this.turnCount = turnCount;
} }
override canApply({ move, pokemon, opponent: attacker }: PostMoveInteractionAbAttrParams): boolean { override canApply({ move, pokemon, opponent }: PostMoveInteractionAbAttrParams): boolean {
return ( return (
move.doesFlagEffectApply({ flag: MoveFlags.MAKES_CONTACT, user: attacker, target: pokemon }) && move.doesFlagEffectApply({ flag: MoveFlags.MAKES_CONTACT, user: opponent, target: pokemon }) &&
pokemon.randBattleSeedInt(100) < this.chance && pokemon.randBattleSeedInt(100) < this.chance &&
attacker.canAddTag(this.tagType) opponent.canAddTag(this.tagType)
); );
} }
override apply({ simulated, opponent: attacker, move }: PostMoveInteractionAbAttrParams): void { override apply({ pokemon, simulated, opponent, move }: PostMoveInteractionAbAttrParams): void {
if (!simulated) { if (!simulated) {
attacker.addTag(this.tagType, this.turnCount, move.id, attacker.id); opponent.addTag(this.tagType, this.turnCount, move.id, pokemon.id);
} }
} }
} }