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 GSC Toxic interaction with Baton Pass/Heal Bell #5226

Merged
merged 10 commits into from
Mar 5, 2019

Conversation

scheibo
Copy link
Contributor

@scheibo scheibo commented Mar 1, 2019

Fixes #3357

data/mods/gen2/statuses.js Outdated Show resolved Hide resolved
@scheibo scheibo changed the title Fix GSC Toxic interfaction with Baton Pass/Heal Bell Fix GSC Toxic interaction with Baton Pass/Heal Bell Mar 1, 2019
@Zarel
Copy link
Member

Zarel commented Mar 2, 2019

Does the residual damage counter reset on switch-out? I don't remember the report touching on that.

@scheibo scheibo mentioned this pull request Mar 4, 2019
23 tasks
@scheibo
Copy link
Contributor Author

scheibo commented Mar 4, 2019

I'd like a hint in Gen 1, too. PS generally needs more hints.

On it.

If a previously burned/poisoned Pokemon is switched in with Baton Pass from a Pokemon with a Toxic counter, it immediately takes 1/16 * X damage (even though regular poison and burn is 1/8 max HP in Gen 2). If they get passed a Toxic counter and get burned or poisoned later, it's also 1/16 * X, where X is whatever the previous counter was + 1 no matter how many turns have passed.

Gotcha. So the toxic counter kind of 'ruins' the original status's damage and forces it to behave like toxic would.

Unless I'm misunderstanding, onAfterSwitchSelf isn't relevant in Gen 1 because Baton Pass doesn't exist.

I've taken the liberty of deleting it from the Gen 1 code then given we don't think its going to actually occur (no point in retaining dead code).

Does the residual damage counter reset on switch-out? I don't remember the report touching on that.

Oh, you're right, that wasn't covered. I'm going to take a guess and assume it goes away completely through a normal switch, just like how Toxic reverts to regular poison (I've modified the code to behave that way). @Marty-D, is that correct?

data/mods/gen2/statuses.js Outdated Show resolved Hide resolved
@Marty-D
Copy link
Collaborator

Marty-D commented Mar 4, 2019

Unless I'm misunderstanding, onAfterSwitchSelf isn't relevant in Gen 1 because Baton Pass doesn't exist.

I've taken the liberty of deleting it from the Gen 1 code then given we don't think its going to actually occur (no point in retaining dead code).

Oh, really sorry for the confusion but I was answering your question about whether or not the Toxic counter increases there, not switches in general. onAfterSwitchInSelf is definitely needed in Gen 1 for those statuses.

Does the residual damage counter reset on switch-out? I don't remember the report touching on that.

Oh, you're right, that wasn't covered. I'm going to take a guess and assume it goes away completely through a normal switch, just like how Toxic reverts to regular poison (I've modified the code to behave that way). @Marty-D, is that correct?

Yep, normal switching removes the counter.

@scheibo
Copy link
Contributor Author

scheibo commented Mar 4, 2019

onAfterSwitchInSelf is definitely needed in Gen 1 for those statuses.

Reverted back.

sim/battle.ts Outdated Show resolved Hide resolved
Copy link
Member

@Zarel Zarel left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@Zarel
Copy link
Member

Zarel commented Mar 5, 2019

@Marty-D?

@Marty-D
Copy link
Collaborator

Marty-D commented Mar 5, 2019

The counter should be paused while the Pokemon doesn't have a damaging status condition. If something is badly poisoned, takes 3 turns of Toxic damage, then uses Baton Pass into something that isn't statused, then 5 more turns pass, then this new Pokemon gets burned, its next residual damage will be 1/16 * 4. Likewise, in the same situation except the Baton Pass is into a Pokemon that is already burned or poisoned, it immediately takes the 1/16 * 4.

@scheibo
Copy link
Contributor Author

scheibo commented Mar 5, 2019

The counter should be paused while the Pokemon doesn't have a damaging status condition.
Done

@Marty-D Marty-D merged commit 6f82443 into smogon:master Mar 5, 2019
sim/battle.ts Outdated
@@ -2987,6 +2989,24 @@ export class Battle extends Dex.ModdedDex {
return false;
}

hint(hint: string, once?: boolean, sideid?: 'p1'|'p2') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of interest, why are you using a sideid here? I would have thought a Side would make more sense (and also simplify the code slightly, see Pokemon.getHeathInner).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, it would be simpler. I'll update it in a future commit.

@scheibo scheibo deleted the gsc-toxic branch March 10, 2019 17:46
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.

4 participants