bgillisp

Yanfly Lunatic States - Punishment - Edited to add new state

Jan 6th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.62 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Lunatic States Package - Punishment v1.01
  4. # -- Last Updated: 2011.12.15
  5. # -- Level: Lunatic
  6. # -- Requires: YEA - Lunatic States v1.00+
  7. #
  8. #==============================================================================
  9.  
  10.  
  11. $imported = {} if $imported.nil?
  12. $imported["YEA-LSP-Punishment"] = true
  13.  
  14.  
  15. #==============================================================================
  16. # ▼ Updates
  17. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  18. # 2011.12.31 - Bug Fixed: Error with battle popups not showing.
  19. # 2011.12.15 - Started Script and Finished.
  20. #
  21. #==============================================================================
  22. # ▼ Introduction
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # This is a script for Lunatic States Package Effects with punishment themed
  25. # effects. Included in it are effects that make battlers undead (take damage
  26. # whenever they are healed), make battlers whenever they execute physical or
  27. # magical attacks, make battlers take damage based on the original caster of
  28. # the state's stats, and an effect that heals the original caster of the state
  29. # whenever the battler takes HP or MP damage.
  30. #
  31. #==============================================================================
  32. # ▼ Instructions
  33. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. # To install this script, open up your script editor and copy/paste this script
  35. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  36. #
  37. # Install this script under YEA - Lunatic States. Then, proceed to use the
  38. # proper effects notetags to apply the proper LSP Punishment item desired.
  39. # Look within the script for more instructions on how to use each effect.
  40. #
  41. #==============================================================================
  42. # ▼ Compatibility
  43. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  44. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  45. # it will run with RPG Maker VX without adjusting.
  46. #
  47. # This script requires YEA - Lunatic States v1.00+ to work. It must be placed
  48. # under YEA - Lunatic States v1.00+ in the script listing.
  49. #
  50. #==============================================================================
  51.  
  52.  
  53. if $imported["YEA-LunaticStates"]
  54. class Game_BattlerBase
  55.  
  56. #--------------------------------------------------------------------------
  57. # ● Lunatic States Package Effects - Punishment
  58. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  59. # These effects are centered around the theme of punishment. These effects
  60. # punish users for doing various aspects that may benefit them by harming
  61. # them in different ways.
  62. #--------------------------------------------------------------------------
  63. alias lunatic_state_extension_lsp1 lunatic_state_extension
  64. def lunatic_state_extension(effect, state, user, state_origin, log_window)
  65. case effect.upcase
  66. #----------------------------------------------------------------------
  67. # Punish Effect No.1: Undead HP
  68. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  69. # Best used with react effect. This causes any HP healing done to become
  70. # reversed and deal HP damage to the healed target.
  71. #
  72. # Recommended notetag:
  73. # <react effect: undead hp>
  74. #----------------------------------------------------------------------
  75. when /UNDEAD HP/i
  76. return unless @result.hp_damage < 0
  77. @result.hp_damage *= -1
  78. @result.hp_drain *= -1
  79.  
  80. #----------------------------------------------------------------------
  81. # Punish Effect No.2: Undead MP
  82. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  83. # Best used with react effect. This causes any MP healing done to become
  84. # reversed and deal MP damage to the healed target.
  85. #
  86. # Recommended notetag:
  87. # <react effect: undead mp>
  88. #----------------------------------------------------------------------
  89. when /UNDEAD MP/i
  90. return unless @result.mp_damage < 0
  91. @result.mp_damage *= -1
  92. @result.mp_drain *= -1
  93.  
  94. #----------------------------------------------------------------------
  95. # Punish Effect No.3: Physical Backfire
  96. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  97. # Best used with while effect. Whenever the affected battler uses a
  98. # physical attack, that battler will take HP damage equal to its own
  99. # stats after finishing the current action. Battler cannot die from
  100. # this effect.
  101. #
  102. # Recommended notetag:
  103. # <while effect: physical backfire stat x%>
  104. #
  105. # Replace "stat" with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK.
  106. # Replace x with the stat multiplier to affect damage dealt.
  107. #----------------------------------------------------------------------
  108. when /PHYSICAL BACKFIRE[ ](.*)[ ](\d+)([%%])/i
  109. return if user.current_action.nil?
  110. return unless user.current_action.item.physical?
  111. case $1.upcase
  112. when "MAXHP"; dmg = user.mhp
  113. when "MAXMP"; dmg = user.mmp
  114. when "ATK"; dmg = user.atk
  115. when "DEF"; dmg = user.def
  116. when "MAT"; dmg = user.mat
  117. when "MDF"; dmg = user.mdf
  118. when "AGI"; dmg = user.agi
  119. when "LUK"; dmg = user.luk
  120. else; return
  121. end
  122. dmg = (dmg * $2.to_i * 0.01).to_i
  123. if $imported["YEA-BattleEngine"] && dmg > 0
  124. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_dmg], dmg.group)
  125. user.create_popup(text, "HP_DMG")
  126. end
  127. user.perform_damage_effect
  128. user.hp = [user.hp - dmg, 1].max
  129.  
  130. #----------------------------------------------------------------------
  131. # Punish Effect No.4: Magical Backfire
  132. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  133. # Best used with while effect. Whenever the affected battler uses a
  134. # magical attack, that battler will take HP damage equal to its own
  135. # stats after finishing the current action. Battler cannot die from
  136. # this effect.
  137. #
  138. # Recommended notetag:
  139. # <while effect: magical backfire stat x%>
  140. #
  141. # Replace "stat" with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK.
  142. # Replace x with the stat multiplier to affect damage dealt.
  143. #----------------------------------------------------------------------
  144. when /MAGICAL BACKFIRE[ ](.*)[ ](\d+)([%%])/i
  145. return if user.current_action.nil?
  146. return unless user.current_action.item.magical?
  147. case $1.upcase
  148. when "MAXHP"; dmg = user.mhp
  149. when "MAXMP"; dmg = user.mmp
  150. when "ATK"; dmg = user.atk
  151. when "DEF"; dmg = user.def
  152. when "MAT"; dmg = user.mat
  153. when "MDF"; dmg = user.mdf
  154. when "AGI"; dmg = user.agi
  155. when "LUK"; dmg = user.luk
  156. else; return
  157. end
  158. dmg = (dmg * $2.to_i * 0.01).to_i
  159. if $imported["YEA-BattleEngine"] && dmg > 0
  160. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_dmg], dmg.group)
  161. user.create_popup(text, "HP_DMG")
  162. end
  163. user.perform_damage_effect
  164. user.hp = [user.hp - dmg, 1].max
  165.  
  166. #----------------------------------------------------------------------
  167. # Punish Effect No.5: Stat Slip Damage
  168. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  169. # Best used with close effect. At the end of the turn, the affected
  170. # battler will take HP slip damage based on the stat of the of one who
  171. # casted the status effect onto the battler. Battler cannot die from
  172. # this effect.
  173. #
  174. # Recommended notetag:
  175. # <close effect: stat slip damage x%>
  176. #
  177. # Replace "stat" with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK.
  178. # Replace x with the stat multiplier to affect damage dealt.
  179. #----------------------------------------------------------------------
  180. when /(.*)[ ]SLIP DAMAGE[ ](\d+)([%%])/i
  181. case $1.upcase
  182. when "MAXHP"; dmg = state_origin.mhp
  183. when "MAXMP"; dmg = state_origin.mmp
  184. when "ATK"; dmg = state_origin.atk
  185. when "DEF"; dmg = state_origin.def
  186. when "MAT"; dmg = state_origin.mat
  187. when "MDF"; dmg = state_origin.mdf
  188. when "AGI"; dmg = state_origin.agi
  189. when "LUK"; dmg = state_origin.luk
  190. when "FIXED"; dmg = 100
  191. else; return
  192. end
  193. dmg = (dmg * $2.to_i * 0.01).to_i
  194. if $imported["YEA-BattleEngine"] && dmg > 0
  195. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_dmg], dmg.group)
  196. user.create_popup(text, "HP_DMG")
  197. end
  198. user.perform_damage_effect
  199. user.hp = [user.hp - dmg, 1].max
  200.  
  201. #----------------------------------------------------------------------
  202. # Punish Effect No.6: Stat Slip Heal
  203. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  204. # Best used with close effect. At the end of the turn, the affected
  205. # battler will heal HP based on the stat of the of one who casted the
  206. # status effect onto the battler.
  207. #
  208. # Recommended notetag:
  209. # <close effect: stat slip heal x%>
  210. #
  211. # Replace "stat" with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK.
  212. # Replace x with the stat multiplier to affect damage dealt.
  213. #----------------------------------------------------------------------
  214. when /(.*)[ ]SLIP HEAL[ ](\d+)([%%])/i
  215. case $1.upcase
  216. when "MAXHP"; dmg = state_origin.mhp
  217. when "MAXMP"; dmg = state_origin.mmp
  218. when "ATK"; dmg = state_origin.atk
  219. when "DEF"; dmg = state_origin.def
  220. when "MAT"; dmg = state_origin.mat
  221. when "MDF"; dmg = state_origin.mdf
  222. when "AGI"; dmg = state_origin.agi
  223. when "LUK"; dmg = state_origin.luk
  224. when "FIXED"; dmg = 100
  225. else; return
  226. end
  227. dmg = (dmg * $2.to_i * 0.01).to_i
  228. if $imported["YEA-BattleEngine"] && dmg > 0
  229. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_heal], dmg.group)
  230. user.create_popup(text, "HP_HEAL")
  231. end
  232. #user.perform_damage_effect
  233. user.hp += dmg
  234.  
  235. #----------------------------------------------------------------------
  236. # Punish Effect No.7: Drain HP
  237. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  238. # Best used with shock effect. Whenever user takes HP damage, the
  239. # original caster of the state will heal HP based on HP damage dealt.
  240. #
  241. # Recommended notetag:
  242. # <shock effect: drain hp x%>
  243. #----------------------------------------------------------------------
  244. when /DRAIN HP[ ](\d+)([%%])/i
  245. return unless @result.hp_damage > 0
  246. dmg = (@result.hp_damage * $1.to_i * 0.01).to_i
  247. if $imported["YEA-BattleEngine"] && dmg > 0
  248. Sound.play_recovery
  249. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_heal], dmg.group)
  250. user.create_popup(text, "HP_HEAL")
  251. end
  252. state_origin.hp += dmg
  253.  
  254. #----------------------------------------------------------------------
  255. # Punish Effect No.8: Drain MP
  256. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  257. # Best used with shock effect. Whenever user takes MP damage, the
  258. # original caster of the state will heal MP based on MP damage dealt.
  259. #
  260. # Recommended notetag:
  261. # <shock effect: drain mp x%>
  262. #----------------------------------------------------------------------
  263. when /DRAIN MP[ ](\d+)([%%])/i
  264. return unless @result.mp_damage > 0
  265. dmg = (@result.mp_damage * $1.to_i * 0.01).to_i
  266. if $imported["YEA-BattleEngine"] && dmg > 0
  267. Sound.play_recovery
  268. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:mp_heal], dmg.group)
  269. user.create_popup(text, "MP_HEAL")
  270. end
  271. state_origin.mp += dmg
  272.  
  273. #Cutsom effect #9 - KO on no MP
  274. when /KO MP ZERO/i#[ ](.*)[ ](\d+)([%%])/i
  275. return if user.mp > 0
  276. user.hp = 0
  277.  
  278. #----------------------------------------------------------------------
  279. # Stop editting past this point.
  280. #----------------------------------------------------------------------
  281. else
  282. so = state_origin
  283. lw = log_window
  284. lunatic_state_extension_lsp1(effect, state, user, so, lw)
  285. end
  286. end
  287.  
  288. end # Game_BattlerBase
  289. end # $imported["YEA-LunaticStates"]
  290.  
  291.  
  292. #==============================================================================
  293. #
  294. # ▼ End of File
  295. #
  296. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment