mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Improvement to Scent items' in-battle effects
This commit is contained in:
@@ -294,7 +294,7 @@ ItemHandlers::UseOnPokemon.add(:TIMEFLUTE, proc { |item, qty, pkmn, scene|
|
|||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::CanUseInBattle.add(:JOYSCENT, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages|
|
ItemHandlers::CanUseInBattle.add(:JOYSCENT, proc { |item, pokemon, battler, move, firstAction, battle, scene, showMessages|
|
||||||
if !battler || !battler.shadowPokemon? || !battler.inHyperMode?
|
if !pokemon.shadowPokemon? || (pokemon.happiness == 255 && pokemon.heart_gauge == 0)
|
||||||
scene.pbDisplay(_INTL("It won't have any effect.")) if showMessages
|
scene.pbDisplay(_INTL("It won't have any effect.")) if showMessages
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -303,24 +303,33 @@ ItemHandlers::CanUseInBattle.add(:JOYSCENT, proc { |item, pokemon, battler, move
|
|||||||
|
|
||||||
ItemHandlers::CanUseInBattle.copy(:JOYSCENT, :EXCITESCENT, :VIVIDSCENT)
|
ItemHandlers::CanUseInBattle.copy(:JOYSCENT, :EXCITESCENT, :VIVIDSCENT)
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:JOYSCENT, proc { |item, battler, scene|
|
ItemHandlers::BattleUseOnPokemon.add(:JOYSCENT, proc { |item, pokemon, battler, choices, scene|
|
||||||
battler.pokemon.hyper_mode = false
|
if pokemon.hyper_mode
|
||||||
battler.pokemon.change_heart_gauge("scent", 1)
|
pokemon.hyper_mode = false
|
||||||
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!", battler.pbThis, GameData::Item.get(item).name))
|
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",
|
||||||
|
battler&.pbThis || pokemon.name, GameData::Item.get(item).name))
|
||||||
|
end
|
||||||
|
pbRaiseHappinessAndReduceHeart(pokemon, scene, 1, false)
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:EXCITESCENT, proc { |item, battler, scene|
|
ItemHandlers::BattleUseOnPokemon.add(:EXCITESCENT, proc { |item, pokemon, battler, choices, scene|
|
||||||
battler.pokemon.hyper_mode = false
|
if pokemon.hyper_mode
|
||||||
battler.pokemon.change_heart_gauge("scent", 2)
|
pokemon.hyper_mode = false
|
||||||
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!", battler.pbThis, GameData::Item.get(item).name))
|
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",
|
||||||
|
battler&.pbThis || pokemon.name, GameData::Item.get(item).name))
|
||||||
|
end
|
||||||
|
pbRaiseHappinessAndReduceHeart(pokemon, scene, 2, false)
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::BattleUseOnBattler.add(:VIVIDSCENT, proc { |item, battler, scene|
|
ItemHandlers::BattleUseOnPokemon.add(:VIVIDSCENT, proc { |item, pokemon, battler, choices, scene|
|
||||||
battler.pokemon.hyper_mode = false
|
if pokemon.hyper_mode
|
||||||
battler.pokemon.change_heart_gauge("scent", 3)
|
pokemon.hyper_mode = false
|
||||||
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!", battler.pbThis, GameData::Item.get(item).name))
|
scene.pbDisplay(_INTL("{1} came to its senses from the {2}!",
|
||||||
|
battler&.pbThis || pokemon.name, GameData::Item.get(item).name))
|
||||||
|
end
|
||||||
|
pbRaiseHappinessAndReduceHeart(pokemon, scene, 3, false)
|
||||||
next true
|
next true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user