Pokerus has been introduced in Gen 2 games. See #2
Pokerus info is stored in a byte. The upper 4 bits of the byte represent the specific strain of the Pokérus. The lower 4 bits represent the number of days remaining before the infected Pokémon is cured of the virus.
data class Pokerus (val strain: Int, val days: Int) {
val isCured: Boolean = strain != 0 && days == 0
companion object {
val StrainValues: IntRange = 1..15 // 0 means never infected
fun maxAllowedDays(strain: Int): Int = strain rem 4 + 1
val NeverInfected = Pokerus(strain = 0, days = 0)
}
}
interface Pokemon {
val pokerus: Pokerus
}
interface Mutator {
fun pokerus(value: Pokerus): Mutator
}
Pokerus info is stored in a byte. The upper 4 bits of the byte represent the specific strain of the Pokérus. The lower 4 bits represent the number of days remaining before the infected Pokémon is cured of the virus.