Resource Gsc Mechanics

Approved by Jellicent

Hello and welcome to this resource of GSC mechanics. This will be something for the newer players to have as a lot of people going into GSC (or any gen) have no idea what the mechanics are. I am here to introduce the mechanics that have relevence and effect the GSC Meta in general. I am going to be stealing some descriptions from royal flush 's competitive guide to GSC. I am gonna thank him/her along with Xeze for his GSC mechanics video over on youtube, most of the things in this resource will come from their resources.
Royal flush's guide
Spikes: Introduced in this generation, Spikes originally had only one layer, which means you can't use it more than once and the residual damage will always be 1/8 of the pokemon's health.
  • Toxic: Starts out as venomous poison (1/16 HP initial damage, then adds 1/16 each turn) like the later gens, but it becomes normal poison (1/8 every turn) if the user switches out.
  • 999 Stat Limit: Since RSE, stats wouldn't have a limit. Until GSC though, the maximum number that a stat could have was 999. If a Pokémon reaches 999 before the +6 stage boost, it'll be unable to boost further. For example, a Snorlax has 999 Attack at +5, so he will unable to hit +6 with Curse (Defense will still boost to +6, being lower). Plus, if he gets Growled by a Miltank, he will be at +4, which happens to be 954 Attack.
  • Sleep Talk: Sleep Talk can pick Rest, simply enough. The Pokémon will regain its HP, and the sleep count will reset to the regular two turns of Rest (which means it can save you from the sleep count of Sleep Powder/Hypnosis).
  • Roar/Whirlwind: A very weird fact about pseudo-hazing in GSC is that itneeds to go last to actually work. That said, we have exactly the opposite scenario of later gens: the slower Pokémon will manage to phaze the opponent instead of the faster one. Furthermore, Roar/Whirlwind priority is set to -1, so if a Machamp uses Vital Throw against a Skarmory trying to Whirlwind him for instance, both moves happen to have -1 priority but Machamp is slower, resulting in Whirlwind failing (yes, that "But it failed!" message).
  • Belly Drum: Normally, Belly Drum cuts half of the user's HP and maximizes its Attack (regardless of being -6 to -1); however, if the Pokémon has less than 50% of its HP, it will show a "But it failed!" message. Don't be fooled by mere words, though, because your Attack has secretly risen to +2!
  • Critical hits: Now this is interesting: considering the stat stages ranging from -6 to +6, if the stat stage for the Attack / Special Attack is equal or lower than the foe Defense / Special Defense, both boosts will be ignored on a critical hit, as well as Reflect / Light Screen and burn status Attack drops. If they are higher, nothing will be ignored. A simple example: Machamp landing a critical hit at +0 Attack against a Starmie behind Reflect will deal MORE damage than if he was at +1 Attack. Didn't see that coming, did you?
  • Mean Look: Contrary to popular belief, Substitute does not block Mean Look in GSC (nor Spider Web if you are using Smeargle). Mean Look and Spider Web can be baton passed.
Move Priority (thanks to david stone and darkie)
+4 Pursuit (on switch)
+3 Switching
+2 Detect, Endure ,Protect
+1 Extremespeed, Mach Punch, Quick Attack
0 All moves not listed.
-1 Mirror Coat, Counter, Whirlwind, Roar, Vital Throw

A faster Pokemon always goes first within the speed bracket of the move. In every single case, higher priority moves go before lower priority moves.

The 'exceptions' are Metronome, Mirror Move, and Sleep Talk. These have a priority of 0, and thus if you Sleep Talk Whirlwind, for example, you can go before a slower Pokemon using, say, Tackle.

-1 priority moves have to go last to work, however. If the Pokemon using the move with -1 moves first, the moves fail. This can happen by selecting those moves with another move or if the opponent is using Counter, Mirror Coat, Roar, Vital Throw, or Whirlwind and is slower. All of these moves have to go second to work.

Pursuit comes right before a switch if a switch is used. It doubles in power if they switch out. If they use Baton Pass and you are faster, the Pokemon using Baton Pass takes normal damage. If they use Baton Pass and you are slower, the Pokemon they pass to takes normal damage.

Quick Claw gives your Pokemon a 23.4375% (60 / 256) chance of ignoring Speed and going first within your speed bracket, barring the enemy also activating a Quick Claw, in which case normal Speed rules would apply. Speed and Quick Claw never let a move with a lower priority beat a higher priority (so a Quick Claw activated Aerodactyl using Roar always goes after a paralyzed Shuckle using Tackle).

Ivs Evs and moves and other things.

Ivs range from 1-15
Evs can be maxed out in all stats
Ivs determines the pokemon's gender and if its shiny. It is advised that you don't change the Pokemon to shiny as it is going to make the pokemon worse overall.
Ivs determine a pokemon's hidden power.

Physical moves: Normal, Poison, Ground, Fighting, Bug, Flying, Rock, Ghost.

Special Moves: Fire, Water, Grass, Electric, Ice, Psychic, Dark, Dragon.
Hidden Powers are physical depending on their respective types.

Relevant Events and Illegal Movesets
Legal Events
Growth eveelutions
Lovely Kiss Snorlax
Lovely Kiss Nidoking and Nidoqueen.

Illegal Movesets
Cloyster Rapid Spin + Explosion
Tentacruel Swords Dance + Rapid Spin
Nidoking Morning Sun + Lovely Kiss
All Eevee evolutions: Charm + Growth
Alakazam: Encore + Substitute / Thunder Wave
Chansey: Heal Bell + Counter / Reflect / Seismic Toss / Thunder Wave
Clefable: Belly Drum + Body Slam / Double-Edge / Reflect / Substitute
Exeggutor: Explosion + Synthesis / Moonlight
Gengar: Perish Song + Substitute
Muk: Mean Look + Explosion

Residual damage and Sleep
Residual Damage is dealt immediately after moving. Residual damage however is not dealt if the affected pokemon KO's the opposing pokemon. These rules apply to everything bar sandstorm, which deals damage at the end of the turn regardless. The turn ends if the pokemon who moved died, this can be through explosion or poison for example.
Sleep lasts anywhere from 1-6 turns. If you use rest it's two turns.
You can'take encore sleep talk.
Counter and Mirror Coat
Counter works against all types of hidden powers because it treats them as physical. Don'the use mirror coat if you predict a hidden power. They also do not work against moves that are picked by sleep talk.

Glitches
If marrowak has a thick club and its attack goes over 999 he will very little damage, you always wanna set your marowak to 13 attack ivs. His attack becomes 8 to be exact.

BD glitch: read above.

Reflect and light screen like the Marowak glitch reflect and light screen can affect the pokemon behind its defenses. A common example of this is when Skarmory or Steelix curse up behind it.
Snorlax Double-Edge vs. +1 Skarmory: 36-43 (10.8 - 12.9%)
Snorlax Double-Edge vs. +1 Skarmory through Reflect: 188-222 (56.4 - 66.6%)

Misc. Info
Frozen Pokemon can't move on the turn they thaw out.
Abilities and Natures don't exist.
Explosion and Selfdestruct halve the opponent's defense.
Absorbing moves like Giga Drain, Mega Drain, Leech Seed, Absorb, and Leech Life fail against Substitute.
You can't use protect behind a Substitute.

If I missed anything tell me below.
 
Last edited:
Taunt always lasts for just 2 turns.

Taunt did not exist pre-ADV

+2 15 DV Thick Club Marowak rolls over to 8 Atk if you want to be precise

Probably clarify that Growtheons/LK Lax/LK Nidos are legal via events whereas Cloyster Spin + Boom is illegal, they're under the same header
 
Taunt did not exist pre-ADV

+2 15 DV Thick Club Marowak rolls over to 8 Atk if you want to be precise

Probably clarify that Growtheons/LK Lax/LK Nidos are legal via events whereas Cloyster Spin + Boom is illegal, they're under the same header
Jellicent gave me the taunt thing :/ but anyways fixed.
 
could use some work, for example

'A faster Pokemon always goes first within the speed bracket of the move. In every single case, higher priority moves go before lower priority moves.

The 'exceptions' are Metronome, Mirror Move, and Sleep Talk. These have a priority of 0, and thus if you Sleep Talk Whirlwind, for example, you can go before a slower Pokemon using, say, Tackle.'

this stuff is also true in ORAS, and probably in all generations
'
  • Roar/Whirlwind: A very weird fact about pseudo-hazing in GSC is that itneeds to go last to actually work. That said, we have exactly the opposite scenario of later gens: the slower Pokémon will manage to phaze the opponent instead of the faster one. Furthermore, Roar/Whirlwind priority is set to -1, so if a Machamp uses Vital Throw against a Skarmory trying to Whirlwind him for instance, both moves happen to have -1 priority but Machamp is slower, resulting in Whirlwind failing (yes, that "But it failed!" message).'
the start is kind of confusing, i'd put in the start that they have -1 priority

'A simple example: Machamp landing a critical hit at +0 Attack against a Starmie behind Reflect will deal MORE damage than if he was at +1 Attack. Didn't see that coming, did you?'

no, i didn't, but that's probably because this example doesn't make any sense... if boosts are ignored then it's the same as a +0 crit, right?

'Roar and Whirlwind have to go last to work, however. If the Pokemon using Roar / Whirlwind moves first, the moves fail. This can happen by selecting those moves with another move or if the opponent is using Counter, Mirror Coat, Roar, Vital Throw, or Whirlwind and is slower. All of these moves have to go second to work.'

all of them or roar / whirlwind? you tack on 'all of these moves' at the end, so if it's all of them just say it at the start

'Pursuit comes right before a switch if a switch is used. It doubles in power if they switch out. If they use Baton Pass and you are faster, the Pokemon using Baton Pass takes normal damage. If they use Baton Pass and you are slower, the Pokemon they pass to takes normal damage.'

all of that is bog standard, except for Baton Pass meaning you take normal damage even if faster, that part is very interesting actually, and definitely worth mentioning

Quick Claw gives your Pokemon a 23.4375% (60 / 256) chance of ignoring Speed and going first within your speed bracket, barring the enemy also activating a Quick Claw, in which case normal Speed rules would apply. Speed and Quick Claw never let a move with a lower priority beat a higher priority (so a Quick Claw activated Aerodactyl using Roar always goes after a paralyzed Shuckle using Tackle).

quick claw always stayed in its priority bracket so far as i'm aware. certainly it does so in ORAS and XY


"Relevant Events and Illegal Movesets
Growth eveelutions
Lovely Kiss Snorlax
Lovely Kiss Nidoking and Nidoqueen.
Cloyster Rapid Spin + Explosion"

are these illegal or events?

'Absorbing moves like Giga Drain, Mega Drain, Leech Seed, Absorb, and Leech Life fail against Substitute.'

leech seed always failed, the rest is cool
 
You might wanna mention Reflect/Light Screen particular mechanics: they work just like a Thick Club/Light Ball boost, doubling your defenses instead of halving your damage like later gens. This also means that your defenses can rollover just like Marowak. Common scenarios would be Skarm and Steelix cursing up with Reflect on field.

Snorlax Double-Edge vs. +1 Skarmory: 36-43 (10.8 - 12.9%)
Snorlax Double-Edge vs. +1 Skarmory through Reflect: 188-222 (56.4 - 66.6%) - rollover



'A simple example: Machamp landing a critical hit at +0 Attack against a Starmie behind Reflect will deal MORE damage than if he was at +1 Attack. Didn't see that coming, did you?'

no, i didn't, but that's probably because this example doesn't make any sense... if boosts are ignored then it's the same as a +0 crit, right?
Read carefully. Equal stat stages means Reflect will be ignored, so Starmie will take more damage: at the +1 atk against +0 def situation, Reflect won't be ignored.

Machamp Cross Chop vs. Starmie on a critical hit: 142-168 (43.9 - 52%)
+1 Machamp Cross Chop vs. Starmie through Reflect on a critical hit: 108-127 (33.4 - 39.3%)
 
You might wanna mention Reflect/Light Screen particular mechanics: they work just like a Thick Club/Light Ball boost, doubling your defenses instead of halving your damage like later gens. This also means that your defenses can rollover just like Marowak. Common scenarios would be Skarm and Steelix cursing up with Reflect on field.

