vindaca510

V's Variable Battle Skills v0.1

Sep 10th, 2013
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.71 KB | None | 0 0
  1.  
  2.  
  3. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  4. #                                                                              #
  5. #                           V's Variable Battle Skills                         #
  6. #                                 Version  0.1                                 #
  7. #                                                                              #
  8. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  9. #                                Written By:  V                                #
  10. #                       Last Edited:  September 10, 2013                       #
  11. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  12. #                                                                              #
  13. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  14.  
  15.  
  16. #==============================================================================#
  17. #------------------------------------------------------------------------------#
  18. # ** Disclaimer                                                                #
  19. #------------------------------------------------------------------------------#
  20. #                                                                              #
  21. # This script was intended for Non-commercial use only, if you wish to use     #
  22. # this script in a commercial game please PM me at which ever site you found   #
  23. # this script. Either way please give me credit in your game script as the     #
  24. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  25. #                                                                              #
  26. #------------------------------------------------------------------------------#
  27. # ** How To Use                                                                #
  28. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  29. #                                                                              #
  30. # * This script is semi-plug-and-play.                                         #
  31. #                                                                              #
  32. # ============================================================================ #
  33. # * ALL ACTORS MUST HAVE THIS TAG OR YOU WILL GET AN ERROR!                    #
  34. # ============================================================================ #
  35. #                                                                              #
  36. #   Replace the words with the corresponding numbers                           #
  37. #                                                                              #
  38. #   <VBS: (Skill 1 Var), (Skill 1 Icon), (Skill 2 Var), (Skill 1 Icon)>        #
  39. #                                                                              #
  40. #   It should look something like this.                                        #
  41. #                                                                              #
  42. #   <VBS: 1, 22, 2, 23>                                                        #
  43. #                                                                              #
  44. #                                                                              #
  45. # ============================================================================ #
  46. # * ALL SKILLS MUST HAVE THIS TAG OR YOU WILL GET AN ERROR!                    #
  47. # ============================================================================ #
  48. #                                                                              #
  49. #   Replace the words with the corresponding numbers                           #
  50. #                                                                              #
  51. #   <VBS: (Var to deduct skills cost from)>                                    #
  52. #                                                                              #
  53. #   It should look something like this.                                        #
  54. #                                                                              #
  55. #   <VBS: 1>                                                                   #
  56. #                                                                              #
  57. #   ** The skills cost is set up to be equal to the mp or tp cost.             #
  58. #                                                                              #
  59. #------------------------------------------------------------------------------#
  60. # ** Description                                                               #
  61. #------------------------------------------------------------------------------#
  62. #                                                                              #
  63. #  v0.1                                                                        #
  64. # ~=~=~=~                                                                      #
  65. #                                                                              #
  66. # This script is an Add-On for The regular battle system to display variables  #
  67. # and icons instead of Mp and Tp.                                              #
  68. #                                                                              #
  69. #------------------------------------------------------------------------------#
  70. #==============================================================================#
  71.  
  72.  
  73. class Game_BattlerBase
  74.   def skill_mp_cost(skill)
  75.     skill.mp_cost
  76.   end
  77.   def skill_tp_cost(skill)
  78.     skill.tp_cost
  79.   end
  80.   def skill_cost_payable?(skill)
  81.     bd = /<VBS:\s*(\d*)>/i
  82.     note = $data_skills[skill.id].note.scan(bd) if $data_skills[skill.id].note.scan(bd) != nil
  83.     bv = $1.to_i
  84.     $game_variables[bv] >= skill_tp_cost(skill) && $game_variables[bv] >= skill_mp_cost(skill)
  85.   end
  86.   def pay_skill_cost(skill)
  87.     bd = /<VBS:\s*(\d*)>/i
  88.     note = $data_skills[skill.id].note.scan(bd) if $data_skills[skill.id].note.scan(bd) != nil
  89.     bv = $1.to_i
  90.     skill_mp_cost(skill) == 0 ? $game_variables[bv] -= skill_tp_cost(skill) : $game_variables[bv] -= skill_mp_cost(skill)
  91.   end
  92. end
  93. class Window_BattleStatus < Window_Selectable
  94.   def draw_gauge_area(rect, actor)
  95.      dvas(rect, actor)
  96.   end
  97.   def dvas(rect, actor)
  98.     bd = /<VBS:\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)>/i
  99.     note = $data_actors[actor.id].note.scan(bd) if $data_actors[actor.id].note.scan(bd) != nil
  100.     var = $1.to_i
  101.     icon_id = $2.to_i
  102.     vara = $3.to_i
  103.     icon_ida = $4.to_i
  104.     draw_actor_hp(actor, rect.x - 50, rect.y, 100)
  105.     draw_icon(icon_id, rect.x + 70, rect.y)
  106.     draw_text(rect.x - 275, rect.y - 45, self.width, self.height, $game_variables[var], 2)
  107.     draw_icon(icon_ida, rect.x + 150, rect.y)
  108.     draw_text(rect.x - 195, rect.y - 45, self.width, self.height, $game_variables[vara], 2)
  109.   end
  110. end
Advertisement
Add Comment
Please, Sign In to add comment