mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 06:19:29 +02:00
Merge branch 'beta' into freeze-dry-implementation
This commit is contained in:
commit
4e87c4eec3
@ -26,6 +26,7 @@ import {
|
|||||||
applyMoveAttrs,
|
applyMoveAttrs,
|
||||||
AttackMove,
|
AttackMove,
|
||||||
DelayedAttackAttr,
|
DelayedAttackAttr,
|
||||||
|
FlinchAttr,
|
||||||
HitsTagAttr,
|
HitsTagAttr,
|
||||||
MissEffectAttr,
|
MissEffectAttr,
|
||||||
MoveAttr,
|
MoveAttr,
|
||||||
@ -502,6 +503,10 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
*/
|
*/
|
||||||
protected applyHeldItemFlinchCheck(user: Pokemon, target: Pokemon, dealsDamage: boolean) : () => void {
|
protected applyHeldItemFlinchCheck(user: Pokemon, target: Pokemon, dealsDamage: boolean) : () => void {
|
||||||
return () => {
|
return () => {
|
||||||
|
if (this.move.getMove().hasAttr(FlinchAttr)) {
|
||||||
|
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);
|
||||||
user.scene.applyModifiers(FlinchChanceModifier, user.isPlayer(), user, flinched);
|
user.scene.applyModifiers(FlinchChanceModifier, user.isPlayer(), user, flinched);
|
||||||
|
@ -29,10 +29,14 @@ export class QuietFormChangePhase extends BattlePhase {
|
|||||||
|
|
||||||
const preName = getPokemonNameWithAffix(this.pokemon);
|
const preName = getPokemonNameWithAffix(this.pokemon);
|
||||||
|
|
||||||
if (!this.pokemon.isOnField() || this.pokemon.getTag(SemiInvulnerableTag)) {
|
if (!this.pokemon.isOnField() || this.pokemon.getTag(SemiInvulnerableTag) || this.pokemon.isFainted()) {
|
||||||
this.pokemon.changeForm(this.formChange).then(() => {
|
if (this.pokemon.isPlayer() || this.pokemon.isActive()) {
|
||||||
this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), 1500);
|
this.pokemon.changeForm(this.formChange).then(() => {
|
||||||
});
|
this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), 1500);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.end();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user