mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 08:22:16 +02:00
More
This commit is contained in:
parent
89f9fd91b5
commit
034410f855
@ -1954,14 +1954,12 @@ export class StatusEffectAttr extends MoveEffectAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user !== target && target.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY)) {
|
if (!pokemon.status || (pokemon.status.effect === this.effect && moveChance < 0)) {
|
||||||
if (move.category === MoveCategory.STATUS) {
|
pokemon.checkIfCanSetStatus(this.effect, false, false, user);
|
||||||
user.scene.queueMessage(i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(target)}));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!pokemon.status || (pokemon.status.effect === this.effect && moveChance < 0))
|
if ((!pokemon.status || (pokemon.status.effect === this.effect && moveChance < 0))
|
||||||
&& pokemon.trySetStatus(this.effect, false, user, this.cureTurn)) {
|
&& pokemon.trySetStatus(this.effect, true, user, this.cureTurn, null)) {
|
||||||
applyPostAttackAbAttrs(ConfusionOnStatusEffectAbAttr, user, target, move, null, false, this.effect);
|
applyPostAttackAbAttrs(ConfusionOnStatusEffectAbAttr, user, target, move, null, false, this.effect);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2787,14 +2787,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
return this.gender !== Gender.GENDERLESS && pokemon.gender === (this.gender === Gender.MALE ? Gender.FEMALE : Gender.MALE);
|
return this.gender !== Gender.GENDERLESS && pokemon.gender === (this.gender === Gender.MALE ? Gender.FEMALE : Gender.MALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// This function only checks if it is possible to set status. If will not apply anything or do anything, just check if possible.
|
||||||
* Checks if it is possible for a pokemon to be afflicted with the given status
|
|
||||||
* @param effect {@linkcode StatusEffect} the status effect being checked.
|
|
||||||
* @param quiet a boolean value determining whether or not to show messages.
|
|
||||||
* @param overrideStatus a boolean value to determine whether a status should be overriden. If true, the pokemon cannot be statused essentially
|
|
||||||
* @param sourcePokemon {@linkcode Pokemon} The pokemon causing the status. The target pokemon is 'this'.
|
|
||||||
* @returns true if the pokemon can be affected by the status, false if not.
|
|
||||||
*/
|
|
||||||
checkIfCanSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean {
|
checkIfCanSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean {
|
||||||
if (effect !== StatusEffect.FAINT) {
|
if (effect !== StatusEffect.FAINT) {
|
||||||
if (overrideStatus ? this.status?.effect === effect : this.status) {
|
if (overrideStatus ? this.status?.effect === effect : this.status) {
|
||||||
@ -2878,6 +2871,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
canSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean {
|
canSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean {
|
||||||
const checkIfPossible = this.checkIfCanSetStatus(effect, quiet, overrideStatus, sourcePokemon);
|
const checkIfPossible = this.checkIfCanSetStatus(effect, quiet, overrideStatus, sourcePokemon);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
canSetStatus(effect: StatusEffect | undefined, quiet: boolean = false, overrideStatus: boolean = false, sourcePokemon: Pokemon | null = null): boolean {
|
||||||
|
const checker = this.checkIfCanSetStatus(effect, quiet, overrideStatus, sourcePokemon);
|
||||||
|
|
||||||
const cancelled = new Utils.BooleanHolder(false);
|
const cancelled = new Utils.BooleanHolder(false);
|
||||||
applyPreSetStatusAbAttrs(StatusEffectImmunityAbAttr, this, effect, cancelled, quiet);
|
applyPreSetStatusAbAttrs(StatusEffectImmunityAbAttr, this, effect, cancelled, quiet);
|
||||||
|
|
||||||
@ -2888,7 +2889,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return checkIfPossible;
|
return checker;
|
||||||
}
|
}
|
||||||
|
|
||||||
trySetStatus(effect: StatusEffect | undefined, asPhase: boolean = false, sourcePokemon: Pokemon | null = null, cureTurn: integer | null = 0, sourceText: string | null = null): boolean {
|
trySetStatus(effect: StatusEffect | undefined, asPhase: boolean = false, sourcePokemon: Pokemon | null = null, cureTurn: integer | null = 0, sourceText: string | null = null): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user