Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # Mobius' Critical Animations
- # Author: Mobius XVI
- # Version: 1.0
- # Date: 3 JAN 2019
- #===============================================================================
- #
- # Introduction:
- #
- # This script allows you to add custom animations that trigger on critical hits.
- #
- # Instructions:
- #
- # - Place this script below all the default scripts but above main.
- #
- # - The customization section below has additional instructions on
- # how to set up.
- #
- # Issues/Bugs/Possible Bugs:
- #
- # - None
- #
- # Credits/Thanks:
- # - Mobius XVI, author
- # - MollyAvast, for requesting it
- #
- # License
- #
- # This script is available in its entirety for commercial and non-commercial
- # use. View the specific license terms below.
- #
- # The portions of this script written by me is licensed under the MIT License:
- #
- # The MIT License (MIT)
- #
- # Copyright (c) 2018 darmes
- #
- # Permission is hereby granted, free of charge, to any person obtaining a copy
- # of this software and associated documentation files (the "Software"), to deal
- # in the Software without restriction, including without limitation the rights
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- # copies of the Software, and to permit persons to whom the Software is
- # furnished to do so, subject to the following conditions:
- #
- # The above copyright notice and this permission notice shall be included in all
- # copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- # SOFTWARE.
- #
- # Further, if you do decide to use this script in a commercial product,
- # I'd ask that you let me know via a forum post or a PM. Thanks.
- #
- #==============================================================================
- # ** CUSTOMIZATION START
- #==============================================================================
- module Mobius
- module Critical_Animations
- # ACTOR ANIMATION IDs #
- ACTOR_ANIMATION_IDS = {
- # Actor 1 => [ Possible animation IDs in the database],
- 1 => [453,454,455],
- 2 => [456,457,458],
- 3 => [459,460,461],
- 4 => [462,463,464,465],
- 5 => [466,467,468],
- 8 => [469,470,471],
- 9 => [472,473],
- 11 => [474,475],
- 12 => [476,477,478],
- 14 => [479,480,481],
- 19 => [482, 483, 484],
- # Start with actor_id then make this symbol '=>' then put an opening
- # square bracket '[' then all the IDs for animations that you want
- # separate IDs with commas ','. Finish with a closing square bracket ']'
- # Lastly, place another comma after the square bracket.
- }
- ACTOR_ANIMATION_IDS.default = 0
- end
- end
- #==============================================================================
- # ** CUSTOMIZATION END
- #------------------------------------------------------------------------------
- # ** EDIT BELOW THIS LINE AT OWN RISK!!!
- #==============================================================================
- #==============================================================================
- # ** Scene_Battle
- #==============================================================================
- class Scene_Battle
- # Create Alias
- alias mobius_update_phase4_step4 update_phase4_step4
- #--------------------------------------------------------------------------
- # * Frame Update (main phase step 4 : animation for target)
- #--------------------------------------------------------------------------
- def update_phase4_step4
- # init critical flag to false
- crit_flag = false
- # check all possible targets for critical hits
- for target in @target_battlers
- # if critical hit occurred
- if target.critical
- # set flag and exit loop early
- crit_flag = true
- break
- end
- end
- # if critical hit occurred
- if crit_flag and @active_battler.is_a?(Game_Actor)
- # Set animation id
- animation_id_array = Mobius::Critical_Animations::ACTOR_ANIMATION_IDS[@active_battler.id]
- @active_battler.animation_id = animation_id_array[rand(animation_id_array.size)]
- @active_battler.animation_hit = true
- end
- # call original method
- mobius_update_phase4_step4
- end
- end
RAW Paste Data