From bd7a15d1fc5feb49f7af4458ce82827d8b98338e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCnder?= Date: Sat, 27 Jul 2024 23:24:31 +0200 Subject: [PATCH] Make black/white flute toggleable --- Data/Scripts/013_Items/002_Item_Effects.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Data/Scripts/013_Items/002_Item_Effects.rb b/Data/Scripts/013_Items/002_Item_Effects.rb index 078a819bf..1f7099d8d 100644 --- a/Data/Scripts/013_Items/002_Item_Effects.rb +++ b/Data/Scripts/013_Items/002_Item_Effects.rb @@ -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 })