mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-28 11:12:24 +02:00
Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
b409d6cc8b
commit
6e5ca28a63
@ -2701,7 +2701,6 @@ export class PreLeaveFieldAbAttr extends AbAttr {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clears Desolate Land/Primordial Sea/Delta Stream upon the Pokemon switching out.
|
||||
*/
|
||||
|
@ -1422,11 +1422,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
*/
|
||||
public hasPassive(): boolean {
|
||||
// returns override if valid for current case
|
||||
if ((Overrides.HAS_PASSIVE_ABILITY_OVERRIDE === false && this.isPlayer()) || (Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE === false && !this.isPlayer())) {
|
||||
if (
|
||||
(Overrides.HAS_PASSIVE_ABILITY_OVERRIDE === false && this.isPlayer())
|
||||
|| (Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE === false && !this.isPlayer())
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (((Overrides.PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE || Overrides.HAS_PASSIVE_ABILITY_OVERRIDE) && this.isPlayer())
|
||||
|| ((Overrides.OPP_PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE || Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE) && !this.isPlayer())) {
|
||||
if (
|
||||
((Overrides.PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE || Overrides.HAS_PASSIVE_ABILITY_OVERRIDE) && this.isPlayer())
|
||||
|| ((Overrides.OPP_PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE || Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE) && !this.isPlayer())
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -181,9 +181,14 @@ export class OverridesHelper extends GameManagerHelper {
|
||||
return this;
|
||||
}
|
||||
|
||||
public hasPassiveAbility(hasPassiveAbility: boolean): this {
|
||||
public hasPassiveAbility(hasPassiveAbility: boolean | null): this {
|
||||
vi.spyOn(Overrides, "HAS_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(hasPassiveAbility);
|
||||
this.log("Player Pokemon PASSIVE ability is active!");
|
||||
if (hasPassiveAbility === null) {
|
||||
this.log("Player Pokemon PASSIVE ability no longer force enabled or disabled!");
|
||||
}
|
||||
else {
|
||||
this.log("Player Pokemon PASSIVE ability is force ${hasPassiveAbility ? "enabled" : "disabled"}!");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@ -330,9 +335,14 @@ export class OverridesHelper extends GameManagerHelper {
|
||||
return this;
|
||||
}
|
||||
|
||||
public enemyHasPassiveAbility(hasPassiveAbility: boolean): this {
|
||||
public enemyHasPassiveAbility(hasPassiveAbility: boolean | null): this {
|
||||
vi.spyOn(Overrides, "OPP_HAS_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(hasPassiveAbility);
|
||||
this.log("Enemy Pokemon PASSIVE ability is active!");
|
||||
if (hasPassiveAbility === null) {
|
||||
this.log("Enemy Pokemon PASSIVE ability no longer force enabled or disabled!");
|
||||
}
|
||||
else {
|
||||
this.log("Enemy Pokemon PASSIVE ability is force ${hasPassiveAbility ? "enabled" : "disabled"}!");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user