Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix interaction of Ruin Abilities with themselves #9328

Merged
merged 4 commits into from
Jan 15, 2023

Conversation

@@ -357,7 +357,7 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
},
onAnyModifySpD(spd, target, source, move) {
const abilityHolder = this.effectState.target;
if (abilityHolder === target) return;
if (abilityHolder === target || target.hasAbility('Beads of Ruin')) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably just shorten these to just the hasAbility check right? since that must return true on the ability holder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feels correct

@DaWoblefet DaWoblefet changed the title Fix ruin abilities interaction with itself Fix interaction of Ruin Abilities with themselves Jan 15, 2023
@@ -4437,7 +4437,7 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
},
onAnyModifyDef(def, target, source, move) {
const abilityHolder = this.effectState.target;
if (abilityHolder === target) return;
if (abilityHolder === target || target.hasAbility('Sword of Ruin')) return;
if (!move.ruinedDef?.hasAbility('Sword of Ruin')) move.ruinedDef = abilityHolder;
if (move.ruinedDef !== abilityHolder && move.ruinedDef !== target) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (move.ruinedDef !== abilityHolder && move.ruinedDef !== target) return;
if (move.ruinedDef !== abilityHolder) return;

This part of the check is redundant now.

@@ -357,7 +357,7 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
},
onAnyModifySpD(spd, target, source, move) {
const abilityHolder = this.effectState.target;
if (abilityHolder === target) return;
if (abilityHolder === target || target.hasAbility('Beads of Ruin')) return;
if (!move.ruinedSpD?.hasAbility('Beads of Ruin')) move.ruinedSpD = abilityHolder;
if (move.ruinedSpD !== abilityHolder && move.ruinedSpD !== target) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (move.ruinedSpD !== abilityHolder && move.ruinedSpD !== target) return;
if (move.ruinedSpD !== abilityHolder) return;

@HisuianZoroark
Copy link
Contributor Author

Implemented all suggestions, thanks!

@DaWoblefet DaWoblefet merged commit 32bbb77 into smogon:master Jan 15, 2023
@DaWoblefet
Copy link
Member

Thank you!

Comment on lines 361 to +362
if (!move.ruinedSpD?.hasAbility('Beads of Ruin')) move.ruinedSpD = abilityHolder;
if (move.ruinedSpD !== abilityHolder && move.ruinedSpD !== target) return;
if (move.ruinedSpD !== abilityHolder) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Although with the new mechanics couldn't ruinedSpD et. al. just be boolean?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, Def and SpD are harder because of spread moves. Never mind then.

MathyFurret pushed a commit to MathyFurret/pokemon-showdown that referenced this pull request Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants