Pokérus: Difference between revisions

2,822 bytes removed ,  22 March 2014
→‎Technical information: Badly wordy. I don't understand whether the "illegitimate" strain is supposed to be impossible to get, so I decline to discuss it at all. Tell me if I screwed something up
(→‎Technical information: Badly wordy. I don't understand whether the "illegitimate" strain is supposed to be impossible to get, so I decline to discuss it at all. Tell me if I screwed something up)
Line 31: Line 31:


====Technical information====
====Technical information====
In [[Generation II]], Pokérus is stored in a Pokémon's [[Pokémon data structure in Generation II|data structure]] as a single byte at offset 0x1C. Within the byte, the upper 4 bits (upper nibble) and lower 4 bits (lower nibble) are represented in hexadecimal format as '''XY''', where '''X''' represents the specific strand of Pokérus the Pokémon has contracted, and '''Y''' represents the number of days remaining before the infected Pokémon is cured of the virus.<br>
In [[Generation II]], Pokérus is stored in a Pokémon's [[Pokémon data structure in Generation II|data structure]] as a single byte at offset 0x1C. When represented in hexadecimal format as '''XY''', the upper 4 bits of the byte, '''X''', represent the specific strain of Pokérus the Pokémon has contracted and the lower 4 bits, '''Y''', represent the number of days remaining before the infected Pokémon is cured of the virus.


This means that there exist 256 possible states of Pokérus: 1 unaffected state, 240 infected states (39 legitimate and 201 hacked), 15 cured states:
A Pokémon is or has been infected if '''X''' (the strain) is a non-zero value. If '''Y''' (days remaining) is non-zero when '''X''' is also non-zero, this means the Pokémon is currently infected. If '''Y''' is 0 and '''X''' is non-zero, then the Pokémon is "cured" of Pokérus. If both '''X''' and '''Y''' are 0, then the Pokémon has never been affected by Pokérus.
* An unaffected state is always represented as 0 (hex 00).
* An infected state is represented by any number between 1 and 255 that has a remainder when divided by 16. In other words, when the lower nibble '''Y''' is nonzero, the Pokémon is infected.
** For example, 33 (hex 21) represents an infected state, since 33 divided by 16 would produce 1 as a remainder.
* A cured state is represented by any number between 1 and 255 that does not have a remainder when divided by 16. In other words, when the lower nibble '''Y''' is zero, the Pokémon is cured.
** Possible 'cured' values can be 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224 or 240 (hex values 10, 20, 30, 40, 50, 60, 70, 80, 90, A0, B0, C0, D0, E0 or F0 respectively).


=====Remaining days=====
Whenever the game's internal clock strikes midnight, every currently infected Pokémon in the player's party has their Pokérus value decreased by one. Once the '''Y''' value reaches 0, the Pokémon will be cured of Pokérus.
Whenever the game's internal clock strikes midnight, every Pokémon in the player's party has their Pokérus value decreased by one point. Once the '''Y''' value reaches 0, the Pokémon will be cured of Pokérus.<br>
For example, if a given Pokémon's Pokérus value was 65 (hex 41), it would decrease down to 64 (hex 40) and therefore be cured. However, if the value was 82 (hex 52), it would instead decrease down to 81 (hex 51). This means that if consistently left in the player's party, it is possible for a Pokémon to remain infected with Pokérus for a potential maximum of 15 days.


=====Specific strain=====
=====Strains=====
Whenever the game assigns a Pokérus value to any given Pokémon, '''Y''' values between 1 through 4 are used, depending upon the '''X''' value generated. (However, any '''Y''' value can be attained through hacking, meaning that if left in the player's party, a Pokémon can only remain infected with Pokérus for a legitimate maximum time span of 4 days.)
Whenever the game creates Pokérus on a Pokémon, the value assigned to '''Y''' (days) depends on the value assigned to '''X''' (strain). Specifically, the number of days will be set to '''X''' modulo 4 + 1. In other words, the higher two bits of '''X''' are irrelevant to the "strain".
 
The value of '''X''' represents the specific Pokérus strain that the Pokémon has been infected with:
{| class="roundy" style="text-align:center; border: 3px solid #A54ACE; background: #D67BFF"
{| class="roundy" style="text-align:center; border: 3px solid #A54ACE; background: #D67BFF"
! style="background: #EFA5EF; {{roundytl|5px}}" | Strand #<br>(X value)
! style="background: #EFA5EF; {{roundytl|5px}}" | Strain
! style="background: #EFA5EF" | Duration<br>(Y value)
! style="background: #EFA5EF" | X values
! style="background: #EFA5EF; {{roundytr|5px}}" | Pokérus value
! style="background: #EFA5EF; {{roundytr|5px}}" | Duration<br>(Y value)
|- style="background: #fff"
| 00 || 1 day || 001 (hex 01)
|- style="background: #fff"
| 01 || 2 days || 018 (hex 12)
|- style="background: #fff"
| 02 || 3 days || 035 (hex 23)
|- style="background: #fff"
| 03 || 4 days || 052 (hex 34)
|- style="background: #fff"
| 04 || 1 day || 065 (hex 41)
|- style="background: #fff"
| 05 || 2 days || 082 (hex 52)
|- style="background: #fff"
| 06 || 3 days || 099 (hex 63)
|- style="background: #fff"
| 07 || 4 days || 116 (hex 74)
|- style="background: #fff"
| 08 || 1 day || 129 (hex 81)
|- style="background: #fff"
|- style="background: #fff"
| 09 || 2 days || 146 (hex 92)
| A || 0, 4, 8, 12 || 1 day
|- style="background: #fff"
|- style="background: #fff"
| 10 (hex A) || 3 days || 163 (hex A3)
| B || 1, 5, 9, 13 || 2 days
|- style="background: #fff"
|- style="background: #fff"
| 11 (hex B) || 4 days || 180 (hex B4)
| C || 2, 6, 10, 14 || 3 days
|- style="background: #fff"
|- style="background: #fff"
| 12 (hex C) || 1 day || 193 (hex C1)
| D || 3, 7, 11, 15 || 4 days
|- style="background: #fff"
| 13 (hex D) || 2 days || 210 (hex D2)
|- style="background: #fff"
| 14 (hex E) || 3 days || 227 (hex E3)
|-
| style="background: #fff; {{roundybl|5px}}" | 15 (hex F)
| style="background: #fff" | 4 days
| style="background: #fff; {{roundybr|5px}}" | 244 (hex F4)
|}
|}


For example, if a Pokémon has a Pokérus value of 50 (hex 32), meaning it has strain 3 and will be cured in 2 more days. If it were to infect another Pokémon, the new Pokémon would obtain the Pokérus value of 52 (hex 34), meaning it would instead be cured in 4 more days. The strain remains constant when copied over. The remaining number of days prior to being cured however, depends on the strain itself.
Whenever Pokérus spreads from an infected Pokémon to a new Pokémon, the new Pokémon inherits the infected Pokémon's strain of Pokérus ('''X''') and '''Y''' is set to the default value for that strain. As an example, if a Pokémon has Pokérus with an '''X''' value of 7 and a '''Y''' value of 2 (2 days remaining before it will be cured) and it infects another Pokémon, the new Pokémon will get Pokérus with an '''X''' value of 7 and a '''Y''' value of 4 (4 days before it will be cured).
 
Currently, there is no known way to determine how specific strains are generated by the game (other than the fact that there is a 3 in 65,536 chance of a wild Pokémon carrying Pokérus). However one of these 16 strains is illegitimate: Strain 0. This is because when Pokérus values between 1 through 15 (hexadecimals 01 through 0F) eventually decrease down to 0 (hexadecimal 00), a Pokémon would not only be cured of Pokérus, but would also lose any sign of having been infected in the first place—meaning that they could become reinfected at a later point in time.
 
As a result, out of the 240 possible states of Pokérus infection, only 39 of them are considered legitimate. This can be calculated by adding up all of the 15 legitimate strains and multiplying each of them by the possible number of remaining infected days (2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 = 39).


====Erasing Pokérus from a Pokémon====
====Erasing Pokérus from a Pokémon====