Snorlax Double-Edge vs. +1 Skarmory: 36-43 (10.8 - 12.9%)
Snorlax Double-Edge vs. +1 Skarmory through Reflect: 188-222 (56.4 - 66.6%) - rollover




Read carefully. Equal stat stages means Reflect will be ignored, so Starmie will take more damage: at the +1 atk against +0 def situation, Reflect won't be ignored.

Machamp Cross Chop vs. Starmie on a critical hit: 142-168 (43.9 - 52%)
+1 Machamp Cross Chop vs. Starmie through Reflect on a critical hit: 108-127 (33.4 - 39.3%)

ah, so reflect is ignored but isn't factored as a stat boost

fair enough, that's just kind of confusing to read however
 
could use some work, for example

'A faster Pokemon always goes first within the speed bracket of the move. In every single case, higher priority moves go before lower priority moves.

The 'exceptions' are Metronome, Mirror Move, and Sleep Talk. These have a priority of 0, and thus if you Sleep Talk Whirlwind, for example, you can go before a slower Pokemon using, say, Tackle.'

this stuff is also true in ORAS, and probably in all generations
'
  • Roar/Whirlwind: A very weird fact about pseudo-hazing in GSC is that itneeds to go last to actually work. That said, we have exactly the opposite scenario of later gens: the slower Pokémon will manage to phaze the opponent instead of the faster one. Furthermore, Roar/Whirlwind priority is set to -1, so if a Machamp uses Vital Throw against a Skarmory trying to Whirlwind him for instance, both moves happen to have -1 priority but Machamp is slower, resulting in Whirlwind failing (yes, that "But it failed!" message).'
the start is kind of confusing, i'd put in the start that they have -1 priority

'A simple example: Machamp landing a critical hit at +0 Attack against a Starmie behind Reflect will deal MORE damage than if he was at +1 Attack. Didn't see that coming, did you?'

no, i didn't, but that's probably because this example doesn't make any sense... if boosts are ignored then it's the same as a +0 crit, right?

'Roar and Whirlwind have to go last to work, however. If the Pokemon using Roar / Whirlwind moves first, the moves fail. This can happen by selecting those moves with another move or if the opponent is using Counter, Mirror Coat, Roar, Vital Throw, or Whirlwind and is slower. All of these moves have to go second to work.'

all of them or roar / whirlwind? you tack on 'all of these moves' at the end, so if it's all of them just say it at the start

'Pursuit comes right before a switch if a switch is used. It doubles in power if they switch out. If they use Baton Pass and you are faster, the Pokemon using Baton Pass takes normal damage. If they use Baton Pass and you are slower, the Pokemon they pass to takes normal damage.'

all of that is bog standard, except for Baton Pass meaning you take normal damage even if faster, that part is very interesting actually, and definitely worth mentioning

Quick Claw gives your Pokemon a 23.4375% (60 / 256) chance of ignoring Speed and going first within your speed bracket, barring the enemy also activating a Quick Claw, in which case normal Speed rules would apply. Speed and Quick Claw never let a move with a lower priority beat a higher priority (so a Quick Claw activated Aerodactyl using Roar always goes after a paralyzed Shuckle using Tackle).

quick claw always stayed in its priority bracket so far as i'm aware. certainly it does so in ORAS and XY


"Relevant Events and Illegal Movesets
Growth eveelutions
Lovely Kiss Snorlax
Lovely Kiss Nidoking and Nidoqueen.
Cloyster Rapid Spin + Explosion"

are these illegal or events?

'Absorbing moves like Giga Drain, Mega Drain, Leech Seed, Absorb, and Leech Life fail against Substitute.'

leech seed always failed, the rest is cool

I am gonna leave the move priority things and leech seed was put there as an example for absorbing moves. Already fixed the legal events and illegal move sets thing how long were you writing this post? -1 priority moves section fixed

You might wanna mention Reflect/Light Screen particular mechanics: they work just like a Thick Club/Light Ball boost, doubling your defenses instead of halving your damage like later gens. This also means that your defenses can rollover just like Marowak. Common scenarios would be Skarm and Steelix cursing up with Reflect on field.

Snorlax Double-Edge vs. +1 Skarmory: 36-43 (10.8 - 12.9%)
Snorlax Double-Edge vs. +1 Skarmory through Reflect: 188-222 (56.4 - 66.6%) - rollover




Read carefully. Equal stat stages means Reflect will be ignored, so Starmie will take more damage: at the +1 atk against +0 def situation, Reflect won't be ignored.

Machamp Cross Chop vs. Starmie on a critical hit: 142-168 (43.9 - 52%)
+1 Machamp Cross Chop vs. Starmie through Reflect on a critical hit: 108-127 (33.4 - 39.3%)
Mentioned in the glitches now
 
Huh. Didn't know that about Reflect tbh. It's an issue in RBY for sure, but I didn't know that it wasn't fixed for GSC.

IIRC the BD glitch is exclusive to Crystal version. Something different happens in G/S (I think it just lets you die?) and Stadium 2 implements the failure correctly.

For those who care (probably nobody as Crystal version is the standard on which we all agree play), the Present glitch in G/S involves a strange damage formula calculation that adjusts the Level variable according to the type of the defending Pokemon. Laughably low levels are imputed for Dark-type Pokemon (iirc something like 23), so a funny gimmick involves Present Blissey doing like 70%+ to Umbreon with Present. Somebody else with more brain can specify things if needed.

Critical Hit pseudocode, idk maybe another explanation of the phenomenon might help people get it since it is kinda tricky to wrap your head around sometimes.

Code:
if CRIT
   if defender.defense_stage >= attacker.attack_stage
      # define temporarily only for damage calculation phase
      # Ignore EVERYTHING if attacker is on equal or worse standing w.r.t. defender's stat stage
      defender.defense_stage = 0
      attacker.attack_stage  = 0
      defender.reflect       = 0
      attacker.status        = 0
   else
      # Ignore NOTHING if attacker is on better standing w.r.t. defender's stat change
      # otherwise, we ignore boosts and might actually make crits do less damage than regular hits, like in RBY!
      # (this is totally foolproof and doesn't result in anything seemingly paradoxical, no sir, we are geniuses here at GF)
   end
end
 
Huh. Didn't know that about Reflect tbh. It's an issue in RBY for sure, but I didn't know that it wasn't fixed for GSC.

IIRC the BD glitch is exclusive to Crystal version. Something different happens in G/S (I think it just lets you die?) and Stadium 2 implements the failure correctly.

Yes Stadium 2 corrected the Belly Drum glitch. In G/S the glitch is the same, the only thing different, IIRC, is in-game when you use Belly Drum with 50% HP left you die. In Link battles, however, it's the same for G/S and Crystal.
 
For those who care (probably nobody as Crystal version is the standard on which we all agree play), the Present glitch in G/S involves a strange damage formula calculation that adjusts the Level variable according to the type of the defending Pokemon. Laughably low levels are imputed for Dark-type Pokemon (iirc something like 23), so a funny gimmick involves Present Blissey doing like 70%+ to Umbreon with Present. Somebody else with more brain can specify things if needed.
Actually we should stick to G/S mechs because these are the one that apply to link battles. No matter what Crystal fixed it will always have to revert to G/S mechanics in link battles to be consistent with G/S.
 
