diamondandplatinum3

Determine if "in battle" ~ RGSS3

Dec 10th, 2012
1,345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.46 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Determine if "in battle"
  3. #             Author: DiamondandPlatinum3
  4. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. #  Description:
  6. #
  7. #    This script will allow you to set an event switch that will turn on if
  8. #    you are in battle, and turn off if you are not.
  9. #    It's useful for changing what an item does if battling compared to if
  10. #    not battling.
  11. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12.  
  13.  
  14.  
  15. class Scene_Battle < Scene_Base
  16.   #------------------------
  17.   # Editable Part
  18.   #------------------------
  19.  
  20.   # Event Switch to turn on if in battle
  21.   ITEM_EVENT_SWITCH_ID = 10
  22.  
  23.   #------------------------
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.   #--------------------------------------------------------------------------
  38.   # * Start processing
  39.   #--------------------------------------------------------------------------
  40.   alias evntswitchbtlstart_1g5s start
  41.   def start
  42.     evntswitchbtlstart_1g5s
  43.     $game_switches[ITEM_EVENT_SWITCH_ID] = true
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # * Termination Processing
  47.   #--------------------------------------------------------------------------
  48.   alias evntswitchbtlterminate_1g5s terminate
  49.   def terminate
  50.     evntswitchbtlterminate_1g5s
  51.     $game_switches[ITEM_EVENT_SWITCH_ID] = false
  52.   end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment