pagefaultgames / pokerogue

A browser based Pokémon fangame heavily inspired by the roguelite genre.
https://pokerogue.net
GNU Affero General Public License v3.0
3.93k stars 1.57k forks source link

[BUG] Lum berry (sometimes?) triggers after status damage on switch-in #2469

Open Terrorforge opened 2 weeks ago

Terrorforge commented 2 weeks ago

Okay I wrote out a whole bug report, but I realized it's not quite right. What happened is that I switched in a pokemon with Focus Bands (Mega Riotte in the provided save file) into an attack in lategame Endless, it held on at 1hp, and then died to the poison inflicted by the poison token before its Lum berry triggered, which is inconsistent with how Lum berries usually interact with that sort of thing.

I've had similar experiences with Sturdy pokemon, and I saw someone complain about the same thing on Reddit the other day so I'm pretty sure something is fucky, but after writing this whole damn thing I switched my Metal Burst carry into an attack, it got poisoned, and this time it didn't die. So whatever's going on isn't consistent, but I don't know how to investigate it further and it's 1am and I need to sleep. I'm just gonna leave you with the whole bug report as I originally wrote it in case it helps identify the real problem:

Describe the bug

In Endless, if you switch a pokemon into an attack and it gets burned or poisoned by the status tokens, it will take damage from the status effect before its Lum berry triggers. This means that if you switch a full-health Sturdy pokemon into an attack and it gets burned or poisoned, it will get knocked down to 1 hp thanks to Sturdy, but die to the status. This does not happen if the pokemon was in from the beginning of the turn; in this case, the pokemon is brought down to 1 hp, but the status is cured by the Lum berry before it takes damage.

I have not confirmed if this is the case if you get statused normally, e.g. if you eat a Toxic on switch-in in Classic

To Reproduce

  1. Play lategame Endless where the status tokens are maxed out and every hit one-shots your pokemon
  2. Switch a Sturdy pokemon with a Lum berry into an attack, repeating/reloading until it gets burned or poisoned
  3. Note that the pokemon dies
  4. Reload and just leave the same pokemon in, noting that it does not die when it gets knocked down to 1hp and burned/poisoned

Expected behavior

The order of operations for end-of-turn triggers remains the same regardless of whether a pokemon just switched in or not.

Device

Chrome on PC.

Additional context

sessionData3_Terrorforge_LumProblem.zip This is a save very late in Endless, wave 5400. Tyrazone and Primal Kyoludon have Sturdy, so you can try switching them into an attack and see that they die if they get burned or poisoned. Mega Riotte and Linoorgeist have Focus Bands, so they behave similarly the ~50% of times they survive the hit. If you then restart and set up Leech Seed with Wormaloom, the Sturdy mons will generally heal to full after each attack so you can leave them in and confirm that they don't die to burn or poison if they're already in when they get hit. Kyoludon has shell bells though, so just click Protect to not taint the result.

Terrorforge commented 2 weeks ago

Well, I once again switched a Sturdy pokemon into an attack, it got burned, and the burn killed it. The same pokemon (Kyogre/Archaludon) that earlier survived a poisoning under the same circumstances. Is it just burn or something?