vindaca510

Stealth System v0.2

Aug 4th, 2014
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 12.86 KB | None | 0 0
  1.  
  2. ################################################################################
  3. #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#
  4. #↓                                                                            ↓#
  5. #↓                        Stealth System: Version 0.2                         ↓#
  6. #↓                                                                            ↓#
  7. #↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕#
  8. #↑                                                                            ↑#
  9. #↑                          Written By: Joseph Hale                           ↑#
  10. #↑                        Last Edited: August 4, 2014                         ↑#
  11. #↑                                                                            ↑#
  12. #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑#
  13. ################################################################################
  14.  
  15. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  16. #◙ ** Disclaimer                                                              ◙#
  17. #◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
  18. #◙                                                                            ◙#
  19. #◙ This script is not for commercial, if you wish to use this script in a     ◙#
  20. #◙ game please PM me. All credit is to be given to me as the author of this   ◙#
  21. #◙ script.                                                                    ◙#
  22. #◙                                                                            ◙#
  23. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  24. #◙ ** How To Use                                                              ◙#
  25. #◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
  26. #◙                                                                            ◙#
  27. #◙ * Use the example below in an event script call.                           ◙#
  28. #◙                                                                            ◙#
  29. #◙    stealth?                                                                ◙#
  30. #◙                                                                            ◙#
  31. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  32. #◙ ** Updates / Version Notes                                                 ◙#
  33. #◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
  34. #◙                                                                            ◙#
  35. #◙   v0.1                                                                     ◙#
  36. #◙ ~◄◙◙◙◙►~                                                                   ◙#
  37. #◙ * This script adds stealth variable and a button to control it.            ◙#
  38. #◙                                                                            ◙#
  39. #◙   v0.2                                                                     ◙#
  40. #◙ ~◄◙◙◙◙►~                                                                   ◙#
  41. #◙ * Added an option to change Players opacity when in stealth.               ◙#
  42. #◙                                                                            ◙#
  43. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  44.  
  45.  
  46.  
  47. ################################################################################
  48. #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#
  49. #↓                                                                            ↓#
  50. #↕                        Stealth System: Version 0.1                         ↕#
  51. #↑                                                                            ↑#
  52. #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑#
  53. ################################################################################
  54.  
  55.  
  56.  
  57. #===============================================================================
  58. # ** Stealth System
  59. #------------------------------------------------------------------------------
  60. #  This module manages the customizable and function modules.
  61. #===============================================================================
  62. module Stealth_System
  63.  
  64.  
  65.  
  66. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  67. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  68. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙Customizeable Area◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  69. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  70. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  71.  
  72.   #=============================================================================
  73.   # * Stealth Trigger
  74.   #=============================================================================
  75.     Stealth_Trigger = :L
  76.  
  77.   #=============================================================================
  78.   # * Stealth Movement Speed
  79.   #=============================================================================
  80.     Stealth_Speed = 2
  81.  
  82.   #=============================================================================
  83.   # * Stealth Opacity
  84.   #=============================================================================
  85.     Stealth_Opacity = 150
  86.  
  87. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  88. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  89. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙End Customizeable Area◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  90. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  91. #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
  92.  
  93.  
  94.  
  95. end
  96.  
  97.  
  98. #==============================================================================
  99. # ** Game_Map
  100. #------------------------------------------------------------------------------
  101. #  This class handles maps. It includes scrolling and passage determination
  102. # functions. The instance of this class is referenced by $game_map.
  103. #==============================================================================
  104.  
  105. class Game_Map
  106.  
  107.   #--------------------------------------------------------------------------
  108.   # * Aliasing Method: Frame Update
  109.   #--------------------------------------------------------------------------
  110.   alias :gmu0035406400034 :update
  111.  
  112.   #--------------------------------------------------------------------------
  113.   # * Frame Update
  114.   #     main:  Interpreter update flag
  115.   #--------------------------------------------------------------------------
  116.   def update(*args)
  117.     gmu0035406400034(*args)
  118.     update_stealth
  119.   end
  120.  
  121.   #--------------------------------------------------------------------------
  122.   # * Frame Update
  123.   #     main:  Interpreter update flag
  124.   #--------------------------------------------------------------------------
  125.   def update_stealth
  126.     if Input.press?(Stealth_System::Stealth_Trigger)
  127.       unless $game_player.stealth == true
  128.         $game_player.move_speed = Stealth_System::Stealth_Speed
  129.         $game_player.stealth = true
  130.       end
  131.     else
  132.       unless $game_player.stealth == false
  133.         $game_player.move_speed = 4
  134.         $game_player.stealth = false
  135.       end
  136.     end
  137.   end
  138.  
  139. end
  140.  
  141.  
  142. #==============================================================================
  143. # ** Game_Player
  144. #------------------------------------------------------------------------------
  145. #  This class handles the player. It includes event starting determinants and
  146. # map scrolling functions. The instance of this class is referenced by
  147. # $game_player.
  148. #==============================================================================
  149.  
  150. class Game_Player < Game_Character
  151.  
  152.   #--------------------------------------------------------------------------
  153.   # * Public Instance Variables
  154.   #--------------------------------------------------------------------------
  155.   attr_accessor   :stealth                                          # Stealth
  156.   attr_accessor   :move_speed                                    # Move Speed
  157.  
  158.   #--------------------------------------------------------------------------
  159.   # * Aliasing Method: Object Initialization
  160.   #--------------------------------------------------------------------------
  161.   alias :gpi13215460000 :initialize
  162.  
  163.   #--------------------------------------------------------------------------
  164.   # * Object Initialization
  165.   #--------------------------------------------------------------------------
  166.   def initialize
  167.     gpi13215460000()
  168.     @stealth = false
  169.   end
  170.  
  171.   #--------------------------------------------------------------------------
  172.   # * Opacity
  173.   #--------------------------------------------------------------------------
  174.   def opacity
  175.     @opacity = ( @stealth == true ? Stealth_System::Stealth_Opacity : 255 )
  176.   end
  177.  
  178. end
  179.  
  180.  
  181. #==============================================================================
  182. # ** Game_Interpreter
  183. #------------------------------------------------------------------------------
  184. #  An interpreter for executing event commands. This class is used within the
  185. # Game_Map, Game_Troop, and Game_Event classes.
  186. #==============================================================================
  187.  
  188. class Game_Interpreter
  189.  
  190.   #--------------------------------------------------------------------------
  191.   # * Get Proximity of Event to Player
  192.   #--------------------------------------------------------------------------
  193.   def stealth?
  194.     $game_player.stealth
  195.   end
  196.  
  197. end
Advertisement
Add Comment
Please, Sign In to add comment