Advertisement
TheSixth

Toolbar Addon for Falcao's ABS by Sixth

Sep 26th, 2015
1,240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 42.90 KB | None | 0 0
  1. #===============================================================================
  2. # * [ACE] Toolbar Addon for Falcao's Pearl ABS Liquid v3
  3. #===============================================================================
  4. # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
  5. # * Version: 1.8
  6. # * Updated: 28/11/2016
  7. # * Requires: Falcao's Pearl ABS Liquid v3
  8. #             Cidiomar's Perfect Pixel Collision System
  9. #             Cidiomar's Collision Helper
  10. #-------------------------------------------------------------------------------
  11. # * < Change Log >
  12. #-------------------------------------------------------------------------------
  13. # * Version 1.0 (26/09/2015)
  14. #   - Initial release.
  15. # * Version 1.1 (29/09/2015)
  16. #   - Fixed a weird crash issue.
  17. # * Version 1.2 (05/10/2015)
  18. #   - Added an option to use images for your cooldown masks.
  19. #     Now you can use other shapes for them, not just squares or rectangles.
  20. #   - Added a switch setting to hide/show the toolbar without turning off the
  21. #     entire ABS script.
  22. # * Version 1.3 (26/02/2016)
  23. #   - Fixed an ammo coloring issue.
  24. #   - Skills can now properly show item cost as well.
  25. #     TP display takes priority over MP display, and MP display takes priority
  26. #     over item cost display. This applies to the color of cost display as well.
  27. # * Version 1.4 (09/08/2016)
  28. #   - Now properly shows the cooldown for dual wield characters (2 weapons).
  29. #     This was fixed before, but forgot to include it in the change log. o.o
  30. #   - Fixed an incorrect update method. Minor performance increase.
  31. # * Version 1.5 (30/09/2016)
  32. #   - Major update! From now on, this script requires Cidiomar's
  33. #     Perfect Pixel Collision System! This one works better and quicker.
  34. #   - Added settings to adjust the Z level of the toolbar images.
  35. #   - Fixed a bug with the ammo display.
  36. #   - Fixed a bug with the cooldown display.
  37. # * Version 1.6 (30/10/2016)
  38. #   - Added compatibility with my Control Configuration System.
  39. #     Now you can show the correct key-binds on your toolbars regardless of how
  40. #     the player changed them in my control configuration menu.
  41. # * Version 1.7 (18/11/2016)
  42. #   - Fixed a bug with the item cost display.
  43. # * Version 1.8 (28/11/2016)
  44. #   - Fixed a bug with the item cost display... Again. >.>
  45. #-------------------------------------------------------------------------------
  46. # * < Description >
  47. #-------------------------------------------------------------------------------
  48. # * This script will add complete control over the toolbar of the ABS.
  49. # * Set up the position of each icon, letter and tool cost data.
  50. # * Font setting for the cost and letter displays.
  51. # * Disable any icon from the toolbar if you want.
  52. #   Just be aware that it won't actually disable the tool trigger, only hide
  53. #   the graphical display of it!
  54. # * Separate settings for the 3 scenes where the toolbar can appear.
  55. # * Changed the display method of the cooldown data. It will not the use simple
  56. #   number countdown anymore. Instead, it will use a gradient/image mask which
  57. #   fills up depending on the cooldown time. Many RPGs use this kind of cooldown
  58. #   display, and it looks way better this way, in my opinion.
  59. # * Option to toggle the visibility of the on-map toolbar anytime with a switch.
  60. #-------------------------------------------------------------------------------
  61. # * < Installation >
  62. #-------------------------------------------------------------------------------
  63. # * Place this script below the last script from Falcao's Pearl ABS Liquid v3
  64. #   script series but above Main!
  65. # * Place this script below Cidiomar's Collision Helper script!
  66. # * If you are using my Stat Bonus Addon script, you must place this script
  67. #   below that one too!
  68. # * In case you can't find Cidiomar's Perfect Pixel Collision System:
  69. #   http://himeworks.com/redirect.php?type=demo&name=image_collision_detection
  70. #   That is a link to the script's demo. Thanks Tsukihime for the backup!
  71. # * Don't forget to put Cidiomar's CollisionDetection.dll into the System folder
  72. #   of your project!
  73. #-------------------------------------------------------------------------------
  74. # * < Compatibility Info >
  75. #-------------------------------------------------------------------------------
  76. # * No known incompatibilities.
  77. #-------------------------------------------------------------------------------
  78. # * < Known Issues >
  79. #-------------------------------------------------------------------------------
  80. # * Mouse functionality is broken at the moment, so you can't use the toolbar
  81. #   by clicking on the icons. This will only affect your game if you use
  82. #   Falcao's mouse addon.
  83. #   Will try to fix this in the next update.
  84. #-------------------------------------------------------------------------------
  85. # * < Terms of Use >
  86. #-------------------------------------------------------------------------------
  87. # * Free to use for whatever purposes you want.
  88. # * Credit me (Sixth) in your game, pretty please! :P
  89. # * Posting modified versions of this script is allowed as long as you notice me
  90. #   about it with a link to it!
  91. #===============================================================================
  92. $imported = {} if $imported.nil?
  93. $imported["SixthABSToolBarAddon"] = true
  94. #===============================================================================
  95. # Settings:
  96. #===============================================================================
  97. module PearlSkillBar
  98.   #-----------------------------------------------------------------------------
  99.   # Toolbar Switch Settings:
  100.   #-----------------------------------------------------------------------------
  101.   # You can set up a switch to toggle the visibility of the toolbar on the map.
  102.   # When this switch is ON, the toolbar is shown, when it is OFF, the toolbar
  103.   # is hidden. This will only affect the toolbar on the map!
  104.   # You can set it to 0 if you don't want to use this feature.
  105.   #-----------------------------------------------------------------------------  
  106.   ToolBarSwitch = 0
  107.  
  108.   #-----------------------------------------------------------------------------
  109.   # Background Position Settings:
  110.   #-----------------------------------------------------------------------------
  111.   # You can set up the position of the background used for the toolbar here.
  112.   # This will move the whole toolbar!
  113.   # You can set up a setting for the 3 scenes separately.
  114.   # Format: :scene => [x,y],
  115.   # The position settings are measured in pixels, NOT in tiles!
  116.   #-----------------------------------------------------------------------------
  117.   Position = {
  118.     :map => [14,110],       # For the map toolbar.
  119.     :toolmenu => [14,110],  # For the quick tool menu.
  120.     :charmenu => [14,110],  # For the character selection menu.
  121.   }
  122.  
  123.   #-----------------------------------------------------------------------------
  124.   # Background Image Settings:
  125.   #-----------------------------------------------------------------------------
  126.   # You can set up the background image used for the toolbar here.
  127.   # You can set up different images for the 3 scenes separately.
  128.   # The images must be placed in the "Graphics\Pictures" folder of your game!
  129.   #-----------------------------------------------------------------------------
  130.   LayoutImg = {
  131.     :map => "SkillBarFinal",       # For the map toolbar.
  132.     :toolmenu => "SkillBarFinal",  # For the quick tool menu.
  133.     :charmenu => "SkillBarFinal",  # For the character selection menu.
  134.   }
  135.  
  136.   #-----------------------------------------------------------------------------
  137.   # Priority Settings:
  138.   #-----------------------------------------------------------------------------
  139.   # You can setup the Z level of each images on the toolbar here.
  140.   # In case you want to show the icons below the background image or the ammo
  141.   # below the cooldown mask, you can set them up however you want to.
  142.   # Images with higher values set here will show up above the ones with lower
  143.   # values!
  144.   # Also, if some images from another custom script would appear above the
  145.   # toolbar and you don't want that, try to increase the values here, that might
  146.   # solve that issue.
  147.   # ----------
  148.   # :back = Background image.
  149.   # :icons = Icon display.
  150.   # :cool = Cooldown display.
  151.   # :ammo = Ammo display.
  152.   # :letters = Button letter display.
  153.   #-----------------------------------------------------------------------------
  154.   Priority = {
  155.     :map => { # Map toolbar settings:
  156.       :back => 0, :icons => 1, :cool => 2, :ammo => 3, :letters => 4,
  157.     },
  158.     :toolmenu => { # Quick tool selection menu toolbar settings:
  159.       :back => 0, :icons => 1, :cool => 2, :ammo => 3, :letters => 4,
  160.     },
  161.     :charmenu => { # Character selection menu toolbar settings:
  162.       :back => 0, :icons => 1, :cool => 2, :ammo => 3, :letters => 4,
  163.     },
  164.   }
  165.  
  166.   #-----------------------------------------------------------------------------
  167.   # Enable Settings:
  168.   #-----------------------------------------------------------------------------
  169.   # You can enable/disable some features here.
  170.   # Currently only one feature can be disabled.
  171.   # true = enabled, false = disabled.
  172.   #-----------------------------------------------------------------------------
  173.   EnableSettings = {
  174.     :letters => false, # Button letters.
  175.   }
  176.  
  177.   #-----------------------------------------------------------------------------
  178.   # Button Display Mode Settings:
  179.   #-----------------------------------------------------------------------------
  180.   # Can't really call these "letter settings" anymore, because with my control
  181.   # configuration system, you can choose how do you want to display the required
  182.   # button for triggering your tools.
  183.   # You can choose from 3 types:
  184.   # :name - This will diplay the name of the button with text.
  185.   # :icon - This will diplay the icon of the button.
  186.   # :img  - This will diplay the custom image of the button.
  187.   # In all cases, only the first key-bind will be displayed for each tool type!
  188.   #
  189.   # If you don't have my control configuration system installed, this setting
  190.   # will not do anything! In that case, the default drawing method will be used.
  191.   #-----------------------------------------------------------------------------
  192.   LetterTypes = {
  193.     :map => :name,
  194.     :toolmenu => :name,
  195.     :charmenu => :name,
  196.     :sixthmenu => :name,
  197.   }
  198.  
  199.   #-----------------------------------------------------------------------------
  200.   # Font Settings:
  201.   #-----------------------------------------------------------------------------
  202.   # Set up the font properties used for the letter and ammo display.
  203.   # :type = The name of the font type used. (array of strings)
  204.   # :size = The size of the font. (integer)
  205.   # :bold = Bold the font or not? (true/false)
  206.   # :color = The color of the font. Uses RGBA codes!
  207.   #          Format: Color.new(R,G,B,A),
  208.   # ----------
  209.   # NOTE:
  210.   # A skill tool will only display it's MP or TP cost, and only one of them!
  211.   # The TP cost is prioritized, so if a skill got both TP and MP cost,
  212.   # only the TP cost will be displayed!
  213.   # For this reason, if you want to display item cost for your tools, make them
  214.   # as items, instead of skills. Items will always display the current number
  215.   # of ammo in the party's inventory, but only if the tool actually requires
  216.   # ammo!
  217.   #-----------------------------------------------------------------------------
  218.   Fonts = {
  219.     :letters => { # Button letters.
  220.       :type => ["Gabriola"], :size => 36, :bold => true,
  221.       :color => Color.new(250,180,50,255),
  222.     },
  223.     :ammo => { # Ammo display.
  224.       :type => ["Tw Cen MT Condensed"], :size => 16, :bold => true,
  225.       :color => {
  226.         :item => Color.new(255,255,255,255), # Color for the item cost.
  227.         :mp => Color.new(110,160,255,255),   # Color for the MP cost.
  228.         :tp => Color.new(255,80,80,255),     # Color for the TP cost.
  229.       },
  230.     },
  231.   }
  232.  
  233.   #-----------------------------------------------------------------------------
  234.   # Cooldown Display Settings:
  235.   #-----------------------------------------------------------------------------
  236.   # You can set up various settings used for the mask in the cooldown display
  237.   # here. You can choose to use an image for your masks, or use the default
  238.   # gradient drawing.
  239.   # The image used must be in the "Graphics/Pictures" folder of your game!
  240.   # The color settings for the default gradient type masks use RGBA codes!
  241.   # The cooldown mask will be drawn above the tool icons. Once a tool with
  242.   # cooldown is used, the mask will appear above the used tool's icon, and will
  243.   # start to shrink vertically, from the bottom to the top.
  244.   # When the mask disappears, the tool can be used again.
  245.   # Remember that you need to set the cooldown display to true for your tools,
  246.   # or else it will not be displayed!
  247.   #-----------------------------------------------------------------------------
  248.   CoolDisplay = {
  249.     :useimg => true,             # Enable image type masks? (true/false)
  250.     :coolimg => "coolfill1",     # Image used for the masks. (string)
  251.     :coolopa => 250,             # Opacity of the image type masks. (0 - 255)
  252.     :f1 => Color.new(0,0,0,160), # Fill color 1 for gradient type masks. (RGBA)
  253.     :f2 => Color.new(0,0,0,160), # Fill color 2 for gradient type masks. (RGBA)
  254.   }
  255.  
  256.   #-----------------------------------------------------------------------------
  257.   # Cooldown Refresh Settings:
  258.   #-----------------------------------------------------------------------------
  259.   # You can set up the refresh rate of the cooldown display here.
  260.   # There should be no performance issues with the new cooldown display, even if
  261.   # it is refreshed in every frame, but in case you notice an FPS drop, you can
  262.   # try to set this to higher values.
  263.   # 1 means that the cooldown masks will be refreshed in every frame.
  264.   # 2 means that it will be refreshed after every 2nd frame, and so on.
  265.   # Note that if you set this to any value other than 1, your cooldown mask
  266.   # display might not be accurate!
  267.   #-----------------------------------------------------------------------------
  268.   CoolRefreshRate = 1
  269.  
  270.   #-----------------------------------------------------------------------------
  271.   # Map Toolbar Settings:
  272.   #-----------------------------------------------------------------------------
  273.   # This is the placce to set up the position of everything in the toolbar.
  274.   # This setting affects the map toolbar only!
  275.   # ----------
  276.   # :icon = Position settings for the tool icons.
  277.   # :cool = Position settings for the cooldown masks.
  278.   # :ammo = Position settings for the ammo/cost display.
  279.   # :letter = Position settings for the button letters.
  280.   # ----------
  281.   # :weapon = Settings for the weapon tool.
  282.   # :armor = Settings for the armor tool.
  283.   # :item1 = Settings for the 1st item tool.
  284.   # :item2 = Settings for the 2nd item tool.
  285.   # :skill1 = Settings for the 1st skill tool.
  286.   # :skill2 = Settings for the 2nd skill tool.
  287.   # :skill3 = Settings for the 3rd skill tool.
  288.   # :skill4 = Settings for the 4th skill tool.
  289.   # :toggle = Settings for the follower toggle icon.
  290.   # ----------
  291.   # :pos = Position settings. Format: :pos => [x,y],
  292.   # :size = Size settings. Format: :size => [width,height],
  293.   # :align = Alignment settings. 0 = Left, 1 = Middle, 2 = Right.
  294.   # ----------
  295.   # If you don't want to show a tool, simply comment out it's line, just like
  296.   # I did with the 3rd and 4th tool, and with the follower toggle icon.
  297.   #-----------------------------------------------------------------------------
  298.   MapSettings = {
  299.     :icon => {
  300.       :weapon => {:pos => [1,15]},
  301.       :armor =>  {:pos => [1,56]},
  302.       :item1 =>  {:pos => [1,97]},
  303.       :item2 =>  {:pos => [1,126]},
  304.       :skill1 => {:pos => [1,167]},
  305.       :skill2 => {:pos => [1,196]},
  306.      # :skill3 => {:pos => [1,196]},
  307.      # :skill4 => {:pos => [1,196]},
  308.      # :toggle => {:pos => [1,196]},
  309.     },
  310.     :cool => {
  311.       :weapon => {:pos => [17,27], :size => [24,24]},
  312.       :armor =>  {:pos => [17,68], :size => [24,24]},
  313.       :item1 =>  {:pos => [17,109], :size => [24,24]},
  314.       :item2 =>  {:pos => [17,138], :size => [24,24]},
  315.       :skill1 => {:pos => [17,179], :size => [24,24]},
  316.       :skill2 => {:pos => [17,208], :size => [24,24]},
  317.      # :skill3 => {:pos => [17,208], :size => [24,24]},
  318.      # :skill4 => {:pos => [17,208], :size => [24,24]},
  319.      # :toggle => {:pos => [17,208], :size => [24,24]},
  320.     },
  321.     :ammo => {
  322.       :weapon => {:pos => [37,17], :size => [32,32], :align => 1},
  323.       :armor =>  {:pos => [37,58], :size => [32,32], :align => 1},
  324.       :item1 =>  {:pos => [37,99], :size => [32,32], :align => 1},
  325.       :item2 =>  {:pos => [37,128], :size => [32,32], :align => 1},
  326.       :skill1 => {:pos => [37,169], :size => [32,32], :align => 1},
  327.       :skill2 => {:pos => [37,198], :size => [32,32], :align => 1},
  328.      # :skill3 => {:pos => [37,198], :size => [32,32], :align => 1},
  329.      # :skill4 => {:pos => [37,198], :size => [32,32], :align => 1},
  330.      # :toggle => {:pos => [37,198], :size => [32,32], :align => 1},
  331.     },
  332.     :letter => {
  333.       :weapon => {:pos => [17,27], :size => [24,24], :align => 1},
  334.       :armor =>  {:pos => [17,68], :size => [24,24], :align => 1},
  335.       :item1 =>  {:pos => [17,109], :size => [24,24], :align => 1},
  336.       :item2 =>  {:pos => [17,138], :size => [24,24], :align => 1},
  337.       :skill1 => {:pos => [17,179], :size => [24,24], :align => 1},
  338.       :skill2 => {:pos => [17,208], :size => [24,24], :align => 1},
  339.      # :skill3 => {:pos => [17,208], :size => [24,24], :align => 1},
  340.      # :skill4 => {:pos => [17,208], :size => [24,24], :align => 1},
  341.      # :toggle => {:pos => [17,208], :size => [24,24], :align => 1},
  342.     },
  343.   }
  344.  
  345.   #-----------------------------------------------------------------------------
  346.   # Quick Tool Selection Menu Toolbar Settings:
  347.   #-----------------------------------------------------------------------------
  348.   # Same as the map toolbar settings above, but this will only affect the
  349.   # quick tool selection menu made by Falcao!
  350.   # Uses the same format too, so I won't write down the details here again. :P
  351.   #-----------------------------------------------------------------------------
  352.   ToolMenuSettings = {
  353.     :icon => {
  354.       :weapon => {:pos => [1,15]},
  355.       :armor =>  {:pos => [1,56]},
  356.       :item1 =>  {:pos => [1,97]},
  357.       :item2 =>  {:pos => [1,126]},
  358.       :skill1 => {:pos => [1,167]},
  359.       :skill2 => {:pos => [1,196]},
  360.      # :skill3 => {:pos => [1,196]},
  361.      # :skill4 => {:pos => [1,196]},
  362.      # :toggle => {:pos => [1,196]},
  363.     },
  364.     :cool => {
  365.       :weapon => {:pos => [17,27], :size => [24,24]},
  366.       :armor =>  {:pos => [17,68], :size => [24,24]},
  367.       :item1 =>  {:pos => [17,109], :size => [24,24]},
  368.       :item2 =>  {:pos => [17,138], :size => [24,24]},
  369.       :skill1 => {:pos => [17,179], :size => [24,24]},
  370.       :skill2 => {:pos => [17,208], :size => [24,24]},
  371.      # :skill3 => {:pos => [17,208], :size => [24,24]},
  372.      # :skill4 => {:pos => [17,208], :size => [24,24]},
  373.      # :toggle => {:pos => [17,208], :size => [24,24]},
  374.     },
  375.     :ammo => {
  376.       :weapon => {:pos => [37,17], :size => [32,32], :align => 1},
  377.       :armor =>  {:pos => [37,58], :size => [32,32], :align => 1},
  378.       :item1 =>  {:pos => [37,99], :size => [32,32], :align => 1},
  379.       :item2 =>  {:pos => [37,128], :size => [32,32], :align => 1},
  380.       :skill1 => {:pos => [37,169], :size => [32,32], :align => 1},
  381.       :skill2 => {:pos => [37,198], :size => [32,32], :align => 1},
  382.      # :skill3 => {:pos => [37,198], :size => [32,32], :align => 1},
  383.      # :skill4 => {:pos => [37,198], :size => [32,32], :align => 1},
  384.      # :toggle => {:pos => [37,198], :size => [32,32], :align => 1},
  385.     },
  386.     :letter => {
  387.       :weapon => {:pos => [17,27], :size => [24,24], :align => 1},
  388.       :armor =>  {:pos => [17,68], :size => [24,24], :align => 1},
  389.       :item1 =>  {:pos => [17,109], :size => [24,24], :align => 1},
  390.       :item2 =>  {:pos => [17,138], :size => [24,24], :align => 1},
  391.       :skill1 => {:pos => [17,179], :size => [24,24], :align => 1},
  392.       :skill2 => {:pos => [17,208], :size => [24,24], :align => 1},
  393.      # :skill3 => {:pos => [17,208], :size => [24,24], :align => 1},
  394.      # :skill4 => {:pos => [17,208], :size => [24,24], :align => 1},
  395.      # :toggle => {:pos => [17,208], :size => [24,24], :align => 1},
  396.     },
  397.   }
  398.  
  399.   #-----------------------------------------------------------------------------
  400.   # Character Selection Menu Toolbar Settings:
  401.   #-----------------------------------------------------------------------------
  402.   # Same as the map toolbar settings above, but this will only affect the
  403.   # character selection menu made by Falcao!
  404.   # Uses the same format too, so I won't write down the details here again. :P
  405.   #-----------------------------------------------------------------------------
  406.   CharMenuSettings = {
  407.     :icon => {
  408.       :weapon => {:pos => [1,15]},
  409.       :armor =>  {:pos => [1,56]},
  410.       :item1 =>  {:pos => [1,97]},
  411.       :item2 =>  {:pos => [1,126]},
  412.       :skill1 => {:pos => [1,167]},
  413.       :skill2 => {:pos => [1,196]},
  414.      # :skill3 => {:pos => [1,196]},
  415.      # :skill4 => {:pos => [1,196]},
  416.      # :toggle => {:pos => [1,196]},
  417.     },
  418.     :cool => {
  419.       :weapon => {:pos => [17,27], :size => [24,24]},
  420.       :armor =>  {:pos => [17,68], :size => [24,24]},
  421.       :item1 =>  {:pos => [17,109], :size => [24,24]},
  422.       :item2 =>  {:pos => [17,138], :size => [24,24]},
  423.       :skill1 => {:pos => [17,179], :size => [24,24]},
  424.       :skill2 => {:pos => [17,208], :size => [24,24]},
  425.      # :skill3 => {:pos => [17,208], :size => [24,24]},
  426.      # :skill4 => {:pos => [17,208], :size => [24,24]},
  427.      # :toggle => {:pos => [17,208], :size => [24,24]},
  428.     },
  429.     :ammo => {
  430.       :weapon => {:pos => [37,17], :size => [32,32], :align => 1},
  431.       :armor =>  {:pos => [37,58], :size => [32,32], :align => 1},
  432.       :item1 =>  {:pos => [37,99], :size => [32,32], :align => 1},
  433.       :item2 =>  {:pos => [37,128], :size => [32,32], :align => 1},
  434.       :skill1 => {:pos => [37,169], :size => [32,32], :align => 1},
  435.       :skill2 => {:pos => [37,198], :size => [32,32], :align => 1},
  436.      # :skill3 => {:pos => [37,198], :size => [32,32], :align => 1},
  437.      # :skill4 => {:pos => [37,198], :size => [32,32], :align => 1},
  438.      # :toggle => {:pos => [37,198], :size => [32,32], :align => 1},
  439.     },
  440.     :letter => {
  441.       :weapon => {:pos => [17,27], :size => [24,24], :align => 1},
  442.       :armor =>  {:pos => [17,68], :size => [24,24], :align => 1},
  443.       :item1 =>  {:pos => [17,109], :size => [24,24], :align => 1},
  444.       :item2 =>  {:pos => [17,138], :size => [24,24], :align => 1},
  445.       :skill1 => {:pos => [17,179], :size => [24,24], :align => 1},
  446.       :skill2 => {:pos => [17,208], :size => [24,24], :align => 1},
  447.      # :skill3 => {:pos => [17,208], :size => [24,24], :align => 1},
  448.      # :skill4 => {:pos => [17,208], :size => [24,24], :align => 1},
  449.      # :toggle => {:pos => [17,208], :size => [24,24], :align => 1},
  450.     },
  451.   }
  452.      
  453. end
  454. #===============================================================================
  455. # End of settings! O.o
  456. #===============================================================================
  457.  
  458. module PxColl
  459.  
  460.   def self.check_coll(sp1,sp2)
  461.     if !sp1.nil? && !sp1.disposed? && !sp2.nil? && !sp2.disposed? &&
  462.        sp2.pixel_collide?(sp1)
  463.       return true
  464.     end
  465.     return false
  466.   end
  467.  
  468. end
  469.  
  470. class Game_Battler < Game_BattlerBase
  471.    
  472.   attr_accessor :msc, :mic, :mac, :mwc
  473.  
  474.   alias add_maxi_vals2221 initialize
  475.   def initialize
  476.     @msc = {}; @mic = {}; @mwc = {}; @mac = {}
  477.     add_maxi_vals2221
  478.   end
  479.  
  480.   unless $imported["SixthABSStatAddon"]
  481.     alias add_max_cools8874 apply_cooldown
  482.     def apply_cooldown(item, value)    
  483.       @msc[item.id] = value if item.is_a?(RPG::Skill)
  484.       @mic[item.id] = value if item.is_a?(RPG::Item)
  485.       @mwc[item.id] = value if item.is_a?(RPG::Weapon)
  486.       @mac[item.id] = value if item.is_a?(RPG::Armor)
  487.       add_max_cools8874(item, value)
  488.     end
  489.   end
  490.  
  491. end
  492.  
  493. class Game_Actor < Game_Battler
  494.  
  495.   alias change_usability6642 setup
  496.   def setup(actor_id)
  497.     change_usability6642(actor_id)
  498.     @usability = { # Rewritten variable.
  499.       :weapon => nil, :armor => nil, :item1 => nil, :item2 => nil,
  500.       :skill1 => nil, :skill2 => nil, :skill3 => nil, :skill4 => nil,
  501.     }
  502.   end
  503.    
  504.   # Rewritten.
  505.   def apply_usability
  506.     apply_usabilityto_melee(:weapon)
  507.     apply_usabilityto_melee(:armor)
  508.     @usability[:item1] = usable?(@assigned_item) if !@assigned_item.nil?
  509.     @usability[:item2] = usable?(@assigned_item2) if !@assigned_item2.nil?
  510.     @usability[:skill1] = usable?(@assigned_skill) if !@assigned_skill.nil?
  511.     @usability[:skill2] = usable?(@assigned_skill2) if !@assigned_skill2.nil?
  512.     @usability[:skill3] = usable?(@assigned_skill3) if !@assigned_skill3.nil?
  513.     @usability[:skill4] = usable?(@assigned_skill4) if !@assigned_skill4.nil?
  514.   end
  515.  
  516.   # Rewritten.
  517.   def apply_usabilityto_melee(type)
  518.     index = type == :weapon ? 0 : 1
  519.     if !equips[index].nil?
  520.       invoke = equips[index].tool_data("Tool Invoke Skill = ")
  521.       if invoke != nil and invoke != 0 and index == 0
  522.         @usability[type] = usable?($data_skills[invoke])
  523.       elsif index == 0
  524.         @usability[type] = usable?($data_skills[1])
  525.       end
  526.       if invoke != nil and invoke != 0 and index == 1
  527.         @usability[type] = usable?($data_skills[invoke])
  528.       elsif index == 1
  529.         @usability[type] = usable?($data_skills[2])
  530.       end
  531.     end
  532.   end
  533.  
  534. end
  535.  
  536. class Scene_Map < Scene_Base
  537.    
  538.   alias fix_crash8861 get_event_spriteset
  539.   def get_event_spriteset(evt_id)
  540.     return nil if @spriteset.nil?
  541.     fix_crash8861(evt_id)
  542.   end
  543.  
  544.   alias fix_crash8864 get_picture_spriteset
  545.   def get_picture_spriteset(pic_id)    
  546.     return nil if @spriteset.nil?
  547.     fix_crash8864(pic_id)
  548.   end
  549.  
  550. end
  551.  
  552. class Sprite_PearlTool < Sprite
  553.      
  554.   # Rewritten.
  555.   def initialize(view, custom_pos=nil)
  556.     super(view)
  557.     @actor = $game_player.actor
  558.     @actor.apply_usability
  559.     @old_usability = {}
  560.     @layout = ::Sprite.new(view)
  561.     if SceneManager.scene_is?(Scene_Map)
  562.       @bartype = :map
  563.       @info = MapSettings
  564.     elsif SceneManager.scene_is?(Scene_QuickTool)
  565.       @bartype = :toolmenu
  566.       @info = ToolMenuSettings
  567.     elsif SceneManager.scene_is?(Scene_CharacterSet)
  568.       @bartype = :charmenu
  569.       @info = CharMenuSettings
  570.     #elsif SceneManager.scene_is?(ABSScene)
  571.     #  @bartype = :sixthmenu
  572.     #  @info = SixthMenuSettings
  573.     end
  574.     @layout.bitmap = Cache.picture(LayoutImg[@bartype])
  575.     @layout.x = Position[@bartype][0]
  576.     @layout.y = Position[@bartype][1]
  577.     @priority = Priority[@bartype]
  578.     @info[:icon].each_key do |key|
  579.       next if key == :toggle
  580.       @old_usability[key] = @actor.usability[key]
  581.     end
  582.     @icons = ::Sprite.new(view)
  583.     @icons.bitmap = Bitmap.new(@layout.bitmap.width, @layout.bitmap.height)
  584.     self.bitmap = Bitmap.new(@layout.bitmap.width+32, @layout.bitmap.height+32)
  585.     self.bitmap.font.size = Fonts[:ammo][:size]
  586.     self.bitmap.font.name = Fonts[:ammo][:type]
  587.     self.bitmap.font.bold = Fonts[:ammo][:bold]
  588.     @icons.x = @layout.x
  589.     @icons.y = @layout.y
  590.     self.x = @layout.x - 16
  591.     self.y = @layout.y - 12
  592.     @framer = 0
  593.     @cool_img = Sprite.new(view)
  594.     @cool_img.bitmap = Bitmap.new(@layout.bitmap.width+32, @layout.bitmap.height+32)
  595.     @cool_img.x = @layout.x - 16
  596.     @cool_img.y = @layout.y - 12
  597.     if EnableSettings[:letters] == true
  598.       @info_keys = ::Sprite.new(view)
  599.       @info_keys.bitmap = Bitmap.new(self.bitmap.width, self.bitmap.height)
  600.       @info_keys.x = self.x; @info_keys.y = self.y; @info_keys.z = self.z
  601.       @info_keys.bitmap.font.name = Fonts[:letters][:type]
  602.       @info_keys.bitmap.font.size = Fonts[:letters][:size]
  603.       @info_keys.bitmap.font.bold = Fonts[:letters][:bold]
  604.       @info_keys.bitmap.font.color = Fonts[:letters][:color]
  605.       draw_key_info
  606.     end
  607.     set_z_priority
  608.     @cools = {}
  609.     [:weapop,:armor,:item1,:item2,:skill1,:skill2,:skill3,:skill4].each {|type|
  610.       @cools[type] = -1
  611.     }
  612.     refresh_icons
  613.     refresh_texts(true)
  614.     @view = view
  615.     @on_map = SceneManager.scene_is?(Scene_Map)
  616.     @mouse_exist = defined?(Map_Buttons).is_a?(String)
  617.     @mouse_exist = false if @mouse_exist && !SceneManager.scene_is?(Scene_Map)
  618.     update
  619.   end
  620.  
  621.   def set_z_priority
  622.     @layout.z = @priority[:back]
  623.     self.z = @priority[:ammo]
  624.     @icons.z = @priority[:icons]
  625.     @info_keys.z = @priority[:letters] if @info_keys
  626.     @cool_img.z = @priority[:cool]
  627.   end
  628.      
  629.   def get_letter(*path)
  630.     buttons = System.nest($system,*path)
  631.     return "" if buttons.nil?
  632.     key = buttons.find {|ky| !ky.nil? }
  633.     return key ? ConfigScene::Keys[key][:name] : ConfigScene::Keys[:empty][:name]
  634.   end
  635.  
  636.   def get_icon(*path)
  637.     buttons = System.nest($system,*path)
  638.     return 0 if buttons.nil?
  639.     key = buttons.find {|ky| !ky.nil? }
  640.     return key ? ConfigScene::Keys[key][:icon] : ConfigScene::Keys[:empty][:icon]
  641.   end
  642.  
  643.   def get_img(*path)
  644.     buttons = System.nest($system,*path)
  645.     return "" if buttons.nil?
  646.     key = buttons.find {|ky| !ky.nil? }
  647.     return key ? ConfigScene::Keys[key][:img] : ConfigScene::Keys[:empty][:img]
  648.   end
  649.  
  650.   def draw_key_letters
  651.     letters = {
  652.       :weapon => get_letter(:p1,:l_hand), :armor => get_letter(:p1,:r_hand),
  653.       :item1 => get_letter(:p1,:item_1), :item2 => get_letter(:p1,:item_2),
  654.       :skill1 => get_letter(:p1,:skill_1), :skill2 => get_letter(:p1,:skill_2),
  655.       :skill3 => get_letter(:p1,:skill_3), :skill4 => get_letter(:p1,:skill_4),
  656.       :toggle => get_letter(:p1,:follower),
  657.     }
  658.     @info[:letter].each do |key,info|
  659.       next if letters[key].nil?
  660.       xx = info[:pos][0]; yy = info[:pos][1]; w = info[:size][0]; h = info[:size][1]
  661.       @info_keys.bitmap.draw_text(xx,yy,w,h,letters[key],info[:align])
  662.     end
  663.   end
  664.  
  665.   def draw_key_icons
  666.     letters = {
  667.       :weapon => get_icon(:p1,:l_hand), :armor => get_icon(:p1,:r_hand),
  668.       :item1 => get_icon(:p1,:item_1), :item2 => get_icon(:p1,:item_2),
  669.       :skill1 => get_icon(:p1,:skill_1), :skill2 => get_icon(:p1,:skill_2),
  670.       :skill3 => get_icon(:p1,:skill_3), :skill4 => get_icon(:p1,:skill_4),
  671.       :toggle => get_icon(:p1,:follower),
  672.     }
  673.     @info[:letter].each do |key,info|
  674.       next if letters[key].nil?
  675.       xx = info[:pos][0]; yy = info[:pos][1]; w = info[:size][0]; h = info[:size][1]
  676.       draw_icon(letters[key], xx, yy, true, @info_keys.bitmap)
  677.     end
  678.   end
  679.  
  680.   def draw_key_imgs
  681.     letters = {
  682.       :weapon => get_img(:p1,:l_hand), :armor => get_img(:p1,:r_hand),
  683.       :item1 => get_img(:p1,:item_1), :item2 => get_img(:p1,:item_2),
  684.       :skill1 => get_img(:p1,:skill_1), :skill2 => get_img(:p1,:skill_2),
  685.       :skill3 => get_img(:p1,:skill_3), :skill4 => get_img(:p1,:skill_4),
  686.       :toggle => get_img(:p1,:follower),
  687.     }
  688.     @info[:letter].each do |key,info|
  689.       next if letters[key].nil?
  690.       xx = info[:pos][0]; yy = info[:pos][1]; w = info[:size][0]; h = info[:size][1]
  691.       draw_img(letters[key],xx,yy,@info_keys.bitmap)
  692.     end
  693.   end
  694.  
  695.   def draw_original_info
  696.     letters = {
  697.       :weapon => Key::Weapon[1], :armor => Key::Armor[1],
  698.       :item1 => Key::Item[1], :item2 => Key::Item2[1],
  699.       :skill1 => Key::Skill[1], :skill2 => Key::Skill2[1],
  700.       :skill3 => Key::Skill3[1], :skill4 => Key::Skill4[1],
  701.       :toggle => Key::Follower[1],
  702.     }
  703.     @info[:letter].each do |key,info|
  704.       next if letters[key].nil?
  705.       xx = info[:pos][0]; yy = info[:pos][1]; w = info[:size][0]; h = info[:size][1]
  706.       @info_keys.bitmap.draw_text(xx,yy,w,h,letters[key],info[:align])
  707.     end
  708.   end
  709.  
  710.   # Rewritten.
  711.   def draw_key_info
  712.     if $imported["SixthControlConfigMenu"]
  713.       case LetterTypes[@bartype]
  714.       when :name; draw_key_letters
  715.       when :icon; draw_key_icons
  716.       when :img;  draw_key_imgs
  717.       end
  718.     else
  719.       draw_original_info
  720.     end
  721.   end
  722.  
  723.   # Rewritten.
  724.   def draw_icon(icon_index, x, y, enabled = true, bmp = nil)
  725.     bmp = @icons.bitmap if bmp.nil?
  726.     bit = Cache.system("Iconset")
  727.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  728.     bmp.blt(x, y, bit, rect, enabled ? 255 : 150)
  729.   end
  730.  
  731.   def draw_img(iname,x,y,bmp)
  732.     img = Cache.custom_imgs(iname,System::ImgFolder)
  733.     rect = Rect.new(0,0,img.width,img.height)
  734.     bmp.blt(x,y,img,rect,255)
  735.   end
  736.  
  737.   # Rewritten.
  738.   def refresh_texts(force=false)
  739.     refresh_cooldown if @on_map || force
  740.     refresh_ammo
  741.   end
  742.    
  743.   # Refresh toolbar icons - rewritten.
  744.   def refresh_icons
  745.     @icons.bitmap.clear    
  746.     icon = {
  747.       :weapon => @actor.equips[0], :armor => @actor.equips[1],
  748.       :item1 => @actor.assigned_item, :item2 => @actor.assigned_item2,
  749.       :skill1 => @actor.assigned_skill, :skill2 => @actor.assigned_skill2,
  750.       :skill3 => @actor.assigned_skill3, :skill4 => @actor.assigned_skill4,
  751.       :toggle => ToggleIcon,
  752.     }
  753.     @info[:icon].each do |key,info|
  754.       next if icon[key].nil?
  755.       xx = info[:pos][0]; yy = info[:pos][1]
  756.       case icon[key]
  757.       when RPG::Item, RPG::Skill
  758.         draw_icon(icon[key].icon_index, xx, yy, true)
  759.       when RPG::Weapon
  760.         enable = @actor.usability[0] ; enable = true if enable.nil?
  761.         draw_icon(icon[key].icon_index, xx, yy, true)
  762.       when RPG::Armor
  763.         enable = @actor.usability[1] ; enable = true if enable.nil?
  764.         draw_icon(icon[key].icon_index, xx, yy, true)
  765.       when Fixnum
  766.         draw_icon(icon[key], xx, yy)
  767.       end
  768.     end    
  769.     @now_equip = [@actor.equips[0], @actor.equips[1], @actor.assigned_item,
  770.     @actor.assigned_item2, @actor.assigned_skill, @actor.assigned_skill2,
  771.     @actor.assigned_skill3, @actor.assigned_skill4]
  772.   end
  773.    
  774.   # fade effect when player is behind the toolbar - rewritten.
  775.   # Added tool bar hide switch.
  776.   def update_fade_effect
  777.     if SceneManager.scene_is?(Scene_Map)
  778.       if ToolBarSwitch == 0 || $game_switches[ToolBarSwitch]
  779.         if self.visible == false
  780.           @layout.visible = @icons.visible = self.visible = true
  781.           @info_keys.visible = true if EnableSettings[:letters] == true
  782.         end
  783.       else
  784.         if self.visible == true
  785.           @layout.visible = @icons.visible = self.visible = false
  786.           @info_keys.visible = false if EnableSettings[:letters] == true
  787.         end
  788.       end
  789.     end
  790.     if behind_toolbar?
  791.       if self.opacity >= 60
  792.         self.opacity -= 10
  793.         @layout.opacity = @icons.opacity = self.opacity
  794.         @info_keys.opacity = self.opacity if EnableSettings[:letters] == true
  795.       end
  796.     elsif self.opacity != 255
  797.       self.opacity += 10
  798.       @layout.opacity = @icons.opacity = self.opacity
  799.       @info_keys.opacity = self.opacity if EnableSettings[:letters] == true
  800.     end
  801.   end
  802.    
  803.   # Rewritten check, it's pixel collison based now.
  804.   # Uses Cidiomar's Perfect Pixel Collision System.
  805.   def behind_toolbar?
  806.     return false unless @on_map
  807.     if SceneManager.scene_is?(Scene_Map)
  808.       pl_sprite = SceneManager.scene.get_event_spriteset(0)
  809.       return true if PxColl.check_coll(pl_sprite,@layout)
  810.     end
  811.     return false
  812.   end
  813.  
  814.   # refresh the icons when the usability change - rewritten.
  815.   def update_usability_enable
  816.     @info[:icon].each_key do |key|
  817.       next if key == :toggle
  818.       refresh_icons if @old_usability[key] != @actor.usability[key]
  819.     end
  820.   end
  821.  
  822.   # ammunition engine - rewritten.
  823.   def ammo_ready?(item)
  824.     return false if item.nil?
  825.     return true if item.has_data.nil? && item.is_a?(RPG::Item) &&
  826.     item.consumable
  827.     return true if item.is_a?(RPG::Skill)
  828.     return false if flagged(item, 2).nil?
  829.     return true  if flagged(item, 2) != 0
  830.     return false
  831.   end
  832.  
  833.   # get item cost - rewritten
  834.   def itemcost(item)
  835.     return 0 if item.nil?
  836.     if item.is_a?(RPG::Item) && item.consumable && item.itemcost == 0
  837.       return $game_party.item_number(item)
  838.     end
  839.     if item.is_a?(RPG::Skill)
  840.       if @actor.skill_tp_cost(item) > 0
  841.         return @actor.skill_tp_cost(item)
  842.       elsif @actor.skill_mp_cost(item) > 0
  843.         return @actor.skill_mp_cost(item)
  844.       end
  845.     end
  846.     return $game_party.item_number($data_items[item.itemcost]) if item.itemcost != 0
  847.     return 0
  848.   end
  849.  
  850.   # Ammo refresher - rewritten.
  851.   def refresh_ammo
  852.     if @wnumber != itemcost(@actor.equips[0])
  853.       @wnumber = itemcost(@actor.equips[0])
  854.       draw_em_ammo(:weapon,@wnumber,@actor.equips[0])
  855.     end
  856.     if @anumber != itemcost(@actor.equips[1])
  857.       @anumber = itemcost(@actor.equips[1])
  858.       draw_em_ammo(:armor,@anumber,@actor.equips[1])
  859.     end
  860.     if @inumber != itemcost(@actor.assigned_item)
  861.       @inumber = itemcost(@actor.assigned_item)
  862.       draw_em_ammo(:item1,@inumber,@actor.assigned_item)
  863.     end
  864.     if @inumber2 != itemcost(@actor.assigned_item2)
  865.       @inumber2 = itemcost(@actor.assigned_item2)
  866.       draw_em_ammo(:item2,@inumber2,@actor.assigned_item2)
  867.     end
  868.     if @snumber != itemcost(@actor.assigned_skill)
  869.       @snumber = itemcost(@actor.assigned_skill)
  870.       draw_em_ammo(:skill1,@snumber,@actor.assigned_skill)
  871.     end
  872.     if @snumber2 != itemcost(@actor.assigned_skill2)
  873.       @snumber2 = itemcost(@actor.assigned_skill2)
  874.       draw_em_ammo(:skill2,@snumber2,@actor.assigned_skill2)
  875.     end
  876.     if @snumber3 != itemcost(@actor.assigned_skill3)
  877.       @snumber3 = itemcost(@actor.assigned_skill3)
  878.       draw_em_ammo(:skill3,@snumber3,@actor.assigned_skill3)
  879.     end
  880.     if @snumber4 != itemcost(@actor.assigned_skill4)
  881.       @snumber4 = itemcost(@actor.assigned_skill4)
  882.       draw_em_ammo(:skill4,@snumber4,@actor.assigned_skill4)
  883.     end
  884.   end
  885.  
  886.   def draw_em_ammo(key,number,item)
  887.     return if @info[:ammo][key].nil?
  888.     case item
  889.     when RPG::Weapon, RPG::Armor, RPG::Item
  890.       self.bitmap.font.color = Fonts[:ammo][:color][:item]
  891.     when RPG::Skill
  892.       return if item.tp_cost == 0 && item.mp_cost == 0 && item.itemcost == 0
  893.       if item.tp_cost > 0
  894.         self.bitmap.font.color = Fonts[:ammo][:color][:tp]
  895.       elsif item.mp_cost > 0
  896.         self.bitmap.font.color = Fonts[:ammo][:color][:mp]
  897.       else
  898.         self.bitmap.font.color = Fonts[:ammo][:color][:item]
  899.       end
  900.     end
  901.     info = @info[:ammo][key]
  902.     xx = info[:pos][0]; yy = info[:pos][1]; w = info[:size][0]; h = info[:size][1]
  903.     self.bitmap.clear_rect(xx,yy,w,h)
  904.     self.bitmap.draw_text(xx, yy, w, h, number.to_s, info[:align]) if number > 0
  905.   end
  906.    
  907.   def get_max_cool(slot1,slot2=nil)
  908.     return nil if @actor.equips[slot1].nil?
  909.     if @actor.equips[slot1].is_a?(RPG::Weapon)
  910.       return @actor.mwc[@actor.equips[slot1].id]
  911.     elsif @actor.equips[slot1].is_a?(RPG::Armor)
  912.       return @actor.mac[@actor.equips[slot1].id]
  913.     end
  914.   end
  915.  
  916.   # Cooldown refresher - completely rewritten.
  917.   def refresh_cooldown
  918.     if !get_max_cool(0,1).nil?
  919.       wr = weapon_cooldown.to_f/get_max_cool(0,1)
  920.     else
  921.       wr = 0.0
  922.     end
  923.     if !get_max_cool(1,0).nil?
  924.       ar = armor_cooldown.to_f/get_max_cool(1,0)
  925.     else
  926.       ar = 0.0
  927.     end
  928.     if !@actor.assigned_item.nil? && !@actor.mic[@actor.assigned_item.id].nil?
  929.       ir = item_cooldown.to_f/@actor.mic[@actor.assigned_item.id]
  930.     else
  931.       ir = 0.0
  932.     end
  933.     if !@actor.assigned_item2.nil? && !@actor.mic[@actor.assigned_item2.id].nil?
  934.       ir2 = item_cooldown2.to_f/@actor.mic[@actor.assigned_item2.id]
  935.     else
  936.       ir2 = 0.0
  937.     end
  938.     if !@actor.assigned_skill.nil? && !@actor.msc[@actor.assigned_skill.id].nil?
  939.       sr = skill_cooldown.to_f/@actor.msc[@actor.assigned_skill.id]
  940.     else
  941.       sr = 0.0
  942.     end
  943.     if !@actor.assigned_skill2.nil? && !@actor.msc[@actor.assigned_skill2.id].nil?
  944.       sr2 = skill_cooldown2.to_f/@actor.msc[@actor.assigned_skill2.id]
  945.     else
  946.       sr2 = 0.0
  947.     end
  948.     if !@actor.assigned_skill3.nil? && !@actor.msc[@actor.assigned_skill3.id].nil?
  949.       sr3 = skill_cooldown3.to_f/@actor.msc[@actor.assigned_skill3.id]
  950.     else
  951.       sr3 = 0.0
  952.     end
  953.     if !@actor.assigned_skill4.nil? && !@actor.msc[@actor.assigned_skill4.id].nil?
  954.       sr4 = skill_cooldown4.to_f/@actor.msc[@actor.assigned_skill4.id]
  955.     else
  956.       sr4 = 0.0
  957.     end
  958.     c1 = CoolDisplay[:f1]; c2 = CoolDisplay[:f2]
  959.     if CoolDisplay[:useimg] == true
  960.       draw_em_gauge_pic(:weapon,wr) if @cools[:weapon] != wr
  961.       draw_em_gauge_pic(:armor,ar) if @cools[:armor] != ar
  962.       draw_em_gauge_pic(:item1,ir) if @cools[:item1] != ir
  963.       draw_em_gauge_pic(:item2,ir2) if @cools[:item2] != ir2
  964.       draw_em_gauge_pic(:skill1,sr) if @cools[:skill1] != sr
  965.       draw_em_gauge_pic(:skill2,sr2) if @cools[:skill2] != sr2
  966.       draw_em_gauge_pic(:skill3,sr3) if @cools[:skill3] != sr3
  967.       draw_em_gauge_pic(:skill4,sr4) if @cools[:skill4] != sr4
  968.     else
  969.       draw_em_gauge(:weapon,wr,c1,c2) if @cools[:weapon] != wr
  970.       draw_em_gauge(:armor,ar,c1,c2) if @cools[:armor] != ar
  971.       draw_em_gauge(:item1,ir,c1,c2) if @cools[:item1] != ir
  972.       draw_em_gauge(:item2,ir2,c1,c2) if @cools[:item2] != ir2
  973.       draw_em_gauge(:skill1,sr,c1,c2) if @cools[:skill1] != sr
  974.       draw_em_gauge(:skill2,sr2,c1,c2) if @cools[:skill2] != sr2
  975.       draw_em_gauge(:skill3,sr3,c1,c2) if @cools[:skill3] != sr3
  976.       draw_em_gauge(:skill4,sr4,c1,c2) if @cools[:skill4] != sr4
  977.     end
  978.   end
  979.  
  980.   def draw_em_gauge(key,rate,c1,c2)
  981.     @cools[key] = rate
  982.     return if @info[:cool][key].nil?
  983.     xx = @info[:cool][key][:pos][0]
  984.     yy = @info[:cool][key][:pos][1]
  985.     w = @info[:cool][key][:size][0]
  986.     h = @info[:cool][key][:size][1]
  987.     fill_h = (h * rate).to_i
  988.     @cool_img.bitmap.clear_rect(xx,yy,w,h)
  989.     @cool_img.bitmap.gradient_fill_rect(xx, yy, w, fill_h, c2, c1, true)
  990.   end
  991.  
  992.   def draw_em_gauge_pic(key,rate)
  993.     @cools[key] = rate
  994.     return if @info[:cool][key].nil?
  995.     xx = @info[:cool][key][:pos][0]
  996.     yy = @info[:cool][key][:pos][1]
  997.     pic = Cache.picture(CoolDisplay[:coolimg])
  998.     fill_h = (pic.height * rate).to_i
  999.     grect = Rect.new(0,0,pic.width,fill_h)
  1000.     @cool_img.bitmap.clear_rect(xx,yy,pic.width,pic.height)
  1001.     @cool_img.bitmap.blt(xx,yy,pic,grect,CoolDisplay[:coolopa])
  1002.   end
  1003.  
  1004.   def update_cooldown
  1005.     if @on_map and @actor != $game_player.actor
  1006.       @actor = $game_player.actor
  1007.       refresh_icons
  1008.       refresh_texts
  1009.     end
  1010.     if $game_player.refresh_skillbar > 0
  1011.       $game_player.refresh_skillbar -= 1
  1012.       if $game_player.refresh_skillbar == 0
  1013.         @actor.apply_usability
  1014.         refresh_icons
  1015.       end
  1016.     end
  1017.     # Rewrote cooldown update here.
  1018.     refresh_texts if Graphics.frame_count % CoolRefreshRate == 0
  1019.   end
  1020.  
  1021.   def dispose
  1022.     self.bitmap.dispose
  1023.     @cool_img.bitmap.dispose
  1024.     @cool_img.dispose
  1025.     @layout.bitmap.dispose
  1026.     @layout.dispose
  1027.     @icons.bitmap.dispose
  1028.     @icons.dispose
  1029.     # Dispose the letters only if they are enabled.
  1030.     if EnableSettings[:letters] == true
  1031.       @info_keys.bitmap.dispose
  1032.       @info_keys.dispose
  1033.     end
  1034.     super
  1035.   end
  1036.    
  1037. end
  1038. #==============================================================================
  1039. # !!END OF SCRIPT - OHH, NOES!!
  1040. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement