From 3d9c3e2c00b31ca58208dc28e05860bd927bd31c Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Wed, 18 Jan 2023 19:11:14 +0000 Subject: [PATCH] Fixed incorrect variable use for Jaboca/Rowap Berries' effects --- .../005_Battle_CatchAndStoreMixin.rb | 9 --------- .../006_Other battle code/009_Battle_ItemEffects.rb | 12 ++++++------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb b/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb index 8369257c6..058899ab5 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb @@ -33,15 +33,6 @@ module Battle::CatchAndStoreMixin next if party_index < 0 # Cancelled party_size = pbPlayer.party.length # Send chosen Pokémon to storage - # NOTE: This doesn't work properly if you catch multiple Pokémon in - # the same battle, because the code below doesn't alter the - # contents of pbParty(0), only pbPlayer.party. This means that - # viewing the party in battle after replacing a party Pokémon - # with a caught one (which is possible if you've caught a second - # Pokémon) will not show the first caught Pokémon in the party - # but will still show the boxed Pokémon in the party. Correcting - # this would take a surprising amount of code, and it's very - # unlikely to be needed anyway, so I'm ignoring it for now. send_pkmn = pbPlayer.party[party_index] stored_box = @peer.pbStorePokemon(pbPlayer, send_pkmn) pbPlayer.party.delete_at(party_index) diff --git a/Data/Scripts/011_Battle/006_Other battle code/009_Battle_ItemEffects.rb b/Data/Scripts/011_Battle/006_Other battle code/009_Battle_ItemEffects.rb index 6a45ab439..203cb30f5 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/009_Battle_ItemEffects.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/009_Battle_ItemEffects.rb @@ -1318,13 +1318,13 @@ Battle::ItemEffects::OnBeingHit.add(:JABOCABERRY, next if !user.takesIndirectDamage? amt = user.totalhp / 8 ripening = false - if battler.hasActiveAbility?(:RIPEN) - battle.pbShowAbilitySplash(battler) + if target.hasActiveAbility?(:RIPEN) + battle.pbShowAbilitySplash(target) amt *= 2 ripening = true end battle.pbCommonAnimation("EatBerry", target) - battle.pbHideAbilitySplash(battler) if ripening + battle.pbHideAbilitySplash(target) if ripening battle.scene.pbDamageAnimation(user) user.pbReduceHP(amt, false) battle.pbDisplay(_INTL("{1} consumed its {2} and hurt {3}!", target.pbThis, @@ -1388,13 +1388,13 @@ Battle::ItemEffects::OnBeingHit.add(:ROWAPBERRY, next if !user.takesIndirectDamage? amt = user.totalhp / 8 ripening = false - if battler.hasActiveAbility?(:RIPEN) - battle.pbShowAbilitySplash(battler) + if target.hasActiveAbility?(:RIPEN) + battle.pbShowAbilitySplash(target) amt *= 2 ripening = true end battle.pbCommonAnimation("EatBerry", target) - battle.pbHideAbilitySplash(battler) if ripening + battle.pbHideAbilitySplash(target) if ripening battle.scene.pbDamageAnimation(user) user.pbReduceHP(amt, false) battle.pbDisplay(_INTL("{1} consumed its {2} and hurt {3}!", target.pbThis,