Adds HitResult.SELF for confusion to distinguish from indirect damage
This commit is contained in:
parent
3027cd8630
commit
21add68ed7
|
@ -665,7 +665,7 @@ export class ConfusedTag extends BattlerTag {
|
||||||
const def = pokemon.getEffectiveStat(Stat.DEF);
|
const def = pokemon.getEffectiveStat(Stat.DEF);
|
||||||
const damage = toDmgValue(((((2 * pokemon.level / 5 + 2) * 40 * atk / def) / 50) + 2) * (pokemon.randSeedIntRange(85, 100) / 100));
|
const damage = toDmgValue(((((2 * pokemon.level / 5 + 2) * 40 * atk / def) / 50) + 2) * (pokemon.randSeedIntRange(85, 100) / 100));
|
||||||
globalScene.queueMessage(i18next.t("battlerTags:confusedLapseHurtItself"));
|
globalScene.queueMessage(i18next.t("battlerTags:confusedLapseHurtItself"));
|
||||||
pokemon.damageAndUpdate(damage);
|
pokemon.damageAndUpdate(damage, HitResult.SELF);
|
||||||
pokemon.battleData.hitCount++;
|
pokemon.battleData.hitCount++;
|
||||||
(globalScene.getCurrentPhase() as MovePhase).cancel();
|
(globalScene.getCurrentPhase() as MovePhase).cancel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5400,10 +5400,11 @@ export enum HitResult {
|
||||||
FAIL,
|
FAIL,
|
||||||
MISS,
|
MISS,
|
||||||
OTHER,
|
OTHER,
|
||||||
IMMUNE
|
IMMUNE,
|
||||||
|
SELF
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DamageResult = HitResult.EFFECTIVE | HitResult.SUPER_EFFECTIVE | HitResult.NOT_VERY_EFFECTIVE | HitResult.ONE_HIT_KO | HitResult.OTHER;
|
export type DamageResult = HitResult.EFFECTIVE | HitResult.SUPER_EFFECTIVE | HitResult.NOT_VERY_EFFECTIVE | HitResult.ONE_HIT_KO | HitResult.SELF | HitResult.OTHER;
|
||||||
|
|
||||||
/** Interface containing the results of a damage calculation for a given move */
|
/** Interface containing the results of a damage calculation for a given move */
|
||||||
export interface DamageCalculationResult {
|
export interface DamageCalculationResult {
|
||||||
|
|
Loading…
Reference in New Issue