Advertisement
Dekita

$D13x - Damage Limits v1.1

May 30th, 2013
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.02 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Damage Limits
  5. # -- Author : Dekita
  6. # -- Version : 1.1
  7. # -- Level : Easy
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Damage_Limits]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 17/o5/2o13 - Small Update,
  21. # o4/o4/2o13 - Started, Finished,
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script modifys the apply_guard method to allow for each item or skill
  27. # to have a damage limit (can be different for each skill) as well as allowing
  28. # Actors / Classes / Equipment / Enemies / States / Skills to be given notetags
  29. # that allow for the damage limit to be broken.
  30. #
  31. # NOTE: You should place this script below ALL scripts that alias / overwrite
  32. # the apply_guard method within Game_Battler class.
  33. # Press " Ctrl + Shift + F " to find all instances of this method.
  34. #
  35. #===============================================================================
  36. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  37. #===============================================================================
  38. # 1. You MUST give credit to "Dekita" !!
  39. # 2. You are NOT allowed to repost this script.(or modified versions)
  40. # 3. You are NOT allowed to convert this script.
  41. # 4. You are NOT allowed to use this script for Commercial games.
  42. # 5. ENJOY!
  43. #
  44. # "FINE PRINT"
  45. # By using this script you hereby agree to the above terms and conditions,
  46. # if any violation of the above terms occurs "legal action" may be taken.
  47. # Not understanding the above terms and conditions does NOT mean that
  48. # they do not apply to you.
  49. # If you wish to discuss the terms and conditions in further detail you can
  50. # contact me at http://dekitarpg.wordpress.com/
  51. #
  52. #===============================================================================
  53. # ☆ Instructions
  54. #-------------------------------------------------------------------------------
  55. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  56. #
  57. #===============================================================================
  58. # ☆ Notetags ( default )
  59. #-------------------------------------------------------------------------------
  60. # <DLIM: VALUE>
  61. # For Skills / Items. Replace VALUE with that items damage limit.
  62. # ie. 9999
  63. #
  64. # <break damage>
  65. # For Skills (passive), Enemies, Actors, Classes, Weapons, Armors, States
  66. # if this notetag is used then an actor / enemy will be able to break all skills
  67. # damage limits.
  68. # ie, if an actor has a weapon that has <break damage> that actor will be able
  69. # to deal damage above the limit.
  70. #
  71. #===============================================================================
  72. module Damage_Limits
  73. #===============================================================================
  74.  
  75. # Default limit for all skills and items
  76. Default_Limit = 9999
  77.  
  78. Notetags=[ /<break damage>/i , /<DLIM:(.*)>/i ]
  79.  
  80. #####################
  81. # CUSTOMISATION END #
  82. end #####################
  83. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  84. # #
  85. # http://dekitarpg.wordpress.com/ #
  86. # #
  87. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  88. #===============================================================================#
  89. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  90. # YES?\.\. #
  91. # OMG, REALLY? \| #
  92. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  93. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  94. #===============================================================================#
  95. module DataManager
  96. #===============================================================================
  97.  
  98. #---------------------------------------------------------------------------
  99. # Alias List
  100. #---------------------------------------------------------------------------
  101. class << self
  102. alias :lbd_unique_damlim :load_database
  103. end
  104. #---------------------------------------------------------------------------
  105. # Load Database (alias)
  106. #---------------------------------------------------------------------------
  107. def self.load_database
  108. lbd_unique_damlim
  109. loa_unique_damlim
  110. end
  111. #---------------------------------------------------------------------------
  112. # Load Unique Shit
  113. #---------------------------------------------------------------------------
  114. def self.loa_unique_damlim
  115. classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
  116. $data_actors , $data_classes, $data_enemies, $data_states ]
  117. for g in classes
  118. for o in g
  119. next if o == nil
  120. o.load_unique_damlim
  121. end
  122. end
  123. end
  124.  
  125. end # DataManager
  126.  
  127. #===============================================================================
  128. class RPG::BaseItem
  129. #===============================================================================
  130. #---------------------------------------------------------------------------
  131. # Pi Variables
  132. #---------------------------------------------------------------------------
  133. attr_accessor :break_damlim
  134. attr_accessor :damage_limit
  135. #---------------------------------------------------------------------------
  136. # Load Unique Notes
  137. #---------------------------------------------------------------------------
  138. def load_unique_damlim
  139. @break_damlim = false
  140. @damage_limit = Damage_Limits::Default_Limit
  141. self.note.split(/[\r\n]+/).each do |line|
  142. case line
  143. when Damage_Limits::Notetags[0] then @break_damlim = true
  144. when Damage_Limits::Notetags[1] then @damage_limit = $1.to_i
  145. end
  146. end
  147. end
  148.  
  149. end
  150.  
  151. #===============================================================================
  152. class Game_Battler < Game_BattlerBase
  153. #===============================================================================
  154. #--------------------------------------------------------------------------
  155. # Alias List
  156. #--------------------------------------------------------------------------
  157. alias :_MDV__damlim :make_damage_value
  158. alias :_APG__damlim :apply_guard
  159. #--------------------------------------------------------------------------
  160. # M.D.V
  161. #--------------------------------------------------------------------------
  162. def make_damage_value(user, item)
  163. @damlim_user = user
  164. @damlim_item = item
  165. _MDV__damlim(user, item)
  166. end
  167. #--------------------------------------------------------------------------
  168. # Applying Guard Adjustment
  169. #--------------------------------------------------------------------------
  170. def apply_guard(damage)
  171. user = @damlim_user
  172. item = @damlim_item
  173. orig = _APG__damlim(damage)
  174. orig = apply_damlim(orig,damage,item,user)
  175. orig
  176. end
  177. #--------------------------------------------------------------------------
  178. # Apply Damage Limits.
  179. #--------------------------------------------------------------------------
  180. def apply_damlim(orig,damage,item,user)
  181. dam = orig
  182. if orig.to_i > item.damage_limit
  183. dam = item.damage_limit unless user.can_break_damage
  184. end
  185. return dam
  186. end
  187.  
  188. end
  189.  
  190. #===============================================================================
  191. class Game_Actor < Game_Battler
  192. #===============================================================================
  193. #--------------------------------------------------------------------------
  194. # Can Break Damage Limit ?
  195. #--------------------------------------------------------------------------
  196. def can_break_damage
  197. result = false
  198. result = true if actor.break_damlim
  199. result = true if self.class.break_damlim
  200. equips.each do |eq|
  201. next if eq == nil
  202. next unless eq.break_damlim
  203. result = true
  204. end
  205. states.each do |st|
  206. next if st == nil
  207. next unless st.break_damlim
  208. result = true
  209. end
  210. skills.each do |sk|
  211. next if sk == nil
  212. next unless sk.break_damlim
  213. result = true
  214. end
  215. return result
  216. end
  217.  
  218. end
  219.  
  220. #===============================================================================
  221. class Game_Enemy < Game_Battler
  222. #===============================================================================
  223. #--------------------------------------------------------------------------
  224. # Can Break Damage Limit ?
  225. #--------------------------------------------------------------------------
  226. def can_break_damage
  227. result = false
  228. result = true if enemy.break_damlim
  229. states.each do |sk|
  230. next if sk == nil
  231. next unless sk.break_damlim
  232. result = true
  233. end
  234. return result
  235. end
  236.  
  237. end
  238.  
  239. #==============================================================================#
  240. # http://dekitarpg.wordpress.com/ #
  241. #==============================================================================#
  242. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement