mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-23 16:52:24 +02:00
Fix move-effect-phase.ts applications
Some applyX methods were missed in the cherry pick commit and were still returning functions instead of running the function themselves
This commit is contained in:
parent
d6cbd9f4e7
commit
07df67ef39
@ -480,8 +480,8 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
* @param lastHit - `true` if this is the last hit in a multi-hit attack
|
* @param lastHit - `true` if this is the last hit in a multi-hit attack
|
||||||
* @returns a function intended to be passed into a `then()` call.
|
* @returns a function intended to be passed into a `then()` call.
|
||||||
*/
|
*/
|
||||||
protected applySelfTargetEffects(user: Pokemon, target: Pokemon, firstHit: boolean, lastHit: boolean): () => void {
|
protected applySelfTargetEffects(user: Pokemon, target: Pokemon, firstHit: boolean, lastHit: boolean): void {
|
||||||
return () => applyFilteredMoveAttrs((attr: MoveAttr) =>
|
applyFilteredMoveAttrs((attr: MoveAttr) =>
|
||||||
attr instanceof MoveEffectAttr
|
attr instanceof MoveEffectAttr
|
||||||
&& attr.trigger === MoveEffectTrigger.POST_APPLY
|
&& attr.trigger === MoveEffectTrigger.POST_APPLY
|
||||||
&& attr.selfTarget
|
&& attr.selfTarget
|
||||||
@ -578,20 +578,18 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
* @param dealsDamage - `true` if the attempted move successfully dealt damage
|
* @param dealsDamage - `true` if the attempted move successfully dealt damage
|
||||||
* @returns a function intended to be passed into a `then()` call.
|
* @returns a function intended to be passed into a `then()` call.
|
||||||
*/
|
*/
|
||||||
protected applyHeldItemFlinchCheck(user: Pokemon, target: Pokemon, dealsDamage: boolean) : () => void {
|
protected applyHeldItemFlinchCheck(user: Pokemon, target: Pokemon, dealsDamage: boolean) : void {
|
||||||
return () => {
|
if (this.move.getMove().hasAttr(FlinchAttr)) {
|
||||||
if (this.move.getMove().hasAttr(FlinchAttr)) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (dealsDamage && !target.hasAbilityWithAttr(IgnoreMoveEffectsAbAttr) && !this.move.getMove().hitsSubstitute(user, target)) {
|
if (dealsDamage && !target.hasAbilityWithAttr(IgnoreMoveEffectsAbAttr) && !this.move.getMove().hitsSubstitute(user, target)) {
|
||||||
const flinched = new BooleanHolder(false);
|
const flinched = new BooleanHolder(false);
|
||||||
globalScene.applyModifiers(FlinchChanceModifier, user.isPlayer(), user, flinched);
|
globalScene.applyModifiers(FlinchChanceModifier, user.isPlayer(), user, flinched);
|
||||||
if (flinched.value) {
|
if (flinched.value) {
|
||||||
target.addTag(BattlerTagType.FLINCHED, undefined, this.move.moveId, user.id);
|
target.addTag(BattlerTagType.FLINCHED, undefined, this.move.moveId, user.id);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user