Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Battle Frenzy

Battle Frenzy
by Dargor
Version 1.1


Introduction

What is battle frenzy? When a battler's hp reaches 1/4 of his max hp, the battler have a chance (in percent) to enter in a frenzy while attacking. The frenzy multiplies the action by a customizable value. For exemple, Ralph is about to die and he tries to attack a mighty slime. He enters in a frenzy and attacks the slime 4 times in a row! Guess what? Ralph won the battle!

This is script works for both actors and enemies.

Script

Please read the instructions in the script header.
Code:
#==============================================================================

# ** Battle Frenzy

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

#  Â© Dargor, 2008

#  13/06/08

#  Version 1.1

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

#  VERSION HISTORY:

#   - 1.0 (04/03/08), Initial release

#   - 1.1 (13/06/08), Added 'Class Based' Battle Frenzy

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

#  INSTRUCTIONS:

#   - Edit the constants in the Frenzy module and enjoy!

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

 

# Text displayed in the battle text window when someone is in a frenzy

Vocab::InFrenzy = "%s is in a frenzy!"

 

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

#  ** Frenzy Configuration

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

 

module Frenzy

  # Actors that can enter in frenzy

  Actors = [1,2]

  # Enemies that can enter in frenzy

  Enemies = [1]

  # Classes that can enter in frenzy

  # (does not take Actors into conssideration)

  Classes = [1,2,3,4]

  # Determine if Actors battle frenzy depends on the actor itself or

  # the actor's class

  Use_Classes = false

  # Frenzy constants for actors

  module Actor

    Rate = { 1 => 75, 2 => 25}

    Rate.default = 25

    Multiplier = { 1 => 4, 2 => 4}

    Multiplier.default = 2

  end

  # Frenzy constants for enemies

  module Enemy

    Rate = { 1 => 100, 2 => 25}

    Rate.default = 25

    Multiplier = { 1 => 3, 2 => 4}

    Multiplier.default = 2

  end

  # Frenzy constants for actors

  module Class

    Rate = { 1 => 75, 2 => 25}

    Rate.default = 25

    Multiplier = { 1 => 4, 2 => 4}

    Multiplier.default = 2

  end

end

 

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

# ** Game_Battler

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

#  This class deals with battlers. It's used as a superclass of the Game_Actor

# and Game_Enemy classes.

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

 

class Game_Battler

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

  # * Application of Slip Damage Effects

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

  def in_frenzy?

    if self.is_a?(Game_Actor)

      if Frenzy::Use_Classes

        return false unless Frenzy::Classes.include?(self.class.id)

        rate = Frenzy::Class::Rate[self.id]

        rate = Frenzy::Class::Rate.default if rate.nil?

      else

        return false unless Frenzy::Actors.include?(self.id)

        rate = Frenzy::Actor::Rate[self.id]

        rate = Frenzy::Actor::Rate.default if rate.nil?

      end

    elsif self.is_a?(Game_Enemy)

      return false unless Frenzy::Enemies.include?(self.enemy_id)

      rate = Frenzy::Enemy::Rate[self.enemy_id]

      rate = Frenzy::Enemy::Rate.default if rate.nil?

    end

    if self.hp <= self.maxhp / 8 && rand(100) <= rate

      return true

    else

      return false

    end

  end

end

 

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

# ** Scene_Battle

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

#  This class performs battle screen processing.

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

 

class Scene_Battle < Scene_Base

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

  # * Alias listing

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

  alias dargor_frenzy_action_attack execute_action_attack

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

  # * Execute Battle Action: Attack

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

  def execute_action_attack

    if @active_battler.in_frenzy?

      text = sprintf(Vocab::InFrenzy, @active_battler.name)

      @message_window.add_instant_text(text)

      wait(20)

      if @active_battler.is_a?(Game_Actor)

        if Frenzy::Use_Classes

          multiplier = Frenzy::Class::Multiplier[@active_battler.class.id]

          multiplier = Frenzy::Class::Multiplier.default if multiplier.nil?

        else

          multiplier = Frenzy::Actor::Multiplier[@active_battler.id]

          multiplier = Frenzy::Actor::Multiplier.default if multiplier.nil?

        end

      elsif @active_battler.is_a?(Game_Enemy)

        multiplier = Frenzy::Enemy::Multiplier[@active_battler.enemy_id]

        multiplier = Frenzy::Enemy::Multiplier.default if multiplier.nil?

      end

      for i in 1..multiplier

        dargor_frenzy_action_attack

        @message_window.back_one

      end

    else

      dargor_frenzy_action_attack

    end

  end

end

Notes

This script is compatible with my Weapon Unleash Script.
Don't forget to give me credit!

Hope you like it!
-Dargor
 
No, because an XP version would be harder to code and less compatible. VX Battle System is extremely well organized compared to the 4 Parts DBS in XP.
 
Dargor, would be possible for an actor when the battle frenzy is active to activate an event or even a script call? And can an actor play 4 spells instead normal attacks? Thanks.
 
It's not possible right now but it's doable.
1) You want to call a parallel process when a certain actor enters in a frenzy?
2) How exactly do you imagine the "skill" frenzy?
 
1) Yes, Dargor, it would be that (call a paralel process), like an event or even other script.

2) I thought it would only make the actors use common attacks, instead of using spells too.
 

Amaras

Member

What if I only want one character to be able go into frenzy (it's pretty much his special ability). How would I go about doing that?
 
Suggestion:
What about when the user reaches 1/4 hp his normal attack will be replaced by a certian skill, (like ff8's LIMIT BREAK!)
 
Would it be possible to make this available to specific CLASSES instead of the ACTORS themselves? Since I'm using Prexus's Job Changing script, it would be nice for it to work for classes instead.
 
Nice script.  For those of you asking for an XP version... there already is an XP version out there somewhere.  It's called something different, but I used it in an XP game that I was developing a while back.  Too bad that computer crashed and I can't remember the name of it :(

But I assure there is one out there.
 
You're right, I think Trickster did it 2 years ago.

@omegazion 
That's exactly Limit Break. I won't add this feature to the battle frenzy script, I'll post my Limit Break script instead.

@psiclone 
Good idea :thumb:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top