Actually we should stick to G/S mechs because these are the one that apply to link battles. No matter what Crystal fixed it will always have to revert to G/S mechanics in link battles to be consistent with G/S.
That's not the case for Crystal vs Crystal link battles, though, right? We always emulate as if both players are using the final main series game of the generation. Otherwise, we'd have stuff like Rotom-A appearing to be its base form in DPP (In a Platinum vs Diamond game, for instance, Rotom-A keeps its stats, but since the Diamond player can't see the appliances, it just appears as regular Rotom. This would make knowing which appliance you were facing [or if you were facing one at all] impossible.)
 
That's not the case for Crystal vs Crystal link battles, though, right? We always emulate as if both players are using the final main series game of the generation. Otherwise, we'd have stuff like Rotom-A appearing to be its base form in DPP (In a Platinum vs Diamond game, for instance, Rotom-A keeps its stats, but since the Diamond player can't see the appliances, it just appears as regular Rotom. This would make knowing which appliance you were facing [or if you were facing one at all] impossible.)
I don't know about new gens, but in gens 1 and 2 red/blue and gold/silver are always the games to look at if you are testing outside link battles. Crystal will always revert to gs mechs in link battles, including the present glitch and the stat scaling glitch. Doesn't matter what's the game on the other side, crystal will check for link battle status, and if true, apply mechs carried over from gs.
 
When I found that glitched Screens+boosted defense mechanic I made note of a few things:

+1 Steelix rolls over to a scaled value only slightly less than its unboosted defense stat. The same happens for Cloyster and a few others, although the margin is a tad larger.

Forretress, Skarmory, Steelix, Cloyster, Golem, Lugia, Omastar, Shuckle, and Onix all overflow their Defense after +1 and Reflect. Rhydon just barely misses out on rollover (un)fortunately. All other Pokemon don't need to worry about rolling over after a single curse. Snorlax, for example, needs a total of 3 Curses under Reflect to cause overflow.

Your attack stat rolls over for confusion damage too! When I tested with a Forretress that I hacked into the Pokemon Gold game that I was emulating, a Chinchou caused 4% confusion damage under Reflect before I had a Curse up, and on the next turn caused 96% damage with Curse+Reflect.

If passed +4, Light Ball Pikachu's SAtk should also overflow in the same way that Marowak's Atk does.


Also, on an unrelated note, Crystal_'s testing has shown that Belly Drum can increase to +6 or +5 even though both may max out the attack stat for a certain Pokemon (I'd link but I can't find the post). Belly Drum Snorlax, for example, will increase to +6 with no boosts or an even amount of stat changes. Snorlax will achieve +5 when it starts with an odd number of attack boosts. This doesn't really affect a whole lot, but it can make a difference if the opponent has a Charmer or Growler like Umbreon or Miltank. It has to do with how Belly Drum is essentially a bunch of Swords Dance commands chained together with checks occurring after each +2 boost.
 
Last edited:
I don't know about new gens, but in gens 1 and 2 red/blue and gold/silver are always the games to look at if you are testing outside link battles. Crystal will always revert to gs mechs in link battles, including the present glitch and the stat scaling glitch. Doesn't matter what's the game on the other side, crystal will check for link battle status, and if true, apply mechs carried over from gs.
If that is the case for Crystal vs Crystal, that's quite interesting :o

Are there any other noteworthy mechanical differences then?
 
Also, on an unrelated note, Crystal_'s testing has shown that Belly Drum can increase to +6 or +5 even though both may max out the attack stat for a certain Pokemon (I'd link but I can't find the post). Belly Drum Snorlax, for example, will increase to +6 with no boosts or an even amount of stat changes. Snorlax will achieve +5 when it starts with an odd number of attack boosts. This doesn't really affect a whole lot, but it can make a difference if the opponent has a Charmer or Growler like Umbreon or Miltank. It has to do with how Belly Drum is essentially a bunch of Swords Dance commands chained together with checks occurring after each +2 boost.

It's here: http://www.smogon.com/forums/thread...ralysis-burn-stat-drops.3525356/#post-5946458

Are there any other noteworthy mechanical differences then?

The roll over glitch seems to apply to Ditto with metal powder too. I don't know of anything else (at least relevant to battling).
 
I was thinking about this recently and I don't think it can happen with Ditto. If my understanding is correct, generalized stat scaling occurs first, so Ditto's defenses will be between 1 and 255.

For those who don't know, Metal Powder causes a similar stat scaling, but divides by 2 instead of by 4.

Assume Ditto has a very specific stat spread and that it has a sufficient number of defense boosts to give it 255 after the first stat scaling.
255 * 3 / 2 = 382
(382 / 2) & 0xFF = 191
Unless for some reason the first stat scaling is skipped or in a different order, I don't think overflow can happen due to Metal Powder.

edit: Also, does anyone know specifically how Psywave works for GSC (I'm assuming it's the same for RBY)? I've got some weird looking code in my calc and I'm trying to figure out if I was being stupid or if I read something odd on UPC. For a level 100 Pokemon, is the damage range every integer 1-150 or every integer 1-149? Right now for some dumb reason I have the formula written as all integers from 1 to level*3/2-1, which I'm pretty sure is wrong.

edit2:
dug this up if it means anything
Crystal_ said:
Also, Ditto + Metal powder is actually called after stat scaling. It boosts the defense /sp def stat (depending on if move is phys or spc) by 3/2, and if it overflows (>255) its divided by 2 again, while the attacker's attacking stat is also divided by 2 (if would become 0-> 1)
 
Last edited:
Yeah, you are right about Metal Powder. Forgot how it worked.

For a level 100 Pokemon, is the damage range every integer 1-150 or every integer 1-149?

it's 1-149

Code:
    ld a, b
    srl a
    add b
    ld b, a
.asm_3575d
    call BattleRandom
    and a
    jr z, .asm_3575d ; 35761 $fa
    cp b
    jr nc, .asm_3575d ; 35764 $f7
    ld b, a
    ld a, $0
    jr .asm_3578c ; 35769 $21

150 compared to 150 resets the carry flag so it goes back to get another random number
 
Regarding Thick Club and Reflect/LS: Part of the reason the 999 cap exists is because the technical limit of the older games can't handle anything over 1023 (2^10 - 1). Thick Club and the screens boost their respective stats AFTER the cap is applied, thus can end up breaking it and anything going over 1023 rolls back over to zero.

Marowak at max Attack (258) Swords Dances up to 516, doubling to 1032 which gets rolled over to 8 (1032 - 1024). At a 13 IV, it maxes at 254 and and reaches 1016 after boosting. HP Bug helpfully requires running a 13 Attack IV anyway, or Flying 12 if you hate Heracross.

Since IVs range from 0-15 instead of 0-31, a pokémon's max stats are 1 lower than they are in later generations (e.g. Mew is 403 HP and all-298 instead of 404 HP and all-299.)

Man Jorgen, I forgot about the Present glitch. IIRC in general all Special types got rocked by it, while physical types took a pittance so you could do something like 60% to even Suicune and shit.
 
The technical limit is 1 byte or 255 (2^8-1).

To fit it into 1 byte the game divides both stats by four if either exceeds 255, this maintains a relatively similar ratio between the stats so as to not significantly change the damage. The end value is then truncated to its least significant byte, or the rightmost 8 bits, which has the same effect as (stat/4)&255 or stat/4 mod 256 for non-negative integers.
Assume & to be bitwise-and, mod to be modulo or "remainder", and division to immediately floor.

The problem it that the developers probably thought they'd only be working with stat values of 999 at that point, not realizing that Screens, Thick Club, and Light Ball could all circumvent the cap. The roll over effect comes into play when the scaled down stats still cannot fit into 1 byte. 999/4=249 is less than 255, so they probably thought they were safe.
Marowak's final attack stat is 2, but that's a 2 scaled down by 1/4th since the defense stat was also scaled. So approximately you get an attack stat of 8, but 2 is what's actually used. So in a way the only "real" stats represented by this scaled down version are those which are multiples of 4.

i.e. 1->4, 2->8, 3->12

Note that in-game there is no backwards conversion. Stats are scaled, and then truncation to the least significant byte creates the rollover effect. Afterwards they are used directly in the damage formula.
 
Soooooo is that why it often requires adding 3-4 stat points before a damage calculation actually changes?
 
RBY and GSC make it more prominent with stat scaling, but later generations also have this due to integer division or "round-off", which can produce the same results despite only changing the divisor 5/2=2 and 4/2=2. As far as I know stat scaling is only found in RBY and GSC so that the final result fits in a 16-bit integer. Note that in Crystal, except link battles, it'll continuously divide stats by 4 until they are both <=255 (i.e. fit in one byte).

In later generations, I'll use Adv for simplicity, the phenomena still occurs due to round-off in other places:
Tyranitar Rock Slide 0 atk v. Snorlax 0 def:
42*304*75/166/50 = 115
(115+2)*3/2 = 175
Tyranitar Rock Slide 4 atk v. Snorlax 0 def:
42*305*75/166/50 = 115
(115+2)*3/2 = 175
Tyranitar Rock Slide 8 atk v. Snorlax 0 def:
42*306*75/166/50 = 116
(116+2)*3/2 = 177
 
Back
Top