Koudelka

Villager
Member
Joined
Oct 29, 2019
Messages
27
Reaction score
0
First Language
Portuguese
Primarily Uses
RMVXA
By default, its impossible put scripts before names in VX Ace, even if you use \I[n]

I need a script that makes iconsets appear before the names of characters, classes, and enemies. Can someone make a script that does this or know a script that does this?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,821
Reaction score
1,372
First Language
English
Primarily Uses
RMVXA
A little more detail is required.
Does the icons need to be everywhere?
Enemies would be in battle normally, but can also be in a bestiary.
classes and actor names are in many locations.
Some scripts can do the icons, but for specific windows or scenes.
 

Koudelka

Villager
Member
Joined
Oct 29, 2019
Messages
27
Reaction score
0
First Language
Portuguese
Primarily Uses
RMVXA
A little more detail is required.
Does the icons need to be everywhere?
Enemies would be in battle normally, but can also be in a bestiary.
classes and actor names are in many locations.
Some scripts can do the icons, but for specific windows or scenes.
Yes, the icons must appear everywhere, in menus, in battle, etc, in all windows and scenes.
I don't use bestiary, so no problem.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,821
Reaction score
1,372
First Language
English
Primarily Uses
RMVXA
Yes, the icons must appear everywhere, in menus, in battle, etc, in all windows and scenes.
I don't use bestiary, so no problem.
Try these out. You'll have to set note tags or edit the data in the script for the icon numbers
I modified these a little to work with actors and enemies.
Ruby:
#==============================================================================
# ** Blackmorning -> Basic Module
#------------------------------------------------------------------------------
#  Blackmorning
#  Version 1.24.1
#  updated 11/05/2015
# - adjusted help window
#==============================================================================
# ? Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# - Yami's fix -> revival & item animations in YEA - Ace Battle Engine.
# - adds parameter and experience gauges
# - shows transparent faces for non-battle members in menu
# - new vocab information including for sparam and xparam
# - changes help window to include item type, icon, name
#   (also durability and weight if using Xail system)
# - rotating actor instead of moving.
# - adds codes for other BM scripts
# - added horizontal fix coding for menus(version 1.18)
#==============================================================================
# ? 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.
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Script Calls.
# -----------------------------------------------------------------------------
# setSelfSwitch(map, id, A-D, true/false)
#   ie.   setSelfSwitch(@map_id, 1, "A", true)
# isSelfSwitch?(map, id, A-D)
#   ie.   isSelfSwitch?(2, 1, "A")
# setAllSelf(map, id, true/false)
#   ie.   setAllSelf(2, 1, true)
#===============================================================================
module BM
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Non Member Options -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # if member not in battle party, makes character/face transparent
  NON_PARTY_MEMBER_TRANSPARENCY = true
  STANDBY_COLOR = Color.new(0, 0, 0, 128) #  Standby Members Background Color
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Status Icons on Face (Skills Status Window) -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # for the Skill Status window, states/buffs appear at bottom of actor's face
  MOVE_STATE_OVER_FACE = true
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Bust Image Options -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PORTRAIT_FOLDER = "Graphics/Portraits/"
  # default "Graphics/Portraits/"
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Text Options -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # for drawing actor class and name in menus
  TEXT={
  :bold =>{
    :actor_name => true,
    :actor_class => false,
    }, # DO NOT REMOVE
  :italic =>{
    :actor_name => false,
    :actor_class => true,
    }, # DO NOT REMOVE
  } # DO NOT REMOVE
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Sound Options -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # for sound effects, a random pitch can be given to give some variation
  RAND_PITCH = false
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Parameters Settings -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # EXP Gauge Options
  EXP_VOCAB = "EXP"
  EXP_GAUGE1   = 12            # "Window" skin text colour for gauge.
  EXP_GAUGE2   = 4             # "Window" skin text colour for gauge.
  SHOW_EXP_GAUGE = true        # show exp gauge in menu
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # show parameters gauge in status
  SHOW_PARAM_GAUGE = false
  # set param ratio max to :set, :max or :current
  # if a stat is higher than param max, then will be based on that stat
  # :set (max param is set number)
  # :max (uses default max param)
  # :current (max param is based on highest current param)
  PARAM_RATIO_MAX = :set
  PARAM_MAX = 100 # if PARAM_RATIO_MAX = :set
  # Each of the stats have a non-window colour. Adjust them as you see fit.
  PARAM_COLOUR ={
  # ParamID => [:stat,       Colour1,                   Colour2          ],
          0 => [ :hp,  Color.new(115,  20,  20), Color.new(170,  44,  44)],
          1 => [ :mp,  Color.new(158, 113, 229), Color.new(205, 178, 245)],
          2 => [ :atk, Color.new(151,  83, 123), Color.new(207, 181, 187)],
          3 => [ :def, Color.new(121, 208, 151), Color.new(184, 233, 205)],
          4 => [ :mat, Color.new( 82, 150, 215), Color.new(161, 197, 236)],
          5 => [ :mdf, Color.new(236, 238, 150), Color.new(246, 253, 203)],
          6 => [ :agi, Color.new(182, 150, 131), Color.new(222, 208, 194)],
          7 => [ :luk, Color.new(146,  89, 165), Color.new(206, 182, 219)],
  } # DO NOT REMOVE
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # Parameter Vocabulary
  PARAM_VOCAB_FULL={
    0 => "Hit Points",
    1 => "Spell Points",
    2 => "Attack",
    3 => "Defence",
    4 => "Intelligence",
    5 => "Resistance",
    6 => "Agility",
    7 => "Luck",
  } # DO NOT REMOVE
  XPARAM_VOCAB = {
    0 => "HIT",
    1 => "EVA",
    2 => "CRI",
    3 => "CEV",
    4 => "MEV",
    5 => "MRF",
    6 => "CNT",
    7 => "HRG",
    8 => "MRG",
    9 => "LRG",
  } # DO NOT REMOVE
  XPARAM_VOCAB_FULL={
    0 => "Hit Rate",
    1 => "Evasion",
    2 => "Critical Hit",
    3 => "Critical Evade",
    4 => "Magic Evasion",
    5 => "Magic Reflect",
    6 => "Counter Rate",
    7 => "HP Regen",
    8 => "SP Regen",
    9 => "LP Regen",
  } # DO NOT REMOVE
  SPARAM_VOCAB = {
    0 => "TGR",
    1 => "GRD",
    2 => "REC",
    3 => "PHA",
    4 => "MCR",   
    5 => "LCR",
    6 => "PDR",
    7 => "MDR",
    8 => "FDR",
    9 => "EXR",
  } # DO NOT REMOVE
  SPARAM_VOCAB_FULL={
    0 => "Target Rate",
    1 => "Guard Rate",
    2 => "Recovery",
    3 => "Item Boost",
    4 => "SP Cost Rate",
    5 => "LP Charge",
    6 => "Physical Damage",
    7 => "Magical Damage",
    8 => "Floor Damage",
    9 => "#{EXP_VOCAB} Rate",
  } # DO NOT REMOVE
  CPARAM_VOCAB ={
    :cdr         => "CDR",  #cooldown rate       # Requires YEA - Skill Restrictions
    :wur         => "WUR",  #warmup rate         # Requires YEA - Skill Restrictions
    :hcr         => "HCR",  #hp cost rate        # Requires YEA - Skill Cost Manager
    :tcr_y       => "LCR",  #tp cost rate        # Requires YEA - Skill Cost Manager
    :gcr         => "GCR",  #gold cost rate      # Requires YEA - Skill Cost Manager
    :hp_physical => "HPhys",#convert hp physical # Requires YEA - Convert Damage
    :mp_physical => "SPhys",#convert mp physical # Requires YEA - Convert Damage
    :hp_magical  => "HMag", #convert hp magical  # Requires YEA - Convert Damage
    :mp_magical  => "SMag", #convert mp magical  # Requires YEA - Convert Damage
  } # DO NOT REMOVE
  CPARAM_VOCAB_FULL ={
    :cdr         => "Cooldown Rate",    #cooldown rate       # Requires YEA - Skill Restrictions
    :wur         => "Warmup Rate",      #warmup rate         # Requires YEA - Skill Restrictions
    :tcr_y       => "LP Cost Rate",     #tp cost rate        # Requires YEA - Skill Cost Manager
    :hcr         => "HP Cost Rate",     #hp cost rate        # Requires YEA - Skill Cost Manager   
    :gcr         => "Gold Cost Rate",   #gold cost rate      # Requires YEA - Skill Cost Manager
    :hp_physical => "Drain HP Physical",#convert hp physical # Requires YEA - Convert Damage
    :mp_physical => "Drain SP Physical",#convert mp physical # Requires YEA - Convert Damage
    :mp_magical  => "Drain HP Magical", #convert hp magical  # Requires YEA - Convert Damage
    :hp_magical  => "Drain SP Magical", #convert mp magical  # Requires YEA - Convert Damage
  } # DO NOT REMOVE
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Actor Movement -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # Hold button when entering direction to turn actor.
  ROTATE_INPUT = Input::Y 
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - Advanced Help -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # Show additional info in the help window
  ADVANCED_HELP = true
  # HELP_DISPLAY = [show_help_icon, show_name, show_description, show_type]
  HELP_DISPLAY = [true, true, true, true]
  HELP_SIZE = 2 # number of lines in help
  ITEM_NAME_COLOR = Color.new(182, 150, 131) # color of item/skill name in help
  # NOTE:
  # color is overwritten if using hime item rarity or vlue weapon/armor randomizer
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - System Options -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # This determines if the Game's Process Priority will be heightened to "High"
  # at startup. This may help some lag issues.
  HIGH_PROCESS = true
  # This determines if the Mouse Cursor should be hidden will inside the game.
  # This only applies if the mouse is inside the Game's window.
  HIDE_MOUSE = false
  # This determines if the window should be resizable.
  # By default, the game window is not resizable without script calls.
  # Note this does not increase the Game's graphic displaying abilities,
  # and will cause graphics stretching/shrinking.
  ALLOW_RESIZING = false
end
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
if $sel_time_frame != nil
  BM::SELCHAR_CALENDER = true
else
  BM::SELCHAR_CALENDER = false
end
#===============================================================================
module BM
  #--------------------------------------------------------------------------
  # * New method: required_script
  #--------------------------------------------------------------------------
  def self.required_script(name, req, version, type = 0)
    if version == true
      return unless (!$imported[req]) # non-bm scripts
      msg = "The script '%s' requires the script\n"
      case type
      when :above
        msg += "'%s' above it to work properly\n"
      when :below
        msg += "'%s' or higher to work properly\n"
      else     
        msg += "'%s' below it to work properly\n"
      end
      msg += "Go to bmscripts.weebly.com to download this script."
      self.exit_message(msg, name, req, version)
    end
    if type != :below && (!$imported[req] || $imported[req] < version) #checks version number
      msg = "The script '%s' requires the script\n"
      case type
      when :above
        msg += "'%s' v%s or higher above it to work properly\n"
      else
        msg += "'%s' v%s or higher to work properly\n"
      end
      msg += "Go to bmscripts.weebly.com to download this script."
      self.exit_message(msg, name, req, version)
    elsif type == :below && $imported[req] # wrong position
      msg = "The script '%s' requires the script\n"
      msg += "'%s' below it to work properly\n"
      msg += "move the scripts to the proper position"
      self.exit_message(msg, name, req, version)
    end
  end
  #--------------------------------------------------------------------------
  # * New method: exit_message
  #--------------------------------------------------------------------------
  def self.exit_message(message, name, req, version = 1.00)
    name = self.script_name(name)
    req  = self.script_name(req)
    msgbox(sprintf(message, name, req, version))
    exit
  end
  #--------------------------------------------------------------------------
  # * New method: script_name
  #--------------------------------------------------------------------------
  def self.script_name(name, ext = "BM")
    name = name.to_s.gsub("_", " ").upcase.split
    name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
    name.join(" ")
  end
end
$imported ||= {}
$imported[:bm_base] = 1.24
#===============================================================================
module BM
  def self.handle
    a = Win32API.new('kernel32', 'GetPrivateProfileString', 'pppplp', 'l')
    b = Win32API.new('user32', 'FindWindow', 'pp', 'i')
    a.call("Game", "Title", "", title = "\0" * 256, 256, ".//Game.ini")
    return b.call("RGSS Player", title.delete!("\0"))
  end
end
Win32API.new('user32', 'ShowCursor', 'i', 'i').call(0) if BM::HIDE_MOUSE
Win32API.new('kernel32','SetPriorityClass','pi','i').call(-1, 256) if BM::HIGH_PROCESS
Win32API.new('user32', 'SetWindowLong', 'lll', 'l').call(BM.handle, -16, 0x10C70000|0x00080000) if BM::ALLOW_RESIZING
#==============================================================================
# ** Cache
#==============================================================================
module Cache
  #--------------------------------------------------------------------------
  # * New Method: Get Portrait Graphic
  #--------------------------------------------------------------------------
  def self.portrait(filename, hue = 0)
    load_bitmap(BM::PORTRAIT_FOLDER, filename, hue)
  end
end
#==============================================================================
# ** SE  (randomizes pitch)
#==============================================================================
module RPG
  class SE < AudioFile
    def play
      unless @name.empty?
        pitch = @pitch
        pitch += rand(7)-3 if BM::RAND_PITCH
        Audio.se_play("Audio/SE/" + @name, @volume, pitch)
      end
    end
  end
end
#==============================================================================
# ** Numeric
#==============================================================================
class Numeric
  #--------------------------------------------------------------------------
  # * group_digits
  #--------------------------------------------------------------------------
  def group
    return self.to_s unless $imported["YEA-CoreEngine"] && YEA::CORE::GROUP_DIGITS
    self.to_s.gsub(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/,'\1,\2')
  end
end
#==============================================================================
# ** Object
#==============================================================================
class Object
  #--------------------------------------------------------------------------
  # * New method: file_exist?
  #--------------------------------------------------------------------------
  def file_exist?(path, filename)
    $file_list ||= {}
    $file_list[path + filename] ||= file_test(path, filename)
    $file_list[path + filename]
  end
  #--------------------------------------------------------------------------
  # * New method: get_file_list
  #--------------------------------------------------------------------------
  def file_test(path, filename)
    bitmap = Cache.load_bitmap(path, filename) rescue nil
    bitmap ? true : false
  end
  #--------------------------------------------------------------------------
  # * New method: portrait_exist?
  #--------------------------------------------------------------------------
  def portrait_exist?(filename)
    file_exist?(BM::PORTRAIT_FOLDER, filename)
  end
  #--------------------------------------------------------------------------
  # * New method: character_exist?
  #--------------------------------------------------------------------------
  def character_exist?(filename)
    file_exist?("Graphics/Characters/", filename)
  end
  #--------------------------------------------------------------------------
  # * New method: faceset_exist?
  #--------------------------------------------------------------------------
  def faceset_exist?(filename)
    file_exist?("Graphics/Faces/", filename)
  end
end
#==============================================================================
# ** Horizontal fix
#==============================================================================
module Horizontal_Fix
  #--------------------------------------------------------------------------
  # * Get Number of Lines to Show
  #--------------------------------------------------------------------------
  def visible_line_number; return 1; end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max; return item_max; end
  #--------------------------------------------------------------------------
  # * Get Spacing for Items Arranged Side by Side
  #--------------------------------------------------------------------------
  def spacing; return 8;  end
  #--------------------------------------------------------------------------
  # * Calculate Width of Window Contents
  #--------------------------------------------------------------------------
  def contents_width
    (item_width + spacing) * item_max - spacing
  end
  #--------------------------------------------------------------------------
  # * Calculate Height of Window Contents
  #--------------------------------------------------------------------------
  def contents_height; item_height; end
  #--------------------------------------------------------------------------
  # * Get Leading Digits
  #--------------------------------------------------------------------------
  def top_col
    ox / (item_width + spacing)
  end
  #--------------------------------------------------------------------------
  # * Set Leading Digits
  #--------------------------------------------------------------------------
  def top_col=(col)
    self.ox = (col < 0 ? 0 : col) * (item_width + spacing)
  end
  #--------------------------------------------------------------------------
  # * Get Trailing Digits
  #--------------------------------------------------------------------------
  def bottom_col
    top_col + col_max - 1
  end
  #--------------------------------------------------------------------------
  # * Set Trailing Digits
  #--------------------------------------------------------------------------
  def bottom_col=(col)
    self.top_col = col - (col_max - 1)
  end
  #--------------------------------------------------------------------------
  # * Overwrite: Scroll Cursor to Position Within Screen
  #--------------------------------------------------------------------------
  def ensure_cursor_visible
    self.top_col = index if index < top_col
    self.bottom_col = index if index > bottom_col
  end
  #--------------------------------------------------------------------------
  # * Get Rectangle for Displaying Items
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super
    rect.x = index * (item_width + spacing)
    rect.y = 0
    rect
  end
end
#==============================================================================
# ** Vertical fix
#==============================================================================
module Vertical_Fix
  #--------------------------------------------------------------------------
  # * Get Number of Lines to Show
  #--------------------------------------------------------------------------
  def visible_line_number; return item_max; end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max; return 1; end
  #--------------------------------------------------------------------------
  # * Get Spacing for Items Arranged Side by Side
  #--------------------------------------------------------------------------
  def spacing; return 32;  end
  #--------------------------------------------------------------------------
  # overwrite method: contents_width
  #--------------------------------------------------------------------------
  def contents_width; return width - standard_padding * 2; end
  #--------------------------------------------------------------------------
  # overwrite method: contents_height
  #--------------------------------------------------------------------------
  def contents_height
    ch = height - standard_padding * 2
    return [ch - ch % item_height, row_max * item_height].max
  end
  #--------------------------------------------------------------------------
  # * Scroll Cursor to Position Within Screen
  #--------------------------------------------------------------------------
  def ensure_cursor_visible
    self.top_row = row if row < top_row
    self.bottom_row = row if row > bottom_row
  end
  #--------------------------------------------------------------------------
  # * Get Rectangle for Drawing Items
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new
    rect.width = item_width
    rect.height = item_height
    rect.x = index % col_max * (item_width + spacing)
    rect.y = index / col_max * item_height
    rect
  end
  #--------------------------------------------------------------------------
  # overwrite method: cursor_down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    if index < item_max - col_max || (wrap && col_max == 1)
      select((index + col_max) % item_max)
    end
  end
  #--------------------------------------------------------------------------
  # overwrite method: cursor_up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    if index >= col_max || (wrap && col_max == 1)
      select((index - col_max + item_max) % item_max)
    end
  end
