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.

Conversion: VX to VXA

I would really appreciate it if someone could convert these two scripts for use in RMVXAce.

Code:
#/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\|/

#~ Battler SE (Default Battle System Version)

#~ By: Rockleedude

#~ Version: 3.0

#~ Latest Update: 10/26/2009

#~

#~ This script allows you to add 13 different sound effects to play for 

#~ actors and enemies in battle.

#~

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

#~                               Instructions

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

#~ To setup the sound effects played for a battler, use the following tag:

#~ <battler se (type) (name) v(volume) p(pitch)>

#~ (type): One of the 13 types. They are specified in the "For type" section.

#~ (name): The name of the song file for the sound effect. Put playnothing to

#~         mute the sound effects for that type.

#~ (volume): The sound effect's volume.

#~ (pitch): The sound effect's pitch.

#~

#~ The tags for enemies go into the notes box in the database.

#~ The tags for actors go in the customization section below in this script.

#~

#~ For type:

#~   Put the type corresponding to whichever type of sound effect this sound is.

#~   i.e. If this is the sound effect for when the battler takes damage, put take.

#~   The 13 types are the following:

#~      1. Take - Played when the battler loses hp or mp as a result of the

#~                action of another battler.

#~      2. Recover - Played when the battler regains hp or mp, loses a negative

#~                   state, or is revived from death.

#~      3. Evade - Played when the battler dodges an attack.

#~      4. Plus State - Played when the battler receives a positive, good state.

#~                      Does not play if both a plus and minus state are received.

#~      5. Minus State - Played when the battler receives a negative, bad state.

#~                      Does not play if both a plus and minus state are received.

#~      6. Attack - Played when the battler does a regular attack or uses a

#~                  skill or item that has physical attack checked.

#~      7. Target Foe - Played when the battler uses a skill or item that

#~                      targets one or more foes.

#~      8. Target Ally - Played when the battler uses a skill or item that

#~                       targets one or more allies. Does not play if the only

#~                       target is the battler itself.

#~      9. Self - Played when the battler uses a skill or item that targets

#~                iteself.

#~      10. Critical Hit - Played when the battler delivers a critical hit.

#~      11. Miss - Played when the battler misses with an attack.

#~      12. Death - Played when the battler dies.

#~      13. Low Health - Played when the battler's hp falls below a specified

#~                       amount.

#~ For name:

#~   This should be the exact name of the file. So if the file name is "Scream"

#~   you should put "Scream" and not "scream" (Notice the difference in first

#~   letters). You can have quotation marks around the name of file if you 

#~   choose to. The file type of the sound effect is also optional.

#~   Files for the sound effects should be located in the SE folder that

#~   is inside the Audio folder of your project. You also have the choice of

#~   creating a folder inside the SE folder to store the battler sound effects in.

#~   The purpose of this is to avoid having a name conflict between a regular

#~   sound effect and a sound effect for an battler. This could also help with

#~   organization. This is all up to you. In the customization section below,

#~   type in the exact name of the folder. If you are not using the custom

#~   folder, then put nil instead. Note, if the custom folder exists, it

#~   will be searched first before looking in the SE folder.

#~   To completely mute the sound effects (even the default sound effects) for

#~   particularly type for a battler, put playnothing into the name spot. This

#~   will make it so no sound effect will play for that type for that battler.

#~   Note that playnothing with quotation marks ("playnothing") will not mute 

#~   the se. Instead it would search for the sound effect named "playnothing".

#~ For volume:

#~   This is the volume for the sound effect. Be sure to include the "v" before

#~   the volume. Use the sound test to help decide what you want this value to

#~   be. The volume can be left out. If it is left out, then the default

#~   volume will be used instead. You can set the default volume in the

#~   customization section. Must be between 0 and 100.

#~ For pitch:

#~   This is the pitch for the sound effect. Be sure to include the "p" before

#~   the pitch. Use the sound test to help decide what you want this value to

#~   be. The pitch can also be left out. If it is left out, then the default

#~   pitch will be used instead. You can set the default pitch in the

#~   customization section. Must be between 50 and 150.

#~ You can insert more than one sound effect for each type for a battler. Each

#~ sound effect for each type must be in a separate tag. When there is more than

#~ one sound effect for a particular type of a battler, a sound effect will

#~ randomly be chosen to be played. Note, if playnothing is one of the choices, 

#~ it can be randomly chosen. Just because playnothing is one of the choices 

#~ does not mean it will automatically play nothing for that type. It has to be

#~ chosen randomly.

#~

#~

#~

#~ Examples:

#~

#~ <battler se death Scream v85 p100>

#~ - Will play the sound file "Scream" with the volume as 85 and pitch as 100

#~   for the death sound effect.

#~

#~ <battler se target foe "Roar" p90>

#~ - Will play the sound file "Roar" with the volume as the default and pitch as

#~   90 for the target foe sound effect. Remember, the quotation marks are not

#~   required.

#~

#~ <battler se minus state Groan>

#~ - Will play the sound file "Groan" with the volume and pitch as the defaults

#~   for the minus state damage sound effect.

#~

#~ <battler se evade playnothing>

#~ - Will play no sound effect, not even the default sound effect chosen in the 

#~   database, when the battler evades.

#~   

#~

#/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\/|\|/|\|/

 

$imported = {} if $imported == nil

$imported["Battler_SE"] = true

 

module Rockleedude

  module Battler_SE

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

#                               CUSTOMIZATION

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

                              # Setup for Actors #

    # With the addition of the actor part of the script, comes an addition to

    # the customization section. Since actors have no notes box like enemies

    # do, another method had to be used for setup for actors. Basically, I

    # created a notes box for actors in this script (note this "notes box" will 

    # only work for this script). The syntax for the tag is exactly the same

    # as the syntax for enemies. Put ACTOR_SE_SETUP[x] = "  y  " where x is the

    # id of the actor and y is the tags. You can have any number of lines of

    # tag between the quotation marks. See the example below if confused.

    # 

    # The following is an example:

    #   ACTOR_SE_SETUP[1] = 

    #  "<battler se take Ouch> 

    #   <battler se take playnothing>

    #   <battler se attack Yell>

    #   <battler se death Scream p125>"

    #

    ACTOR_SE_SETUP = [] # Do not alter or remove!

    #

    #

    #               --> Insert Tags for Actors Below Here <--

 

 

    

    

    #               --> Insert Tags for Actors Above Here <--

    

    

    BATTLER_SE_FOLDER_NAME = nil

    # The name of the folder inside of the SE folder where the battler sound

    # effects are stored. Include quotation marks around the name.

    # For example: "Battler_SE"

    # If the custom folder is not being used, put nil with no quotations.

    

    DEFAULT_VOLUME = 100

    # The volume used whenever the volume is left out of the tag.

    # Can be 0-100

    DEFAULT_PITCH = 100

    # The pitch used whenever the pitch is left out of the tag.

    # Can be 50-150

    

    PLUS_STATES = [9, 10, 11, 12]

    # The states that are considered positive, good states. When a battler

    # receives one of these states, the specified plus state sound effect will

    # play. Insert the id of the state in the above array.

    MINUS_STATES = [1, 2, 3, 4, 5, 6, 7, 8, 13, 14, 15, 16]

    # The states that are considered negative, bad states. When a battler

    # receives one of these states, the specified minus state sound effect will

    # play. Insert the id of the state in the above array.

    #

    # States can be left out if they don't fall into either category of plus

    # or negative.

    

    DEATH_STATE_ID = 1

    # The id of the state that represents death, knock-out, incapacitated, etc.

    # The default is id 1. There is really no reason to change the id of the

    # death state but I had to include this just incase.

    

    LOW_HEALTH_PERCENTAGE = 25

    # The percentage that determines when the low health sound effect is played. 

    # This number should be between 0 and 100 since it's a percentage. The color 

    # of the hp shown in the status changes to yellow when the hp is below 25%

    # incase you want to make it as much as the game considers low health.

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

#                             END CUSTOMIZATION

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

 

    BATTLER_SE = /<BATTLER[\s_]?SE[\s_]?(TAKE|RECOVER|EVADE|PLUSSTATE|PLUS[\s]STATE|PLUS_STATE|MINUSSTATE|MINUS[\s]STATE|MINUS_STATE|ATTACK|TARGETFOE|TARGET[\s]FOE|TARGET_FOE|TARGETALLY|TARGET[\s]ALLY|TARGET_ALLY|CRITICALHIT|CRITICAL[\s]HIT|CRITICAL_HIT|MISS|DEATH|LOWHEALTH|LOW[\s]HEALTH|LOW_HEALTH|SELF)[\s_]?(.*?)[\s_]?(v\d*?)?[\s_]?(p\d*?)?>/i

    BATTLER_SE_PLAYNOTHING = /<BATTLER[\s_]?SE[\s_]?(TAKE|RECOVER|EVADE|PLUSSTATE|PLUS[\s]STATE|PLUS_STATE|MINUSSTATE|MINUS[\s]STATE|MINUS_STATE|ATTACK|TARGETFOE|TARGET[\s]FOE|TARGET_FOE|TARGETALLY|TARGET[\s]ALLY|TARGET_ALLY|CRITICALHIT|CRITICAL[\s]HIT|CRITICAL_HIT|MISS|DEATH|LOWHEALTH|LOW[\s]HEALTH|LOW_HEALTH|SELF)[\s_]?PLAYNOTHING>/i

  end

end

 

#

# SE CLASS

#

class RPG::SE

  

    def battler_se_play

      folder = Rockleedude::Battler_SE::BATTLER_SE_FOLDER_NAME

      unless @name.empty?

        unless folder == nil

          begin

            Audio.se_play("Audio/SE/" + folder + "/" + @name, @volume, @pitch)

            #print @name + ": name" if $TEST

          rescue

            begin

              play

            rescue

              print "The sound effect, " + @name + ", is not found in either folder." if $TEST

              return false

            end

          end

        else

          begin

            play

          rescue

            print "The sound effect, " + name + ", is not found in the SE folder.

            If you created a Battler_SE folder be sure you put the name correctly

            in the module as BATTLER_SE_FOLDER_NAME" if $TEST

            return false

          end

        end

      else

        return false

      end

    end

 

    def play

      unless @name.empty?

        Audio.se_play("Audio/SE/" + @name, @volume, @pitch)

      end

    end

end # class end

 

#

# SOUND MODULE

#

module Sound

 

  def self.play_enemy_attack

  end

 

  def self.play_enemy_damage

  end

  

  def self.play_enemy_collapse

  end

 

  def self.play_actor_damage

  end

 

  def self.play_actor_collapse

  end

 

  def self.play_recovery

  end

 

  def self.play_miss

  end

 

  def self.play_evasion

  end

 

  def self.play_battler_se(battler_id, type, a_or_e, default) 

   # Type:   0: Take, 1: Recover, 2: Evade, 3: Plus State, 4: Minus State, 

   # Type:   5: Attack, 6: Target Foe, 7: Target Ally, 8: Critical Hit, 9: Miss,

   # Type:   10: Death, 11: Low Health, 12: Self

   # a_or_e: 1: Actor  2: Enemy

                  

    se = $data_actor_se[battler_id] if a_or_e == 1

    se = $data_enemy_se[battler_id] if a_or_e == 2

    unless se[type].empty?

      chosen_se = se[type][rand(se[type].size)]

    else

      Sound.play_default_se(type, a_or_e)

      return

    end

    #print chosen_se.inspect + ":chosen_se" if $TEST

    return if chosen_se == "PLAYNOTHING"

    t_or_f = chosen_se.battler_se_play

    return if default == false

    Sound.play_default_se(type, a_or_e) if t_or_f == false

  end

    

  def self.play_default_se(type, a_or_e)

    if a_or_e == 1

      $data_system.sounds[12].play if type == 0

      $data_system.sounds[13].play if type == 10

    else

      $data_system.sounds[9].play if type == 5

      $data_system.sounds[10].play if type == 0

      $data_system.sounds[11].play if type == 10

    end

    $data_system.sounds[14].play if type == 1

    $data_system.sounds[15].play if type == 9

    $data_system.sounds[16].play if type == 2

  end

  

end

 

#

# SCENE_BATTLE CLASS

#

class Scene_Battle < Scene_Base

 

  # HP: Take(0) and Recover(1)

  alias display_hp_damage_orig_rld_battler_se display_hp_damage

  def display_hp_damage(target, obj = nil)

    if target.hp_damage > 0

      if target.actor?

        Sound.play_battler_se(target.actor_id, 0, 1, true)

      else

        Sound.play_battler_se(target.enemy_id, 0, 2, true)

      end

    elsif target.hp_damage < 0

      if target.actor?

        Sound.play_battler_se(target.actor_id, 1, 1, true)

      else

        Sound.play_battler_se(target.enemy_id, 1, 2, true)

      end

    end

    display_hp_damage_orig_rld_battler_se(target, obj = nil)

  end

 

  # MP: Take(0) and Recover(1)

  alias display_mp_damage_orig_rld_battler_se display_mp_damage

  def display_mp_damage(target, obj = nil)

    if target.hp_damage == 0

      if target.mp_damage > 0

        if target.actor?

          Sound.play_battler_se(target.actor_id, 0, 1, false)

        else

          Sound.play_battler_se(target.enemy_id, 0, 2, false)

        end

      elsif target.mp_damage < 0

        if target.actor?

          Sound.play_battler_se(target.actor_id, 1, 1, true)

        else

          Sound.play_battler_se(target.enemy_id, 1, 2, true)

        end

      end

    end

    display_mp_damage_orig_rld_battler_se(target, obj = nil)

  end

  

  # Recover(1) for Removed Minus States

  def play_if_minus_state_removed(target, obj = nil)

    return unless (target.hp_damage == 0) and (target.mp_damage == 0)

    plus_a = []

    minus_a = []

    plus_list = Rockleedude::Battler_SE::PLUS_STATES

    minus_list = Rockleedude::Battler_SE::MINUS_STATES

    for state in target.removed_states

      plus_a.insert(0, state) if plus_list.include?(state.id)

      minus_a.insert(0, state) if minus_list.include?(state.id)

      if state.id == Rockleedude::Battler_SE::DEATH_STATE_ID

        if target.actor?

          Sound.play_battler_se(target.actor_id, 1, 1, false)

        else

          Sound.play_battler_se(target.enemy_id, 1, 2, false)

        end

        return

      end

    end

    return if (plus_a.size != 0) and (minus_a.size != 0)

    return if plus_a.empty? and minus_a.empty?

    if plus_a.empty?

      if target.actor?

        Sound.play_battler_se(target.actor_id, 1, 1, false)

      else

        Sound.play_battler_se(target.enemy_id, 1, 2, false)

      end

    end

  end

 

  # Evade(2)

  alias display_evasion_orig_rld_battler_se display_evasion

  def display_evasion(target, obj = nil)

    if target.actor?

      Sound.play_battler_se(target.actor_id, 2, 1, true)

    else

      Sound.play_battler_se(target.enemy_id, 2, 2, true)

    end

    display_evasion_orig_rld_battler_se(target, obj = nil)

  end

 

  # Plus State(3) and Minus State(4)

  def play_if_plus_or_minus_added(target, obj = nil)

    plus_a = []

    minus_a = []

    plus_list = Rockleedude::Battler_SE::PLUS_STATES

    minus_list = Rockleedude::Battler_SE::MINUS_STATES

    for state in target.added_states

      plus_a.insert(0, state) if plus_list.include?(state.id)

      minus_a.insert(0, state) if minus_list.include?(state.id)

      return if state.id == Rockleedude::Battler_SE::DEATH_STATE_ID

    end

    return if (plus_a.size != 0) and (minus_a.size != 0)

    return if plus_a.empty? and minus_a.empty?

    return unless (target.hp_damage == 0) and (target.mp_damage == 0)

    if minus_a.empty?

      if target.actor?

        Sound.play_battler_se(target.actor_id, 3, 1, false)

      else

        Sound.play_battler_se(target.enemy_id, 3, 2, false)

      end

    elsif plus_a.empty?

      if target.actor?

        Sound.play_battler_se(target.actor_id, 4, 1, false)

      else

        Sound.play_battler_se(target.enemy_id, 4, 2, false)

      end

    end

  end

  alias display_added_states_orig_rld_battler_se display_added_states

  def display_added_states(target, obj = nil)

    play_if_plus_or_minus_added(target, obj = nil)

    play_if_minus_state_removed(target, obj = nil)

    display_added_states_orig_rld_battler_se(target, obj = nil)

  end

 

  # Attack(5)

  alias display_attack_animation_orig_rld_battler_se display_attack_animation

  def display_attack_animation(targets)

    if @active_battler.actor?

      Sound.play_battler_se(@active_battler.actor_id, 5, 1, false)

      wait(15, true)

    else

      Sound.play_battler_se(@active_battler.enemy_id, 5, 2, true)

    end

    display_attack_animation_orig_rld_battler_se(targets)

  end

  def play_attack_if_ui_phy_atk

    if @active_battler.action.skill?

      if @active_battler.action.skill.physical_attack

        if @active_battler.actor?

          Sound.play_battler_se(@active_battler.actor_id, 5, 1, false)

        else

          Sound.play_battler_se(@active_battler.enemy_id, 5, 2, false)

        end

      end

    end

    if @active_battler.action.item?

      if @active_battler.action.item.physical_attack

        if @active_battler.actor?

          Sound.play_battler_se(@active_battler.actor_id, 5, 1, false)

        else

          Sound.play_battler_se(@active_battler.enemy_id, 5, 2, false)

        end

      end

    end

  end

 

  # Target Foe(6) and Target Ally(7) and Self(12)

  def play_if_target_foe_or_ally_or_self(targets)

    if @active_battler.action.skill?

      return if @active_battler.action.skill.physical_attack

    elsif @active_battler.action.item?

      return if @active_battler.action.item.physical_attack

    end

    if targets.compact.size == 1

      if targets.compact[0] == @active_battler

        if @active_battler.actor?

          Sound.play_battler_se(@active_battler.actor_id, 12, 1, false)

        else

          Sound.play_battler_se(@active_battler.enemy_id, 12, 2, false)

        end

        return

      end

    end

    return if targets.nitems == 0

    unless targets.compact[0].actor?

      if @active_battler.actor?

        Sound.play_battler_se(@active_battler.actor_id, 6, 1, false)

      else

        Sound.play_battler_se(@active_battler.enemy_id, 7, 2, false)

      end

    else

      if @active_battler.actor?

        Sound.play_battler_se(@active_battler.actor_id, 7, 1, false)

      else

        Sound.play_battler_se(@active_battler.enemy_id, 6, 2, false)

      end

    end

  end

  alias display_animation_orig_rld_battler_se display_animation

  def display_animation(targets, animation_id)

    play_attack_if_ui_phy_atk

    play_if_target_foe_or_ally_or_self(targets)

    display_animation_orig_rld_battler_se(targets, animation_id)

  end

 

  # Critical Hit(8)

  alias display_critical_orig_rld_battler_se display_critical

  def display_critical(target, obj = nil)

    if target.critical

      if @active_battler.actor?

        Sound.play_battler_se(@active_battler.actor_id, 8, 1, false)

      else

        Sound.play_battler_se(@active_battler.enemy_id, 8, 2, false)

      end

    end

    display_critical_orig_rld_battler_se(target, obj = nil)

  end

  

  # Miss(9)

  alias display_miss_orig_rld_battler_se display_miss

  def display_miss(target, obj = nil)

    if obj == nil or obj.physical_attack

      if @active_battler.actor?

        Sound.play_battler_se(@active_battler.actor_id, 9, 1, true)

      else

        Sound.play_battler_se(@active_battler.enemy_id, 9, 2, true)

      end

    end

    display_miss_orig_rld_battler_se(target, obj = nil)

  end

  

end # class end

 

#

# GAME_BATTLER CLASS

#

class Game_Battler

  

  # Low Health(11)

  alias execute_damage_orig_rld_battler_se execute_damage

  def execute_damage(user)

    max_hp_b = maxhp

    hp_b = self.hp

    execute_damage_orig_rld_battler_se(user)

    max_hp_a = maxhp

    hp_a = self.hp

    ratio_b = hp_b.to_f / max_hp_b.to_f

    ratio_a = hp_a.to_f / max_hp_a.to_f

    #print ratio_b.inspect + ":ratio_b    " + ratio_a.inspect + ":ratio_a"

    lowh_percent = Rockleedude::Battler_SE::LOW_HEALTH_PERCENTAGE

    unless hp_a <= 0

      if lowh_percent.between?(0.0, 100.0)

        lowh_percent = lowh_percent.to_f / 100.0

        if ratio_b > lowh_percent

          if ratio_a < lowh_percent

            if self.actor?

              Sound.play_battler_se(self.actor_id, 11, 1, false)

            else

              Sound.play_battler_se(self.enemy_id, 11, 2, false)

            end

          end

        end

      end

    end

  end

  

end # class end

 

#

# GAME_ACTOR CLASS

#

 

class Game_Actor < Game_Battler

  attr_accessor :battler_se_note

  

  alias perform_collapse_orig_rld_battler_se perform_collapse

  def perform_collapse

    Sound.play_battler_se(@actor_id, 10, 1, true) if $game_temp.in_battle and dead?

    perform_collapse_orig_rld_battler_se

  end

  

  def actor_id

    return @actor_id

  end

  

  alias setup_orig_battler_se setup

  def setup(actor_id)

    setup_orig_battler_se(actor_id)

    @battler_se_note = Rockleedude::Battler_SE::ACTOR_SE_SETUP

  end

  

end # class end

 

#

# GAME_ENEMY CLASS

#

class Game_Enemy < Game_Battler

  alias perform_collapse_orig_rld_battler_se perform_collapse

  def perform_collapse

    Sound.play_battler_se(@enemy_id, 10, 2, true) if $game_temp.in_battle and dead?

    perform_collapse_orig_rld_battler_se

  end

  

end # class end

 

#

# ACTOR CLASS

#

