FF6-style Limit Break system

Discussion in 'JS Plugin Requests' started by Jeffafa, Nov 11, 2015.

  1. Jeffafa

    Jeffafa Multi-colored Mage Veteran

    Messages:
    42
    Likes Received:
    1
    Location:
    New Orleans
    First Language:
    English
    I want to implement Limit Breaks into my game, but I want them to be less controlled than most of the Final Fantasy limit breaks. I liked FF6's system, where it was a small random chance that your character would execute a limit break (Desperation Attack, I believe they were called), and it was only when the character was in critical.

    Selchar made one for VX Ace a while back. Here it is, for what it's worth and if it helps:

    #===============================================================================

    #Script: Limit Break 8

    #Author: Selchar

    #-------------------------------------------------------------------------------

    =begin

    This is a rather basic implementation of the Limit Break system from FF8.  To

    use it, start with the settings below.  You create a skill category much like

    the default Special/Magic, and place it's number in TYPE_ID.  Then you create

    skills in said category and have your actors learn them.  They don't need to

    have the "Limit" category under features as the command will appear on it's own

    when the conditions have been met(Below HP and random chance).

     

    Finally, the Limit command will only appear to actors who have the notetag

    <use_limit_break>

    =end

    #===============================================================================

     

    module SEL

      module LIMIT_BREAK_8

        #How low your hp must be before your chosen skill type can show.

        HP_LIMIT = 20

        

        #Odds of your chosen skill type showing after passing the HP check

        SHOW_CHANCE = 20

        

        #Use this to designate a skill type to be used for Limit Breaks.

        TYPE_ID = 4

        

        #Choose whether your "Limit" command will either replace, or appear above

        #the Attack command.

        REPLACE_ATTACK = true

      end

    end

     

    #===============================================================================

    #Don't edit below this line unless you know what you are doing.

    #===============================================================================

    $imported = {} if $imported.nil?

    class Window_ActorCommand < Window_Command

      #--------------------------------------------------------------------------

      # * Alias: Add Attack Command to List

      #--------------------------------------------------------------------------

      alias sel_limit_break_add_attack_command add_attack_command

      def add_attack_command

        current_hp_percent = 100*@actor.hp/@actor.mhp

        if current_hp_percent <= SEL::LIMIT_BREAK_8::HP_LIMIT

          chance = 1+rand(100)

          if chance <= SEL::LIMIT_BREAK_8::SHOW_CHANCE

            if  $data_actors[@actor.id].use_limit_break == true

              add_limit_command

              return if SEL::LIMIT_BREAK_8::REPLACE_ATTACK

            end

          end

        end

        sel_limit_break_add_attack_command

      end

      

      #--------------------------------------------------------------------------

      # * Overwrite Add Skill Command to List

      #--------------------------------------------------------------------------

      def add_skill_commands

        @actor.added_skill_types.sort.each do |stype_id|

          next if stype_id == SEL::LIMIT_BREAK_8::TYPE_ID

          name = $data_system.skill_types[stype_id]

          add_command(name, :skill, true, stype_id)

        end

      end

      

      

      #--------------------------------------------------------------------------

      # * New Method: Add Limit Command to List

      #--------------------------------------------------------------------------

      def add_limit_command

        name = $data_system.skill_types[sEL::LIMIT_BREAK_8::TYPE_ID]

        add_command(name, :skill, true, SEL::LIMIT_BREAK_8::TYPE_ID)

      end

    end

     

    module RPG

      class Actor

        def use_limit_break

          if @use_limit_break.nil?

            if @note =~ /<use_limit_break>/i

              @use_limit_break = true

            else

              @use_limit_break = false

            end

          end

          @use_limit_break

        end

      end

    end

     

    #Yanfly Battle Command Compatibility

    if $imported["YEA-BattleCommandList"]

      class Window_ActorCommand < Window_Command

        def add_skill_commands

          @actor.added_skill_types.each do |stype_id|

            next if stype_id == SEL::LIMIT_BREAK_8::TYPE_ID

            next if @stype_list.include?(stype_id)

            next if include_subclass_type?(stype_id)

            add_skill_type_command(stype_id)

          end

        end

      end

    end
     
    #1

Share This Page