end
#==============================================================================
# ** Vocab
#==============================================================================
module Vocab
  def self.exp; BM::EXP_VOCAB;  end
  def self.exp_a; BM::EXP_VOCAB; end
  ExpTotal        = "Current #{self.exp}"
  ObtainExp       = "%s #{self.exp} received!"
  def self.element(id); $data_system.elements[id] ? $data_system.elements[id] : ""; end
  def self.state(id); $data_states[id] ? $data_states[id].name : ""; end
  def self.enemies(id); $data_enemies[id] ? $data_enemies[id].name : ""; end
  def self.classes(id); $data_classes[id] ? $data_classes[id].name : ""; end
  def self.actors(id); $data_actors[id] ? $data_actors[id].name : ""; end
  def self.items(id); $data_items[id] ? $data_items[id].name : ""; end
  def self.weapons(id); $data_weapons[id] ? $data_weapons[id].name : ""; end
  def self.armors(id); $data_armor[id] ? $data_armor[id].name : ""; end
  def self.skills(id); $data_skills[id] ? $data_skills[id].name : ""; end
  def self.skill_types(id); $data_system.skill_types[id] ? $data_system.skill_types[id] : ""; end
  def self.weapon_types(id); $data_system.weapon_types[id] ?$data_system.weapon_types[id] : ""; end
  def self.armor_types(id); $data_system.armor_types[id] ? $data_system.armor_types[id] : ""; end
  def self.variables(id); $data_system.variables[id] ? $data_system.variables[id] : ""; end
  def self.switches(id); $data_system.switches[id] ? $data_system.switches[id] : ""; end
  #--------------------------------------------------------------------------
  # * New Method: extra Parameters
  #--------------------------------------------------------------------------
  def self.param_a(id)
    case id
    when 0, :hp, :maxhp then self.param(0)
    when 1, :mp, :maxmp then self.param(1)
    when 2, :atk then self.param(2)
    when 3, :def then self.param(3)
    when 4, :mat then self.param(4)
    when 5, :mdf then self.param(5)
    when 6, :agi then self.param(6)
    when 7, :luk then self.param(7)
    else; ""
    end
  end
  #--------------------------------------------------------------------------
  def self.param_f(id)
    case id
    when 0, :maxhp, :hp then BM::PARAM_VOCAB_FULL[0]
    when 1, :maxmp, :mp then BM::PARAM_VOCAB_FULL[1]
    when 2, :atk then BM::PARAM_VOCAB_FULL[2]
    when 3, :def then BM::PARAM_VOCAB_FULL[3]
    when 4, :mat then BM::PARAM_VOCAB_FULL[4]
    when 5, :mdf then BM::PARAM_VOCAB_FULL[5]
    when 6, :agi then BM::PARAM_VOCAB_FULL[6]
    when 7, :luk then BM::PARAM_VOCAB_FULL[7]
    else; ""
    end
  end
  #--------------------------------------------------------------------------
  def self.xparam_a(id)
    case id
    when 0, :hit then BM::XPARAM_VOCAB[0]
    when 1, :eva then BM::XPARAM_VOCAB[1]
    when 2, :cri then BM::XPARAM_VOCAB[2]
    when 3, :cev then BM::XPARAM_VOCAB[3]
    when 4, :mev then BM::XPARAM_VOCAB[4]
    when 5, :mrf then BM::XPARAM_VOCAB[5]
    when 6, :cnt then BM::XPARAM_VOCAB[6]
    when 7, :hrg then BM::XPARAM_VOCAB[7]
    when 8, :mrg then BM::XPARAM_VOCAB[8]
    when 9, :trg then BM::XPARAM_VOCAB[9]
    else; ""
    end
  end
  #--------------------------------------------------------------------------
  def self.xparam_f(id)
    case id
    when 0, :hit then BM::XPARAM_VOCAB_FULL[0]
    when 1, :eva then BM::XPARAM_VOCAB_FULL[1]
    when 2, :cri then BM::XPARAM_VOCAB_FULL[2]
    when 3, :cev then BM::XPARAM_VOCAB_FULL[3]
    when 4, :mev then BM::XPARAM_VOCAB_FULL[4]
    when 5, :mrf then BM::XPARAM_VOCAB_FULL[5]
    when 6, :cnt then BM::XPARAM_VOCAB_FULL[6]
    when 7, :hrg then BM::XPARAM_VOCAB_FULL[7]
    when 8, :mrg then BM::XPARAM_VOCAB_FULL[8]
    when 9, :trg then BM::XPARAM_VOCAB_FULL[9]
    else; ""
    end
  end
  #--------------------------------------------------------------------------
  def self.sparam_a(id)
    case id
    when 0, :tgr then BM::SPARAM_VOCAB[0]
    when 1, :grd then BM::SPARAM_VOCAB[1]
    when 2, :rec then BM::SPARAM_VOCAB[2]
    when 3, :pha then BM::SPARAM_VOCAB[3]
    when 4, :mcr then BM::SPARAM_VOCAB[4]
    when 5, :tcr then BM::SPARAM_VOCAB[5]
    when 6, :pdr then BM::SPARAM_VOCAB[6]
    when 7, :mdr then BM::SPARAM_VOCAB[7]
    when 8, :fdr then BM::SPARAM_VOCAB[8]
    when 9, :exr then BM::SPARAM_VOCAB[9]
    else; ""
    end 
  end 
  #--------------------------------------------------------------------------
  def self.sparam_f(id)
    case id
    when 0, :tgr then BM::SPARAM_VOCAB_FULL[0]
    when 1, :grd then BM::SPARAM_VOCAB_FULL[1]
    when 2, :rec then BM::SPARAM_VOCAB_FULL[2]
    when 3, :pha then BM::SPARAM_VOCAB_FULL[3]
    when 4, :mcr then BM::SPARAM_VOCAB_FULL[4]
    when 5, :tcr then BM::SPARAM_VOCAB_FULL[5]
    when 6, :pdr then BM::SPARAM_VOCAB_FULL[6]
    when 7, :mdr then BM::SPARAM_VOCAB_FULL[7]
    when 8, :fdr then BM::SPARAM_VOCAB_FULL[8]
    when 9, :exr then BM::SPARAM_VOCAB_FULL[9]
    else; ""
    end
  end 
  #--------------------------------------------------------------------------
  def self.cparam_a(id)
    case id
      when :hcr, :tcr_y, :gcr, :cdr, :wur, :hp_physical, :mp_physical, :mp_magical, :hp_magical
        BM::CPARAM_VOCAB[id]
      when :gut
        return unless $imported["BubsGuts"]
        Vocab.guts_a
      else; ""
    end
  end
  #--------------------------------------------------------------------------
  def self.cparam_f(id)
    case id
      when :hcr, :tcr_y, :gcr, :cdr, :wur, :hp_physical, :mp_physical, :mp_magical, :hp_magical
        BM::CPARAM_VOCAB_FULL[id]
      when :gut
        return unless $imported["BubsGuts"]
        Vocab.guts
      else; ""
    end
  end
end
#==============================================================================
# ** Cache
#==============================================================================
module Cache
  #--------------------------------------------------------------------------
  # new method: storage_image
  #--------------------------------------------------------------------------
  def self.storage_image(bitmap, name)
    @image_cache ||= {}
    @image_cache[name] = bitmap unless @image_cache.has_key?(name)
    @image_cache[name]
  end
  #--------------------------------------------------------------------------
  # new method: storage_image
  #--------------------------------------------------------------------------
  def self.restore_image(name)
    return false if @image_cache.nil? || !@image_cache.has_key?(name)
    @image_cache[name]
  end
end
#==============================================================================
# ** Game_Action
#==============================================================================
class Game_Action
  #--------------------------------------------------------------------------
  # * Overwrite: targets_for_friends
  #--------------------------------------------------------------------------
  def targets_for_friends
    if item.for_user?
      [subject]
    elsif item.for_dead_friend?
      if item.for_one?
        [friends_unit.smooth_dead_target(@target_index)]
      else
        friends_unit.dead_members
      end
    elsif item.for_friend?
      if item.for_one?
        if @target_index < 0
          [friends_unit.random_target]
        else
          [friends_unit.smooth_target(@target_index)]
        end
      else
        friends_unit.alive_members
      end
    end
  end
end
#==============================================================================
# ** Game_BattlerBase
#==============================================================================
class Game_BattlerBase
  #--------------------------------------------------------------------------
  # * New Method: atk_element_rate
  #--------------------------------------------------------------------------
  def atk_element_rate(id); features_sum(FEATURE_ATK_ELEMENT, id); end
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Alias: Remove the equipment that can not be equipped with Item_gain,
  # returned to the party equipment that removed
  #--------------------------------------------------------------------------
  alias :bm_base_rui :release_unequippable_items
  def release_unequippable_items(item_gain = true)
    loop do
      last_equips = equips.dup
      bm_base_rui(item_gain)
      return if equips == last_equips
    end
  end
end
#==============================================================================
# ** Game_Player
#==============================================================================
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Alias: move_by_input
  #--------------------------------------------------------------------------
  alias :bm_base_mbi :move_by_input
  def move_by_input
    return if !movable? || $game_map.interpreter.running?
    if Input.dir4 > 0
      if Input.press?(BM::ROTATE_INPUT)
        set_direction(Input.dir4)
      else
        bm_base_mbi
      end
    end
  end
end
#==============================================================================
# ** Game_Event
#==============================================================================
class Game_Event
  #--------------------------------------------------------------------------
  # * New method: name
  #--------------------------------------------------------------------------
  def name; @event ? @event.name : ""; end
end
#==============================================================================#
# ** Game_Interpreter
#==============================================================================#
class Game_Interpreter
  #--------------------------------------------------------------------------
  # * New Method: Set SelfSwitch
  #--------------------------------------------------------------------------
  def setSelfSwitch(map, eID, selfSwitch, trueFalse)
    switch = [map, eID, selfSwitch]
    $game_self_switches[switch] = trueFalse
    $game_map.refresh
  end
  #--------------------------------------------------------------------------
  # * New Method: Is SelfSwitch true/false?
  #--------------------------------------------------------------------------
  def isSelfSwitch?(map, eID, selfSwitch)
    switch = [map, eID, selfSwitch]
    $game_self_switches[switch]
  end
  #--------------------------------------------------------------------------
  # * New Method: Set all SelfSwitches
  #--------------------------------------------------------------------------
  def setAllSelf(map, eID, trueFalse)
    switches = ["A","B","C","D"]
    for i in switches
      setSelfSwitch(map, eID, i, trueFalse)
    end
    $game_map.refresh
  end
  #--------------------------------------------------------------------------
  # * New Method: Self On
  #--------------------------------------------------------------------------
  def self_on(mapID,eventID,switch)
     $game_self_switches[[mapID, eventID, switch]] = true
     $game_map.refresh
  end
  #--------------------------------------------------------------------------
  # * New Method: Self Off
  #--------------------------------------------------------------------------
  def self_off(mapID,eventID,switch)
     $game_self_switches[[mapID, eventID, switch]] = false
     $game_map.refresh 
  end
  #--------------------------------------------------------------------------
  # * New Method: A switch on
  #--------------------------------------------------------------------------
  def a_on(mapID,eventID)
     $game_self_switches[[mapID, eventID, "A"]] = true
     $game_map.refresh 
  end
  #--------------------------------------------------------------------------
  # * New Method: A switch off
  #--------------------------------------------------------------------------
  def a_off(mapID,eventID)
     $game_self_switches[[mapID, eventID, "A"]] = false
     $game_map.refresh 
  end 
  #--------------------------------------------------------------------------
  # * New Method: B switch on
  #--------------------------------------------------------------------------
  def b_on(mapID,eventID)
     $game_self_switches[[mapID, eventID, "B"]] = true
     $game_map.refresh
  end
  #--------------------------------------------------------------------------
  # * New Method: B switch off
  #--------------------------------------------------------------------------
  def b_off(mapID,eventID)
     $game_self_switches[[mapID, eventID, "B"]] = false
     $game_map.refresh 
  end 
  #--------------------------------------------------------------------------
  # * New Method: C switch on
  #--------------------------------------------------------------------------
  def c_on(mapID,eventID)
     $game_self_switches[[mapID, eventID, "C"]] = true
     $game_map.refresh 
  end
  #--------------------------------------------------------------------------
  # * New Method: C switch off
  #--------------------------------------------------------------------------
  def c_off(mapID,eventID)
     $game_self_switches[[mapID, eventID, "C"]] = false
     $game_map.refresh 
  end 
  #--------------------------------------------------------------------------
  # * New Method: D switch on
  #--------------------------------------------------------------------------
  def d_on(mapID,eventID)
    $game_self_switches[[mapID, eventID, "D"]] = true
    $game_map.refresh 
  end
  #--------------------------------------------------------------------------
  # * New Method: D switch off
  #--------------------------------------------------------------------------
  def d_off(mapID,eventID)
     $game_self_switches[[mapID, eventID, "D"]] = false
     $game_map.refresh 
  end
  #--------------------------------------------------------------------------
  # * Alias: Change of state
  #--------------------------------------------------------------------------
  alias :bm_base_c313 :command_313
  def command_313
    bm_base_c313
    $game_party.clear_results
  end
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
  alias :bm_base_pnc :process_normal_character
  def process_normal_character(c, pos)
    return unless c >= ' '
    bm_base_pnc(c, pos)
  end
  #--------------------------------------------------------------------------
  # * New method: exp_gauge1
  #--------------------------------------------------------------------------
  def exp_gauge1; return text_color(BM::EXP_GAUGE1); end
  #--------------------------------------------------------------------------
  # * New method: exp_gauge2
  #--------------------------------------------------------------------------
  def exp_gauge2; return text_color(BM::EXP_GAUGE2); end
  #--------------------------------------------------------------------------
  # * New method: param_gauge1
  #--------------------------------------------------------------------------
  def param_gauge1(param_id); return BM::PARAM_COLOUR[param_id][1]; end
  #--------------------------------------------------------------------------
  # * New method: param_gauge2
  #--------------------------------------------------------------------------
  def param_gauge2(param_id); return BM::PARAM_COLOUR[param_id][2]; end
  #--------------------------------------------------------------------------
  # * New method: standby color
  #--------------------------------------------------------------------------
  def standby_color(actor)
    return BM::STANDBY_COLOR unless battle_party?(actor)
    return Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Overwrite: gauge colors
  #--------------------------------------------------------------------------
  def hp_gauge_color1;   BM::PARAM_COLOUR[0][1];   end
  def hp_gauge_color2;   BM::PARAM_COLOUR[0][2];   end
  def mp_gauge_color1;   BM::PARAM_COLOUR[1][1];   end
  def mp_gauge_color2;   BM::PARAM_COLOUR[1][2];   end
  #--------------------------------------------------------------------------
  def item_name_color; BM::ITEM_NAME_COLOR; end
  #--------------------------------------------------------------------------
  # * New Method: percent colour
  #--------------------------------------------------------------------------
  def percent_color(value)
    if value < 0; power_down_color
    elsif value > 0; power_up_color
    else;  normal_color
    end
  end
  #--------------------------------------------------------------------------
  # * New Method: Get Percentage of exp needed
  #--------------------------------------------------------------------------
  def exp_rate(actor)
    now_exp = actor.exp - actor.current_level_exp
    next_exp = actor.next_level_exp - actor.current_level_exp
    rate = now_exp * 1.0 / next_exp
    rate = [[rate, 1.0].min, 0.0].max
  end
  #--------------------------------------------------------------------------
  # * New Method: Get Percentage of Paramaters
  #--------------------------------------------------------------------------
  def param_ratio(actor, param_id)
    minimum = 0
    case BM::PARAM_RATIO_MAX
    when :set
      maximum = BM::PARAM_MAX
    when :max
      maximum = actor.param_max(param_id)
    when :current
      maximum = 1
    end 
    for i in 2..7
      maximum = [actor.param(i), maximum].max
      minimum = [actor.param(i), minimum].min
    end
    return 1.0 if maximum == minimum
    rate = actor.param(param_id).to_f/maximum.to_f
    return rate
  end
  #--------------------------------------------------------------------------
  # * New Method: Draw Portrait
  #     enabled : Enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_portrait(portrait_name, x, y, enabled = true)
    return unless portrait_exist?(portrait_name)
    bitmap = Cache.portrait(portrait_name)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
  #--------------------------------------------------------------------------
  # * New Method: Draw Actor Portrait
  #--------------------------------------------------------------------------
  def draw_actor_portrait(actor, x, y, enabled = true)
    filename = "#{actor.face_name}-#{actor.face_index}"
    return unless portrait_exist?(filename)
    draw_portrait(filename, x, y, enabled)
  end
  #--------------------------------------------------------------------------
  # * Alias: Draw Actor level
  #--------------------------------------------------------------------------
  alias :bm_base_dal :draw_actor_level
  def draw_actor_level(actor, x, y, width = 100)
    draw_gauge(x + 10, y, width - 10, exp_rate(actor), exp_gauge1, exp_gauge2) if BM::SHOW_EXP_GAUGE
    change_color(system_color)
    draw_text(x, y, 32, line_height, Vocab::level_a)
    change_color(normal_color)
    draw_text(x, y, width, line_height, actor.level.group, 2)
  end
  #--------------------------------------------------------------------------
  # * Alias: Draw Parameters
  #--------------------------------------------------------------------------
  alias :bm_base_dap :draw_actor_param
  def draw_actor_param(actor, x, y, param_id, width = 156)
    if BM::SHOW_PARAM_GAUGE
      draw_gauge(x, y, width, param_ratio(actor, param_id), param_gauge1(param_id), param_gauge2(param_id))
    end
    change_color(system_color)
    draw_text(x, y, 120, line_height, Vocab::param(param_id))
    change_color(normal_color)
    draw_text(x, y, width, line_height, actor.param(param_id).group, 2)
  end
  #--------------------------------------------------------------------------
  # * New Method: battle_party?
  #--------------------------------------------------------------------------
  def battle_party?(actor)
    if BM::NON_PARTY_MEMBER_TRANSPARENCY
      return $game_party.battle_members.include?(actor)
    else; true
    end
  end
  #--------------------------------------------------------------------------
  # * Overwrite: draw_actor_face
  #--------------------------------------------------------------------------
  alias :bm_menu_daf :draw_actor_face
  def draw_actor_face(actor, x, y, enabled = battle_party?(actor))
    face_background(actor, x, y)
    bm_menu_daf(actor, x, y, enabled)
  end
  #--------------------------------------------------------------------------
  # * New Method: face_background
  #--------------------------------------------------------------------------
  def face_background(actor, x, y, width = 96, height = 96)
    contents.fill_rect(x, y, width, height, standby_color(actor))
  end
  #--------------------------------------------------------------------------
  # * Overwrite: draw_character
  #--------------------------------------------------------------------------
  def draw_character(character_name, character_index, x, y, ani = false)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = character_index
    step = 0
    step = @walk if ani
    src_rect = Rect.new((n%4*3+1+step)*cw, (n/4*4)*ch, cw, ch)
    contents.blt(x - cw / 2, y - ch, bitmap, src_rect, ani ? 255 : translucent_alpha)
  end
  #--------------------------------------------------------------------------
  # * Overwrite: draw_actor_graphic
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y, ani = false)
    draw_character(actor.character_name, actor.character_index, x, y, ani)
  end
  #--------------------------------------------------------------------------
  # * Alias: draw_actor_name
  #--------------------------------------------------------------------------
  alias :bm_base_dan :draw_actor_name
  def draw_actor_name(*args)
    contents.font.bold = BM::TEXT[:bold][:actor_name]
    contents.font.italic = BM::TEXT[:italic][:actor_name]
    bm_base_dan(*args)
    contents.font.bold = Font.default_bold
    contents.font.italic = Font.default_italic
  end
  #--------------------------------------------------------------------------
  # * Alias: draw_actor_class
  #--------------------------------------------------------------------------
  alias :bm_base_dac :draw_actor_class
  def draw_actor_class(*args)
    contents.font.bold = BM::TEXT[:bold][:actor_class]
    contents.font.italic = BM::TEXT[:italic][:actor_class]
    bm_base_dac(*args)
    contents.font.bold = Font.default_bold
    contents.font.italic = Font.default_italic
  end
  #--------------------------------------------------------------------------
  # * New Method: ani_motion
  #--------------------------------------------------------------------------
  def ani_motion
    @animtime += 1
    if @animtime == 10
      case @walk
      when 1; @walk -= 1
      when -1; @walk += 1
      when 0
        if @step == 1
          @walk = -1
          @step = 0
        else
          @walk = 1
          @step = 1
        end
      end
      refresh
      @animtime = 0
    end
  end
  #--------------------------------------------------------------------------
  # * game_time
  #--------------------------------------------------------------------------
  def game_time
    gametime = Graphics.frame_count / Graphics.frame_rate
    hours = gametime / 3600
    minutes = gametime / 60 % 60
    seconds = gametime % 60
    result = sprintf("%d:%02d:%02d", hours, minutes, seconds)
    return result
  end
  #--------------------------------------------------------------------------
  # * new method: draw_icon_face
  #--------------------------------------------------------------------------
  def draw_icon_face(actor, dest_rect, enabled)
    bitmap = Cache.face(actor.face_name)
    rect = Rect.new(actor.face_index % 4 * 96, actor.face_index / 4 * 96, 96, 96)
    bitmap.blur if dest_rect.width < 96/2
    cache = Bitmap.new(dest_rect.width, dest_rect.height)
    cache.stretch_blt(Rect.new(0,0,dest_rect.width, dest_rect.height), bitmap, rect)
    Cache.storage_image(cache, actor.face_name + actor.face_index.to_s)
    bitmap.dispose
    contents.stretch_blt(dest_rect, cache, Rect.new(0,0,cache.width,cache.height), enabled ? 255 : translucent_alpha)
  end
  #--------------------------------------------------------------------------
  # * new method: Draw icon Character Graphic
  #--------------------------------------------------------------------------
  def draw_icon_character(actor, dest_rect, enabled = false)
    bitmap = Cache.character(actor.character_name)
    sign = actor.character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = actor.character_index
    step = 0
    step = @walk if enabled
    src_rect = Rect.new((n%4*3+1+step)*cw, (n/4*4)*ch, cw, ch)
    bitmap.blur if dest_rect.width < bitmap.width/2
    cache = Bitmap.new(dest_rect.width, dest_rect.height)
    cache.stretch_blt(Rect.new(0,0,dest_rect.width, dest_rect.height), bitmap, src_rect)
    Cache.storage_image(cache, actor.character_name + actor.character_index.to_s)
    contents.stretch_blt(dest_rect, cache, Rect.new(0,0,cache.width,cache.height), enabled ? 255 : translucent_alpha)
  end
