mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Some fixes related to the previous commit and Exp Candy effect
This commit is contained in:
@@ -5,9 +5,11 @@ ItemHandlers::UseOnPokemon.add(:EXPCANDYXS, proc { |item, pkmn, scene|
|
||||
end
|
||||
gain_amount = 100
|
||||
maximum = ((pkmn.growth_rate.maximum_exp - pkmn.exp) / gain_amount.to_f).ceil
|
||||
maximum = [maximum, $PokemonBag.pbQuantity(item)].min
|
||||
qty = scene.scene.pbChooseNumber(
|
||||
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), maximum)
|
||||
next false if qty = 0
|
||||
next false if qty == 0
|
||||
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
|
||||
pbChangeExp(pkmn, pkmn.exp + gain_amount * qty, scene)
|
||||
$PokemonBag.pbDeleteItem(item, qty - 1)
|
||||
scene.pbHardRefresh
|
||||
@@ -21,9 +23,11 @@ ItemHandlers::UseOnPokemon.add(:EXPCANDYS, proc { |item, pkmn, scene|
|
||||
end
|
||||
gain_amount = 800
|
||||
maximum = ((pkmn.growth_rate.maximum_exp - pkmn.exp) / gain_amount.to_f).ceil
|
||||
maximum = [maximum, $PokemonBag.pbQuantity(item)].min
|
||||
qty = scene.scene.pbChooseNumber(
|
||||
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), maximum)
|
||||
next false if qty = 0
|
||||
next false if qty == 0
|
||||
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
|
||||
pbChangeExp(pkmn, pkmn.exp + gain_amount * qty, scene)
|
||||
$PokemonBag.pbDeleteItem(item, qty - 1)
|
||||
scene.pbHardRefresh
|
||||
@@ -37,9 +41,11 @@ ItemHandlers::UseOnPokemon.add(:EXPCANDYM, proc { |item, pkmn, scene|
|
||||
end
|
||||
gain_amount = 3_000
|
||||
maximum = ((pkmn.growth_rate.maximum_exp - pkmn.exp) / gain_amount.to_f).ceil
|
||||
maximum = [maximum, $PokemonBag.pbQuantity(item)].min
|
||||
qty = scene.scene.pbChooseNumber(
|
||||
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), maximum)
|
||||
next false if qty = 0
|
||||
next false if qty == 0
|
||||
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
|
||||
pbChangeExp(pkmn, pkmn.exp + gain_amount * qty, scene)
|
||||
$PokemonBag.pbDeleteItem(item, qty - 1)
|
||||
scene.pbHardRefresh
|
||||
@@ -53,9 +59,11 @@ ItemHandlers::UseOnPokemon.add(:EXPCANDYL, proc { |item, pkmn, scene|
|
||||
end
|
||||
gain_amount = 10_000
|
||||
maximum = ((pkmn.growth_rate.maximum_exp - pkmn.exp) / gain_amount.to_f).ceil
|
||||
maximum = [maximum, $PokemonBag.pbQuantity(item)].min
|
||||
qty = scene.scene.pbChooseNumber(
|
||||
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), maximum)
|
||||
next false if qty = 0
|
||||
next false if qty == 0
|
||||
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
|
||||
pbChangeExp(pkmn, pkmn.exp + gain_amount * qty, scene)
|
||||
$PokemonBag.pbDeleteItem(item, qty - 1)
|
||||
scene.pbHardRefresh
|
||||
@@ -69,9 +77,11 @@ ItemHandlers::UseOnPokemon.add(:EXPCANDYXL, proc { |item, pkmn, scene|
|
||||
end
|
||||
gain_amount = 30_000
|
||||
maximum = ((pkmn.growth_rate.maximum_exp - pkmn.exp) / gain_amount.to_f).ceil
|
||||
maximum = [maximum, $PokemonBag.pbQuantity(item)].min
|
||||
qty = scene.scene.pbChooseNumber(
|
||||
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), maximum)
|
||||
next false if qty = 0
|
||||
next false if qty == 0
|
||||
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
|
||||
pbChangeExp(pkmn, pkmn.exp + gain_amount * qty, scene)
|
||||
$PokemonBag.pbDeleteItem(item, qty - 1)
|
||||
scene.pbHardRefresh
|
||||
|
||||
@@ -565,7 +565,7 @@ class PokemonParty_Scene
|
||||
end
|
||||
|
||||
def pbChooseNumber(helptext, maximum, initnum = 1)
|
||||
return UIHelper.pbChooseNumber(@sprites["helpwindow"], helptext, maximum, initnum) { pbUpdate }
|
||||
return UIHelper.pbChooseNumber(@sprites["helpwindow"], helptext, maximum, initnum) { update }
|
||||
end
|
||||
|
||||
def pbSetHelpText(helptext)
|
||||
|
||||
@@ -295,6 +295,7 @@ module UIHelper
|
||||
Input.update
|
||||
numwindow.update
|
||||
helpwindow.update
|
||||
yield if block_given?
|
||||
if Input.trigger?(Input::BACK)
|
||||
ret = 0
|
||||
pbPlayCancelSE
|
||||
|
||||
Reference in New Issue
Block a user