-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Cheek pouch fixes #2375
Conversation
@@ -1052,11 +1052,9 @@ BattlePokemon = (function () { | |||
if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect; | |||
if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; | |||
item = this.getItem(); | |||
if (this.battle.runEvent('UseItem', this, null, null, item) && this.battle.runEvent('EatItem', this, null, null, item)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this line, berries will bypass Unnerve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, based on where you moved it, it means berries will bypass Unnerve, then they might possibly keep their item!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might keep their item as in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EatItem
is actually a very important for making sure berries don't get consumed out of order, and is used in quite a few cases:
- Unnerve blocking all berries
- Heal Block blocking healing berries
The way the order is now, an eating message will appear, the effect will trigger, and then Unnerve will block the item from being "consumed" and the item will stay as held. Berry Pouch probably needs to activate in an event that occurs after EatItem
, perhaps in AfterUseItem
? We'll still have to do some extra checks for Bug Bite and whatnot (because those are not fixed yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I continue working on this, or will Marty do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continue working on this. The person assigned to a pull request is the one who reviews it before merging (usually), and Marty knows the most about game mechanics.
Cheek pouch no longer activates with Unnerve. This was earlier causing problems, when the berry wasn't being consumed but cheek pouch was getting activated. |
@@ -282,7 +282,10 @@ 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 target = pokemon.side.foe.active[pokemon.side.foe.active.length - 1 - pokemon.position]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All opposing Pokemon with unnerve block berry consumption and you can't just check one of the Pokemon.
You seem to have reverted your other changes regarding the cheek pouch activation order. Are you not going to work on that part any more? |
I tried to rectify the bigger problem first. Thinking about the other one. |
Cheek pouch fix for all pokes
Corrected the previous problem of checking with the first foe only. |
let unnervecheck = false; | ||
for (let i = 0; i < targets.length; i++) { | ||
if (!targets[i] || targets[i].fainted) continue; | ||
if (targets[i].ability.toString() === 'unnerve') { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
All my critiques here are pointless, though, since if you just wanted to fix the interaction with Unnerve, the correct way is to give a negative |
And if you wanted the right order, you'd probably want to rename |
Beyond all of the above, this code assumes it's impossible to eat a Berry while the opponent has Unnerve active. Consider the case where your opponent has Unnerve and you have Cheek Pouch. If you use Bug Bite on something, steal and eat a Liechi Berry for example, you get +1 Attack and then Cheek Pouch activates. This is entirely possible, if improbable. Edit: Apparently stealing and eating a Berry isn't even activating Cheek Pouch as it is. Another bug for the Cheek Pouch list! |
Note that the changes I suggested above (changing |
Zarel, using TryEatItem is rendering Unnerve completely useless, since now any Pokemon can consume its Berry even though the opponent has Unnerve. Any suggestions on how to use Priority? |
You're not using TryEatItem correctly. Unnerve should return false to TryEatItem. And if TryEatItem fails, the pokemon should not eat the berry. |
Doesn't work. With unnerve, tryuseitem returns the held berry's name. |
^Ignore that :S. |
Should I close this? I'm getting nowhere with it :/ |
Since this doesn't appear to have anything to do with Cheek Pouch anymore, I'll just close it for you. I fixed those tooltips in smogon/pokemon-showdown-client@209b49a, by the way, which I've already pointed out to you. |
Reference #2367
Now, the Berry's effect occurs first, and the healing takes place later.