#============================================================================== # # ▼ Yanfly Engine Ace - Element Reflect v1.01 # -- Last Updated: 2012.01.23 # -- Level: Normal, Hard # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-ElementReflect"] = true #============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.01.23 - Compatibility Update: Doppelganger # 2011.12.14 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # The ability to reflect magic attacks already exists in RPG Maker VX Ace by # default. However, the ability to reflect skills based on their element type # does not exist. This script adds the ability to reflect skills back to the # caster if the skill is a particular element type and provides a percent bonus # to reflect it back at, too. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # ----------------------------------------------------------------------------- # Actor Notetags - These notetags go in the actors notebox in the database. # ----------------------------------------------------------------------------- # # # This tag causes the element x to reflect at a bonus y% rate. The reflect rate # only applies if element x is involved with the skill used. To reflect more # than one type of element, use multiple of this tag. # # ----------------------------------------------------------------------------- # Class Notetags - These notetags go in the class notebox in the database. # ----------------------------------------------------------------------------- # # # This tag causes the element x to reflect at a bonus y% rate. The reflect rate # only applies if element x is involved with the skill used. To reflect more # than one type of element, use multiple of this tag. # # ----------------------------------------------------------------------------- # Weapon Notetags - These notetags go in the weapons notebox in the database. # ----------------------------------------------------------------------------- # # # This tag causes the element x to reflect at a bonus y% rate. The reflect rate # only applies if element x is involved with the skill used. To reflect more # than one type of element, use multiple of this tag. # # ----------------------------------------------------------------------------- # Armour Notetags - These notetags go in the armours notebox in the database. # ----------------------------------------------------------------------------- # # # This tag causes the element x to reflect at a bonus y% rate. The reflect rate # only applies if element x is involved with the skill used. To reflect more # than one type of element, use multiple of this tag. # # ----------------------------------------------------------------------------- # Enemy Notetags - These notetags go in the enemies notebox in the database. # ----------------------------------------------------------------------------- # # # This tag causes the element x to reflect at a bonus y% rate. The reflect rate # only applies if element x is involved with the skill used. To reflect more # than one type of element, use multiple of this tag. # # ----------------------------------------------------------------------------- # State Notetags - These notetags go in the states notebox in the database. # ----------------------------------------------------------------------------- # # # This tag causes the element x to reflect at a bonus y% rate. The reflect rate # only applies if element x is involved with the skill used. To reflect more # than one type of element, use multiple of this tag. # #============================================================================== # ▼ Compatibility # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that # it will run with RPG Maker VX without adjusting. # # This script also works with YEA - Ace Battle Engine v1.00+. To ensure it has # the best possible compatibility, place this script below Ace Battle Engine. # #============================================================================== module YEA module ELEMENT_REFLECT #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Visual Reflect Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings affect reflected attacks and how they work. You can set # an animation to run whenever a reflected magic attack occurs successful. # If you don't want an animation to occur, set it to zero. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- REFLECTOR_ANIMATION_ID = 94 # Animation ID used for magic reflect. PLAY_ANIMATION_CASTER = true # Play the reflected skill ani on caster? #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Ace Battle Engine Popup - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # For those with Ace Battle Engine, a popup can occur indicating that the # skill/item is reflected. Adjust the popup settings here. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- POPUP_TEXT = "REFLECT" # Text that appears when reflected. POPUP_RULE = "NEGATIVE" # Popup rule used. end # ELEMENT_REFLECT end # YEA #============================================================================== # ▼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== module YEA module REGEXP module BASEITEM ELE_RFL = /<(?:ELEMENT_REFLECT|element reflect)[ ](\d+):[ ]([\+\-]\d+)([%%])>/i end # BASEITEM end # REGEXP end # YEA #============================================================================== # ■ DataManager #============================================================================== module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class < 0 target.animation_id = YEA::ELEMENT_REFLECT::REFLECTOR_ANIMATION_ID target.animation_mirror = false end if YEA::ELEMENT_REFLECT::PLAY_ANIMATION_CASTER @subject.animation_id = item.animation_id @subject.animation_mirror = true end end #-------------------------------------------------------------------------- # new method: show_reflected_magic_popup #-------------------------------------------------------------------------- def show_reflected_magic_popup(target) return unless $imported["YEA-BattleEngine"] text = YEA::ELEMENT_REFLECT::POPUP_TEXT rule = YEA::ELEMENT_REFLECT::POPUP_RULE target.create_popup(text, rule) end end # Scene_Battle #============================================================================== # # ▼ End of File # #==============================================================================