#==============================================================================
# ** Module Monster
#==============================================================================
module Monster
# Just include the Monsters you want to have in the array, they'll be
# displayed in the order you place them in the array
Database_Monster = [1, 2,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10]
# The variables are assigned to the actors in the array, means the first
# variable in the array is assigned to the first actor in the
# Database_Monster array
Variables = [200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210]
# Text that shows up if a character / monster is not available
Not_Available = "Not Available"
# Text that shows up if you want to release a monster
Release = "Are you sure you want to release it?"
end
#==============================================================================
# ** Scene_Release
#==============================================================================
class Scene_Release
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@bestiary_left = Window_Bestiary_Left.new
@bestiary_right = Window_Bestiary_Right.new
@dummy_window = Window_Base.new(170, 129, 300, 64)
@dummy_window.contents = Bitmap.new(@dummy_window.width - 32, @dummy_window.height - 32)
@dummy_window.contents.draw_text(4, 0, 250, 32, Monster::Release)
@command_window = Window_Command.new(160,["Yes", "No"])
@command_window.active = false
@command_window.visible = false
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
@command_window.z = 150
@dummy_window.z = 150
@dummy_window.visible = false
refresh
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@bestiary_left.dispose
@bestiary_right.dispose
@command_window.dispose
@dummy_window.dispose
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if @old_index != @bestiary_left.index
@bestiary_right.refresh(@bestiary_left.index)
@old_index = @bestiary_left.index
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@command_window.update
@bestiary_left.update
refresh
if @bestiary_left.active
bestiary_update
elsif @command_window.active
command_update
end
end
#--------------------------------------------------------------------------
# * Frame Update (when bestiary window is active)
#--------------------------------------------------------------------------
def bestiary_update
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to Map screen
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_variables[Monster::Variables[@bestiary_left.index]] != 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@bestiary_left.active = false
@command_window.active = true
@command_window.visible = true
@dummy_window.visible = true
@command_window.index = 0
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def command_update
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@bestiary_left.active = true
@command_window.active = false
@command_window.visible = false
@dummy_window.visible = false
@command_window.index = 0
return
end
if Input.trigger?(Input::C)
# Play decision SE
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 1
@bestiary_left.active = true
@command_window.active = false
@command_window.visible = false
@dummy_window.visible = false
@command_window.index = 0
when 0
$game_variables[Monster::Variables[@bestiary_left.index]] = 0
# Switch to Map screen
$scene = Scene_Map.new
end
end
end
end
#==============================================================================
# * Window_Bestiary_Left
#==============================================================================
class Window_Bestiary_Left < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 210, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@index = 0
@item_max = Monster::Database_Monster.size
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = Color.new(0, 0, 0)
self.contents.draw_text(3, 1, 150, 32, "Monster Name:")
self.contents.draw_text(5, -1, 150, 32, "Monster Name:")
self.contents.draw_text(3, -1, 150, 32, "Monster Name:")
self.contents.draw_text(5, 1, 150, 32, "Monster Name:")
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 150, 32, "Monster Name:")
for i in 0...Monster::Database_Monster.size
y = i * 32
@name = $game_variables[Monster::Variables[i]] == 2 ? $game_actors[Monster::Database_Monster[i]].name : Monster::Not_Available
self.contents.draw_text(4, y + 32, 150, 32, "#{@name}")
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
self.cursor_rect.set(0, @index * 32 + 32, self.width - 32, 32)
end
end
#==============================================================================
# * Window_Bestiary_Right
#==============================================================================
class Window_Bestiary_Right < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(210, 0, 430, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(index = 0)
self.contents.clear
@monster = $game_actors[Monster::Database_Monster[index]]
self.contents.font.color = Color.new(0, 0, 0)
self.contents.draw_text(3, 1, 200, 32, "Monster Description:")
self.contents.draw_text(5, -1, 200, 32, "Monster Description:")
self.contents.draw_text(3, -1, 200, 32, "Monster Description:")
self.contents.draw_text(5, 1, 200, 32, "Monster Description:")
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 200, 32, "Monster Description:")
if $game_variables[Monster::Variables[index]] == 2
draw_actor_battler(@monster, 140, 256)
draw_actor_hp(@monster, 4, 32)
draw_actor_parameter(@monster, 204, 32, 4)
draw_actor_sp(@monster, 4, 64)
draw_actor_parameter(@monster, 204, 64, 5)
draw_actor_parameter(@monster, 4, 96, 3)
draw_actor_parameter(@monster, 204, 96, 6)
draw_actor_level(@monster, 4, 160)
self.contents.draw_text(52, 192, 150, 32, "#{@monster.now_exp} / #{@monster.next_exp}")
self.contents.font.color = system_color
self.contents.draw_text(4, 192, 120, 32, "Exp:")
else
self.contents.font.color = system_color
self.contents.draw_text(4, 32, 32, 32, $data_system.words.hp)
self.contents.draw_text(4, 64, 32, 32, $data_system.words.sp)
self.contents.draw_text(204, 32, 120, 32, $data_system.words.dex)
self.contents.draw_text(204, 64, 120, 32, $data_system.words.agi)
self.contents.draw_text(4, 96, 120, 32, $data_system.words.str)
self.contents.draw_text(204, 96, 120, 32, $data_system.words.int)
self.contents.draw_text(4, 160, 120, 32, "Lv")
self.contents.draw_text(4, 192, 120, 32, "Exp:")
end
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Battler
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
end
end