class RPG::Actor

  attr_accessor :battler_se_note

  

  # Battler Receiving

  attr_accessor :take_damage_se

  attr_accessor :recover_damage_se

  attr_accessor :evade_se

  attr_accessor :plus_state_se

  attr_accessor :minus_state_se

  

  # Battler Delivering

  attr_accessor :attack_se

  attr_accessor :target_foe_se

  attr_accessor :target_ally_se

  attr_accessor :critical_hit_se

  attr_accessor :miss_se

  

  # Random Conditions

  attr_accessor :death_se

  attr_accessor :low_health_se

  attr_accessor :self_se

  

  def gsub_without_md(string)

    string.gsub!(/ /i, "")

    string.gsub!(/_/i, "")

    return string

  end

  

  def prepare_se_cache

    # Battler Receiving

    @take_damage_se = []

    @recover_damage_se = []

    @evade_se = []

    @plus_state_se = []

    @minus_state_se = []

    

    # Battler Delivering

    @attack_se = []

    @target_foe_se = []

    @target_ally_se = []

    @critical_hit_se = []

    @miss_se = []

    

    # Random Conditions

    @death_se = []

    @low_health_se = []

    @self_se = []

 

    a = Rockleedude::Battler_SE::ACTOR_SE_SETUP[@id]

    @battler_se_note = ""

    @battler_se_note = a if a != nil

  end

  

  def create_se_cache

    prepare_se_cache

    dv = Rockleedude::Battler_SE::DEFAULT_VOLUME

    dp = Rockleedude::Battler_SE::DEFAULT_PITCH

    self.battler_se_note.split(/[\r\n]+/).each { |line|

    case line

    when Rockleedude::Battler_SE::BATTLER_SE

      type = $1

      type.upcase! unless $1 == nil

      type = gsub_without_md(type) unless $1 == nil

      case type

      when "TAKE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @take_damage_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "RECOVER"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @recover_damage_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"  

      when "EVADE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @evade_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "PLUSSTATE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @plus_state_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "MINUSSTATE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @minus_state_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "ATTACK"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @attack_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "TARGETFOE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @target_foe_se.insert(0, se) if se.name.upcase != "PLAYNOTHING" 

      when "TARGETALLY"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @target_ally_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "CRITICALHIT"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @critical_hit_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "MISS"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @miss_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "DEATH"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @death_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "LOWHEALTH"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @low_health_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "SELF"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @self_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      end

    end

    case line

    when Rockleedude::Battler_SE::BATTLER_SE_PLAYNOTHING

      type = $1

      type.upcase! unless $1 == nil

      type.gsub!(/ /i, "") unless $1 == nil

      case type

      when "TAKE"

        @take_damage_se.insert(0, "PLAYNOTHING")

      when "RECOVER"

        @recover_damage_se.insert(0, "PLAYNOTHING")  

      when "EVADE"

        @evade_se.insert(0, "PLAYNOTHING") 

      when "PLUSSTATE"

        @plus_state_se.insert(0, "PLAYNOTHING") 

      when "MINUSSTATE"

        @minus_state_se.insert(0, "PLAYNOTHING") 

      when "ATTACK"

        @attack_se.insert(0, "PLAYNOTHING") 

      when "TARGETFOE"

        @target_foe_se.insert(0, "PLAYNOTHING") 

      when "TARGETALLY"

        @target_ally_se.insert(0, "PLAYNOTHING") 

      when "CRITICALHIT"

        @critical_hit_se.insert(0, "PLAYNOTHING") 

      when "MISS"

        @miss_se.insert(0, "PLAYNOTHING") 

      when "DEATH"

        @death_se.insert(0, "PLAYNOTHING") 

      when "LOWHEALTH"

        @low_health_se.insert(0, "PLAYNOTHING") 

      when "SELF"

        @self_se.insert(0, "PLAYNOTHING") 

      end

    end

    }

  end

  

end # class end

 

#

# ENEMY CLASS

#

class RPG::Enemy

  # Battler Receiving

  attr_accessor :take_damage_se

  attr_accessor :recover_damage_se

  attr_accessor :evade_se

  attr_accessor :plus_state_se

  attr_accessor :minus_state_se

  

  # Battler Delivering

  attr_accessor :attack_se

  attr_accessor :target_foe_se

  attr_accessor :target_ally_se

  attr_accessor :critical_hit_se

  attr_accessor :miss_se

  

  # Random Conditions

  attr_accessor :death_se

  attr_accessor :low_health_se

  attr_accessor :self_se

  

  def gsub_without_md(string)

    string.gsub!(/ /i, "")

    string.gsub!(/_/i, "")

    return string

  end

  

  def prepare_se_cache

    # Battler Receiving

    @take_damage_se = []

    @recover_damage_se = []

    @evade_se = []

    @plus_state_se = []

    @minus_state_se = []

    

    # Battler Delivering

    @attack_se = []

    @target_foe_se = []

    @target_ally_se = []

    @critical_hit_se = []

    @miss_se = []

    

    # Random Conditions

    @death_se = []

    @low_health_se = []

    @self_se = []

  end

  

  def create_se_cache

    prepare_se_cache

    dv = Rockleedude::Battler_SE::DEFAULT_VOLUME

    dp = Rockleedude::Battler_SE::DEFAULT_PITCH

    self.note.split(/[\r\n]+/).each { |line|

    case line

    when Rockleedude::Battler_SE::BATTLER_SE

      type = $1

      type.upcase! unless $1 == nil

      type = gsub_without_md(type) unless $1 == nil

      case type

      when "TAKE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @take_damage_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "RECOVER"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @recover_damage_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"  

      when "EVADE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @evade_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "PLUSSTATE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @plus_state_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "MINUSSTATE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @minus_state_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "ATTACK"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @attack_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "TARGETFOE"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @target_foe_se.insert(0, se) if se.name.upcase != "PLAYNOTHING" 

      when "TARGETALLY"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @target_ally_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "CRITICALHIT"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @critical_hit_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "MISS"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @miss_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "DEATH"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @death_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "LOWHEALTH"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @low_health_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      when "SELF"

        se = RPG::SE.new($2, dv, dp)

        se.volume = $3 if $3 != nil

        se.volume = se.volume[1,3].to_i if $3.class == String

        se.pitch = $4 if $4 != nil

        se.pitch = se.pitch[1,3].to_i if $4.class == String

        @self_se.insert(0, se) if se.name.upcase != "PLAYNOTHING"

      end

    end

    case line

    when Rockleedude::Battler_SE::BATTLER_SE_PLAYNOTHING

      type = $1

      type.upcase! unless $1 == nil

      type.gsub!(/ /i, "") unless $1 == nil

      case type

      when "TAKE"

        @take_damage_se.insert(0, "PLAYNOTHING")

      when "RECOVER"

        @recover_damage_se.insert(0, "PLAYNOTHING")  

      when "EVADE"

        @evade_se.insert(0, "PLAYNOTHING") 

      when "PLUSSTATE"

        @plus_state_se.insert(0, "PLAYNOTHING") 

      when "MINUSSTATE"

        @minus_state_se.insert(0, "PLAYNOTHING") 

      when "ATTACK"

        @attack_se.insert(0, "PLAYNOTHING") 

      when "TARGETFOE"

        @target_foe_se.insert(0, "PLAYNOTHING") 

      when "TARGETALLY"

        @target_ally_se.insert(0, "PLAYNOTHING") 

      when "CRITICALHIT"

        @critical_hit_se.insert(0, "PLAYNOTHING") 

      when "MISS"

        @miss_se.insert(0, "PLAYNOTHING") 

      when "DEATH"

        @death_se.insert(0, "PLAYNOTHING") 

      when "LOWHEALTH"

        @low_health_se.insert(0, "PLAYNOTHING") 

      when "SELF"

        @self_se.insert(0, "PLAYNOTHING") 

      end

    end

    }

  end

  

end # class end

 

#

# SCENE_TITLE CLASS

#

class Scene_Title < Scene_Base

 

  alias load_database_orig_rld_battler_se load_database

  def load_database

    load_database_orig_rld_battler_se

    load_battler_se

  end

  

  alias load_bt_database_orig_rld_battler_se load_bt_database

  def load_bt_database

    load_bt_database_orig_rld_battler_se

    load_battler_se

  end

  

  def load_battler_se

    n = 0

    $data_actor_se = []

    $data_enemy_se = []

    

 # Actor SE's  

    for actor in $data_actors

      next if actor == nil

      actor.create_se_cache

      take = actor.take_damage_se

      recover = actor.recover_damage_se

      evade = actor.evade_se

      plusstate = actor.plus_state_se

      minusstate = actor.minus_state_se

      attack = actor.attack_se

      targetfoe = actor.target_foe_se

      targetally = actor.target_ally_se

      criticalhit = actor.critical_hit_se

      miss = actor.miss_se

      death = actor.death_se

      lowhealth = actor.low_health_se

      selfse = actor.self_se

      $data_actor_se[actor.id] = [take, recover, evade, plusstate, minusstate, attack, targetfoe, targetally, criticalhit, miss, death, lowhealth, selfse] #deal, 

    end

    

  # Enemy SE's

    for enemy in $data_enemies

      next if enemy == nil

      enemy.create_se_cache

      take = enemy.take_damage_se

      recover = enemy.recover_damage_se

      evade = enemy.evade_se

      plusstate = enemy.plus_state_se

      minusstate = enemy.minus_state_se

      attack = enemy.attack_se

      targetfoe = enemy.target_foe_se

      targetally = enemy.target_ally_se

      criticalhit = enemy.critical_hit_se

      miss = enemy.miss_se

      death = enemy.death_se

      lowhealth = enemy.low_health_se

      selfse = enemy.self_se

      $data_enemy_se[enemy.id] = [take, recover, evade, plusstate, minusstate, attack, targetfoe, targetally, criticalhit, miss, death, lowhealth, selfse] #deal, 

    end

  end

  

end # class end
Code:
#=======================================================================

# Battle Cry VX         version 1.00

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

# Function:

#  Plays user configured battle cries for characters at the start

#  of battle and at the end of battle.  

#  Pre-battle cries are selected by the difficulty of the enemy

#  troop, and post-battle cries are selected by the remaining 

#  hp percentage of the actor that scored the final blow.

#

# Compatibility:

#  This script -should- be compatible with other custom battle scripts

#  but compatibility has not as of yet been tested.

#

# Instructions:

#  Simply configure the arrays of actor sounds in the case statements

#  More detailed instructions will be given in the respective areas.

#  Only skills truly needed are typing, copy, and paste.

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

# Contact:

#  Should you encounter a bug or incompatibility with this script,

#  e-mail NAMKCOR at [email=Rockman922@hotmail.com]Rockman922@hotmail.com[/email], or message at

#  http://www.rmrk.net or [url=http://forum.chaos-project.com]http://forum.chaos-project.com[/url]

#

# This script was designed for use and distribution only on 

# The RPG Maker Resource Kit (RMRK) and Chaos Project.

# If this script is found posted on any other website, it is STOLEN

# and it is advised to contact NAMKCOR at the above methods.

#

# This script is -strictly- for NON-commercial purposes.  Please 

# credit NAMKCOR for the creation of this script if you use it.

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

 

module NAMKCOR

  

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

  # volume: simply set the return value to be equal to the volume

  #         you want the battlecries to be played at

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

  def self.volume

    return 100

  end

  

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

  # battle_range: set the return value to be how many levels above or

  #               below the enemy for easy/difficult battles.

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

  def self.battle_range

    return 5

  end

  

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

  # mid_hp: set the return value to be the percentage of hitpoints that

  #         is the -minimum- value for being in 'middle' hp range.

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

  def self.mid_hp

    return 35

  end

  

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

  # high_hp: set the return value to be the percentage of hitpoints that

  #         is the -minimum- value for being in 'high' hp range.

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

  def self.high_hp

    return 75

  end

  

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

  # bosses: to add a boss, simply create a "when" clause for the 

  #         troop id, and set the 'return' value to 'true'

  #         do not touch the 'else' clause

  # example:

  #          when 5

  #            return true

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

  def self.bosses(id)

    case id

    when 3

      return true

    else

      return false

    end

  end

  

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

  # troop_level: to set a troop level, create a "when" clause for the

  #              troop id, and set the 'return' value to be the level

  #              desired.  do not touch the 'else' clause.

  #              THERE MUST BE AN ENTRY FOR EVERY TROOP IN THE DATABASE

  # example:

  #          when 5

  #              return 3

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

  def self.troop_level(id)

    case id

    when 1

      return 1

    when 2

      return 5

    when 3 

      return 10

    else

      return 0

    end

  end

  

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

  # start_battlecry: to add a new actor's set of battlecries to the

  #                  listing, create a "when" clause for the actor's id

  #                  and the return value to an array, configured as follows.

  # array config: ["easy_battle_se", "normal_battle_se", "hard_battle_se",

  #                "boss_battle_se"]

  #                the values in "" are the names of the sound files.

  #                ALL SOUND FILES MUST BE PLACED IN 'AUDIO/Battlecry'

  #                

  # Suggestion: for organization's sake, try naming the files by actor id

  #                            

  # example:

  #          when 3

  #              return ["easy","normal","hard","boss"]

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

  def self.start_battlecry(id)

    case id

    when 1

      return ["rebecca_battlestart_easy", "rebecca_battlestart_normal",

              "rebecca_battlestart_hard", "rebecca_battlestart_boss"]

    when 2

      return ["oracle_battlestart_easy", "oracle_battlestart_normal",

              "oracle_battlestart_hard", "oracle_battlestart_boss"]

    when 3

      return ["irial_battlestart_easy", "irial_battlestart_normal",

              "irial_battlestart_hard", "irial_battlestart_boss"]

    when 4

      return ["jareth_battlestart_easy", "jareth_battlestart_normal",

              "jareth_battlestart_hard", "jareth_battlestart_boss"]

    else

      return nil

    end

  end

  

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

  # victory_battlecry: to add a new actor's set of battlecries to the

  #                  listing, create a "when" clause for the actor's id

  #                  and the return value to an array, configured as follows.

  # array config: ["highHP_win", "normalHP_win", "lowHP_win"]

  #                the values in "" are the names of the sound files.

  #                ALL SOUND FILES MUST BE PLACED IN 'AUDIO/Battlecry'

  #                

  # Suggestion: for organization's sake, try naming the files by actor id

  #                            

  # example:

  #          when 3

  #              return ["high","normal","hurting"]

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

  def self.victory_battlecry(id)

    case id

    when 1

      return ["rebecca_battleend_easy", "rebecca_battleend_normal",

              "rebecca_battleend_hard"]

    when 2

      return ["oracle_battleend_easy", "oracle_battleend_normal",

              "oracle_battleend_hard"]

    when 3

      return ["irial_battleend_easy", "irial_battleend_normal",

              "irial_battleend_hard"]

    when 4

      return ["jareth_battleend_easy", "jareth_battleend_normal",

              "jareth_battleend_hard"]

    else

      return nil

    end

  end

  

end

 

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

# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING

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

class Game_Troop < Game_Unit

  def id

    return @troop_id

  end

end

 

class Scene_Battle < Scene_Base

  

  alias :old_start :start

  def start

    old_start

    @id = $game_party.members[rand($game_party.members.size)]

    if NAMKCOR.bosses($game_troop.id) == true

      @type = 3

    else

      if (@id.level + NAMKCOR.battle_range) <= NAMKCOR.troop_level($game_troop.id)

        @type = 2

      elsif (@id.level - NAMKCOR.battle_range) >= NAMKCOR.troop_level($game_troop.id)

        @type = 0

      else

        @type = 1

      end

    end

    @bcArray = NAMKCOR.start_battlecry(@id.id)

    if @bcArray[@type] != nil

      Audio.se_play("Audio/SE/" + @bcArray[@type], NAMKCOR.volume, 0)

    end

  end

 

  alias :old_victory :process_victory

  def process_victory

    @hp_percent = (@active_battler.hp / @active_battler.maxhp) * 100

    if @hp_percent < NAMKCOR.mid_hp

      @hp_state = 2

    elsif @hp_percent > NAMKCOR.high_hp

      @hp_state = 1

    else

      @hp_state = 0

    end

    @bcArray = NAMKCOR.victory_battlecry(@active_battler.id)

    if @bcArray[@hp_state] != nil

      Audio.se_play("Audio/SE/" + @bcArray[@hp_state], NAMKCOR.volume, 0)

    end

    old_victory

  end

end

If this one can be done another way in VXA, then I would appreciate it if someone could let me know. Otherwise, I'd like this converted as well:

Code:
#===============================================================================

# 

# Shanghai Simple Script - Wereforms

# Last Date Updated: 2010.06.08

# Level: Normal

# 

# Lets actors temporarily "transform" into other forms. These new forms take on

# the skillsets of enemies in the database. Actors will revert back to their

# normal skillsets once outside of battle.

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

# 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.

# 

# Place this in an item or skill notebox.

# 

# <wereform: x>

# This will transform the using actor's skillset into enemy x's skillset. Only

# works in battle as the actor reverts outside of battle.

# 

# <wereimage: string, x>

# If this tag is used, then the actor's image will also change when the actor

# transforms into its wereform. This will be reverted at the end of battle. In

# order for this to work, the next tag must also be used.

# 

# <wereface: string, x>

# If this tag is used, then the actor's face will also change when the actor

# transforms into its wereform. This will be reverted at the end of battle. In

# order for this to work, the previous tag must also be used.

# 

# <wereform revert>

# If this tag is used and the actor is currently in a wereform, the actor will

# revert back to its normal form.

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

 

$imported = {} if $imported == nil

$imported["Wereforms"] = true

 

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

# RPG::UsableItem

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

 

class RPG::UsableItem < RPG::BaseItem

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

  # # Wereform

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

  def wereform

    return @wereform if @wereform != nil

    @wereform = 0

    self.note.split(/[\r\n]+/).each { |line|

      case line

      when /<(?:WEREFORM|metamorph):[ ](\d+)>/i

        @wereform = $1.to_i

      end

    }

    return @wereform

  end

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

  # # Wereform Image

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

  def wereform_image

    return @wereform_image if @wereform_image != nil

    @wereform_image = [nil, 0]

    self.note.split(/[\r\n]+/).each { |line|

      case line

      when /<(?:WEREIMAGE|morphimage):[ ](.*),[ ](\d+)>/i

        @wereform_image[0] = $1.to_s

        @wereform_image[1] = $2.to_i

      end

    }

    return @wereform_image

  end

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

  # # Wereform Face

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

  def wereform_face

    return @wereform_face if @wereform_face != nil

    @wereform_face = [nil, 0]

    self.note.split(/[\r\n]+/).each { |line|

      case line

      when /<(?:WEREFACE|morphface):[ ](.*),[ ](\d+)>/i

        @wereform_face[0] = $1.to_s

        @wereform_face[1] = $2.to_i

      end

    }

    return @wereform_face

  end

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

  # # Wereform Revert

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

  def wereform_revert

    return @wereform_revert if @wereform_revert != nil

    @wereform_revert = false

    self.note.split(/[\r\n]+/).each { |line|

      case line

      when /<(?:WEREFORM REVERT|metamorph revert)>/i

        @wereform_revert = true

      end

    }

    return @wereform_revert

  end

end

 

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

# ** Game_Battler

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

 

class Game_Battler

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

  # * Apply Skill Effects

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

  alias skill_effect_sss_wereform skill_effect unless $@

  def skill_effect(user, skill)

    skill_effect_sss_wereform(user, skill)

    user.wereform_effect(skill)

    user.clear_wereforms if skill.wereform_revert

  end

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

  # * Apply Item Effects

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

  alias item_effect_sss_wereform item_effect unless $@

  def item_effect(user, item)

    item_effect_sss_wereform(user, item)

    user.wereform_effect(item)

    user.clear_wereforms if item.wereform_revert

  end

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

  # * Wereform Effect

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

  def wereform_effect(obj)

    return if obj.nil?

    return unless actor?

    return unless $game_temp.in_battle

    return unless obj.wereform > 0

    @wereform = obj.wereform

    if @wereimage.nil?

      @wereimage = @character_name

      @wereindex = @character_index

      @wereface  = @face_name

      @werefndex = @face_index

    end

    if obj.wereform_image[0] != nil and obj.wereform_face[0] != nil

      a1 = obj.wereform_image[0]

      a2 = obj.wereform_image[1]

      b1 = obj.wereform_face[0]

      b2 = obj.wereform_face[1]

      set_graphic(a1, a2, b1, b2)

    end

    if $imported["BattleEngineMelody"]

      clear_battle_cache

      clear_cooldowns

      clear_limited_use

    end

  end

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

  # * Clear Wereforms

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

  def clear_wereforms

    return if @wereform.nil?

    @wereform = nil

    unless @wereimage.nil?

      set_graphic(@wereimage, @wereindex, @wereface, @werefndex)

      @wereimage = nil

      @wereindex = nil

      @wereface  = nil

      @werefndex = nil

      $game_player.refresh

    end

    if $imported["BattleEngineMelody"]

      clear_battle_cache

      clear_cooldowns

      clear_limited_use

    end

  end

end

 

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

# ** Game_Actor

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

 

class Game_Actor < Game_Battler

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

  # * Get Skill Object Array

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

  alias skills_sss_wereform skills unless $@

  def skills

    if @wereform != nil and @wereform > 0

      enemy = $data_enemies[@wereform]

      return skills_sss_wereform if enemy.nil?

      return enemy_skills(enemy)

    else

      return skills_sss_wereform

    end

  end

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

  # * Determine Usable Skills

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

  def skill_can_use?(skill)

    return super(skill)

  end

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

  # * Enemy Skills

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

  def enemy_skills(enemy)

    result = []

    for action in enemy.actions

      next unless action.kind == 1

      skill = $data_skills[action.skill_id]

      result.push(skill) unless result.include?(skill)

    end

    result.sort! { |a,b| a.id <=> b.id }

    return result.uniq

  end

end

 

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

# ** Scene_Battle

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

 

class Scene_Battle < Scene_Base

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

  # * Start processing

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

  alias start_sss_wereform start unless $@

  def start

    for member in $game_party.members do member.clear_wereforms end

    start_sss_wereform

  end

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

  # * End Battle

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

  alias battle_end_sss_wereform battle_end unless $@

  def battle_end(result)

    for member in $game_party.members do member.clear_wereforms end

    battle_end_sss_wereform(result)

  end

end

 

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

# 

# END OF FILE

# 

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

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