public static bool pbRaiseHappinessAndReduceHeart(Pokemon pokemon, IScene scene, int amount) { if (!pokemon.isShadow) { scene.pbDisplay(_INTL("It won't have any effect.")); return(false); } if (pokemon.Happiness == 255 && pokemon.heartgauge == 0) { scene.pbDisplay(_INTL("It won't have any effect.")); return(false); } else if (pokemon.Happiness == 255) { pokemon.adjustHeart(-amount); scene.pbDisplay(_INTL("{1} adores you!\nThe door to its heart opened a little.", pokemon.Name)); pbReadyToPurify(pokemon); return(true); } else if (pokemon.heartgauge == 0) { pokemon.ChangeHappiness(HappinessMethods.VITAMIN); scene.pbDisplay(_INTL("{1} turned friendly.", pokemon.Name)); return(true); } else { pokemon.ChangeHappiness(HappinessMethods.VITAMIN); pokemon.adjustHeart(-amount); scene.pbDisplay(_INTL("{1} turned friendly.\nThe door to its heart opened a little.", pokemon.Name)); pbReadyToPurify(pokemon); return(true); } }