Facebook
From Voltseon, 4 Years ago, written in Ruby.
Embed
Download Paste or View Raw
Hits: 293
  1. ItemHandlers::UseInField.add(:VIAL,proc{|item|
  2.    case $game_variables[50]
  3.    when 0
  4.      Kernel.pbMessage(_INTL("You do not have any charges left..."))
  5.      $PokemonBag.pbChangeItem(:VIAL,:EMPTYVIAL) #this should never happen btw
  6.    when 1
  7.      Kernel.pbMessage("You have 1 charge left.")
  8.      if Kernel.pbConfirmMessage("Would you like to heal you Pokémon?")
  9.        $game_variables[50] -= 1
  10.        for i in $Trainer.party
  11.         i.heal
  12.        end
  13.        Kernel.pbMessage(_INTL("Your Pokémon were fully healed."))
  14.        Kernel.pbMessage(_INTL("You have no more charges left."))
  15.        $PokemonBag.pbChangeItem(:VIAL,:EMPTYVIAL)
  16.       end
  17.    else
  18.      Kernel.pbMessage(_INTL("You have {1} charge(s) left.",$game_variables[50]))
  19.      if Kernel.pbConfirmMessage("Would you like to heal you Pokémon?")
  20.        $game_variables[50] -= 1
  21.        for i in $Trainer.party
  22.         i.heal
  23.        end
  24.        Kernel.pbMessage(_INTL("Your Pokémon were fully healed."))
  25.        Kernel.pbMessage(_INTL("{1} charge(s) remain!",$game_variables[50]))
  26.       end
  27.     end
  28.    next 1