Minor bugfiixes (#140)

* Fixed moves bounced back by Magic Coat/Bounced moves affecting Pokemon they normally shouldn't
* Fixed townmap compiler not saving any map names (doesn't make a difference; added for completionism)
* Update a few ruby utilities
* Fixed small typo bug in map renderer disposal
This commit is contained in:
Golisopod-User
2021-12-20 02:28:28 +05:30
committed by GitHub
parent 65b1a8d6c3
commit 7f86db6da9
4 changed files with 23 additions and 21 deletions

View File

@@ -471,9 +471,20 @@ class Battle::Battler
@battle.pbHideAbilitySplash(b) if b.damageState.magicBounce
newChoice = choice.clone
newChoice[3] = user.index
newTargets = pbFindTargets(newChoice, move, b)
newTargets = pbFindTargets(newChoice ,move, b)
newTargets = pbChangeTargets(move, b, newTargets)
success = pbProcessMoveHit(move, b, newTargets, 0, false)
success = false
if !move.pbMoveFailed?(b, newTargets)
newTargets.each_with_index do |newTarget, idx|
if pbSuccessCheckAgainstTarget(move, b, newTarget, newTargets)
success = true
next
end
newTargets[idx] = nil
end
newTargets.compact!
end
pbProcessMoveHit(move, b, newTargets, 0, false) if success
b.lastMoveFailed = true if !success
targets.each { |otherB| otherB.pbFaint if otherB && otherB.fainted? }
user.pbFaint if user.fainted?
@@ -486,7 +497,10 @@ class Battle::Battler
@battle.pbShowAbilitySplash(mc) if magicBouncer >= 0
@battle.pbDisplay(_INTL("{1} bounced the {2} back!", mc.pbThis, move.name))
@battle.pbHideAbilitySplash(mc) if magicBouncer >= 0
success = pbProcessMoveHit(move, mc, [], 0, false)
success = false
if !move.pbMoveFailed?(mc, [])
success = pbProcessMoveHit(move, mc, [], 0, false)
end
mc.lastMoveFailed = true if !success
targets.each { |b| b.pbFaint if b && b.fainted? }
user.pbFaint if user.fainted?