Guest User

Untitled

a guest
Mar 9th, 2019
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================================================
  2. # Mobius' Critical Animations
  3. # Author: Mobius XVI
  4. # Version: 1.0
  5. # Date: 3 JAN 2019
  6. #===============================================================================
  7. #
  8. # Introduction:
  9. #
  10. # This script allows you to add custom animations that trigger on critical hits.
  11. #
  12. # Instructions:
  13. #
  14. # - Place this script below all the default scripts but above main.
  15. #
  16. # - The customization section below has additional instructions on
  17. # how to set up.
  18. #
  19. # Issues/Bugs/Possible Bugs:
  20. #
  21. # - None
  22. #
  23. # Credits/Thanks:
  24. # - Mobius XVI, author
  25. # - MollyAvast, for requesting it
  26. #
  27. # License
  28. #
  29. # This script is available in its entirety for commercial and non-commercial
  30. # use. View the specific license terms below.
  31. #
  32. # The portions of this script written by me is licensed under the MIT License:
  33. #
  34. # The MIT License (MIT)
  35. #
  36. # Copyright (c) 2018 darmes
  37. #
  38. # Permission is hereby granted, free of charge, to any person obtaining a copy
  39. # of this software and associated documentation files (the "Software"), to deal
  40. # in the Software without restriction, including without limitation the rights
  41. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  42. # copies of the Software, and to permit persons to whom the Software is
  43. # furnished to do so, subject to the following conditions:
  44. #
  45. # The above copyright notice and this permission notice shall be included in all
  46. # copies or substantial portions of the Software.
  47. #
  48. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  49. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  50. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  51. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  52. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  53. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  54. # SOFTWARE.
  55. #
  56. # Further, if you do decide to use this script in a commercial product,
  57. # I'd ask that you let me know via a forum post or a PM. Thanks.
  58. #
  59. #==============================================================================
  60. # ** CUSTOMIZATION START
  61. #==============================================================================
  62. module Mobius
  63. module Critical_Animations
  64. # ACTOR ANIMATION IDs #
  65. ACTOR_ANIMATION_IDS = {
  66. # Actor 1 => [ Possible animation IDs in the database],
  67. 1 => [453,454,455],
  68. 2 => [456,457,458],
  69. 3 => [459,460,461],
  70. 4 => [462,463,464,465],
  71. 5 => [466,467,468],
  72. 8 => [469,470,471],
  73. 9 => [472,473],
  74. 11 => [474,475],
  75. 12 => [476,477,478],
  76. 14 => [479,480,481],
  77. 19 => [482, 483, 484],
  78. # Start with actor_id then make this symbol '=>' then put an opening
  79. # square bracket '[' then all the IDs for animations that you want
  80. # separate IDs with commas ','. Finish with a closing square bracket ']'
  81. # Lastly, place another comma after the square bracket.
  82. }
  83. ACTOR_ANIMATION_IDS.default = 0
  84. end
  85. end
  86. #==============================================================================
  87. # ** CUSTOMIZATION END
  88. #------------------------------------------------------------------------------
  89. # ** EDIT BELOW THIS LINE AT OWN RISK!!!
  90. #==============================================================================
  91. #==============================================================================
  92. # ** Scene_Battle
  93. #==============================================================================
  94. class Scene_Battle
  95.  
  96. # Create Alias
  97. alias mobius_update_phase4_step4 update_phase4_step4
  98.  
  99. #--------------------------------------------------------------------------
  100. # * Frame Update (main phase step 4 : animation for target)
  101. #--------------------------------------------------------------------------
  102. def update_phase4_step4
  103. # init critical flag to false
  104. crit_flag = false
  105. # check all possible targets for critical hits
  106. for target in @target_battlers
  107. # if critical hit occurred
  108. if target.critical
  109. # set flag and exit loop early
  110. crit_flag = true
  111. break
  112. end
  113. end
  114. # if critical hit occurred
  115. if crit_flag and @active_battler.is_a?(Game_Actor)
  116. # Set animation id
  117. animation_id_array = Mobius::Critical_Animations::ACTOR_ANIMATION_IDS[@active_battler.id]
  118. @active_battler.animation_id = animation_id_array[rand(animation_id_array.size)]
  119. @active_battler.animation_hit = true
  120. end
  121. # call original method
  122. mobius_update_phase4_step4
  123. end
  124.  
  125. end
RAW Paste Data