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

Cheek pouch fixes #2375

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion data/abilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,17 @@ exports.BattleAbilities = {
desc: "If this Pokemon eats a Berry, it restores 1/3 of its maximum HP, rounded down, in addition to the Berry's effect.",
shortDesc: "If this Pokemon eats a Berry, it restores 1/3 of its max HP after the Berry's effect.",
onEatItem: function (item, pokemon) {
this.heal(pokemon.maxhp / 3);
let targets = pokemon.side.foe.active;
let unnervecheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

unnervecheck is a bad variable name that doesn't conform to our standards, anyway.

I would normally suggest foeHasUnnerve

for (let i = 0; i < targets.length; i++) {
if (!targets[i] || targets[i].fainted) continue;
if (targets[i].ability.toString() === 'unnerve') {
Copy link
Member

Choose a reason for hiding this comment

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

And what if they have Gastro Acid?

Copy link
Member

Choose a reason for hiding this comment

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

(This is the entire reason hasAbility exists)

unnervecheck = true;
}
}
if (unnervecheck === false) {
Copy link
Member

Choose a reason for hiding this comment

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

Do you understand how booleans work? Why is this not just !unnervecheck?

this.heal(pokemon.maxhp / 3);
}
},
id: "cheekpouch",
name: "Cheek Pouch",
Expand Down