-
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
Confusion self-hit doesn't trigger Sitrus + super sitrus Berries #4045
Conversation
I can confirm this has been the case since Gen 5 (not sure about prior). I'll check the others today. |
The thing about Also re: the test, the only reason it passes is because Swagger can miss, Deoxys might not hit itself in confusion, and even if it does, it knocks itself out in one hit at +2 so the Sitrus Berry is never used. |
c2afe6c
to
f9439ce
Compare
Does this work better then? I can't think of anything else beside doing something with damage events.
Will this be enough? Test PRNG will hit + self-hit in confusion on the first turn, so it shouldn't be able to pass due to luck. |
The |
rip did Still wondering about Oran Berry/Berry Juice/etc. though. |
So what's wrong with listening to damage events? |
If you mean
And if you meant |
We could fix |
Would it not be better to make |
Yes, that's what I was proposing. |
Here's my testing (if you need the video for confirmation / how the interaction works, let me know).
|
With |
Attach it to |
c5a7c8a
to
2057db5
Compare
Okay, this might work then. I'm not entirely sure on the activation order after Recycle Air Balloon, but otherwise this should be good. |
There's at least one regression with this approach. If you're facing something with Unnerve and it knocks you into range for your Berry to activate, then it switches out, your Berry wouldn't activate immediately anymore. (In fact, it should activate even more immediately than it does currently since switching to another Unnerve Pokemon stops the Berry from activating, which is itself a bug.) |
That's getting to a quite a lot of different events to consider... How many other likely regressions will come from this (Does Magic Room running out make a Pokemon eat a Berry straight away if they are in range for example?). I guess an option would be to activate the
|
I wonder what happens if a Pokemon knocks itself below half through confusion, keeping its berry, and then something with Unnerve switches in and out before the Pokemon with the uneaten berry takes damage, or if the confusion hit happens while the berry is being negated through Unnerve, and then the Unnerve mon switches. |
At this point, I think the approach of "Update event, don't activate if previous event was confusion" might be the best approach. But I'm starting to wonder how exactly Game Freak managed this bug. What happens if you hurt yourself in confusion, and then an opposing Unnerve user switches out? |
I'm honestly not sure what the best way around this is, and there's some interactions that I can't find information on (Magic Room expire after you hit yourself in confusion, do you eat the berry?, or Zarel's Unnerve situation). |
All of these scenarios trigger the Berry. |
I don't think this will lead to any regressions (finally), but it doesn't fix the Unnerve into Unnerve problem Marty brought up earlier. |
data/items.js
Outdated
@@ -396,7 +398,7 @@ exports.BattleItems = { | |||
basePower: 30, | |||
}, | |||
onUpdate: function (pokemon) { | |||
if (pokemon.hp <= pokemon.maxhp / 2) { | |||
if (pokemon.hp <= pokemon.maxhp / 2 && pokemon.lastEffect && pokemon.lastEffect.id !== 'confused') { |
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.
Could lastEffect
ever be null
here? Like say you just switched in and your HP is already in range. Maybe return early like you've done for the rest of the Berry checks just to be extra safe.
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.
It could, probably, so yeah probably better to move it outside.
Does a Pokemon under the effects of Embargo that switches out eat its berry? I think I've covered the other cases now, but I'm not sure about that one. |
When it comes back in later, yeah. Not during the switch or anything. |
This should cover everything then. |
I think Klutz needs an |
Oh, right. Did. |
The last thing would be to include Berry Juice in all your checks since it's not actually a Berry. |
During the |
I just tested it; using your code, Super Fang to Gastro Acid didn't activate the Berry, but when I change it to onEnd it works. |
I was testing with Super Fang to Simple Beam, which doesn't work with onEnd, but onAfterEnd does. I guess I could be doing both (or find out what's happening exactly), but just onEnd isn't enough. |
Oh, weird. I'll have to look into that later. I assume ignoringAbility() is checked in hasAbility(), which lets Gastro Acid work. |
From what I can tell, the Gastro Acid volatile is applied and then the ability On the other hand, when an ability ends in Moving https:/Zarel/Pokemon-Showdown/blob/master/sim/pokemon.js#L1032 to the line above the edit: apparently this messes with the activation order of things (berries are eaten before klutz properly ends, so probably not ideal either. |
Hmm, I sprinkled exceptions to |
I'm confused. Can you describe the problem precisely? |
Using |
I would add a new item event, I'd also consider this sort of change outside the scope of a single pull request, and split it into two. |
I believe I sorted out the Gastro Acid not properly triggering the |
Oh, that's what I was missing, I never looked at Gastro Acid itself. Nice work, thanks! 👍 |
This reverts commit smogon@6651c5d.
Mentioned in #2367 (comment)
Not sure if this is the best way to implement this, but I can't think of anything else.
@Marty or @DaWoblefet can either of you confirm if Oran Berry/Berry Juice/Stat-boosting berries also does this or if it's only the healing berries. Also is this new in Gen 7, or was this also the case before?