Fixed incorrect Hall of Fame time, fixed Shields Down showing too many messages, fixed target of Pluck still being able to consume its healing berry

This commit is contained in:
Maruno17
2023-03-04 23:37:50 +00:00
parent 6157c63fa2
commit 05f5d621b7
7 changed files with 24 additions and 9 deletions

View File

@@ -144,6 +144,7 @@ class Battle::Move
def tramplesMinimize?; return @flags.any? { |f| f[/^TramplesMinimize$/i] }; end
def nonLethal?(_user, _target); return false; end # For False Swipe
def preventsBattlerConsumingHealingBerry?(battler, targets); return false; end # For Bug Bite/Pluck
def ignoresSubstitute?(user) # user is the Pokémon using this move
if Settings::MECHANICS_GENERATION >= 6

View File

@@ -375,6 +375,11 @@ end
# User consumes target's berry and gains its effect. (Bug Bite, Pluck)
#===============================================================================
class Battle::Move::UserConsumeTargetBerry < Battle::Move
def preventsBattlerConsumingHealingBerry?(battler, targets)
return targets.any? { |b| b.index == battler.index } &&
battler.item&.is_berry? && Battle::ItemEffects::HPHeal[battler.item]
end
def pbEffectAfterAllHits(user, target)
return if user.fainted? || target.fainted?
return if target.damageState.unaffected || target.damageState.substitute