Merge pull request #122 from Beinmann/make_black_and_white_flute_persist_between_routes

Make black and white flute effects persist when entering a new route
This commit is contained in:
infinitefusion
2025-04-08 21:35:47 -04:00
committed by GitHub
2 changed files with 13 additions and 5 deletions

View File

@@ -148,17 +148,19 @@ Events.onStepTaken += proc {
ItemHandlers::UseInField.add(:BLACKFLUTE, proc { |item|
pbUseItemMessage(item)
pbMessage(_INTL("Wild Pokémon will be repelled."))
$PokemonMap.blackFluteUsed = true
message = $PokemonMap.blackFluteUsed ? "Wild Pokemon will no longer be repelled.": "Wild Pokémon will be repelled."
pbMessage(_INTL(message))
$PokemonMap.blackFluteUsed = !$PokemonMap.blackFluteUsed
$PokemonMap.whiteFluteUsed = false
next 1
})
ItemHandlers::UseInField.add(:WHITEFLUTE, proc { |item|
pbUseItemMessage(item)
pbMessage(_INTL("Wild Pokémon will be lured."))
message = $PokemonMap.whiteFluteUsed ? "Wild Pokemon will no longer be lured.": "Wild Pokémon will be lured."
pbMessage(_INTL(message))
$PokemonMap.whiteFluteUsed = !$PokemonMap.whiteFluteUsed
$PokemonMap.blackFluteUsed = false
$PokemonMap.whiteFluteUsed = true
next 1
})