This commit is contained in:
geeilhan 2025-01-28 00:49:08 +00:00 committed by GitHub
commit e5b789a89a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View File

@ -667,6 +667,7 @@ export class ConfusedTag extends BattlerTag {
globalScene.queueMessage(i18next.t("battlerTags:confusedLapseHurtItself"));
pokemon.damageAndUpdate(damage);
pokemon.battleData.hitCount++;
pokemon.battleData.confHitCount++;
(globalScene.getCurrentPhase() as MovePhase).cancel();
}
}

View File

@ -4010,13 +4010,13 @@ export class RageFistPowerAttr extends VariablePowerAttr {
}
/**
* Updates the number of hits the Pokemon has taken in battle
* Updates the number of hits the Pokemon has taken in battle not including self inflicted hits due to confusion
* @param user Pokemon calling Rage Fist
* @param hitCount The number of received hits this battle
* @param previousHitCount The number of received hits this battle since last time Rage Fist was used
*/
protected updateHitReceivedCount(user: Pokemon, hitCount: number, previousHitCount: number): void {
user.customPokemonData.hitsRecCount += (hitCount - previousHitCount);
user.customPokemonData.hitsRecCount += ((hitCount - user.battleData.confHitCount) - previousHitCount);
user.battleData.prevHitCount = hitCount;
}
}

View File

@ -5323,6 +5323,8 @@ export class PokemonBattleData {
public hitCount: number = 0;
/** used for {@linkcode Moves.RAGE_FIST} in order to save hit Counts received before Rage Fist is applied */
public prevHitCount: number = 0;
/** used to count the hitCount of self-hits due to confusion */
public confHitCount: number = 0;
public endured: boolean = false;
public berriesEaten: BerryType[] = [];
public abilitiesApplied: Abilities[] = [];