Added battle rule "disablePokeBalls"

This commit is contained in:
Maruno17
2022-02-15 18:39:41 +00:00
parent 5f39363e69
commit f322b234c6
3 changed files with 28 additions and 22 deletions

View File

@@ -31,6 +31,10 @@ ItemHandlers::CanUseInBattle.addIf(proc { |item| GameData::Item.get(item).is_pok
scene.pbDisplay(_INTL("There is no room left in the PC!")) if showMessages
next false
end
if battle.disablePokeBalls
scene.pbDisplay(_INTL("You can't throw a Poké Ball!")) if showMessages
next false
end
# NOTE: Using a Poké Ball consumes all your actions for the round. The code
# below is one half of making this happen; the other half is in def
# pbItemUsesAllActions?.
@@ -50,7 +54,7 @@ ItemHandlers::CanUseInBattle.addIf(proc { |item| GameData::Item.get(item).is_pok
if battle.pbOpposingBattlerCount == 2
scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokémon!")) if showMessages
elsif showMessages
scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are more than one Pokémon!"))
scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there is more than one Pokémon!"))
end
next false
end