VTS-Elemental Charge Field - More than 8 Elements Tweak

Discussion in 'RGSS3 Script Requests' started by Vis_Mage, May 25, 2019.

  1. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    364
    Likes Received:
    135
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Hello! :kaohi:

    Lately, I've been trying to make what I thought would be a really simple edit to Ventwig's VTS-Elemental Charge Field script, but I haven't had any luck on my own. I'm hoping someone with a better idea of what they're doing than myself could help me out here.

    In summery, the script allows you to create multipliers that apply to each element. By default, the script allows up to 8 elements to be used, but I'm hoping to increase that to 20. I'm not actually using the visual HUD aspect of the script, everything happens behind the scenes, so no worries about making everything fit.

    Additionally, I have been trying to get this working myself, without much luck. Here's my current copy of the script, in case it proves helpful in any way:

    Code:
    #============================================================================
    #VTS-Elemental Charge Fields (with Charge Skill Evolution)
    #By Ventwig
    #Version 1.21 - Mar 22 2014
    #For RPGMaker VX Ace
    #Thanks Selchar and Tsukihime for the help!
    #=============================================================================
    # Description:
    # This script adds an extra dynamic to elements for both players and enemies
    # alike. When a skill of an element is used, its "charge" will raise, and,
    # if desired, the opposing element's "charge" will drop. That charge counts
    # as a damage multiplier, and it can even nullify or drain damage of a certain
    # element if its charge drops low enough.
    # The new Charge Skill Evolution feature (from Tales of The Abyss's Field
    # of Fonons Change) allows a skill to change into a more powerful form
    # under certain conditions based on the fields.
    #==============================================================================
    # Compatability:
    # I'd say it's pretty high!
    # It works with Battle Symphony, and YEA because it's only an add-on to battles,
    # so have fun!
    #===============================================================================
    # Instructions: Put in materials, above main. You need to set the elements/icons!
    #==============================================================================
    # Please give Credit to Ventwig if you would like to use one of my scripts!
    # Use it commericial or non-commercial, and feel free to tell me if you're using
    # it commercially!
    # You may edit my scripts, just don't claim as your own!
    #===============================================================================
    #Spirit System / Wisp System
    
    #===============================================================================
    # How to Change Charge Value (Skill Notetags)
    #===============================================================================
    # <charge_value x>
    # x = amount to increase charge (make a negative to decrease) (number)
    # If you want to make certain skills worth more in charge fields, this notetag
    # lets you make some skills strengthen fields better. Negatives weaken fields.
    # These override the default for said skill.
    #===============================================================================
    # How to Set up a Charge Skill Evolution (Skill Notetags)
    #===============================================================================
    # If you do not like the CSE idea, simply do not use these notetags
    #===============================================================================
    # <evolution_element x>
    # x = element id (the number)
    # Set the element ID for the CSE. This means that this element will
    # need the specidic value (or default if you use that) in order to CSE.
    # Please be careful and don't set it to an element without a Charge Field,
    # as that will have no effect.
    #
    # <evolution_charge x>
    # x = required charge value
    # Set a number for the CSE. This means that the element (specified using
    # the notetag above or using the default setting) will need a value equal to or
    # greater than x in order to FOFChange.
    #
    # <evolution_skill x>
    # x = skill id (the number)
    # Set the skill to CSE into. Simple enough, if the conditions are met,
    # then this skill will be used instead.
    #*******************************************************************************
    # IT IS IMPERATIVE to make sure the MP/TP costs are equal to/less than the
    # original skill. This script does not check for that and will bug if
    # the player doesn't have enough MP to use the new skill.
    #===============================================================================
    
    module VTS_ECF
      #This means whether or not elements across from each other will "oppose"
      #each other. If set to true, using a fire attack will raise fire charge
      #and lower ice. False will just raise fire.
      #True/False Def:True
      COUNTER_CHARGE = false
     
      #The default amount an attack will raise/lower the fields
      #Def: 10
      CHARGE_VALUE = 0
     
      #The ID number of the desired elements. In "Terms" in the database, there's
      #the area where you can edit elements. The ID is the number beside them.
      #Def: 3,4,5,8,6,7,9,10 (Fire,Ice,Thunder,Wind,Water,Stone,Light,Dark)
      #NOTE:If you are using opposing elements, then the opposing pairs are:
      # 1/2 and 3/4 (so on), 1/2 will not alter 3/4, 3/4 will not alter 1/2.
     
      ELE1 = 4
      ELE2 = 5
      ELE3 = 6
      ELE4 = 7
      #========
      # Don't want 8 elements? Simply change the number to "nil" w/o brackets!
      # (min 4 elements, max 8)
      #=======
      ELE5 = 10
      ELE6 = 11
      ELE7 = 8
      ELE8 = 9
      ELE9 = 13
      ELE10 = 14
      ELE11 = 15
      ELE12 = 16
      ELE13 = 17
      ELE14 = 18
      ELE15 = 19
      ELE16 = 20
      ELE17 = 21
      ELE18 = 22
      ELE19 = 12
      ELE20 = 23
      #How wide the window should be.
      #Recommended
      #4 elements: 100
      #6 elements: 160
      #8 elements: 200
      WIDTH = 0 #220
     
      #The icon numbers for the elements. These are in sync with the numbers
      #for element id above, so just shove in the icons you want!
      #Def: 96,97,98,101,99,100,102,103
      EIC1 = 96
      EIC2 = 97
      EIC3 = 98
      EIC4 = 100
      EIC5 = 99
      EIC6 = 101
      EIC7 = 102
      EIC8 = 103
      ELE9 = 9
      ELE10 = 9
      ELE11 = 9
      ELE12 = 9
      ELE13 = 9
      ELE14 = 9
      ELE15 = 9
      ELE16 = 9
      ELE17 = 9
      ELE18 = 9
      ELE19 = 9
      ELE20 = 9
     
      #The icon showing "opposing elements", acting as the connector between them.
      #Put 0 if you don't want one (like if you don't use opposing elements)
      #Def:115
      LIC = 0
     
      #The X and Y placement of the window. Easy enough.
      #Def: Graphics.width - 200, 0
      #I recommend keeping X like this, making the number equal to width. Y can be whatever.
      X = Graphics.width - 100
      Y = 0
     
      #=============================================================================
      #Charge Skill Evolution
      #=============================================================================
      DEF_CSE_ELEMENT = 3
      #If an element is not set to a skill with a CSE,
      #this is the element ID it will be given
     
      DEF_CSE_CHARGE = 120
      #If no charge amount is specified for a skill with a
      #CSE, this is the required amount
     
      CSE_TEXT = "Wisp Charge!"
      #The text said when announcing the new change
     
      CSE_TEXT_SKILL = false
      #Display the skill name after the text above? True/false
      #(It shows the traditional (Eric used FIREAGA! Afterwards)
    end
    #############################################################################
     
    class Game_Battler < Game_BattlerBase
      def make_damage_value(user, item)
        value = item.damage.eval(user, self, $game_variables)
        value *= item_element_rate(user, item)
        value *= pdr if item.physical?
        value *= mdr if item.magical?
        value *= rec if item.damage.recover?
        value = value*$vts_elechrg1/100 if item.damage.element_id == VTS_ECF::ELE1
        value = value*$vts_elechrg2/100 if item.damage.element_id == VTS_ECF::ELE2
        value = value*$vts_elechrg3/100 if item.damage.element_id == VTS_ECF::ELE3
        value = value*$vts_elechrg4/100 if item.damage.element_id == VTS_ECF::ELE4
        if $vts_elechrg5 != nil
          value = value*$vts_elechrg5/100 if item.damage.element_id == VTS_ECF::ELE5
        end
        if $vts_elechrg6 != nil
          value = value*$vts_elechrg6/100 if item.damage.element_id == VTS_ECF::ELE6
        end
        if $vts_elechrg7 != nil
          value = value*$vts_elechrg7/100 if item.damage.element_id == VTS_ECF::ELE7
        end
        if $vts_elechrg8 != nil
          value = value*$vts_elechrg8/100 if item.damage.element_id == VTS_ECF::ELE8
        end
         if $vts_elechrg9 != nil
          value = value*$vts_elechrg9/100 if item.damage.element_id == VTS_ECF::ELE9
        end
            if $vts_elechrg10 != nil
          value = value*$vts_elechrg10/100 if item.damage.element_id == VTS_ECF::ELE10
        end
            if $vts_elechrg11 != nil
          value = value*$vts_elechrg11/100 if item.damage.element_id == VTS_ECF::ELE11
        end
            if $vts_elechrg12 != nil
          value = value*$vts_elechrg12/100 if item.damage.element_id == VTS_ECF::ELE12
        end
            if $vts_elechrg13 != nil
          value = value*$vts_elechrg13/100 if item.damage.element_id == VTS_ECF::ELE13
        end
            if $vts_elechrg14 != nil
          value = value*$vts_elechrg14/100 if item.damage.element_id == VTS_ECF::ELE14
        end
            if $vts_elechrg15 != nil
          value = value*$vts_elechrg15/100 if item.damage.element_id == VTS_ECF::ELE15
        end
            if $vts_elechrg16 != nil
          value = value*$vts_elechrg16/100 if item.damage.element_id == VTS_ECF::ELE16
        end
            if $vts_elechrg17 != nil
          value = value*$vts_elechrg17/100 if item.damage.element_id == VTS_ECF::ELE17
        end
            if $vts_elechrg18 != nil
          value = value*$vts_elechrg18/100 if item.damage.element_id == VTS_ECF::ELE18
        end
            if $vts_elechrg19 != nil
          value = value*$vts_elechrg19/100 if item.damage.element_id == VTS_ECF::ELE19
        end
            if $vts_elechrg20 != nil
          value = value*$vts_elechrg20/100 if item.damage.element_id == VTS_ECF::ELE20
        end
       
       
        value = apply_critical(value) if @result.critical
        value = apply_variance(value, item.damage.variance)
        value = apply_guard(value)
        @result.make_damage(value.to_i, item)
      end
    end
     
    class Window_ElementCharge < Window_Base
      def initialize(x,y,width,height)
        super
        self.z = 0
        draw_elements
        set_values
        draw_value
      end
      def set_values
        @val1 = $vts_elechrg1
        @val2 = $vts_elechrg2
        @val3 = $vts_elechrg3
        @val4 = $vts_elechrg4
        @val5 = $vts_elechrg5 if $vts_elechrg5 != nil
        @val6 = $vts_elechrg6 if $vts_elechrg6 != nil
        @val7 = $vts_elechrg7 if $vts_elechrg7 != nil
        @val8 = $vts_elechrg8 if $vts_elechrg8 != nil
        @val9 = $vts_elechrg9 if $vts_elechrg9 != nil
        @val10 = $vts_elechrg10 if $vts_elechrg10 != nil
        @val11 = $vts_elechrg11 if $vts_elechrg11 != nil
        @val12 = $vts_elechrg12 if $vts_elechrg12 != nil
        @val13 = $vts_elechrg13 if $vts_elechrg13 != nil
        @val14 = $vts_elechrg14 if $vts_elechrg14 != nil
        @val15 = $vts_elechrg15 if $vts_elechrg15 != nil
        @val16 = $vts_elechrg16 if $vts_elechrg16 != nil
        @val17 = $vts_elechrg17 if $vts_elechrg17 != nil
        @val18 = $vts_elechrg18 if $vts_elechrg18 != nil
        @val19 = $vts_elechrg19 if $vts_elechrg19 != nil
        @val20 = $vts_elechrg20 if $vts_elechrg20 != nil
       
      end
      def draw_elements
        draw_icon(VTS_ECF::EIC1,0,0,enabled=true) #Fire
        draw_icon(VTS_ECF::EIC2,0,93,enabled=true) #Ice
        draw_icon(VTS_ECF::EIC3,50,0,enabled=true) #Thunder
        draw_icon(VTS_ECF::EIC4,50,93,enabled=true) #Wind
        draw_icon(VTS_ECF::LIC,0,50,enabled=true) #
        draw_icon(VTS_ECF::LIC,50,50,enabled=true) #
       
        draw_icon(VTS_ECF::EIC5,100,0,enabled=true) if $vts_elechrg5 != nil
        draw_icon(VTS_ECF::EIC6,100,93,enabled=true) if $vts_elechrg6 != nil
        draw_icon(VTS_ECF::EIC7,150,0,enabled=true) if $vts_elechrg7 != nil
        draw_icon(VTS_ECF::EIC8,150,93,enabled=true) if $vts_elechrg8 != nil
        draw_icon(VTS_ECF::LIC,100,50,enabled=true) if $vts_elechrg6 != nil
        draw_icon(VTS_ECF::LIC,150,50,enabled=true) if $vts_elechrg8 != nil
       
      end
      def draw_value
        draw_text(0,20,40,32,@val1)
        draw_text(0,70,40,32,@val2)
        draw_text(45,20,40,32,@val3)
        draw_text(45,70,40,32,@val4)
        draw_text(100,20,40,32,@val5)if $vts_elechrg5 != nil
        draw_text(100,70,40,32,@val6)if $vts_elechrg6 != nil
        draw_text(145,20,40,32,@val7)if $vts_elechrg7 != nil
        draw_text(145,70,40,32,@val8)if $vts_elechrg8 != nil
      end
     
      def refresh
        contents.clear
        draw_elements
        set_values
        draw_value
      end
     
      def update
        refresh if $vts_elechrg1 != @val1
        refresh if $vts_elechrg2 != @val2
        refresh if $vts_elechrg3 != @val3
        refresh if $vts_elechrg4 != @val4
        refresh if $vts_elechrg5 != @val5 and $vts_elechrg5 != nil
        refresh if $vts_elechrg6 != @val6 and $vts_elechrg6 != nil
        refresh if $vts_elechrg7 != @val7 and $vts_elechrg7 != nil
        refresh if $vts_elechrg8 != @val8 and $vts_elechrg8 != nil
        refresh if $vts_elechrg9 != @val9
        refresh if $vts_elechrg10 != @val10
        refresh if $vts_elechrg11 != @val11
        refresh if $vts_elechrg12 != @val12
        refresh if $vts_elechrg13 != @val13
        refresh if $vts_elechrg14 != @val14
        refresh if $vts_elechrg15 != @val15
        refresh if $vts_elechrg16 != @val16
        refresh if $vts_elechrg17 != @val17
        refresh if $vts_elechrg18 != @val18
        refresh if $vts_elechrg19 != @val19
        refresh if $vts_elechrg20 != @val20
      end
    end
     
    class Scene_Battle < Scene_Base
      alias ele_charge_start start
      def start
        ele_charge_start
        $vts_elechrg1 = 100
        $vts_elechrg2 = 100
        $vts_elechrg3 = 100
        $vts_elechrg4 = 100
        $vts_elechrg5 = 100 if VTS_ECF::ELE5 != nil
        $vts_elechrg6 = 100 if VTS_ECF::ELE6 != nil
        $vts_elechrg7 = 100 if VTS_ECF::ELE7 != nil
        $vts_elechrg8 = 100 if VTS_ECF::ELE8 != nil
        $vts_elechrg9 = 100 if VTS_ECF::ELE9 != nil
        $vts_elechrg10 = 100 if VTS_ECF::ELE10 != nil
        $vts_elechrg11 = 100 if VTS_ECF::ELE11 != nil
        $vts_elechrg12 = 100 if VTS_ECF::ELE12 != nil
        $vts_elechrg13 = 100 if VTS_ECF::ELE13 != nil
        $vts_elechrg14 = 100 if VTS_ECF::ELE14 != nil
        $vts_elechrg15 = 100 if VTS_ECF::ELE15 != nil
        $vts_elechrg16 = 100 if VTS_ECF::ELE16 != nil
        $vts_elechrg17 = 100 if VTS_ECF::ELE17 != nil
        $vts_elechrg18 = 100 if VTS_ECF::ELE18 != nil
        $vts_elechrg19 = 100 if VTS_ECF::ELE19 != nil
        $vts_elechrg20 = 100 if VTS_ECF::ELE20 != nil
      end
      alias element_charge_create_all_windows create_all_windows
      def create_all_windows
        element_charge_create_all_windows
        create_element_window
      end
     
      def create_element_window
        @element_window = Window_ElementCharge.new(VTS_ECF::X,VTS_ECF::Y,VTS_ECF::WIDTH,150)
      end
     
      alias element_charge_use_item use_item
      def use_item
        item = @subject.current_action.item
        if item.is_a?(RPG::Skill)
          @charge_element = item.damage.element_id
          adjust_element_charge(@charge_element, item)
        end
        element_charge_use_item
      end
    ###
      def adjust_element_charge(element, skill)
        if element == VTS_ECF::ELE1
          $vts_elechrg1 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg2 -= skill.charge_value
          end
        end
        if element == VTS_ECF::ELE2
          $vts_elechrg2 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg1 -= skill.charge_value
          end
        end
        if element == VTS_ECF::ELE3
          $vts_elechrg3 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg4 -= skill.charge_value
          end
        end
        if element == VTS_ECF::ELE4
          $vts_elechrg4 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg3 -= skill.charge_value
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE5
            $vts_elechrg5 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg6 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE6
            $vts_elechrg6 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg5 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE7
            $vts_elechrg7 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE8
            $vts_elechrg8 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg7 -= skill.charge_value
            end
          end
          end
         
    #New elements 9-20
    
          if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE9
            $vts_elechrg9 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg10 -= skill.charge_value
            end
          end
          end
         
            if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE10
            $vts_elechrg10 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg9 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE11
            $vts_elechrg11 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE12
            $vts_elechrg12 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE13
            $vts_elechrg13 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE14
            $vts_elechrg14 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE15
            $vts_elechrg15 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE16
            $vts_elechrg16 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE17
            $vts_elechrg17 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE18
            $vts_elechrg18 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE19
            $vts_elechrg19 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end  
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE20
            $vts_elechrg20 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end
     
       
        end
      end
    
    #===============================================================================
    #FOF CHANGE
    #===============================================================================
    
    module RPG
      class BaseItem
        def fofc_element
          if @fofc_element.nil?
            if @note =~ /<evolution_element (.*)>/i
              @fofc_element= $1.to_i
            else
              @fofc_element = VTS_ECF::DEF_CSE_ELEMENT
            end
          end
          @fofc_element
        end
       
        def fofc_charge
          if @fofc_charge.nil?
            if @note =~ /<evolution_charge (.*)>/i
              @fofc_charge= $1.to_i
            else
              @fofc_charge = VTS_ECF::DEF_CSE_CHARGE
            end
          end
          @fofc_charge
        end
        def fofc_skill
          if @fofc_skill.nil?
            if @note =~ /<evolution_skill (.*)>/i
              @fofc_skill= $1.to_i
            else
              @fofc_skill = 0
            end
          end
          @fofc_skill
        end
        def charge_value
          if @charge_value.nil?
            if @note =~ /<charge_value (.*)>/i
              @charge_value= $1.to_i
            else
              @charge_value = VTS_ECF::CHARGE_VALUE
            end
          end
          @charge_value
        end
      end
    end
    
    class Game_Action
      attr_accessor :old_skill
    end
    
    class Game_Battler < Game_BattlerBase
      def get_new_skill
        return unless current_action.item.is_a?(RPG::Skill)
    
        quest_skill = current_action.item
       
        if quest_skill.fofc_skill != 0
          if quest_skill.fofc_element == VTS_ECF::ELE1
            if $vts_elechrg1 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
          if quest_skill.fofc_element == VTS_ECF::ELE2
            if $vts_elechrg2 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
          if quest_skill.fofc_element == VTS_ECF::ELE3
            if $vts_elechrg3 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
          if quest_skill.fofc_element == VTS_ECF::ELE10
            if $vts_elechrg10 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
        end
      end
    end # Game_Battler
    
    class Window_BattleLog < Window_Selectable #$#CRASHES DJINN System! No knwon side effects from disabling it :)
     #$# alias vts_fofchange_display_use_item display_use_item
     # def display_use_item(subject, item)
      #  if item.is_a?(RPG::Skill)
      #    if subject.current_action.old_skill != nil
       #     name = subject.name
      #      change_text = VTS_ECF::CSE_TEXT
      #      skill_name = item.name + '!'
       #     use_name = subject.current_action.old_skill.message1
       #     old_skill_text = name + use_name
       #     add_text(old_skill_text)
        #    wait
        #    if VTS_ECF::CSE_TEXT_SKILL == true
       #       new_skill_text = change_text + skill_name
       #       else
       #       new_skill_text = change_text
       #     end
       #     add_text(new_skill_text)
      #      wait
      #    end
     #   end  
     #   vts_fofchange_display_use_item(subject, item)
     #   subject.current_action.old_skill = nil
     # end
    end
    
    class Scene_Battle < Scene_Base
      alias scene_battle_use_item_new use_item
      def use_item
        @subject.get_new_skill
        scene_battle_use_item_new
      end
     
    end # Scene_Battle

    Please let me know if you have any questions.

    Thank you! :kaothx:
     
    #1
  2. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,504
    Likes Received:
    318
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Tested this and is working. I set it to show the window. So you can adjust that.
    Code:
    #============================================================================
    #VTS-Elemental Charge Fields (with Charge Skill Evolution)
    #By Ventwig
    #Version 1.21 - Mar 22 2014
    #For RPGMaker VX Ace
    #Thanks Selchar and Tsukihime for the help!
    #=============================================================================
    # Description:
    # This script adds an extra dynamic to elements for both players and enemies
    # alike. When a skill of an element is used, its "charge" will raise, and,
    # if desired, the opposing element's "charge" will drop. That charge counts
    # as a damage multiplier, and it can even nullify or drain damage of a certain
    # element if its charge drops low enough.
    # The new Charge Skill Evolution feature (from Tales of The Abyss's Field
    # of Fonons Change) allows a skill to change into a more powerful form
    # under certain conditions based on the fields.
    #==============================================================================
    # Compatability:
    # I'd say it's pretty high!
    # It works with Battle Symphony, and YEA because it's only an add-on to battles,
    # so have fun!
    #===============================================================================
    # Instructions: Put in materials, above main. You need to set the elements/icons!
    #==============================================================================
    # Please give Credit to Ventwig if you would like to use one of my scripts!
    # Use it commericial or non-commercial, and feel free to tell me if you're using
    # it commercially!
    # You may edit my scripts, just don't claim as your own!
    #===============================================================================
    
    
    #===============================================================================
    # How to Change Charge Value (Skill Notetags)
    #===============================================================================
    # <charge_value x>
    # x = amount to increase charge (make a negative to decrease) (number)
    # If you want to make certain skills worth more in charge fields, this notetag
    # lets you make some skills strengthen fields better. Negatives weaken fields.
    # These override the default for said skill.
    #===============================================================================
    # How to Set up a Charge Skill Evolution (Skill Notetags)
    #===============================================================================
    # If you do not like the CSE idea, simply do not use these notetags
    #===============================================================================
    # <evolution_element x>
    # x = element id (the number)
    # Set the element ID for the CSE. This means that this element will
    # need the specific value (or default if you use that) in order to CSE.
    # Please be careful and don't set it to an element without a Charge Field,
    # as that will have no effect.
    #
    # <evolution_charge x>
    # x = required charge value
    # Set a number for the CSE. This means that the element (specified using
    # the notetag above or using the default setting) will need a value equal to or
    # greater than x in order to FOFChange.
    #
    # <evolution_skill x>
    # x = skill id (the number)
    # Set the skill to CSE into. Simple enough, if the conditions are met,
    # then this skill will be used instead.
    #*******************************************************************************
    # IT IS IMPERATIVE to make sure the MP/TP costs are equal to/less than the
    # original skill. This script does not check for that and will bug if
    # the player doesn't have enough MP to use the new skill.
    #===============================================================================
    
    module VTS_ECF
      #This means whether or not elements across from each other will "oppose"
      #each other. If set to true, using a fire attack will raise fire charge
      #and lower ice. False will just raise fire.
      #True/False Def:True
      COUNTER_CHARGE = true
     
      #The default amount an attack will raise/lower the fields
      #Def: 10
      CHARGE_VALUE = 10
     
      #The ID number of the desired elements. In "Terms" in the database, there's
      #the area where you can edit elements. The ID is the number beside them.
      #Def: 3,4,5,8,6,7,9,10 (Fire,Ice,Thunder,Wind,Water,Stone,Light,Dark)
      #NOTE:If you are using opposing elements, then the opposing pairs are:
      # 1/2 and 3/4 (so on), 1/2 will not alter 3/4, 3/4 will not alter 1/2.
     
      ELE1 = 3
      ELE2 = 4
      ELE3 = 5
      ELE4 = 8
      #========
      # Don't want 8 elements? Simply change the number to "nil" w/o brackets!
      # (min 4 elements, max 8)
      #=======
      ELE5 = 6
      ELE6 = 7
      ELE7 = 9
      ELE8 = 10
      ELE9 = 11
      ELE10 = 12
      ELE11 = 13
      ELE12 = 14
      ELE13 = 15
      ELE14 = 16
      ELE15 = 17
      ELE16 = 18
      ELE17 = 19
      ELE18 = 20
      ELE19 = 21
      ELE20 = 22
     
      #How wide the window should be.
      #Recommended
      #4 elements: 100
      #6 elements: 160
      #8 elements: 200
      WIDTH = 540
     
      #The icon numbers for the elements. These are in sync with the numbers
      #for element id above, so just shove in the icons you want!
      #Def: 96,97,98,101,99,100,102,103
      EIC1 = 96
      EIC2 = 97
      EIC3 = 98
      EIC4 = 101
      EIC5 = 99
      EIC6 = 100
      EIC7 = 102
      EIC8 = 103
      EIC9 = 104
      EIC10 = 105
      EIC11 = 106
      EIC12 = 107
      EIC13 = 108
      EIC14 = 109
      EIC15 = 110
      EIC16 = 111
      EIC17 = 112
      EIC18 = 113
      EIC19 = 114
      EIC20 = 116
    
     
      #The icon showing "opposing elements", acting as the connector between them.
      #Put 0 if you don't want one (like if you don't use opposing elements)
      #Def:115
      LIC = 115
     
      #The X and Y placement of the window. Easy enough.
      #Def: Graphics.width - 200, 0
      #I recommend keeping X like this, making the number equal to width. Y can be whatever.
      X = 0#Graphics.width - 540
      Y = 0
     
      #=============================================================================
      #Charge Skill Evolution
      #=============================================================================
      DEF_CSE_ELEMENT = 3
      #If an element is not set to a skill with a CSE,
      #this is the element ID it will be given
     
      DEF_CSE_CHARGE = 120
      #If no charge amount is specified for a skill with a
      #CSE, this is the required amount
     
      CSE_TEXT = "FoF Change!"
      #The text said when announcing the new change
     
      CSE_TEXT_SKILL = false
      #Display the skill name after the text above? True/false
      #(It shows the traditional (Eric used FIREAGA! Afterwards)
    end
    #############################################################################
     
    class Game_Battler < Game_BattlerBase
      def make_damage_value(user, item)
        value = item.damage.eval(user, self, $game_variables)
        value *= item_element_rate(user, item)
        value *= pdr if item.physical?
        value *= mdr if item.magical?
        value *= rec if item.damage.recover?
        value = value*$vts_elechrg1/100 if item.damage.element_id == VTS_ECF::ELE1
        value = value*$vts_elechrg2/100 if item.damage.element_id == VTS_ECF::ELE2
        value = value*$vts_elechrg3/100 if item.damage.element_id == VTS_ECF::ELE3
        value = value*$vts_elechrg4/100 if item.damage.element_id == VTS_ECF::ELE4
        if $vts_elechrg5 != nil
          value = value*$vts_elechrg5/100 if item.damage.element_id == VTS_ECF::ELE5
        end
        if $vts_elechrg6 != nil
          value = value*$vts_elechrg6/100 if item.damage.element_id == VTS_ECF::ELE6
        end
        if $vts_elechrg7 != nil
          value = value*$vts_elechrg7/100 if item.damage.element_id == VTS_ECF::ELE7
        end
        if $vts_elechrg8 != nil
          value = value*$vts_elechrg8/100 if item.damage.element_id == VTS_ECF::ELE8
        end
        if $vts_elechrg9 != nil
          value = value*$vts_elechrg9/100 if item.damage.element_id == VTS_ECF::ELE9
        end
        if $vts_elechrg10 != nil
          value = value*$vts_elechrg10/100 if item.damage.element_id == VTS_ECF::ELE10
        end
        if $vts_elechrg11 != nil
          value = value*$vts_elechrg11/100 if item.damage.element_id == VTS_ECF::ELE11
        end
        if $vts_elechrg12 != nil
          value = value*$vts_elechrg12/100 if item.damage.element_id == VTS_ECF::ELE12
        end
        if $vts_elechrg13 != nil
          value = value*$vts_elechrg13/100 if item.damage.element_id == VTS_ECF::ELE13
        end
        if $vts_elechrg14 != nil
          value = value*$vts_elechrg14/100 if item.damage.element_id == VTS_ECF::ELE14
        end
        if $vts_elechrg15 != nil
          value = value*$vts_elechrg15/100 if item.damage.element_id == VTS_ECF::ELE15
        end
        if $vts_elechrg16 != nil
          value = value*$vts_elechrg16/100 if item.damage.element_id == VTS_ECF::ELE16
        end
        if $vts_elechrg17 != nil
          value = value*$vts_elechrg17/100 if item.damage.element_id == VTS_ECF::ELE17
        end
        if $vts_elechrg18 != nil
          value = value*$vts_elechrg18/100 if item.damage.element_id == VTS_ECF::ELE18
        end
        if $vts_elechrg19 != nil
          value = value*$vts_elechrg19/100 if item.damage.element_id == VTS_ECF::ELE19
        end
        if $vts_elechrg20 != nil
          value = value*$vts_elechrg20/100 if item.damage.element_id == VTS_ECF::ELE20
        end
        value = apply_critical(value) if @result.critical
        value = apply_variance(value, item.damage.variance)
        value = apply_guard(value)
        @result.make_damage(value.to_i, item)
      end
    end
     
    class Window_ElementCharge < Window_Base
      def initialize(x,y,width,height)
        super
        self.z = 0
        draw_elements
        set_values
        draw_value
      end
      def set_values
        @val1 = $vts_elechrg1
        @val2 = $vts_elechrg2
        @val3 = $vts_elechrg3
        @val4 = $vts_elechrg4
        @val5 = $vts_elechrg5 if $vts_elechrg5 != nil
        @val6 = $vts_elechrg6 if $vts_elechrg6 != nil
        @val7 = $vts_elechrg7 if $vts_elechrg7 != nil
        @val8 = $vts_elechrg8 if $vts_elechrg8 != nil
        @val9 = $vts_elechrg9 if $vts_elechrg9 != nil
        @val10 = $vts_elechrg10 if $vts_elechrg10 != nil
        @val11 = $vts_elechrg11 if $vts_elechrg11 != nil
        @val12 = $vts_elechrg12 if $vts_elechrg12 != nil
        @val13 = $vts_elechrg13 if $vts_elechrg13 != nil
        @val14 = $vts_elechrg14 if $vts_elechrg14 != nil
        @val15 = $vts_elechrg15 if $vts_elechrg15 != nil
        @val16 = $vts_elechrg16 if $vts_elechrg16 != nil
        @val17 = $vts_elechrg17 if $vts_elechrg17 != nil
        @val18 = $vts_elechrg18 if $vts_elechrg18 != nil
        @val19 = $vts_elechrg19 if $vts_elechrg19 != nil
        @val20 = $vts_elechrg20 if $vts_elechrg20 != nil
      end
      def draw_elements
        draw_icon(VTS_ECF::EIC1,0,0,enabled=true) #Fire
        draw_icon(VTS_ECF::EIC2,0,93,enabled=true) #Ice
        draw_icon(VTS_ECF::EIC3,50,0,enabled=true) #Thunder
        draw_icon(VTS_ECF::EIC4,50,93,enabled=true) #Wind
        draw_icon(VTS_ECF::LIC,0,50,enabled=true) #Fire
        draw_icon(VTS_ECF::LIC,50,50,enabled=true) #Fire
     
        draw_icon(VTS_ECF::EIC5,100,0,enabled=true) if $vts_elechrg5 != nil
        draw_icon(VTS_ECF::EIC6,100,93,enabled=true) if $vts_elechrg6 != nil
        draw_icon(VTS_ECF::EIC7,150,0,enabled=true) if $vts_elechrg7 != nil
        draw_icon(VTS_ECF::EIC8,150,93,enabled=true) if $vts_elechrg8 != nil
        draw_icon(VTS_ECF::LIC,100,50,enabled=true) if $vts_elechrg6 != nil
        draw_icon(VTS_ECF::LIC,150,50,enabled=true) if $vts_elechrg8 != nil
     
        draw_icon(VTS_ECF::EIC9,200,0,enabled=true) if $vts_elechrg9 != nil
        draw_icon(VTS_ECF::EIC10,200,93,enabled=true) if $vts_elechrg10 != nil
        draw_icon(VTS_ECF::EIC11,250,0,enabled=true) if $vts_elechrg11 != nil
        draw_icon(VTS_ECF::EIC12,250,93,enabled=true) if $vts_elechrg12 != nil
        draw_icon(VTS_ECF::LIC,200,50,enabled=true) if $vts_elechrg10 != nil
        draw_icon(VTS_ECF::LIC,250,50,enabled=true) if $vts_elechrg12 != nil
     
        draw_icon(VTS_ECF::EIC13,300,0,enabled=true) if $vts_elechrg13 != nil
        draw_icon(VTS_ECF::EIC14,300,93,enabled=true) if $vts_elechrg14 != nil
        draw_icon(VTS_ECF::EIC15,350,0,enabled=true) if $vts_elechrg15 != nil
        draw_icon(VTS_ECF::EIC16,350,93,enabled=true) if $vts_elechrg16 != nil
        draw_icon(VTS_ECF::LIC,300,50,enabled=true) if $vts_elechrg14 != nil
        draw_icon(VTS_ECF::LIC,350,50,enabled=true) if $vts_elechrg16 != nil
     
        draw_icon(VTS_ECF::EIC17,400,0,enabled=true) if $vts_elechrg17 != nil
        draw_icon(VTS_ECF::EIC18,400,93,enabled=true) if $vts_elechrg18 != nil
        draw_icon(VTS_ECF::EIC19,450,0,enabled=true) if $vts_elechrg19 != nil
        draw_icon(VTS_ECF::EIC20,450,93,enabled=true) if $vts_elechrg20 != nil
        draw_icon(VTS_ECF::LIC,400,50,enabled=true) if $vts_elechrg18 != nil
        draw_icon(VTS_ECF::LIC,450,50,enabled=true) if $vts_elechrg20 != nil
      end
      def draw_value
        draw_text(0,20,40,32,@val1)
        draw_text(0,70,40,32,@val2)
        draw_text(45,20,40,32,@val3)
        draw_text(45,70,40,32,@val4)
        draw_text(100,20,40,32,@val5)if $vts_elechrg5 != nil
        draw_text(100,70,40,32,@val6)if $vts_elechrg6 != nil
        draw_text(145,20,40,32,@val7)if $vts_elechrg7 != nil
        draw_text(145,70,40,32,@val8)if $vts_elechrg8 != nil
        draw_text(200,20,40,32,@val9)if $vts_elechrg9 != nil
        draw_text(200,70,40,32,@val10)if $vts_elechrg10 != nil
        draw_text(245,20,40,32,@val11)if $vts_elechrg11 != nil
        draw_text(245,70,40,32,@val12)if $vts_elechrg12 != nil
        draw_text(300,20,40,32,@val13)if $vts_elechrg13 != nil
        draw_text(300,70,40,32,@val14)if $vts_elechrg14 != nil
        draw_text(345,20,40,32,@val15)if $vts_elechrg15 != nil
        draw_text(345,70,40,32,@val16)if $vts_elechrg16 != nil
        draw_text(400,20,40,32,@val17)if $vts_elechrg17 != nil
        draw_text(400,70,40,32,@val18)if $vts_elechrg18 != nil
        draw_text(445,20,40,32,@val19)if $vts_elechrg19 != nil
        draw_text(445,70,40,32,@val20)if $vts_elechrg20 != nil
      end
     
      def refresh
        contents.clear
        draw_elements
        set_values
        draw_value
      end
     
      def update
        refresh if $vts_elechrg1 != @val1
        refresh if $vts_elechrg2 != @val2
        refresh if $vts_elechrg3 != @val3
        refresh if $vts_elechrg4 != @val4
        refresh if $vts_elechrg5 != @val5 and $vts_elechrg5 != nil
        refresh if $vts_elechrg6 != @val6 and $vts_elechrg6 != nil
        refresh if $vts_elechrg7 != @val7 and $vts_elechrg7 != nil
        refresh if $vts_elechrg8 != @val8 and $vts_elechrg8 != nil
        refresh if $vts_elechrg9 != @val9 and $vts_elechrg9 != nil
        refresh if $vts_elechrg10 != @val10 and $vts_elechrg10 != nil
        refresh if $vts_elechrg11 != @val11 and $vts_elechrg11 != nil
        refresh if $vts_elechrg12 != @val12 and $vts_elechrg12 != nil
        refresh if $vts_elechrg13 != @val13 and $vts_elechrg13 != nil
        refresh if $vts_elechrg14 != @val14 and $vts_elechrg14 != nil
        refresh if $vts_elechrg15 != @val15 and $vts_elechrg15 != nil
        refresh if $vts_elechrg16 != @val16 and $vts_elechrg16 != nil
        refresh if $vts_elechrg17 != @val17 and $vts_elechrg17 != nil
        refresh if $vts_elechrg18 != @val18 and $vts_elechrg18 != nil
        refresh if $vts_elechrg19 != @val19 and $vts_elechrg19 != nil
        refresh if $vts_elechrg20 != @val20 and $vts_elechrg20 != nil
      end
    end
     
    class Scene_Battle < Scene_Base
      alias ele_charge_start start
      def start
        ele_charge_start
        $vts_elechrg1 = 100
        $vts_elechrg2 = 100
        $vts_elechrg3 = 100
        $vts_elechrg4 = 100
        $vts_elechrg5 = 100 if VTS_ECF::ELE5 != nil
        $vts_elechrg6 = 100 if VTS_ECF::ELE6 != nil
        $vts_elechrg7 = 100 if VTS_ECF::ELE7 != nil
        $vts_elechrg8 = 100 if VTS_ECF::ELE8 != nil
        $vts_elechrg9 = 100 if VTS_ECF::ELE9 != nil
        $vts_elechrg10 = 100 if VTS_ECF::ELE10 != nil
        $vts_elechrg11 = 100 if VTS_ECF::ELE11 != nil
        $vts_elechrg12 = 100 if VTS_ECF::ELE12 != nil
        $vts_elechrg13 = 100 if VTS_ECF::ELE13 != nil
        $vts_elechrg14 = 100 if VTS_ECF::ELE14 != nil
        $vts_elechrg15 = 100 if VTS_ECF::ELE15 != nil
        $vts_elechrg16 = 100 if VTS_ECF::ELE16 != nil
        $vts_elechrg17 = 100 if VTS_ECF::ELE17 != nil
        $vts_elechrg18 = 100 if VTS_ECF::ELE18 != nil
        $vts_elechrg19 = 100 if VTS_ECF::ELE19 != nil
        $vts_elechrg20 = 100 if VTS_ECF::ELE20 != nil
      end
      alias element_charge_create_all_windows create_all_windows
      def create_all_windows
        element_charge_create_all_windows
        create_element_window
      end
     
      def create_element_window
        @element_window = Window_ElementCharge.new(VTS_ECF::X,VTS_ECF::Y,VTS_ECF::WIDTH,150)
      end
     
      alias element_charge_use_item use_item
      def use_item
        item = @subject.current_action.item
        if item.is_a?(RPG::Skill)
          @charge_element = item.damage.element_id
          adjust_element_charge(@charge_element, item)
        end
        element_charge_use_item
      end
     
      def adjust_element_charge(element, skill)
        if element == VTS_ECF::ELE1
          $vts_elechrg1 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg2 -= skill.charge_value
          end
        end
        if element == VTS_ECF::ELE2
          $vts_elechrg2 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg1 -= skill.charge_value
          end
        end
        if element == VTS_ECF::ELE3
          $vts_elechrg3 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg4 -= skill.charge_value
          end
        end
        if element == VTS_ECF::ELE4
          $vts_elechrg4 += skill.charge_value
          if VTS_ECF::COUNTER_CHARGE
            $vts_elechrg3 -= skill.charge_value
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE5
            $vts_elechrg5 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg6 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE6
            $vts_elechrg6 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg5 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE7
            $vts_elechrg7 +=skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg8 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE8
            $vts_elechrg8 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg7 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE9
            $vts_elechrg9 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg10 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE10
            $vts_elechrg10 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg9 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE11
            $vts_elechrg11 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg12 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE12
            $vts_elechrg12 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg11 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE13
            $vts_elechrg13 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg14 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE14
            $vts_elechrg14 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg13 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE15
            $vts_elechrg15 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg16 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE16
            $vts_elechrg16 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg15 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE17
            $vts_elechrg17 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg18 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE18
            $vts_elechrg18 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg17 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE19
            $vts_elechrg19 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg20 -= skill.charge_value
            end
          end
        end
        if $vts_elechrg5 != nil
          if element == VTS_ECF::ELE20
            $vts_elechrg20 += skill.charge_value
            if VTS_ECF::COUNTER_CHARGE
              $vts_elechrg19 -= skill.charge_value
            end
          end
        end
      end
    end
    
    #===============================================================================
    #FOF CHANGE
    #===============================================================================
    
    module RPG
      class BaseItem
        def fofc_element
          if @fofc_element.nil?
            if @note =~ /<evolution_element (.*)>/i
              @fofc_element= $1.to_i
            else
              @fofc_element = VTS_ECF::DEF_CSE_ELEMENT
            end
          end
          @fofc_element
        end
     
        def fofc_charge
          if @fofc_charge.nil?
            if @note =~ /<evolution_charge (.*)>/i
              @fofc_charge= $1.to_i
            else
              @fofc_charge = VTS_ECF::DEF_CSE_CHARGE
            end
          end
          @fofc_charge
        end
        def fofc_skill
          if @fofc_skill.nil?
            if @note =~ /<evolution_skill (.*)>/i
              @fofc_skill= $1.to_i
            else
              @fofc_skill = 0
            end
          end
          @fofc_skill
        end
        def charge_value
          if @charge_value.nil?
            if @note =~ /<charge_value (.*)>/i
              @charge_value= $1.to_i
            else
              @charge_value = VTS_ECF::CHARGE_VALUE
            end
          end
          @charge_value
        end
      end
    end
    
    class Game_Action
      attr_accessor :old_skill
    end
    
    class Game_Battler < Game_BattlerBase
      def get_new_skill
        return unless current_action.item.is_a?(RPG::Skill)
    
        quest_skill = current_action.item
     
        if quest_skill.fofc_skill != 0
          if quest_skill.fofc_element == VTS_ECF::ELE1
            if $vts_elechrg1 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
          if quest_skill.fofc_element == VTS_ECF::ELE2
            if $vts_elechrg2 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
          if quest_skill.fofc_element == VTS_ECF::ELE3
            if $vts_elechrg3 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
          if quest_skill.fofc_element == VTS_ECF::ELE4
            if $vts_elechrg4 >= quest_skill.fofc_charge
                current_action.set_skill(quest_skill.fofc_skill)
                current_action.old_skill = quest_skill
                $vts_elechrg1 = 100
            end
          end
        end
      end
    end # Game_Battler
    
    class Window_BattleLog < Window_Selectable
      alias vts_fofchange_display_use_item display_use_item
      def display_use_item(subject, item)
        if item.is_a?(RPG::Skill)
          if subject.current_action.old_skill != nil
            name = subject.name
            change_text = VTS_ECF::CSE_TEXT
            skill_name = item.name + '!'
            use_name = subject.current_action.old_skill.message1
            old_skill_text = name + use_name
            add_text(old_skill_text)
            wait
            if VTS_ECF::CSE_TEXT_SKILL == true
              new_skill_text = change_text + skill_name
              else
              new_skill_text = change_text
            end
            add_text(new_skill_text)
            wait
          end
        end
        vts_fofchange_display_use_item(subject, item)
        subject.current_action.old_skill = nil
      end
    end
    
    class Scene_Battle < Scene_Base
      alias scene_battle_use_item_new use_item
      def use_item
        @subject.get_new_skill
        scene_battle_use_item_new
      end
     
    end # Scene_Battle
     
    Last edited: May 25, 2019
    #2
    Vis_Mage likes this.
  3. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    364
    Likes Received:
    135
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Awesome, everything seems to be working great! Thank you very much! :kaothx:
     
    #3

Share This Page