end
#==============================================================================
# ** Window_Help
#==============================================================================
class Window_Help < Window_Base
  attr_accessor :item_color
  #--------------------------------------------------------------------------
  # * Alias: Object Initialization
  #--------------------------------------------------------------------------
  alias bm_base_init initialize
  def initialize(line_number = BM::HELP_SIZE)
    bm_base_init(line_number)
  end
  #--------------------------------------------------------------------------
  # * new method: item color
  #--------------------------------------------------------------------------
  def set_item_color(item)
    @item_color = normal_color
    @item_color = item_name_color
    return unless item.is_a?(RPG::BaseItem)       
    return unless $imported[:TH_ItemRarity] || $imported[:Vlue_WARandom]
    if $imported[:TH_ItemRarity]
      @item_color = item.rarity_colour   
    elsif $imported[:Vlue_WARandom]
      if item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)
        @item_color = item.color
      elsif !item.is_a?(RPG::Weapon) || !item.is_a?(RPG::Armor)
        @item_color = item_name_color
      end   
    end 
  end
  #--------------------------------------------------------------------------
  # * Overwrite: set_item
  #--------------------------------------------------------------------------
  alias :bm_base_si :set_item
  def set_item(item)
    return bm_base_si(item) unless BM::ADVANCED_HELP
    unless item; set_text("") ; return; end
    new_line = "\n"
    icon = BM::HELP_DISPLAY[0] ? '\i[' + item.icon_index.to_s + '] ' : ""
    name = BM::HELP_DISPLAY[1] ? item.name : ""
    desc = BM::HELP_DISPLAY[2] ? '\c[0]' + item.description : ""
    if item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)
      weight = $imported["XAIL-INVENTORY-WEIGHT"] ? weight = " - Weight: #{item.weight}." : ""
      durability = $imported["XAIL-ITEM-DURABILITY"] ? durability = " - Durability: #{item.durability} / #{item.max_durability}." : ""
    else weight = ""; durability = ""
    end
    if BM::HELP_DISPLAY[3]
      if item.is_a?(RPG::Weapon) ; item_type = " (" + Vocab.weapon_types(item.wtype_id) + ")" end
      if item.is_a?(RPG::Armor) ; item_type = " (" + Vocab.armor_types(item.atype_id) + ")" end
      if item.is_a?(RPG::Skill) ; item_type = " (" + Vocab.skill_types(item.stype_id) + ")" end
    else; item_type = ""
    end
    item_text = icon + name + item_type.to_s + weight + durability + new_line + desc
    set_item_color(item)
    set_text(item_text)
  end
  #--------------------------------------------------------------------------
  # * Overwrite: Draw Text with Control Characters
  #--------------------------------------------------------------------------
  def draw_text_ex(x, y, text)
    reset_font_settings
    change_color(@item_color) unless @item_color == nil
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end
end
#==============================================================================
# ** Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * New Method: face_background
  #--------------------------------------------------------------------------
  def face_background(actor, x, y, width = 96, height = 96)
  end
end
#==============================================================================
# ** Window_SkillStatus
#==============================================================================
class Window_SkillStatus < Window_Base
  if BM::MOVE_STATE_OVER_FACE
    alias :bm_skill_dai :draw_actor_icons
    def draw_actor_icons(actor, x, y)
      bm_skill_dai(actor, 0, 72)
    end
  end
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :icon_index
  #--------------------------------------------------------------------------
  # Alias: Setup
  #--------------------------------------------------------------------------
  alias :bm_base_setup :setup
  def setup(actor_id)
    bm_base_setup(actor_id)
    @icon_index = 0
  end
