Advertisement
Dekita

Untitled

May 27th, 2014
1,175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.67 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - States :: Damage Over Time
  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[:DOTs]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 26/o5/2o14 - Started, Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # This script allows states to be given a portion of code to eval during the
  26. # 'refresh state turns' method.
  27. # What this means is, you can create various hp / mp / tp moddifying states.
  28. # You could also attach variables onto your state turns.
  29. # Obviously, as you can code the formula, this opens a whole range of
  30. # possibilities. Such as using various stats to determine the hp/mp loss.
  31. # Using element resistance to determine TP gain.
  32. # Using variables to determine the HP lost...
  33. # There are many uses for this kind of feature, so dont be scared to think
  34. # 'outside of the box'.
  35. #
  36. #===============================================================================
  37. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  38. #===============================================================================
  39. # 1. You MUST give credit to "Dekita" !!
  40. # 2. You are NOT allowed to repost this script.(or modified versions)
  41. # 3. You are NOT allowed to convert this script.
  42. # 4. You are NOT allowed to use this script for Commercial games.
  43. # 5. ENJOY!
  44. #
  45. # "FINE PRINT"
  46. # By using this script you hereby agree to the above terms and conditions,
  47. # if any violation of the above terms occurs "legal action" may be taken.
  48. # Not understanding the above terms and conditions does NOT mean that
  49. # they do not apply to you.
  50. # If you wish to discuss the terms and conditions in further detail you can
  51. # contact me at http://dekitarpg.wordpress.com/
  52. #
  53. #===============================================================================
  54. # ☆ Instructions
  55. #-------------------------------------------------------------------------------
  56. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  57. #
  58. #===============================================================================
  59. # ☆ Notetags ( For State Noteboxes )
  60. #-------------------------------------------------------------------------------
  61. # <dot: ID>
  62. # ID = the DoT_Data[ ID ] for this state.
  63. #
  64. #===============================================================================
  65. # ☆ HELP
  66. #-------------------------------------------------------------------------------
  67. #
  68. #===============================================================================
  69. module Deki_State_DoTs ; DoT_Data = [""] # << Keep
  70. #===============================================================================
  71. #-----------------------------------------------------------------------------
  72. #
  73. #-----------------------------------------------------------------------------
  74. NoTeTaG = /<dot:(.*)>/i
  75. #-----------------------------------------------------------------------------
  76. #
  77. #-----------------------------------------------------------------------------
  78. DoT_Data[1] = "self.hp -= ((self.atk/4)+(self.hp/10)+1).to_i"
  79. #-----------------------------------------------------------------------------
  80. DoT_Data[2] = "self.mp -= ((self.mat/4)+(self.mp/10)+1).to_i"
  81. #-----------------------------------------------------------------------------
  82. # Add Mote DoT_Data[ID] Here. Follow the same format as above.
  83. #-----------------------------------------------------------------------------
  84.  
  85. #-----------------------------------------------------------------------------
  86. #
  87. #-----------------------------------------------------------------------------
  88. #####################
  89. # CUSTOMISATION END #
  90. end #####################
  91. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  92. # #
  93. # http://dekitarpg.wordpress.com/ #
  94. # #
  95. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  96. #===============================================================================#
  97. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  98. # YES?\.\. #
  99. # OMG, REALLY? \| #
  100. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  101. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  102. #===============================================================================#
  103. module Deki_State_DoTs
  104. #===============================================================================
  105. #-----------------------------------------------------------------------------
  106. #
  107. #-----------------------------------------------------------------------------
  108. def self.set_dot(state)
  109. if state.note =~ Deki_State_DoTs::NoTeTaG
  110. return $1.to_i
  111. else
  112. return 0
  113. end
  114. end
  115. #-----------------------------------------------------------------------------
  116. #
  117. #-----------------------------------------------------------------------------
  118. end
  119. #===============================================================================
  120. class RPG::State < RPG::BaseItem
  121. #===============================================================================
  122. #-----------------------------------------------------------------------------
  123. #
  124. #-----------------------------------------------------------------------------
  125. def get_dot
  126. if @dot_eval.nil?
  127. @dot_eval = set_dot
  128. end
  129. @dot_eval
  130. end
  131. #-----------------------------------------------------------------------------
  132. #
  133. #-----------------------------------------------------------------------------
  134. def set_dot
  135. Deki_State_DoTs.set_dot(self)
  136. end
  137. #-----------------------------------------------------------------------------
  138. #
  139. #-----------------------------------------------------------------------------
  140. end
  141. #===============================================================================
  142. class Game_Battler < Game_BattlerBase
  143. #===============================================================================
  144. #-----------------------------------------------------------------------------
  145. #
  146. #-----------------------------------------------------------------------------
  147. alias :update_DOT_state_turns :update_state_turns
  148. #-----------------------------------------------------------------------------
  149. #
  150. #-----------------------------------------------------------------------------
  151. def update_state_turns
  152. update_DOT_state_turns
  153. perform_all_states_DOT
  154. end
  155. #-----------------------------------------------------------------------------
  156. #
  157. #-----------------------------------------------------------------------------
  158. def perform_all_states_DOT
  159. states.each do |state|
  160. perform_state_DoT(state)
  161. end
  162. end
  163. #-----------------------------------------------------------------------------
  164. # state = RPG:State.new || $data_states[id]
  165. #-----------------------------------------------------------------------------
  166. def perform_state_DoT(state)
  167. eval(Deki_State_DoTs::DoT_Data[state.get_dot]) rescue nil
  168. end
  169. #-----------------------------------------------------------------------------
  170. #
  171. #-----------------------------------------------------------------------------
  172. end
  173. #==============================================================================#
  174. # http://dekitarpg.wordpress.com/ #
  175. #==============================================================================#
  176. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement