Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Wlowscha 2025-02-02 18:09:51 +01:00 committed by GitHub
parent b409d6cc8b
commit 6e5ca28a63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 8 deletions

View File

@ -2701,7 +2701,6 @@ export class PreLeaveFieldAbAttr extends AbAttr {
}
}
/**
* Clears Desolate Land/Primordial Sea/Delta Stream upon the Pokemon switching out.
*/

View File

@ -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;
}

View File

@ -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;
}