end
#===============================================================================
#
# END OF FILE
#
#===============================================================================
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,821
Reaction score
1,372
First Language
English
Primarily Uses
RMVXA
Ruby:
#===============================================================================
# ** Blackmorning -> Icon Module (Based on YEM - Icon Module Library)
# -----------------------------------------------------------------------------
#  Blackmorning
#  Version 1.14
#  updated 01/04/2023
# - adjusted icon text coding
#==============================================================================
#  - INTRODUCTION -
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# - adds icons automatically before specific words found in various windows 
#   (stats, elements, menu commands, classes, states, etc...)
#===============================================================================
# Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below BM - Base but above ▼ Main. Remember to save. 
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <icon: x>
# Sets the icon representing the class to x.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Actor Notetags - These notetags go in the actor notebox in the database.
# -----------------------------------------------------------------------------
# <icon: x>
# Sets the icon representing the actor to x.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Enemy Notetags - These notetags go in the enemy notebox in the database.
# -----------------------------------------------------------------------------
# <icon: x>
# Sets the icon representing the enemy to x.
#===============================================================================
module BM
  module ICON
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Icon Assignment
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Edit the hash below which contains all of the icons
    HASH ={
    :border    => 1073, # goes around command icons
    :stat_up   => 960,  # higher stat
    :stat_down => 961,  # lower stat
    :exp       => 912,
    :currency  => 262,
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Bubs Gender Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # used for Bubs Gender Functions
    :gender =>{ 
      :female     => 614,
      :male       => 613,
      :genderless => 612,
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Alignment Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # used for BM-Alignment
    :align =>{
      0 => 591, #"Demonic"
      1 => 591, #"Evil"
      2 => 590, #"Bad"
      3 => 590, #"Neutral"
      4 => 590, #"Good"
      5 => 589, #"Saintly"
      6 => 589, #"Divine"
      }, # Do Not Remove
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # State Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    :state   => { 
      :auto => true,        # if false, icon is not drawn beside state name
      }, # Do Not Remove
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Element Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    :element   => { 
      :auto => true,        # if false, icon is not drawn beside element name
      0  => 0,
      1  => 0,
      2  => 0,
      3  => 104,  # Fire element.
      4  => 105,  # Ice element.
      5  => 106,  # Volt element.
      6  => 107,  # Earth element.
      7  => 108,  # Water element.
      8  => 109,  # Air element.
      9  => 110,  # Light element.
      10 => 111,  # Dark element.
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Basic Stats Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    :basic => {
      :auto => false,        # if false, icon is not drawn beside basic stat name
      :show_words => false, # if false, only icon is shown instead of stat name
      0 => 0,   # Level
      1 => 0,   # Level (short)
      2 => 880, # HP
      3 => 880, # HP (short)
      4 => 881, # MP
      5 => 881, # MP (short)
      6 => 882, # TP
      7 => 882, # TP (short)
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Parameters Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :param => {
      :auto => true,       # if false, icon is not drawn beside param name
      :show_words => true, # if false, only icon is shown instead of param name
      0 => 880, # MaxHP, Max Hit points
      1 => 881, # MaxMP, Max Magic points
      2 => 884, # ATK,   ATtacK power
      3 => 885, # DEF,   DEFense power
      4 => 886, # MAT,   Magic ATtack power
      5 => 887, # MDF,   Magic DeFense power
      6 => 888, # AGI,   AGIlity
      7 => 889, # LUK,   LUcK    
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # ExParameters Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :xparam => {
      :auto => true,      # if false, icon is not drawn beside xparam name
      0 => 884, #HIT, HIT Rate
      1 => 885, #EVA, EVAsion
      2 => 886, #CRI, CRItical Hit
      3 => 887, #CEV, Critical Evade
      4 => 888, #MEV, Magic EVasion
      5 => 889, #MRF, Magic ReFlect
      6 => 890, #CNT, CouNTer rate
      7 => 880, #HRG, Hp ReGen
      8 => 881, #MRG, Mp ReGen 
      9 => 882, #TRG, Tp ReGen
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Special Parameters Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :sparam => {
      :auto => true,      # if false, icon is not drawn beside sparam name
      0 => 884, #TGR, TarGet Rate
      1 => 885, #GRD, GuaRD rate
      2 => 886, #REC, RECovery
      3 => 260, #PHA, Pharamcology
      4 => 881, #MCR, Mp Cost Rate
      5 => 882, #TCR, Tp ChaRge
      6 => 890, #PDR, Physical Damage Rate
      7 => 891, #MDR, Magical Damage Rate
      8 => 892, #FDR, Floor Damage Rate
      9 => 912, #EXR, EXp Rate
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Custom Parameters Icons (from YEA scripts)
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :cparam =>{
      :auto => true,      # if false, icon is not drawn beside cparam name
      :cdr     => 0,  #cooldown rate # Requires YEA - Skill Restrictions
      :wur     => 0,  #warmup rate   # Requires YEA - Skill Restrictions
      :hcr     => 880,  #hp cost rate   # Requires YEA - Skill Cost Manager
      :tcr_y   => 882,  #tp cost rate   # Requires YEA - Skill Cost Manager
      :gcr     => 262,  #gold cost rate # Requires YEA - Skill Cost Manager
      :hp_physical => 880, #convert hp physical # Requires YEA - Convert Damage
      :mp_physical => 881, #convert mp physical # Requires YEA - Convert Damage
      :hp_magical  => 880, #convert hp magical  # Requires YEA - Convert Damage
      :mp_magical  => 881, #convert mp magical  # Requires YEA - Convert Damage
      :gut     => 884, #guts #Requires Galv - Guts Effect
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Class Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :class => { # can also be defined in the Database in Class Notetag
      :auto => true,      # if false, icon is not drawn beside class name
      1  => 126, # Knight
      2  => 583, # Monk
      3  => 577, # Paladin
      4  => 584, # Ranger
      5  => 582, # Ninja
      6  => 578, # Archer
      7  => 581, # Thief 
      8  => 579, # Cleric
      9  => 585, # Druid
      10 => 580, # Sorcerer
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Actor Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :actor => { # can also be defined in the Database in Actor Notetag
      :auto => true,      # if false, icon is not drawn beside actor name
      1  => 276, # Knight
      2  => 583, # Monk
      3  => 577, # Paladin
      4  => 584, # Ranger
      5  => 582, # Ninja
      6  => 578, # Archer
      7  => 581, # Thief 
      8  => 579, # Cleric
      9  => 585, # Druid
      10 => 580, # Sorcerer
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Enemy Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :enemy => { # can also be defined in the Database in Enemy Notetag
      :auto => true,      # if false, icon is not drawn beside enemy name
      1  => 176, # Slime
      2  => 583, # Rat
      3  => 577, # Paladin
      4  => 584, # Ranger
      5  => 582, # Ninja
      6  => 578, # Archer
      7  => 581, # Thief 
      8  => 579, # Cleric
      9  => 585, # Druid
      10 => 580, # Sorcerer
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Command Icons (used in menus, shops, etc)
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :command => {
      0  => 839,    # Battle scene - partycommand - fight.
      1  => 840,    # Battle scene - partycommand - escape.
      2  => 837,    # Battle scene - actorcommand - attack.
      3  => 383,    # Battle scene - actorcommand - defend.
      4  => 820,    # Menu scene. Item scene. Battle scene - items.  
      5  => 821,    # Menu scene - skills.
      6  => 822,    # Menu scene - equipment.
      7  => 823,    # Menu scene - status.
      8  => 824,    # Menu scene - formation.
      9  => 825,    # Menu scene - save.
      10 => 826,    # Menu scene - game end.
      11 =>   0,    # 
      12 => 833,    # Item scene - weapons.
      13 => 834,    # Item scene - armors.
      14 => 835,    # Shop scene - key items.
      15 =>   0,    # Equip scene - change.
      16 =>   0,    # Equip scene - optimize.
      17 =>   0,    # Equip scene - clear all.
      18 => 816,    # Title scene - new game.
      19 => 817,    # Title scene - continue.
      20 => 818,    # Title scene. Game End scene - shutdown.
      21 => 818,    # Game End scene - to title.
      22 => 818,    # Game End scene - cancel.
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Input Icons (button commands)
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # not automatic for any text yet
    :input => {
      :DOWN  => 0,
      :UP    => 0,
      :RIGHT => 0,
      :LEFT  => 0,
      :L     => 0, # Q
      :R     => 0, # W
      :A     => 0, # SHIFT
      :C     => 0, # SPACE, ENTER, Z
      :B     => 0, # ESC, X, 0    
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Item Status Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are for item descriptions (ie YEA - items or shop)
    :item_status => {
      :hp_recover => 880, # used for HP Recovery.
      :mp_recover => 881, # used for MP Recovery.
      :tp_recover => 882, # used for TP Recovery.
      :tp_gain    => 882, # used for TP Gain.
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Skill Types Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :skill_types => {
      1 => 128,          # Skill scene. Battle scene.
      2 => 136,          # Skill scene. Battle scene.
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Armor Types Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :armor_types => {
      1 => 0,
      2 => 0,
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Weapon Types Icons
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    :weapon_types => {
      1 => 0,
      2 => 0,
      }, # DO NOT REMOVE
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # Custom Word Icons 
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # for any other text you want
    :words => {
      :show_words => true, # if false, only icon is shown instead of word
      "Auto"  => 841,
      "JP"    => 883,  
      "Buy"   => 259,
      "Sell"  => 261,
      "Equip" => 822,
      }, # DO NOT REMOVE
    } # DO NOT REMOVE
  end
end
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
module BM
  def self.required(name, req, version, type = nil)
    if !$imported[:bm_base]
      msg = "The script '%s' requires the script\n"
      msg += "'BM - Base' v%s or higher above it to work properly\n"
      msg += "Go to bmscripts.weebly.com to download this script."
      msgbox(sprintf(msg, self.script_name(name), version))
      exit
    else
      self.required_script(name, req, version, type)
    end
  end
  #--------------------------------------------------------------------------
  # * script_name
  #   Get the script name base on the imported value
  #--------------------------------------------------------------------------
  def self.script_name(name, ext = "BM")
    name = name.to_s.gsub("_", " ").upcase.split
    name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
    name.join(" ")
  end
end
$imported ||= {}
$imported[:bm_icon] = 1.13
BM.required(:bm_icon, :bm_base, 1.00, :above)
#==============================================================================
module BM
  module REGEXP
    ICON_INDEX = /<(?:ICON_INDEX|icon index|icon):[ ](\d+)>/i
  end
end
#==============================================================================
# ** DataManager
#==============================================================================
module DataManager  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_bm_icons load_database; end
  def self.load_database
    load_database_bm_icons
    load_notetags_bm_icons
  end  
  #--------------------------------------------------------------------------
  # new method: load_notetags_cs
  #--------------------------------------------------------------------------
  def self.load_notetags_bm_icons
    groups = [$data_actors, $data_classes, $data_enemies]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_bm_icons
      end
    end
  end
  
end # DataManager
#==============================================================================
# ** RPG::Class
#==============================================================================
class RPG::Class < RPG::BaseItem  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :icon_index  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_bm_icons
  #--------------------------------------------------------------------------
  def load_notetags_bm_icons
    @icon_index = 0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when BM::REGEXP::ICON_INDEX
        @icon_index = $1.to_i
      #---
      end
    } # self.note.split
  end  
end # RPG::Class
#==============================================================================
# ** RPG::Actor
#==============================================================================
class RPG::Actor < RPG::BaseItem  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :icon_index  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_bm_icons
  #--------------------------------------------------------------------------
  def load_notetags_bm_icons
    @icon_index = 0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when BM::REGEXP::ICON_INDEX
        @icon_index = $1.to_i
      #---
      end
    } # self.note.split
  end  
end
#==============================================================================
# ** RPG::Class
#==============================================================================
class RPG::Enemy < RPG::BaseItem  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :icon_index  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_bm_icons
  #--------------------------------------------------------------------------
  def load_notetags_bm_icons
    @icon_index = 0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when BM::REGEXP::ICON_INDEX
        @icon_index = $1.to_i
      #---
      end
    } # self.note.split
  end  
end # RPG::Enemy
#==============================================================================
# ** Icon
#==============================================================================
module Icon
  unless $imported[:bm_ring]
    def self.disable; 0; end
  end
  #--------------------------------------------------------------------------
  def self.basic(id)
    return BM::ICON::HASH[:basic][id] if BM::ICON::HASH[:basic].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.param(param_id)
    case param_id
      when :maxhp,:hp then param_id = 0
      when :maxmp,:mp then param_id = 1
      when :atk then param_id = 2
      when :def then param_id = 3
      when :mat then param_id = 4
      when :mdf then param_id = 5
      when :agi then param_id = 6
      when :luk then param_id = 7
    end
    return BM::ICON::HASH[:param][param_id] if BM::ICON::HASH[:param].include?(param_id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.xparam(id)
    case id
      when :hit then id = 0
      when :eva then id = 1
      when :cri then id = 2
      when :cev then id = 3
      when :mev then id = 4
      when :mrf then id = 5
      when :cnt then id = 6
      when :hrg then id = 7
      when :mrg then id = 8
      when :trg then id = 9
    end
    return BM::ICON::HASH[:xparam][id] if BM::ICON::HASH[:xparam].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.sparam(id)
    case id
      when :tgr then id = 0 
      when :grd then id = 1
      when :rec then id = 2
      when :pha then id = 3
      when :mcr then id = 4  
      when :tcr then id = 5
      when :pdr then id = 6
      when :mdr then id = 7
      when :fdr then id = 8
      when :exr then id = 9
    end
    return BM::ICON::HASH[:sparam][id] if BM::ICON::HASH[:sparam].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.cparam(id)
    return BM::ICON::HASH[:cparam][id] if BM::ICON::HASH[:cparam].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.element(id); 
    return BM::ICON::HASH[:element][id] if BM::ICON::HASH[:element].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.class(id)
    return $data_classes[id].icon_index if $data_classes[id].icon_index != 0
    return BM::ICON::HASH[:class][id] if BM::ICON::HASH[:class].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.actor(id)
    return $data_actors[id].icon_index if $data_actors[id].icon_index != 0
    return BM::ICON::HASH[:actor][id] if BM::ICON::HASH[:actor].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.enemy(id)
    return $data_enemies[id].icon_index if $data_enemies[id].icon_index != 0
    return BM::ICON::HASH[:enemy][id] if BM::ICON::HASH[:enemy].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.items(id); $data_items[id].icon_index; end
  def self.weapons(id); $data_weapons[id].icon_index; end
  def self.armors(id); $data_armors[id].icon_index; end
  def self.skills(id); $data_skills[id].icon_index; end
  def self.state(id); $data_states[id].icon_index; end
  #--------------------------------------------------------------------------
  def self.param_compare(num)
    return BM::ICON::HASH[:stat_up] if num > 0
    return BM::ICON::HASH[:stat_down] if num < 0
    else; return 0
  end
  #--------------------------------------------------------------------------
  def self.input(id)
    return BM::ICON::HASH[:input][id] if BM::ICON::HASH[:input].include?(id)
    return 0
  end  
  #--------------------------------------------------------------------------
  def self.item_status(id)
    return BM::ICON::HASH[:item_status][id] if BM::ICON::HASH[:item_status].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  def self.command(id)
    return BM::ICON::HASH[:command][id] if BM::ICON::HASH[:command].include?(id)
    return 0
  end
  #--------------------------------------------------------------------------
  # * self.****_types
  #--------------------------------------------------------------------------
  def self.skill_types(id)
    return BM::ICON::HASH[:skill_types][id] if BM::ICON::HASH[:skill_types].include?(id)
    return 0
  end
  def self.weapon_types(id)
    return BM::ICON::HASH[:weapon_types][id] if BM::ICON::HASH[:weapon_types].include?(id)
    return 0
  end
  def self.armor_types(id)
    return BM::ICON::HASH[:armor_types][id] if BM::ICON::HASH[:armor_types].include?(id)
    return 0
  end
  def self.words(text); BM::ICON::HASH[:words][text]; end
  #--------------------------------------------------------------------------
  def self.border; BM::ICON::HASH[:border]; end
  def self.exp; BM::ICON::HASH[:exp]; end
  def self.currency; BM::ICON::HASH[:currency]; end
  def self.steal_gold; self.currency; end
  def self.gold_cost; self.currency; end
  def self.hp_cost; self.basic(2); end  
  def self.mp_cost; self.basic(4); end  
  def self.tp_cost; self.basic(6); end  
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :icon_index
  #--------------------------------------------------------------------------
  # Alias: Setup
  #--------------------------------------------------------------------------
  alias :bm_icon_setup :setup
  def setup(actor_id)
    bm_icon_setup(actor_id)
    @icon_index = actor.icon_index
  end
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * New method: get_basic_id
  #--------------------------------------------------------------------------
  def get_basic_id(text)
    for id in 0..7
      case text; when Vocab.basic(id) then return id; end      
    end
    return nil
  end  
  #--------------------------------------------------------------------------
  # * New method: get_param_id
  #--------------------------------------------------------------------------
  def get_param_id(text)
    for id in 0..7  
      case text
        when Vocab.param_f(id) then return id
        when Vocab.param_a(id) then return id
      end
    end
    i = 0
    for id in [:hp, :mp, :atk, :def, :mat, :mdf, :agi, :luk]
      case text
        when Vocab.param_a(id) then return i
        when Vocab.param_f(id) then return i
      end
      i += 1
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_xparam_id
  #--------------------------------------------------------------------------
  def get_xparam_id(text)
    for id in 0..9  
      case text
        when Vocab.xparam_f(id) then return id
        when Vocab.xparam_a(id) then return id
      end
    end
    i = 0
    for id in [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
      case text
        when Vocab.xparam_a(id) then return i
        when Vocab.xparam_f(id) then return i
      end
      i += 1
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_sparam_id
  #--------------------------------------------------------------------------
  def get_sparam_id(text)
    for id in 0..9  
      case text
        when Vocab.sparam_f(id) then return id
        when Vocab.sparam_a(id) then return id
      end
    end
    i = 0
    for id in [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
      case text
        when Vocab.sparam_a(id) then return i
        when Vocab.sparam_f(id) then return i
      end
      i += 1
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_cparam_id
  #--------------------------------------------------------------------------
  def get_cparam_id(text)
    for id in [:hcr, :tcr_y, :gcr, :cdr, :wur, :hp_physical, :mp_physical, :hp_magical, :mp_magical, :gut]
      case text
        when Vocab.cparam_a(id) then return id
        when Vocab.cparam_f(id) then return id
      end
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_ele_id
  #--------------------------------------------------------------------------
  def get_ele_id(text)
    for id in 1..$data_system.elements.size-1
      case text; when Vocab.element(id) then return id; end
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_class_id
  #--------------------------------------------------------------------------
  def get_class_id(text)
    for id in 1..$data_classes.size-1
      case text; when Vocab.classes(id) then return id; end
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_actor_id
  #--------------------------------------------------------------------------
  def get_actor_id(text)
    for id in 1..$data_actors.size-1
      case text; when Vocab.actors(id) then return id; end
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_enemy_id
  #--------------------------------------------------------------------------
  def get_enemy_id(text)
    for id in 1..$data_enemies.size-1
      name = remove_unique_names(text)
      case name; when Vocab.enemies(id) then return id; end
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * Add letters (ABC, etc) to enemy characters with the same name
  #--------------------------------------------------------------------------
  def remove_unique_names(text)
    return unless text.instance_of?(String)
    $game_troop.members.each do |enemy|
      next unless enemy.alive?
      next if enemy.letter.empty?
      return enemy.original_name if text.include?(enemy.original_name)
      return text
    end
  end
  #--------------------------------------------------------------------------
  # * New method: get_ele_id
  #--------------------------------------------------------------------------
  def get_state_id(text)
    for id in 1..$data_states.size-1
      case text; when Vocab.state(id) then return id; end
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_command_id
  #--------------------------------------------------------------------------
  def get_command_id(text)
    for id in 0..22
      case text; when Vocab.command(id) then return id; end      
    end
    return nil
  end
  #--------------------------------------------------------------------------
  # * New method: get_item_status_id
  #--------------------------------------------------------------------------
  def get_item_status_id(text)
    return nil unless $imported["YEA-ItemMenu"] || $imported["YEA-ShopOptions"]
    for id in [:hp_recover, :mp_recover, :tp_recover, :tp_gain]
      case text
        when Vocab::item_status(id) then return id
      end
    end
    return nil
  end 
  #--------------------------------------------------------------------------
  # * New method: get_armor_type_id
  #--------------------------------------------------------------------------
  def get_armor_types_id(text)
    for id in 1...$data_system.armor_types.size
      case text
        when Vocab.armor_types(id) then return id
      end
    end
    return nil
  end 
  #--------------------------------------------------------------------------
  # * New method: get_weapon_type_id
  #--------------------------------------------------------------------------
  def get_weapon_types_id(text)
    for id in 1...$data_system.weapon_types.size
      case text
        when Vocab.weapon_types(id) then return id
      end
    end
    return nil
  end 
  #--------------------------------------------------------------------------
  # * New method: get_skill_type_id
  #--------------------------------------------------------------------------
  def get_skill_types_id(text)
    for id in 1...$data_system.skill_types.size
      case text
        when Vocab.skill_types(id) then return id
      end
    end
    return nil
  end 
  #--------------------------------------------------------------------------
  # * Draw Icon
  #     enabled : Enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_icon(icon_index, x, y, enabled = true)
    if icon_index == nil && $TEST
      msg = "The icon number #{icon_index} does not exist or you forgot to assign it properly."
      msgbox(msg)
      return
    end
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  end
  #--------------------------------------------------------------------------
  # * New Method: use_vocab_icon?
  #--------------------------------------------------------------------------
  def use_vocab_icon?(text)
    return true if vocab_icon(text) != 0 || nil
    return false
  end  
  #--------------------------------------------------------------------------
  # * New Method: vocab_icon
  #--------------------------------------------------------------------------
  def vocab_icon(text)
    icon  = 0
    return icon = Icon.words(text) if BM::ICON::HASH[:words][text] != nil
    return icon = Icon.basic(get_basic_id(text)) if (get_basic_id(text) != nil && BM::ICON::HASH[:basic][:auto])
    return icon = Icon.param(get_param_id(text)) if (get_param_id(text) != nil && BM::ICON::HASH[:param][:auto])
    return icon = Icon.xparam(get_xparam_id(text)) if (get_xparam_id(text) != nil && BM::ICON::HASH[:xparam][:auto])
    return icon = Icon.sparam(get_sparam_id(text)) if (get_sparam_id(text) != nil && BM::ICON::HASH[:sparam][:auto])
    return icon = Icon.cparam(get_cparam_id(text)) if (get_cparam_id(text) != nil && BM::ICON::HASH[:cparam][:auto])
    return icon = Icon.element(get_ele_id(text)) if (get_ele_id(text) != nil && BM::ICON::HASH[:element][:auto])
    return icon = Icon.class(get_class_id(text)) if (get_class_id(text) != nil && BM::ICON::HASH[:class][:auto])
    return icon = Icon.actor(get_actor_id(text)) if (get_actor_id(text) != nil && BM::ICON::HASH[:actor][:auto])
    return icon = Icon.enemy(get_enemy_id(text)) if (get_enemy_id(text) != nil && BM::ICON::HASH[:enemy][:auto])
    return icon = Icon.state(get_state_id(text)) if (get_state_id(text) != nil && BM::ICON::HASH[:state][:auto])
    return icon = Icon.item_status(get_item_status_id(text)) if get_item_status_id(text) != nil
    return icon = Icon.exp if text == Vocab.exp
    return (icon == nil) ? 0 : icon 
  end
  #--------------------------------------------------------------------------
  # * Draw Number (Gold Etc.) with Currency Unit
  #--------------------------------------------------------------------------
  alias :bm_icon_dcv :draw_currency_value
  def draw_currency_value(value, unit, x, y, width)
    icon = Icon.currency
    bm_icon_dcv(value, unit, x, y, width)
    draw_icon(icon, x, y)
  end
  #--------------------------------------------------------------------------
  # * Alias: draw_icon_text
  #--------------------------------------------------------------------------
  alias :bm_icon_dt :draw_text
  def draw_text(*args, &block)
    if args[0].is_a?(Rect)
      rect = args[0]
      text = args[1]
      if use_vocab_icon?(text)
        rect1 = Rect.new(rect.x+24,rect.y,rect.width-24,rect.height)
        args[0] = rect1
      end
    else
      text = args[4]
      x, y, width, height = *args[0..3]
      if x == nil; x=0; end
      if y == nil; y=0; end
      if width == nil; width = 0; end
      if height == nil; height = 0; end
      rect = Rect.new(x, y, width, height)
      if use_vocab_icon?(text)
        args[0] += 24; args[2] -=24
      end
    end
    draw_icon(vocab_icon(text), rect.x, rect.y) if use_vocab_icon?(text)  
    if use_vocab_icon?(text) 
      return if BM::ICON::HASH[:words][text] != nil && !BM::ICON::HASH[:words][:show_words]
      return if get_basic_id(text) != nil && !BM::ICON::HASH[:basic][:show_words]
      return if get_param_id(text) != nil && !BM::ICON::HASH[:param][:show_words]
    end
    bm_icon_dt(*args, &block)
  end
  #--------------------------------------------------------------------------
  # * new method: draw_gender_icon
  #--------------------------------------------------------------------------
  def draw_gender_icon(actor, x, y)
    return unless $imported["BubsGenderFunctions"]
    icon = BM::ICON::HASH[:gender][:genderless]
    icon = BM::ICON::HASH[:gender][:male] if actor.male?
    icon = BM::ICON::HASH[:gender][:female] if actor.female?
    return unless icon != 0
    draw_icon(icon, x, y)
  end
  #--------------------------------------------------------------------------
  # * new method: draw_gender_icon
  #--------------------------------------------------------------------------
  def draw_align_icon(actor, x, y)
    return unless $imported[:bm_align]
    icon = BM::ICON::HASH[:align][actor.align_id]
    return unless icon != 0
    draw_icon(icon, x, y)
  end
end
#==============================================================================
# ** Window_Command
#==============================================================================
class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * old Method: draw_text
  #--------------------------------------------------------------------------
  def draw_text(*args, &block); bm_icon_dt(*args, &block); end
  #--------------------------------------------------------------------------
  # * New Method: use_icon?
  #--------------------------------------------------------------------------
  def use_icon?(text)
    if command_icon(text) != 0; return true
    else; return false
    end
  end  
  #--------------------------------------------------------------------------
  # * New Method: command_icon
  #--------------------------------------------------------------------------
  def command_icon(text)
    if $imported["YEA-CommandWindowIcons"]
      return icon = YEA::COMMAND_WINDOW_ICONS::ICON_HASH[text] if YEA::COMMAND_WINDOW_ICONS::ICON_HASH.include?(text)
    end
    return icon = vocab_icon(text) if use_vocab_icon?(text)
    return icon = Icon.command(get_command_id(text)) if get_command_id(text) != nil
    return icon = Icon.skill_types(get_skill_types_id(text)) if get_skill_types_id(text) != nil
    return icon = Icon.armor_types(get_armor_types_id(text)) if get_armor_types_id(text) != nil
    return icon = Icon.weapon_types(get_weapon_types_id(text)) if get_weapon_types_id(text) != nil            
    return (icon == nil) ? 0 : icon  
  end  
  #--------------------------------------------------------------------------
  # * Overwrite: draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    enabled = command_enabled?(index)
    change_color(normal_color, enabled)
    rect = item_rect_for_text(index)
    text = command_name(index)
    if use_icon?(text)
      draw_icon_text(rect.clone, text, alignment, enabled)
      draw_icon(Icon.disable, rect.x, rect.y, @index == index) if !enabled
    else
      bm_icon_dt(rect, text, alignment)
    end
  end  
  #--------------------------------------------------------------------------
  # * New Method: draw_icon_text
  #--------------------------------------------------------------------------
  def draw_icon_text(rect, text, alignment, enabled)
    cw = text_size(text).width
    icon = command_icon(text)
    draw_icon(Icon.border, rect.x, rect.y, enabled)
    draw_icon(icon, rect.x, rect.y, enabled)
    rect.x += 24
    rect.width -= 24
    draw_text(rect, text, alignment)
  end  
end 
#==============================================================================
# ** Window_Command
#==============================================================================
class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # * old Method: draw_text
  #--------------------------------------------------------------------------
  def draw_text(*args, &block); bm_icon_dt(*args, &block); end
  #--------------------------------------------------------------------------
  # * New Method: use_icon?
  #--------------------------------------------------------------------------
  def use_icon?(text)
    return true if enemy_icon(text) != 0 || nil
    return false
  end  
  #--------------------------------------------------------------------------
  # * New Method: command_icon
  #--------------------------------------------------------------------------
  def enemy_icon(text)
    return icon = vocab_icon(text) if use_vocab_icon?(text)
    return icon = Icon.enemy(get_enemy_id(text)) if get_enemy_id(text) != nil
    return (icon == nil) ? 0 : icon  
  end  
  #--------------------------------------------------------------------------
  # * Overwrite: draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    change_color(normal_color)
    rect = item_rect_for_text(index)
    text = $game_troop.alive_members[index].name
    if use_icon?(text)
      draw_icon_text(rect.clone, text)
    else
      bm_icon_dt(rect, text)
    end
  end  
  #--------------------------------------------------------------------------
  # * New Method: draw_icon_text
  #--------------------------------------------------------------------------
  def draw_icon_text(rect, text)
    cw = text_size(text).width
    icon = enemy_icon(text)
    draw_icon(Icon.border, rect.x, rect.y)
    draw_icon(icon, rect.x, rect.y)
    rect.x += 24
    rect.width -= 24
    draw_text(rect, text)
  end  
end 
#==============================================================================
# ** Window_MenuCommand
#==============================================================================
class Window_MenuCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Alias: command_icon
  #--------------------------------------------------------------------------
  alias :bm_xs_ci :command_icon
  def command_icon(text)
    if $imported["XAIL-XS-MENU_DELUX"]
      $game_system.get_menu.each {|key, value|
      name = value[0] == "" ? key.id2name.capitalize : value[0]
      icon = value[2]
      return icon if name == text
      }
    end
    bm_xs_ci(text)
  end
end
#==============================================================================
# ** Window_SkillStatus
#==============================================================================
class Window_SkillStatus < Window_Base
  #--------------------------------------------------------------------------
  # * alias: Refresh
  #--------------------------------------------------------------------------
  alias :bm_icons_ref :refresh
  def refresh
    return unless @actor
    bm_icons_ref
    draw_gender_icon(@actor, 108, line_height*3)
    draw_align_icon(@actor, 108+24, line_height*3)
  end
end
#==============================================================================
# ** Window_EquipActor
#==============================================================================
class Window_EquipActor < Window_Base
  #--------------------------------------------------------------------------
  # * alias: Refresh
  #--------------------------------------------------------------------------
  if $imported["YEA-AceEquipEngine"] && !$imported[:bm_vk_equip]
  alias :bm_icons_ref :refresh 
  def refresh
    return unless @actor
    bm_icons_ref
    draw_gender_icon(@actor, 108, line_height*3)
    draw_align_icon(@actor, 108+24, line_height*3)
  end
  end
end
#==============================================================================
class Window_MateriaList < Window_Selectable
  #--------------------------------------------------------------------------
  # * draw_icon
  #--------------------------------------------------------------------------
  def draw_icon(icon_index, x, y, enabled = true, item = 0)
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  end
end

#===============================================================================
# 
# END OF FILE
# 
#===============================================================================
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
3,124
Reaction score
2,246
First Language
Spanish
Primarily Uses
RMVXA
@Roninator2 why use a cannon to shoot a fly?
just redirect draw_actor_name!

Code:
class Window_Base < Window
 alias draw_actor_name orig_draw_name
 def draw_actor_name(actor, x, y, width = 112)
  icon = actor.note[/"ID\s*=\s*(\n+)"/i] rescue 0
  draw_icon(icon, x, y)
  orig_draw_name(actor, x + 26, y)
 end
end
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
3,124
Reaction score
2,246
First Language
Spanish
Primarily Uses
RMVXA
So every enemy and class is called under draw_actor_name ?
no, of course not.... ¬.¬
but even with the fixes for those classes, it's still simpler than a whole plugin, and you still run everything with the same ONE fix: alias and redirect!
why would you load an entire module and an entire new plugin to fix ONE procedure?
 

Koudelka

Villager
Member
Joined
Oct 29, 2019
Messages
27
Reaction score
0
First Language
Portuguese
Primarily Uses
RMVXA
@Roninator2 Thank you very much! These scripts worked perfectly!
 

Latest Threads

Latest Posts

Latest Profile Posts

Someone please post some beginner problems so I can act like I'm a veteran and know what I'm doing? (Also someone please stop @Andar and @ATT_Turan from posting on them because they are way too fast?!)
Random reminder to work on yo games! Good day.
A preview of the second of five hidden arcade machines you can find in The Brothers, an upcoming JRPG from System Masters. They are fully playable, each with multiple levels, tracked hi-scores and related challenges / achievements / trophies!

Forum statistics

Threads
131,576
Messages
1,221,196
Members
173,270
Latest member
TheAccordionMaster
Top