• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

I Think I broke Pokerus

Rayd12smitty

Shadow Maker
  • 606
    Posts
    13
    Years
    • Seen Feb 21, 2016
    Help Me Again PokeCommunity. I just realized I did something that messed up Pokerus. Whenever I try to view a pokemon's summary or finish a battle I get a Pokerus error. I am getting a finish battle error too, but that can wait. Here are the errors. Does anyone know whats wrong?

    This is the error from the summary screen
    Spoiler:


    And when I defeat a wild pokemon this comes up

    Spoiler:


    Any help would be appreciated
     
    Line 296, under
    Code:
    # Reduces the time remaining for this Pokemon's Pokérus (if infected).
      def lowerPokerusCount
        return if self.pokerusStage!=1
        @pokerus-=1
      end

    add in
    Code:
    # Returns the Pokérus infection stage for this Pokemon.
      def pokerusStage
        return 0 if !@pokerus || @pokerus==0        # Not infected
        return 2 if @pokerus>0 && (@pokerus%16)==0  # Cured
        return 1                                    # Infected
      end
     
    Line 296, under
    Code:
    # Reduces the time remaining for this Pokemon's Pokérus (if infected).
      def lowerPokerusCount
        return if self.pokerusStage!=1
        @pokerus-=1
      end

    add in
    Code:
    # Returns the Pokérus infection stage for this Pokemon.
      def pokerusStage
        return 0 if !@pokerus || @pokerus==0        # Not infected
        return 2 if @pokerus>0 && (@pokerus%16)==0  # Cured
        return 1                                    # Infected
      end


    Thank you so much. It turns out i was missing both of those. Everything is working good now. Thanks
     
    You'll also be missing this def, then:

    Code:
      def givePokerus(strain=0)
        return if self.pokerusStage==2 # Can't re-infect a cured Pokémon
        if strain<=0 || strain>=16
          strain=1+rand(15)
        end
        time=1+(strain%4)
        @pokerus=time
        @pokerus|=strain<<4
      end
    I can only presume you've tried upgrading your project (in the wrong way), and failed to upgrade that script section.
     
    Back
    Top