mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Minor fixes to Pokérus code, fixed some incorrect apostrophes in PBS files
This commit is contained in:
@@ -789,7 +789,7 @@ class Pokemon
|
||||
end
|
||||
|
||||
# Returns the Pokérus infection stage for this Pokémon. The possible stages are
|
||||
# 0 (not infected), 1 (infected) and 2 (cured)
|
||||
# 0 (not infected), 1 (infected) and 2 (cured).
|
||||
# @return [0, 1, 2] current Pokérus infection stage
|
||||
def pokerusStage
|
||||
return 0 if @pokerus == 0
|
||||
@@ -797,11 +797,11 @@ class Pokemon
|
||||
end
|
||||
|
||||
# Gives this Pokémon Pokérus (either the specified strain or a random one).
|
||||
# @param strain [Integer] Pokérus strain to give
|
||||
# @param strain [Integer] Pokérus strain to give (1-15 inclusive, or 0 for random)
|
||||
def givePokerus(strain = 0)
|
||||
return if self.pokerusStage == 2 # Can't re-infect a cured Pokémon
|
||||
$stats.pokerus_infections += 1
|
||||
strain = rand(1..16) if strain <= 0 || strain >= 16
|
||||
strain = rand(1...16) if strain <= 0 || strain >= 16
|
||||
time = 1 + (strain % 4)
|
||||
@pokerus = time
|
||||
@pokerus |= strain << 4
|
||||
@@ -810,7 +810,7 @@ class Pokemon
|
||||
# Resets the infection time for this Pokémon's Pokérus (even if cured).
|
||||
def resetPokerusTime
|
||||
return if @pokerus == 0
|
||||
strain = @pokerus % 16
|
||||
strain = @pokerus / 16
|
||||
time = 1 + (strain % 4)
|
||||
@pokerus = time
|
||||
@pokerus |= strain << 4
|
||||
@@ -822,6 +822,11 @@ class Pokemon
|
||||
@pokerus -= 1
|
||||
end
|
||||
|
||||
# Cures this Pokémon's Pokérus (if infected).
|
||||
def curePokerus
|
||||
@pokerus -= @pokerus % 16
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
# Ownership, obtained information
|
||||
#=============================================================================
|
||||
|
||||
Reference in New Issue
Block a user