#=======================================================================
# 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 Rockman922@hotmail.com, or message at
# http://www.rmrk.net or http://forum.chaos-project.com
#
# 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 80
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 40
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 ["Actor001-easyBattle", "Actor001-normalBattle",
"Actor001-desperateBattle", "Actor001-bossBattle"]
when 2
return ["Actor002-easyBattle", "Actor002-normalBattle",
"Actor002-desperateBattle", "Actor002-bossBattle"]
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 ["Actor001-bestWin","Actor001-normWin","Actor001-lowWin"]
when 2
return ["Actor002-bestWin","Actor002-normWin","Actor002-lowWin"]
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/Battlecry/" + @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/Battlecry/" + @bcArray[@hp_state], NAMKCOR.volume, 0)
end
old_victory
end
end