mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Fixed error when gaining happiness while at/above the happiness soft cap
This commit is contained in:
@@ -191,5 +191,5 @@ Battle::PokeBallEffects::OnCatch.add(:HEALBALL, proc { |ball, battle, pkmn|
|
|||||||
})
|
})
|
||||||
|
|
||||||
Battle::PokeBallEffects::OnCatch.add(:FRIENDBALL, proc { |ball, battle, pkmn|
|
Battle::PokeBallEffects::OnCatch.add(:FRIENDBALL, proc { |ball, battle, pkmn|
|
||||||
pkmn.happiness = 200
|
pkmn.happiness = (Settings::APPLY_HAPPINESS_SOFT_CAP) ? 150 : 200
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -962,7 +962,7 @@ class Pokemon
|
|||||||
gain += 1 if @poke_ball == :LUXURYBALL
|
gain += 1 if @poke_ball == :LUXURYBALL
|
||||||
gain = (gain * 1.5).floor if hasItem?(:SOOTHEBELL)
|
gain = (gain * 1.5).floor if hasItem?(:SOOTHEBELL)
|
||||||
if Settings::APPLY_HAPPINESS_SOFT_CAP && method != "evberry"
|
if Settings::APPLY_HAPPINESS_SOFT_CAP && method != "evberry"
|
||||||
gain = gain.clamp(0, 179 - @happiness)
|
gain = (@happiness >= 179) ? 0 : gain.clamp(0, 179 - @happiness)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@happiness = (@happiness + gain).clamp(0, 255)
|
@happiness = (@happiness + gain).clamp(0, 255)
|
||||||
|
|||||||
Reference in New Issue
Block a user