Advertisement
Dekita

$D13x - Damage Limits v1.0

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