Monster Catalogue

Monster Catalogue
Version: 1.0b
Author: modern algebra
Date: August 21, 2009
RPG Maker Forums

Description

This script allows you to create multiple monster catalogues that shows a small information window on any monsters you have encountered (and have included in the particular catalogue). As with all my Catalogue scripts, you can make many different catalogues. Want a catalogue that shows all monsters? That can be done. Want a catalogue that only shows Undead monsters? That can be done too. You can also turn auto encounter to off and manually set when monsters should show up, or you could turn the show all option on for a catalogue and have it reveal all monsters included in the catalogue. The choice is yours to make smile.gif

Features

Very configurable. Everything from the position of the battler in the catalogue to the colour of the border is configurable.
You can make as many monster catalogues as you like and put only the monsters you want in each one.
You can have the monsters added as soon as they are encountered or you can disable autoencounter and control it all manually through call script
A simple, but I think quite pretty design
monstercatscreen.png


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

  1. Monster Catalogue
  2. Version: 1.0b
  3. Author: modern algebra (rmrk.net)
  4. Date: August 21, 2009

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Description:

#

  1. This script allows you to create a monster catalogue that shows a small
  2. information window on any monsters you have encountered (if you have auto
  3. encounter ON. You could also manually alter which monsters have been
  4. "encountered" if you wish to set different conditions on their inclusion in
  5. the catalogues. As with all my Catalogue scripts, you can make many
  6. many different catalogues. Want a catalogue that shows all monsters? That
  7. can be done. Want a catalogue that only shows Undead monsters? That can be
  8. done too.

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Instructions:

#

  1. This script REQUIRES the Catalogue_Base script, and Bitmap Addons is
  2. recommended. Both can be found in the RMVX Scripts Database of RMRK.

#

  1. Place this script above Main and below Catalogue Base (which should itself
  2. be below Materials). For instructions on setting up new catalogues and
  3. other configuration options, please see the editable regions at lines 122,
  4. 157, and 252.

#

  1. To call a catalogue screen, use this code:

#

  1. $scene = Scene_Catalogue.new (id)

#

  1. By default, the all enemies catalogue has an ID of 20, and this is because
  2. I didn't want it to interfere if you also have the Items Catalogue. Remember
  3. that NO catalogue can have the same ID as another, even if they are
  4. different scripts. So, by default, to call the all enemies catalogue, the
  5. code is:

#

  1. $scene = Scene_Catalogue.new (20)

#

  1. To manually "encounter" an enemy without having to actually fight the
  2. monster, you can use the code in a Call Script:

#

  1. encounter_monster (monster_id)
  2. monster_id : the ID of the monster to encounter

#

  1. Some Enemy data can be set in the notebox.

#

  1. SPECIES
  2. In order to make monster collection a little more interesting, it is
  3. possible to give an enemy a species now. It is purely cosmetic. If you wish
  4. to get rid of it altogether, then go down to lines 163 and 127 and change
  5. the name to "" and icon to 0. Those are the default species settings.
  6. However, you can change species settings on an individual enemy basis by
  7. putting these codes in the note box of the enemy:

#

  1. \species["<name>"]
  2. name : the name of the species.
  3. \species_icon[<index>]
  4. index : the icon index for the species

#

  1. Example:
  2. \species[Undead]
  3. \species_icon[112]

#

  1. ICON
  2. In order to make the monster list a little more interesting looking, you can
  3. give them individual icons to show up in that list. If you do not give them
  4. an individual icon, then it will default to showing the species icon. The
  5. code to put in the notes box is:

#

  1. \icon[<index>]
  2. index : the index of the icon you want to use.

#

  1. Example:
  2. \icon[1]

#

  1. Note: if you want to keep a species icon, but don't want any icons to show
  2. up next to the monster's name in the list, than you can manually set the
  3. icon to blank with the code: \icon[0]

#

  1. DESCRIPTION
  2. Another feature to make the screens a little more interesting is that you
  3. can give monsters individual descriptions. If you don't give them a
  4. description, than it will default to the value at line 166. The code to put in
  5. the note box is:

#

  1. \description[<text>]
  2. text : the description text. Don't worry about extending past one line.

#

  1. Example:
  2. \description[It may be blind,
  3. but it's still a dangerous
  4. foe]

#

  1. CATALOGUE Y
  2. This is something purely cosmetic. By default, the monster battler is drawn
  3. at about 48 pixels in the catalogue window. This allows you to change that
  4. y value if you so desire. It can make for a nice effect with maybe flying
  5. creatures appearing a little over the border, for instance, or anything like
  6. that really. It's very unnecessary though, and I recommend you not altering
  7. it. The code to put in the note box is:
  8. \cat_y[<new_y>]
  9. new_y : the y position for the battler in the catalogue window

#

  1. Example:
  2. \cat_y[16]

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

  1. *** ModernAlgebra

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Summary of Changes:
  2. new constants - CM_DEFAULT_SPECIES_ICON

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

module ModernAlgebra
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** CONSTANTS
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # EDITABLE REGION A
#```````````````````````````````````````````````````````````````````````` # Read the instructions surrounding each constant to see what it does. #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| # The icon for whatever you set as the default species CM_DEFAULT_SPECIES_ICON = 196 # Truth value of whether monsters should be visible once they are first # fought against or whether it should be done manually. CM_AUTO_ENCOUNTER_MONSTERS = true # All colours set up as: [Red, Green, Blue[, Alpha]] CM_MONSTERSPECIES_COLOUR = [160, 160, 160] # Colour of Monster Race CM_MONSTERCARD_RIM_COLOUR = [105, 105, 255, 255] # Colour of Card Border CM_MONSTERCARD_RIMSHADOW_COLOUR = [0, 0, 0] # Shadow of Card Border # Icons to represent elements of items in the Item Card. Every element MUST # have an icon. If you have set this up in CI_ITEM_ELEMENT_ICONS, you can # delete it here. CI_ITEM_ELEMENT_ICONS = [132, 2, 4, 14, 16, 12, 138, 137, 104, 105, 106, 107, 108, 109, 110, 111] #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| # END EDITABLE REGION A #////////////////////////////////////////////////////////////////////////// end #============================================================================== # *** Vocab #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # new constants : GI_EVASION; GI_HIT_RATIO; CM_DEFAULT_RACE #============================================================================== module Vocab #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ** CONSTANTS #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # EDITABLE REGION B #‘```````````````````````````````````````````````````````````````````````
# Read the instructions surrounding each constant to see what it does.
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# If a species name is not set in the enemy’s note box, it will show up
# as the following for defualt.
CM_DEFAULT_SPECIES_NAME = "Monster"
# If a description is not set in an enemy's note box, this is the description
# it will have.
CM_DEFAULT_MONSTER_DESCRIPTION = "A fearsome foe"
# These are the letter ranks for a monster's element efficiency.
CM_ELEMENT_RANKS = ["A", "B", "C", "D", "E", "F"]
# All constants prefaced by GI are also present in the Grid Inventory script
# and in the Item & Skill Catalogue script; if you have either of those
# scripts, it is recommended that you delete any of the constants with GI
# preface in this script (Monster Catalogue).
# THe label for stats
GI_STATS = "Stats"
# The label for the evasion stat of armors
GI_EVASION = "Evasion"
# The label for the hit stat of skills & weapons
GI_HIT_RATIO = "Hit Ratio"
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# END EDITABLE REGION B
#//
end

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

  1. ** RPG::Enemy

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Summary of Changes:
  2. new method - ma_species

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

class RPG::Enemy
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Species Name
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_species_name
if @species_name == nil
@species_name = self.note[/\\SPECIES\[(.*?)\]/i] != nil ? $1 : Vocab::CM_DEFAULT_SPECIES_NAME
end
return @species_name
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Species Icon
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_species_icon
if @species_icon == nil
@species_icon = self.note[/\\SPECIES_ICON\[(\d+)\]/i] != nil ? $1.to_i : ModernAlgebra::CM_DEFAULT_SPECIES_ICON
end
return @species_icon
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * ICON
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def icon_index
if @ma_icon == nil
@ma_icon = self.note[/\\ICON\[(\d+)\]/i] != nil ? $1.to_i : ma_species_icon
end
return @ma_icon
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * ICON
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def description
if @ma_desc == nil
@ma_desc = self.note[/\\DESCRIPTION\[(.*?)\]/i] != nil ? $1 : Vocab::CM_DEFAULT_MONSTER_DESCRIPTION
end
return @ma_desc
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Catalogue Y
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def catalogue_y
@ma_cat_y = (self.note[/\\CAT_Y\[(\d+)\]/i] != nil ? $1.to_i : 32) if @ma_cat_y == nil
return @ma_cat_y
end
end

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

  1. ** Data Catalogues

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Summary of Changes:
  2. aliased method - initialize

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

class Data_Catalogues
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malgbr_monstcatlg_intlz_5bc2 initialize
def initialize (*args)
malgbr_monstcatlg_intlz_5bc2 (*args) # Run Original Method
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # EDITABLE REGION C
#‘`````````````````````````````````````````````````````````````````````
# These are the setup options for making catalogues. It can be sort of
# complicated, so I will go into detail here.
#
# A catalogue object can be made with the following code:
#
# @data[<id>] = Catalogue_Monster.new ("<name>", [<objects>], <show_all>)
# id : this is the ID of this catalogue. When you open a
# catalogue, this is how you reference the catalogue you want to
# open. No two catalogues can EVER possess the same ID.
# name : this is the name of the catalogue, as it appears in the
# catalogue scene when you open this catalogue. Defaults to
# "Catalogue"
# objects : this is the array of monster IDs that belong to this
# catalogue and will show up (if encountered) when the catalogue is
# open. Defaults to []
# show_all : this is the truth value on whether encountered arrays
# are ignored. If true, then all objects in the catalogue,
# regardless of whether they’ve been encountered, will show up
# when this particular catalogue is opened. Note that it will
# show all objects of THIS catalogue, which is to say that it
# will only show them if they are set as objects belonging. It
# DOESN'T mean that all monsters ever will show up, unless those
# are the objects setup. Defaults to false
#
# The default monster catalogues are:
#
# 20 => Name: Enemies; Objects: All enemiesin database; shows only
# encountered enemies in its group. It is called by:
#
# $scene = Scene_Catalogue.new (20)
#‘`````````````````````````````````````````````````````````````````````
# * EXAMPLES
# monsters = [1, 2, 3, 4, 7, 8, 9]
# @data[22] = Catalogue_Monster.new ("Random Baddies", monsters, true)
#
# this will make a catalogue that will include the enemies with IDs
# 1, 2, 3, 4, 7, 8, & 9. It is named "Random Baddies", and it will
# always show all the monsters it includes regardless of whether
# they have been encountered because show_all is true. It’s ID is 22,
# so it can be called by:
# $scene = Scene_Catalogue.new (22)
#
# monsters = [2, 3, 6, 11, 14, 15, 18, 19, 27]
# @data[23] = Catalogue_Monster.new ("Flying Enemies", monsters)
#
# this will make a catalogue that will include the enemies with IDs
# 2, 3, 6, 11, 14, 15, 18, 19, & 27. It is named "Flying Enemies",
# and it will only show the monsters it includes if they have been
# encountered by the party. It's ID is 23, so it can be called by:
# $scene = Scene_Catalogue.new (23)
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
all_monsters = []
for i in 1…$data_enemies.size do all_monsters.push (i) end
@data[20] = Catalogue_Monster.new ("Enemies", all_monsters)
undead = [11, 12, 17, 26]
@data[21] = Catalogue_Monster.new ("Undead", undead)
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# END EDITABLE REGION C
#//
end
end

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

  1. ** Game_Party

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Summary of Changes:
  2. aliased method - initialize
  3. new public instance variable - encountered_monsters

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

class Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :encountered_monsters
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias algbamorn_init_monstrcatlg_6jb1 initialize
def initialize (*args)
@encountered_monsters = []
algbamorn_init_monstrcatlg_6jb1 (*args) # Run Original Method
end
end

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

  1. ** Game Interpreter

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Summary of Changes:
  2. new method - encounter_monster

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

class Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Encounter Monster
# monster_id : the ID of the monster to encounter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def encounter_monster (monster_id)
$game_party.encountered_monsters.push (monster_id) unless $game_party.encountered_monsters.include? (monster_id)
end
end

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

  1. ** Catalogue_Monster

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Summary of Changes:
  2. modified super methods - card; object; object_help_text; include?

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

class Catalogue_Monster < Catalogue_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Card
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def card
return Window_MonsterCard
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object
# index : index of the object in @objects
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def object (index)
return nil if index == nil || @objects[index] == nil
return $data_enemies[@objects[index]]
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Help Text
# index : index of the object in @objects
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def object_help_text (index)
return "" if object (index) == nil
return object (index).description
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Include?
# index : index of the object in @objects
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def include? (index)
return true if @show_all
return $game_party.encountered_monsters.include? (@objects[index])
end
end

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

  1. ** Window MonsterCard

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. This window displays all relevant information about a monster

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

class Window_MonsterCard < Window_CatalogueCard
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
# placement : the item placement
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def refresh (index)
super
draw_border
return if @object == nil
draw_monster_name (8, 4)
draw_monster_species (8, 32)
# Calculate room all other stats will take
item_stats, stat_names = get_monster_stats
y = draw_stats_box (6, contents.width - 12, item_stats.size)
height = y - @object.catalogue_y
draw_monster_battler (0, @object.catalogue_y, contents.width, height)
draw_stats_signifier (30, y)
draw_monster_stats (12, y + (WLH / 2), contents.width - 24, item_stats, stat_names)
draw_monster_elements (contents.width - 32, 4)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Border
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_border
# Choose Colours for Frame
rim = Color.new(*ModernAlgebra::CM_MONSTERCARD_RIM_COLOUR)
shadow = Color.new(*ModernAlgebra::CM_MONSTERCARD_RIMSHADOW_COLOUR)
# Draw the frame
cb_outline_rect (1, 1, contents.width - 1, contents.height - 1, shadow, 1, 1)
cb_outline_rect (0, 0, contents.width - 1, contents.height - 1, rim, 1, 1)
# Other Lines
contents.fill_rect (1, 31, contents.width - 2, 1, rim)
contents.fill_rect (2, 32, contents.width - 4, 1, shadow)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Monster Name
# x, y : the coordinates to draw on
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_monster_name (x, y)
contents.font.color = normal_color
contents.draw_text (x, y, 200, WLH, @object.name)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Monster Species
# x, y : the coordinates to draw on
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_monster_species (x, y)
# Draw the species icon
draw_icon (@object.ma_species_icon, x, y)
contents.font.color = Color.new (*ModernAlgebra::CM_MONSTERSPECIES_COLOUR)
contents.draw_text (x + 24, y, contents.width / 2, WLH, @object.ma_species_name)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Stats Box
# x : the x coordinate for the stats
# width : the amount of space it can take horizontally
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_stats_box (x, width, size)
# Draw Box
box_size = ((size / 2) + 1)*WLH
y = contents.height - 8 - box_size
cb_outline_rect (x, y, contents.width - 2*x, box_size)
return y
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Stats Signifier
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_stats_signifier (x, y)
# Clear place for signifier
tw = contents.text_size (Vocab::GI_STATS).width
contents.clear_rect (x, y, tw + 4, 2)
contents.font.color = system_color
contents.draw_text (x + 2, y - (WLH / 2), tw + 2, WLH, Vocab::GI_STATS)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Monster Stats
# x : the x coordinate for the stats
# width : the amount of space it can take horizontally
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_monster_stats (x, y, width, item_stats, stat_names)
room_width = (contents.width - x*2 - 10) / 2
for i in 0…item_stats.size
tw = contents.text_size (item_stats[i].to_s).width
x_actual = x + (room_width + 10)*(i % 2)
# Draw Signifier Text
contents.font.color = system_color
contents.draw_text (x_actual, y + (i / 2)*WLH, room_width - tw - 4, WLH, stat_names[i])
contents.font.color = normal_color
contents.draw_text (x_actual, y + (i / 2)*WLH, room_width, WLH, item_stats[i].to_s, 2)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Monster Battler
# x, y : the coordinates to draw on
# enabled : truth value of whether it should be drawn opaque or not
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_monster_battler (x, y, width, height)
bmp = Cache.battler (@object.battler_name, @object.battler_hue)
src_rect = bmp.rect.dup
opac_rect = Rect.new (0, 0, src_rect.width, 0)
draw_opac_rect = false
# If it will overlap
# Take the centre of the bitmap if too large
if width < src_rect.width
src_rect.x = (src_rect.width - width) / 2
opac_rect.x = src_rect.x
src_rect.width = width
else # Centre battler
x += (width - src_rect.width) / 2
end
# Take the centre of the bitmap if too large
if height < src_rect.height
opac_rect.y = height
opac_rect.height = src_rect.height - height
src_rect.height = height
draw_opac_rect = true
else # Centre battler
y += (height - src_rect.height) / 2
end
contents.blt (x, y, bmp, src_rect)
contents.blt (x, y + opac_rect.y, bmp, opac_rect, 128) if draw_opac_rect
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Monster Elements
# x, y : coordinates to draw onto
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_monster_elements (x, y)
contents.font.color = system_color
for i in 1…@object.element_ranks.xsize
next if @object.element_ranks[i] == 3
draw_icon (ModernAlgebra::CI_ITEM_ELEMENT_ICONS[i - 1], x, y, false)
# Draw Rank
rank = Vocab::CM_ELEMENT_RANKS[@object.element_ranks[i] - 1]
contents.draw_text (x, y, 24, 24, rank, 1)
x -= 24
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Monster Stats
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def get_monster_stats
item_stats, stat_names = [], []
# HP and MP
item_stats.push (@object.maxhp, @object.maxmp)
stat_names.push (Vocab.hp, Vocab.mp)
# Get all parameters
item_stats.push (@object.atk, @object.def, @object.agi, @object.spi)
stat_names.push (Vocab.atk, Vocab.def, Vocab.agi, Vocab.spi)
item_stats.push (@object.hit, @object.eva)
stat_names.push (Vocab::GI_HIT_RATIO, Vocab::GI_EVASION)
return item_stats, stat_names
end
end

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

  1. ** Scene Battle

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Summary of Changes:
  2. aliased method - initialize

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

class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malgbra_catmonster_start_5hg2 start
def start (*args)
if ModernAlgebra::CM_AUTO_ENCOUNTER_MONSTERS
array = $game_party.encountered_monsters
$game_troop.members.each { |enemy| array.push (enemy.enemy_id) unless array.include? (enemy.enemy_id) }
end
malgbra_catmonster_start_5hg2 (*args) # Run Original Method
end
end