• 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.
  • 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!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Pokemon Happiness

Wrong.

To fix change every happiness moddification (search for ".happiness") in script to Happiness.modify(pokemon, gaintype) where the gaintype is one of the nine variables in script like Happiness::LEVELUP and Happiness::VITAMIN. You also need to call scene.pbRefresh after calling the "modify" at battle use of ENERGYPOWDER, ENERGYROOY and HEALPOWDER. In REVIVALHERB code I can't manage to make this work, in this code I can't call a module on it for some reason without messing with scene. I need to put the code manually in this section.
Code:
module Happiness
 LEVELUP=1
 STEPS256=2
 VITAMIN=3
 BERRY=4
 FAINT=5
 ENERGYPOWDER=6
 ENERGYROOT=7
 HEALPOWDER=8
 REVIVALHERB=9
 
 def self.modify(pokemon, gaintype)
  happinessgain=0
  if (gaintype==Happiness::LEVELUP || gaintype==Happiness::VITAMIN)
   if pokemon.happiness>199
     happinessgain=2
   elsif pokemon.happiness>99
     happinessgain=3
   else
     happinessgain=5
   end
  elsif (gaintype==Happiness::BERRY)
   if pokemon.happiness>199
     happinessgain=2
   elsif pokemon.happiness>99
     happinessgain=5
   else
     happinessgain=10
   end
  elsif (gaintype==Happiness::STEPS256)
   happinessgain=1
  elsif (gaintype==Happiness::FAINT)
   happinessgain=-1
  elsif (gaintype==Happiness::ENERGYPOWDER || gaintype==Happiness::HEALPOWDER)
   if pokemon.happiness>199
     happinessgain=-10
   else
     happinessgain=-5
   end
  elsif (gaintype==Happiness::ENERGYROOY)
   if pokemon.happiness>199
     happinessgain=-15
   else
     happinessgain=-10
   end
  elsif (gaintype==Happiness::REVIVALHERB)
   if pokemon.happiness>199
     happinessgain=-20
   else
     happinessgain=-15
   end
  end

  if isConst?(pokemon.item,PBItems,:SOOTHEBELL) && happinessgain>1
    pokemon.happiness+=((3*happinessgain)/2)
  else
    pokemon.happiness+=happinessgain
  end
  pokemon.happiness=255 if pokemon.happiness>255
  pokemon.happiness=0 if pokemon.happiness<0
 end
end

What graph? The Poffin (Contest status) ones?
 
Searching for the word "happiness" in the scripts will give you all the examples of how happiness works, so you can see for yourself.
 
Back
Top