Advertisement
vindaca510

V's Chest Pop-Up v0.2

Aug 22nd, 2013
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.88 KB | None | 0 0
  1.  
  2. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  3. #                                                                              #
  4. #                               V's Chest Pop-Up                               #
  5. #                                 Version  0.2                                 #
  6. #                                                                              #
  7. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  8. #                                Written By:  V                                #
  9. #                          Last Edited: August 24, 2013                        #
  10. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  11. #                                                                              #
  12. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  13.  
  14.  
  15. #==============================================================================#
  16. #------------------------------------------------------------------------------#
  17. # ** Disclaimer                                                                #
  18. #------------------------------------------------------------------------------#
  19. #                                                                              #
  20. # This script was intended for Non-commercial use only, if you wish to use     #
  21. # this script in a commercial game please PM me at which ever site you found   #
  22. # this script. Either way please give me credit in your game script as the     #
  23. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  24. #                                                                              #
  25. #------------------------------------------------------------------------------#
  26. # ** How To Use                                                                #
  27. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  28. #                                                                              #
  29. # * This script is pretty much plug-and-play.                                  #
  30. #                                                                              #
  31. # * Just leave the word chest in a script call at the bottom of any event page #
  32. #   that you want to use the window with.                                      #
  33. #                                                                              #
  34. #------------------------------------------------------------------------------#
  35. # ** Description                                                               #
  36. #------------------------------------------------------------------------------#
  37. #                                                                              #
  38. #  v0.1                                                                        #
  39. # ~=~=~=~                                                                      #
  40. #                                                                              #
  41. # This script displays any gold that is found durring an event in pop-up.      #
  42. #                                                                              #
  43. #  v0.2                                                                        #
  44. # ~=~=~=~                                                                      #
  45. #                                                                              #
  46. # Fixed a bug that was making the window pop up whenever any event was         #
  47. # triggered                                                                    #
  48. #                                                                              #
  49. #------------------------------------------------------------------------------#
  50. #==============================================================================#
  51.    
  52.  
  53.  
  54.  
  55.  
  56.  
  57. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  58. #                                                                              #
  59. #         DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.         #
  60. #                                                                              #
  61. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  62.    
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98. $imported = {} if $imported.nil?
  99. $imported["V's Chest Pop-Up"] = true
  100.    
  101. class VCPW < Window_Base
  102.   def initialize(x, y, w, h)
  103.     super(x, y, w, h)
  104.     dpr
  105.   end
  106.   def lc
  107.     color = normal_color
  108.     color.alpha = 200
  109.     color
  110.   end
  111.   def dhl
  112.     contents.fill_rect(0, 30, 544, 2, lc)
  113.   end
  114.   def dpr
  115.     draw_text(0, -60, 200, 150,  "You Got", 0)
  116.     dhl
  117.     dg if $game_system.gf != 0
  118.   end
  119.   def dg
  120.     gv = $data_system.currency_unit
  121.     ga = $game_system.gf.to_s
  122.     draw_icon(361, 145, 41)
  123.     draw_text(-55, -20,200, 150,  gv, 2)
  124.     $imported["V_Lucky_Gold_Find"] ? draw_text(-70, -20, 200, 150, $game_system.gra, 2) : draw_text(-70, -20, 200, 150, ga, 2)
  125.   end
  126. end
  127. class VCPS < Scene_Base
  128.   def start
  129.     super
  130.     cpw
  131.     cb
  132.   end
  133.   def cb
  134.     @bs = Sprite.new
  135.     @bs.bitmap = SceneManager.background_bitmap
  136.     @bs.color.set(16, 16, 16, 128)
  137.   end
  138.   def dcb
  139.     @bs.dispose
  140.     @bs.bitmap.dispose
  141.   end
  142.   def cpw
  143.     @pw = VCPW.new(172, 80, 200, 100)
  144.   end
  145.   def cs
  146.     rv
  147.     dcb
  148.     return_scene
  149.   end
  150.   def rv
  151.     $game_system.rc = 0
  152.   end
  153.   def update
  154.     super
  155.     cs if Input.trigger?(:B)
  156.   end
  157. end
  158. class Game_Interpreter
  159.   def chest
  160.     SceneManager.call(VCPS)
  161.   end
  162.   alias :command_1250645600 :command_125
  163.   def command_125
  164.     $game_system.rc += 1
  165.     $game_system.gf = operate_value(@params[0], @params[1], @params[2])
  166.     command_1250645600()
  167.   end
  168. end
  169. class Game_System
  170.   attr_accessor :gf
  171.   attr_accessor :rc
  172.   alias :old_init452527327532 :initialize
  173.   def initialize
  174.     @gf = 0
  175.     @rc = 0
  176.     old_init452527327532()
  177.   end
  178. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement