Eventers Lab & G+ Games (ELG+)
Olá, se você já é cadastrado no nosso fórum, faça seu login, se ainda não é, não perca tempo! Cadastre-se já!

Participe do fórum, é rápido e fácil

Eventers Lab & G+ Games (ELG+)
Olá, se você já é cadastrado no nosso fórum, faça seu login, se ainda não é, não perca tempo! Cadastre-se já!
Eventers Lab & G+ Games (ELG+)
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Entrar

Esqueci-me da senha

Últimos assuntos
» 2 Players no jogo (Backup RMB)
Monster Book EmptyDom Jul 31, 2011 5:39 pm por Rodrigo Vernaschi

» Chamar Bote
Monster Book EmptyDom Jul 31, 2011 5:16 pm por Rodrigo Vernaschi

» Caixa de Texto Acima do Personagem
Monster Book EmptyDom Jul 31, 2011 4:56 pm por Rodrigo Vernaschi

» Auto-Tile Speed
Monster Book EmptyDom Jul 31, 2011 4:49 pm por Rodrigo Vernaschi

» Apresentação Antes do Title
Monster Book EmptyDom Jul 31, 2011 4:35 pm por Rodrigo Vernaschi

» Anti-Hack System (Silver Link/Gold Link)
Monster Book EmptyDom Jul 31, 2011 4:26 pm por Rodrigo Vernaschi

» Anti Hack (AMIGO X)
Monster Book EmptyDom Jul 31, 2011 4:19 pm por Rodrigo Vernaschi

» Ajustar Volume Durante o Jogo
Monster Book EmptyDom Jul 31, 2011 3:58 pm por Rodrigo Vernaschi

» Músicas e poemas
Monster Book EmptyQua Out 20, 2010 8:19 pm por Memories


Monster Book

Ir para baixo

Monster Book Empty Monster Book

Mensagem por Vingador Ter Jan 05, 2010 3:12 pm

Álbum de figurinhas? É isso aí... colecione seus monstros. Coloque monstros em locais secretos para poderem ser dificilmente acessados e a "figurinha" tornar-se-a muuuuuito rara! Monster Book Icon_cool


Código:
################################################################################
#                            Monster Album VX 4.0                              #
################################################################################
# Author: Vingador                                                            #
# Date: August/3/09                                                            #
# Platform: RPG Maker VX                                                      #
################################################################################
#----------------------------------------------------------------------------
#  About Update: 2.0
#    Alright, nearly a year after its first release I have updated this script.
#    This was one of my earlier scripts, so there was a few things that could
#    have been done better. I have taken care of such issues and added to it.
#    It was the only script that never had an update, however it turned out to
#    be one of my more popular scripts. So here is the much needed update.
#
#  About Update: 3.0
#    Alright, with this update my Album script will be the most comprehensive.
#    bestiary I have done. Nothing is secret about your enemies now. The enemy
#    attribute weaknesses are now color coded for easier readability. To make
#    things easier I even used the Color Module I created for my HP Bar script.
#    It makes it easy for you to alter and add colors as you so wish. Aside
#    from being able to see enemy attribute weakneses you can now also see their
#    abilities, and scroll with L and R to a different monster while in the
#    monster window. Rather than having all the attributes or skills crammed in
#    a single window, you can now select which you would like to see from a new
#    command window.
#
#  About Update: 4.0
#    This powerful Bestiary script has gotten even better. In addition to
#    viewing enemy attributes and skills, you can now test fight the monster
#    from the Album! I had to pull some clever coding tricks to make this work
#    without doing something drastic or complicated, like rewriting and/or
#    altering many other Classes. I proved I could pull a monster out of a hat.
#    I have also added a feature that allows you to hide enemy statistics for
#    certian enemies of your choosing. Perhaps Boss enemies or whatever.
#----------------------------------------------------------------------------

#----------------------------------------------------------------------------
#  What it Does:
#    This script basically creates a catalogue of monsters you've killed.
#    You are also given a monster hunter rank based on how many
#    different monsters have been defeated. The catalogue displays all
#    the monsters attributes & picture, player rank, and percent of album
#    completion. See above for info on updates.
#----------------------------------------------------------------------------

#----------------------------------------------------------------------------
#  How it Works:
#   
#    Okay for version 2.0 I recreated the way a few things work, but don't worry
#    the changes are for the better. I made an independant Monster_Album class
#    to deal with all the album related tasks, rather than just having modded
#    several other classes to share the work, like version 1.0. Because of this
#    new system it gives us greater flexibility to do things. I also cleaned up
#    some messy code in other classes, though there still is some that I will
#    contend with in a later update.
#   
#    scripts used are:
#
#      Section I: Album Scene and related Windows
#            - Scene_Album NOT
#            - Window_Album_Right NOT
#            - Window_Monster_List DONE
#            - Window_Monster_Picture NOT
#            - Window_Album_Command NOT
#            - Window_Total DONE
#
#      Section II: Extra Windows
#            - Window_Base Done?
#
#      Section III: Dependancies
#            - Game_Troop DONE
#            - Scene_Menu DONE
#            - Scene_Battle DONE
#
#      Section IV: Data Management
#            - Scene_Title DONE
#            - Scene_File DONE
#
#      Section V: Modules
#            - Module Color DONE
#            - Module Vocab DONE
#----------------------------------------------------------------------------

#----------------------------------------------------------------------------
#  How to Use This script:
#    Just copy it and paste it above Main.
#
#    If you are going to use events to call the album menu, use Call script:
#    $scene = Scene_Album.new
#
#    You can use an item to call the menu as well. Just make the item call a
#    Common Event, and make the Common Event do the above task.
#   
#    You can also access the Albums hunter rank in game by using:
#
#    $game_album.rank
#
#    Accessing it is now a bit easier than with version 1.0. It had a dumb way
#    operating. Also you now add enemies to the Album anytime in game with
#    a Call script like this:
#
#    $game_album.add_enemy_killed($data_enemies[N])
#
#    Where N is, put the ID of the monster you want to add.
#
#    To Hide enemy stats in the album, got to Game_Album class and look for
#    the @black_list array. Put the ID's of the enemies you want hidden in it.
#----------------------------------------------------------------------------

#----------------------------------------------------------------------------
#  script Conflicts and Compatability:
#    This is an Advisory for those of you using multiple scripts. If you are
#    using other scripts that rewrite the same classes or methods as this one,
#    there may be a conflict and things will work incorrectly in unpredictable
#    ways. I put all the Classes that could cause conflicts in the Utilities
#    Section III.
#
#    To remedy a script conflict, the pieces of the classes or methods that
#    overwrite each other must be combined.
#
#    script conflicts are a major issue with many users. I get many messages
#    form those having problems. Almost always it is due to script conflicts.
#    Ocassionally I offer quick tips, fixes, and instructions  to get them to
#    work. However, as my time is limited, I can't always provide help on an
#    individual basis.
#----------------------------------------------------------------------------

#----------------------------------------------------------------------------
#  Comments:
#    I hope my script is easy for you to use and modify. Study this
#    script to learn RGSS better and become a better scriptor yourself. 
#----------------------------------------------------------------------------

#==============================================================================
#  Section I: Album Classes
#==============================================================================

#==============================================================================
# * Game_Album
#------------------------------------------------------------------------------
#  This class handles the Bestairy.
#==============================================================================

class Game_Album
  #--------------------------------------------------------------------------
  # * Constant: Add or remove enemy ID's you want to have hidden in the Album
  #--------------------------------------------------------------------------
  BLACK_LIST = [29, 30]
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader  :seen          # Array of enemies seen but not killed
  attr_reader  :killed        # Array of enemies actually killed in battle
  attr_reader  :rank          # String to contain rank title
  attr_reader  :percent        # Percent of Album completion
  attr_reader  :test_enemy_id  # ID of enemy to be tested in battle
  attr_reader  :black_list    # Array of enemy ID's to be hidden
  attr_accessor :battle_test    # Whether the impending fight is album related
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Set seen & killed variables to blank arrays for new album
    @seen = []
    @killed = []
    for i in 1...$data_enemies.size
      @killed.push(nil)
      @seen.push(nil)
    end
    @rank = 'none'
    @percent = 0
    @test_enemy_id = 0
    @battle_test = false
  end
  #--------------------------------------------------------------------------
  # * add_enemy_seen
  #--------------------------------------------------------------------------
  def add_enemy_seen(enemy)
    # Use enemy ID - 1 for correct index placement in the array
    index = enemy.id - 1
    # The following replaces the nil object with the enemy at the index
    @seen.insert(index, enemy)
    @seen.delete_at(enemy.id)
    determine_rank
  end
  #--------------------------------------------------------------------------
  # * add_enemy_killed
  #--------------------------------------------------------------------------
  def add_enemy_killed(enemy)
    # Use enemy ID - 1 for correct index placement in the array
    index = enemy.id - 1
    # The following replaces the nil object with the enemy at the index
    @killed.insert(index, enemy)
    @killed.delete_at(enemy.id)
    determine_rank
  end
  #--------------------------------------------------------------------------
  # * Determine party's rank title for album completion
  #--------------------------------------------------------------------------
  def determine_rank
    # First check to see if the player has seen more enemies than killed
    if @seen.nitems > @killed.nitems
      # Assign rank and end rank check
      @rank = 'Observer'
      return
    end
    # Get percent of enemies killed over total amount of enemies in game
    # -1 to make up for nil in $data_enemies array
    @percent = ((@killed.nitems * 100) / ($data_enemies.size - 1))
    # Change player rank according to percent
    case @percent
    when 1..25                  # When up to 25%
      @rank = 'Adventurer'
    when 26..50                # When 26% to 50%
      @rank = 'Slayer'
    when 51..75                # When 51% to 75%
      @rank = 'Monster Hunter'
    when 76..99                # When 76% to 99%
      @rank = 'Beast Master'
    when 100                    # When 100%
      @rank = 'Perfectionist'
    end
  end
  #--------------------------------------------------------------------------
  # * has_seen_enemy? Checks if enemy is included in the @seen array
  #--------------------------------------------------------------------------
  def has_seen_enemy?(enemy)
    return @seen.include?(enemy)
  end
  #--------------------------------------------------------------------------
  # * has_killed_enemy? Checks if enemy is included in the @killed array



  #--------------------------------------------------------------------------
  def has_killed_enemy?(enemy)
    return @killed.include?(enemy)
  end
  #--------------------------------------------------------------------------
  # * enemy_blacklisted? Checks if ID is included among the enemy ID's to hide
  #--------------------------------------------------------------------------
  def enemy_blacklisted?(enemy_id)
    return BLACK_LIST.include?(enemy_id)
  end
  #--------------------------------------------------------------------------
  # * Simple search algorithym
  #  Checks all the troops for the latest one that contains the given enemy ID
  #--------------------------------------------------------------------------
  def soul_searcher(id)
    # Set ID of enemy to be 'singled out' for battle later
    @test_enemy_id = id
    # Look through all the $data_troops array
    for i in 1...$data_troops.size
      # In current troop, look through all the members for the enemy ID
      for j in 0...$data_troops[i].members.size
        # If the enemy ID being searched is within this troop
        if $data_troops[i].members[j].enemy_id == id
          # Set this variable to that troop ID to be returned & Break the search
          troop = $data_troops[i]
          break
        end
      end
    end
    return troop.id
  end
  #--------------------------------------------------------------------------
  # * Initiates a combat
  #--------------------------------------------------------------------------
  def start_battle(id)
    # Start battle with the troop results from soul searcher
    $game_troop.setup(soul_searcher(id))
    # if this battle is a album test fight, single out the enemy being tested
    $game_troop.single_out_enemy(id)
    # Set album battle test flag to true
    @battle_test = true
    # Play battle start SE
    $game_temp.map_bgm = RPG::BGM.last
    $game_temp.map_bgs = RPG::BGS.last
    RPG::BGM.stop
    RPG::BGS.stop
    Sound.play_battle_start
    $game_system.battle_bgm.play
    $game_temp.next_scene = nil
    $scene = Scene_Battle.new
  end
end

#==============================================================================
# * Scene_Album
#------------------------------------------------------------------------------
#  This class handles the monster album windows.
#==============================================================================

class Scene_Album < Scene_Base
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    # Set up windows used in this scene
    # Set window of monster names currently known
    @monster_list_window = Window_Album_List.new
    # Get monster currently selected in window list
    @monster = @monster_list_window.monster
    # Make window that shows current selected monster's stats
    @monster_info_window = Window_Album_Right.new(@monster)
    # Make info window of album completion
    @total_window = Window_Total.new
    # Make monster window
    @monster_window = Window_Monster_Picture.new(@monster)
    @monster_window.visible = false
    # Make monster command window
    @command_window = Window_Album_Command.new(['Elements', 'States',
    'Abilities', 'Battle'])
    @command_window.visible = false
    @command_window.active = false
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    # Dispose of windows
    @monster_info_window.dispose
    @monster_list_window.dispose
    @total_window.dispose
    @monster_window.dispose
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows conditionally
    # If monster list window is active: call update_list
    if @monster_list_window.active
      update_list
      return
    end
    # If monster command window is active: call update_command
    if @command_window.visible
      update_command
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when monster list window is active)
  #--------------------------------------------------------------------------
  def update_list
    @monster_list_window.update
    # Set the variable @monster equal to the currently selected monster
    @monster = @monster_list_window.monster
    # Set info window's monster to the selected monster
    @monster_info_window.set_new_monster(@monster)
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      Sound.play_cancel
      # Switch to menu screen
      @monster_list_window.active = false
      $scene = Scene_Menu.new(0)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      if @monster != nil
        # Play decision SE
        Sound.play_decision
        # Activate monster window
        @monster_list_window.active = false
        @monster_list_window.visible = false
        @monster_info_window.visible = false
        @total_window.visible = false
        @monster_window.visible = true
        @monster_window.get_new_monster(@monster)
        @monster_window.draw_enemy_elementals
        @command_window.visible = true
        @command_window.active = true
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when monster command window is active)
  #--------------------------------------------------------------------------
  def update_command
    @command_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      Sound.play_cancel
      # Go back to monster list
      @monster_list_window.active = true
      @monster_list_window.visible = true
      @monster_window.visible = false
      @monster_info_window.visible = true
      @total_window.visible = true
      @command_window.index = 0
      @command_window.active = false
      @command_window.visible = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      Sound.play_decision
      # Play decision SE
      case @command_window.index
      when 0  # Elementals
        # Draw enemy elemental attributes
        @monster_window.draw_enemy_elementals
      when 1  # States
        # Draw enemy states info
        @monster_window.draw_enemy_states
      when 2  # Abilities
        # Draw enemy abilitites
        @monster_window.draw_enemy_actions
      when 3  # Battle
        # Call an album test battle process
        $game_album.start_battle(@monster.id)
      end
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L)
      prev_monster
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::R)
      next_monster
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Next enemy
  #--------------------------------------------------------------------------
  def next_monster
    # Don't let the index go past the enemy list
    unless @monster_list_window.index == $game_album.killed.size - 1
      @monster_list_window.index += 1
    end
    # Set the variable @monster equal to the currently selected monster
    @monster = @monster_list_window.monster
    # Set info window's monster to the selected monster
    @monster_info_window.set_new_monster(@monster)
    if @monster != nil
      # Play decision SE
      Sound.play_decision
      # Inform Monster window of new monster and redraw stats
      @monster_window.get_new_monster(@monster)
      @monster_window.draw_enemy_elementals
    end
  end
  #--------------------------------------------------------------------------
  # * previous enemy
  #--------------------------------------------------------------------------
  def prev_monster
    # Don't let the index go above the enemy list
    unless @monster_list_window.index == 0
      @monster_list_window.index -= 1
    end
    # Set the variable @monster equal to the currently selected monster
    @monster = @monster_list_window.monster
    # Set info window's monster to the selected monster
    @monster_info_window.set_new_monster(@monster)
    if @monster != nil
      # Play decision SE
      Sound.play_decision
      # Inform Monster window of new monster and redraw stats
      @monster_window.get_new_monster(@monster)
      @monster_window.draw_enemy_elementals
    end
  end
end

#==============================================================================
# * Window_Album_List
#------------------------------------------------------------------------------
#  The list of monster names.
#==============================================================================

class Window_Album_List < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 56, 214, 360)
    @column_max = 1
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Monster Acquisition
  #--------------------------------------------------------------------------
  def monster
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    #if self.contents != nil
      #self.contents.dispose
      #self.contents = nil
    #end
    @data = []
    # For every enemy in the album, a address of them to @data
    for i in 0...$game_album.killed.size
        @data.push($game_album.killed[i])
    end
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    monster = @data[index]
    rect.width -= 4
    draw_monster_name(monster, rect.x, rect.y)
  end
end

#==============================================================================
# * Window_Album_Right
#------------------------------------------------------------------------------
#  This window shows monster attributes.
#==============================================================================

class Window_Album_Right < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(enemy)
    super(214, 56, 330, 360)
    self.contents = Bitmap.new(width - 32, height - 32)
    @enemy = enemy
    self.opacity = 0  # Increase this if you want to see the window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Set parameters for monster
  #--------------------------------------------------------------------------
  def set_new_monster(new_monster)
    if @enemy != new_monster
      @enemy = new_monster
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @enemy != nil
      draw_enemy_picture(@enemy, 185, 208)
      draw_enemy_exp(@enemy, 4, 50)
      draw_enemy_gold(@enemy, 4, 75)
      draw_enemy_name(@enemy, 2, 0, normal_color)
      draw_enemy_stats(@enemy, 4, 220, $game_album.enemy_blacklisted?(@enemy.id))
    end
  end
end

#==============================================================================
# * Window_Monster_Total 544×416
#------------------------------------------------------------------------------
#  Shows album completion.
#==============================================================================

class Window_Total < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 544, 56)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 200, 32, "Bestiary Completion :")
    self.contents.draw_text(370, 0, 200, 32, "Rank :")
    self.contents.font.color = normal_color
    self.contents.draw_text(200, 0, 200, 32, $game_album.killed.nitems.to_s + ' / ')
    self.contents.draw_text(240, 0, 200, 32, ($data_enemies.size - 1).to_s + " : ")
    self.contents.draw_text(295, 0, 200, 32, $game_album.percent.to_s + "%")
    self.contents.draw_text(430, 0, 200, 32, $game_album.rank)
  end
end

#==============================================================================
# * Window_Monster_Picture
#------------------------------------------------------------------------------
#  This window shows a bigger picture of the monster with name.
#==============================================================================

class Window_Monster_Picture < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(enemy)
    super(0, 0, 544, 370)
    self.contents = Bitmap.new(width - 32, height - 32)
    @enemy = enemy
    refresh
  end
  #--------------------------------------------------------------------------
  # * Set parameters for monster
  #--------------------------------------------------------------------------
  def get_new_monster(new_monster)
    if @enemy != new_monster
      @enemy = new_monster
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @enemy != nil
    draw_enemy_picture2(@enemy)
    draw_enemy_name(@enemy, 4, 4, system_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's elementals chart
  #--------------------------------------------------------------------------
  def draw_enemy_elementals
    refresh
    x = 4
    y = 4
    # Change color and font size
    self.contents.font.color = system_color
    #self.contents.font.size = 20
    # Draw text
    #self.contents.draw_text(x, y + 32, 100, 22, "Elements:")
    self.contents.font.size = 18
    self.contents.draw_text(x, y + 25, 50, 22, "Absorb:")
    self.contents.draw_text(x + 75, y + 25, 50, 22, "Strong:")
    self.contents.draw_text(x + 150, y + 25, 50, 22, "Weak:")
    self.contents.draw_text(x + 225, y + 25, 50, 22, "Poor:")
    # Change color and font size
    self.contents.font.color = normal_color
    self.contents.font.size = 16
    # unless the enemy info is hidden
    unless $game_album.enemy_blacklisted?(@enemy.id)
    # Draw the attributes names in position determined by attribute strength
    for i in 1...@enemy.element_ranks.xsize
      if @enemy.element_ranks[i] == 6
        self.contents.font.color = Colors::GREEN
        self.contents.draw_text(x, 16 * i + 34, 120, 16, $data_system.elements[i])
      end
      if @enemy.element_ranks[i] == 5
        self.contents.font.color = Colors::INDIGO
        self.contents.draw_text(x + 75, 16 * i + 34, 120, 16, $data_system.elements[i])
      end
      if @enemy.element_ranks[i] == 2
        self.contents.font.color = Colors::ORANGE
        self.contents.draw_text(x + 150, 16 * i + 34, 120, 16, $data_system.elements[i])
      end
      if @enemy.element_ranks[i] == 1
        self.contents.font.color = Colors::RED
        self.contents.draw_text(x + 225, 16 * i + 34, 120, 16, $data_system.elements[i])
      end
    end
    end
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's States chart
  #--------------------------------------------------------------------------
  def draw_enemy_states
    refresh
    x = 4#300
    y = 4
    # Change color and font size
    self.contents.font.color = system_color
    #self.contents.font.size = 18
    # Draw text
    #self.contents.draw_text(x, y + 25, 100, 22, "States:")
    self.contents.font.size = 18
    self.contents.draw_text(x, y + 25, 50, 22, "Null:")
    self.contents.draw_text(x + 75, y + 25, 50, 22, "Strong:")
    self.contents.draw_text(x + 150, y + 25, 50, 22, "Weak:")
    self.contents.draw_text(x + 225, y + 25, 50, 22, "Poor:")
    # Change color and font size
    self.contents.font.color = normal_color
    self.contents.font.size = 16
    # unless the enemy info is hidden
    unless $game_album.enemy_blacklisted?(@enemy.id)
    # Draw the state names in position determined by attribute strength
    for i in 1...@enemy.state_ranks.xsize
      if @enemy.state_ranks[i] == 6
        self.contents.font.color = Colors::BLACK
        self.contents.draw_text(x, 16 * i + 34, 75, 16, $data_states[i].name)
      end
      if @enemy.state_ranks[i] == 5
        self.contents.font.color = Colors::VIOLET
        self.contents.draw_text(x + 75, 16 * i + 34, 75, 16, $data_states[i].name)
      end
      if @enemy.state_ranks[i] == 2
        self.contents.font.color = Colors::YELLOW
        self.contents.draw_text(x + 150, 16 * i + 34, 75, 16, $data_states[i].name)
      end
      if @enemy.state_ranks[i] == 1
        self.contents.font.color = Colors::RED
        self.contents.draw_text(x + 225, 16 * i + 34, 75, 16, $data_states[i].name)
      end
    end
    end
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's States chart
  #--------------------------------------------------------------------------
  def draw_enemy_actions
    refresh
    x = 4
    y = 4
    # Change color and font size
    self.contents.font.color = system_color
    self.contents.font.size = 20
    # Draw text
    self.contents.draw_text(x, y + 32, 100, 22, "Actions:")
    # Change color and font size
    self.contents.font.color = normal_color
    # unless the enemy info is hidden
    unless $game_album.enemy_blacklisted?(@enemy.id)
    # Draw the names of the actions the enemy can perform
    for i in 0...@enemy.actions.size
      # If the action is not a skill
      if @enemy.actions[i].kind == 0
        # Draw text that corresponds to action basic type
        case @enemy.actions[i].basic
        when 0
          self.contents.draw_text(x, 24 * i + 76, 200, 24, 'Attack')
        when 1
          self.contents.draw_text(x, 24 * i + 76, 200, 24, 'Defend')
        when 2
          self.contents.draw_text(x, 24 * i + 76, 200, 24, 'Escape')
        when 3
          self.contents.draw_text(x, 24 * i + 76, 200, 24, 'Do Nothing')
        end
        # Other wise if actions is a skill, draw the name of the skill
      elsif @enemy.actions[i].kind = 1
        ability = $data_skills[@enemy.actions[i].skill_id].name
        self.contents.draw_text(x, 24 * i + 76, 200, 24, ability)
      end
    end
    end
  end
end

#==============================================================================
# * Window_Album_Command
#==============================================================================

class Window_Album_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    width    : window width
  #    commands : command text string array
  #--------------------------------------------------------------------------
  def initialize(commands)
    super(0, 360, 544, 56)
    @item_max = commands.size
    @commands = commands

    @column_max = 4
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index : item number
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    x = 4 + index * 136
    self.contents.draw_text(x, 0, 160, 32, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #    index : item number
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end

#==============================================================================
#  Section II: Dependancy WIndows
#==============================================================================

#==============================================================================
# * Window_Base
#==============================================================================

class Window_Base < Window
  #
  def draw_monster_name(monster, x, y, enabled = true)
    self.contents.font.color = normal_color
    if monster == nil
      self.contents.draw_text(x+50, y, 204, 32, '?', 0)
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 204, 32, '?', 0)
    else
      self.contents.draw_text(x+50, y, 204, 32, monster.name, 0)
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 204, 32, sprintf("%03d", monster.id.to_s), 0)
    end
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's picture
  #--------------------------------------------------------------------------
  def draw_enemy_picture(enemy, x, y)
    bitmap = Cache.battler(enemy.battler_name, enemy.battler_hue)
    x2 = bitmap.width
    y2 = bitmap.height
    x3 = x2 / 2
    y3 = y2 - 120
    src_rect = Rect.new(0, 0, x2, y2)
    # If enemy height is greater than 220, draw the picture lower on the screen
    if bitmap.height > 220
      self.contents.blt(x - x3, y - y3, bitmap, src_rect)
    else
      self.contents.blt(x - x3, y - y2, bitmap, src_rect)
    end
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's large picture
  #--------------------------------------------------------------------------
  def draw_enemy_picture2(enemy)
    bitmap = Cache.battler(enemy.battler_name, enemy.battler_hue)
    x2 = bitmap.width
    y2 = bitmap.height
    x3 = 398 - bitmap.width
    y3 = 398 - bitmap.height
    src_rect = Rect.new(0, 0, x2, y2)
    if x3 <= y3
    new_rect = Rect.new(160, 10, x2 + x3, y2 + x3)
    else
    new_rect = Rect.new(160, 10, x2 + y3, y2 + y3)
    end
    self.contents.stretch_blt(new_rect, bitmap, src_rect, 100)
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's name
  #--------------------------------------------------------------------------
  def draw_enemy_name(enemy, x, y, color)
    self.contents.font.color = color
    self.contents.font.size = 24
    self.contents.draw_text(x, y, 400, 32, enemy.name)
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's gold
  #--------------------------------------------------------------------------
  def draw_enemy_gold(enemy, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 100, 32, "$")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 24, y, 84, 32, enemy.gold.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's exp
  #--------------------------------------------------------------------------
  def draw_enemy_exp(enemy, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, "EXP")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 24, y, 84, 32, enemy.exp.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Draws enemy's statistics
  #--------------------------------------------------------------------------
  def draw_enemy_stats(enemy, x, y, hidden)
    # Change color
    self.contents.font.color = system_color
    # Draw text
    self.contents.draw_text(x, y, 32, 32, "HP")
    self.contents.draw_text(x + 150, y, 32, 32, "SP")
    self.contents.draw_text(x, y + 26, 32, 32, "Atk")
    self.contents.draw_text(x + 150, y + 26, 32, 32, "Str")
    self.contents.draw_text(x, y + 52, 60, 32, "Def")
    self.contents.draw_text(x + 150, y + 52, 32, 32, "Mdf")
    self.contents.draw_text(x, y + 78, 32, 32, "Dex")
    self.contents.draw_text(x + 150, y + 78, 32, 32, "Int")
    self.contents.draw_text(x, y + 104, 32, 32, "Agi")
    self.contents.draw_text(x + 150, y + 104, 32, 32, "Eva")
    self.contents.draw_text(x, y - 120, 125, 32, "Items Dropped :")
    #self.contents.draw_text(x, y - 65, 100, 32, "Drop Rate :")
    # Change color
    self.contents.font.color = normal_color
    # Draw stats, draw ?'s if enemy is hidden
    if hidden
      self.contents.draw_text(x + 40, y, 84, 32, '?', 2)
      self.contents.draw_text(x + 190, y, 84, 32, '?', 2)
      self.contents.draw_text(x + 40, y + 26, 84, 32, '?', 2)
      self.contents.draw_text(x + 190, y + 26, 84, 32, '?', 2)
      self.contents.draw_text(x + 40, y + 52, 84, 32, '?', 2)
      self.contents.draw_text(x + 190, y + 52, 84, 32, '?', 2)
      self.contents.draw_text(x + 40, y + 78, 84, 32, '?', 2)
      self.contents.draw_text(x + 190, y + 78, 84, 32, '?', 2)
    else
      self.contents.draw_text(x + 40, y, 84, 32, enemy.maxhp.to_s, 2)
      self.contents.draw_text(x + 190, y, 84, 32, enemy.maxmp.to_s, 2)
      self.contents.draw_text(x + 40, y + 26, 84, 32, enemy.atk.to_s, 2)
      self.contents.draw_text(x + 190, y + 26, 84, 32, enemy.def.to_s, 2)
      self.contents.draw_text(x + 40, y + 52, 84, 32, enemy.hit.to_s, 2)
      self.contents.draw_text(x + 190, y + 52, 84, 32, enemy.spi.to_s, 2)
      self.contents.draw_text(x + 40, y + 78, 84, 32, enemy.agi.to_s, 2)
      self.contents.draw_text(x + 190, y + 78, 84, 32, enemy.eva.to_s, 2)
    end
    # If enemy has an item, draw its name and icon
    if enemy.drop_item1.kind == 1
      draw_item_name($data_items[enemy.drop_item1.item_id], x, y - 85)
    end
    # If enemy has a weapon, draw its name and icon
    if enemy.drop_item1.kind == 2
      draw_item_name($data_weapons[enemy.drop_item1.weapon_id], x, y - 85)
      #self.contents.draw_text(x + 95, y - 75, 50, 32, enemy.drop_item1.denominator.to_s + "%", 2)
    end
    # If enemy has a piece armor, draw its name and icon
    if enemy.drop_item1.kind == 3
      draw_item_name($data_armors[enemy.drop_item1.armor_id], x, y - 85)
    end
   
    # If enemy has an item, draw its name and icon
    if enemy.drop_item2.kind == 1
      draw_item_name($data_items[enemy.drop_item2.item_id], x, y - 50)
    end
    # If enemy has a weapon, draw its name and icon
    if enemy.drop_item2.kind == 2
      draw_item_name($data_weapons[enemy.drop_item2.weapon_id], x, y - 50)
    end
    # If enemy has a piece armor, draw its name and icon
    if enemy.drop_item2.kind == 3
      draw_item_name($data_armors[enemy.drop_item2.armor_id], x, y - 50)
    end
  end
end

#==============================================================================
# Section III: Dependancy Classes
#==============================================================================

#==============================================================================
# * Game_Troop
#==============================================================================

class Game_Troop
  #--------------------------------------------------------------------------
  # * enemy single out algorithym
  #  Filters out a single enemy of the specified ID
  #--------------------------------------------------------------------------
  def single_out_enemy(id)
    # Set variable to false.
    # Later this will be set to true when the first enemy ID is found
    has_been_singled = false
    # Sort out array yo make it easlier to search
    @enemies.sort! {|a, z| a.id <=> z.id}
    # Reverse the sorted array if first index is greater than ID to be searched
    if @enemies[0].id > id
      @enemies.reverse!
    end
    # Scroll through all the enemies in the array and check the following
    for each in @enemies
      # Do the next check if the current enemy isn't hidden or dead
      unless each.hidden or each.dead?
        # Find one enemy of the specified ID, and get rid of the rest
        if each.enemy.id != id or (each.enemy.id == id and has_been_singled)
          each.escape
        else
          has_been_singled = true
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Adds defeated enemies to the Album
  #--------------------------------------------------------------------------
  def process_album_enemies
    for each in dead_members
      # If the bestairy doesn't already have this monster, then add it
      if !$game_album.killed.include?(each.enemy)
        $game_album.add_enemy_killed(each.enemy)
      end
    end
  end
end

#==============================================================================
# * Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Escape Processing
  #--------------------------------------------------------------------------
  def process_escape
    @info_viewport.visible = false
    @message_window.visible = true
    text = sprintf(Vocab::EscapeStart, $game_party.name)
    $game_message.texts.push(text)
    if $game_troop.preemptive
      success = true
    else
      success = (rand(100) < @escape_ratio)
    end
    Sound.play_escape
    if success
      wait_for_message
      # Call method that collects monsters and sends them to the album
      $game_troop.process_album_enemies
      battle_end(1)
    else
      @escape_ratio += 10
      $game_message.texts.push('\.' + Vocab::EscapeFailure)
      wait_for_message
      $game_party.clear_actions
      start_main
    end
  end
  #--------------------------------------------------------------------------
  # * Victory Processing
  #--------------------------------------------------------------------------
  def process_victory
    @info_viewport.visible = false
    @message_window.visible = true
    RPG::BGM.stop
    $game_system.battle_end_me.play
    unless $BTEST
      $game_temp.map_bgm.play
      $game_temp.map_bgs.play
    end
    # Call method that collects monsters and sends them to the album
    $game_troop.process_album_enemies
    if $game_album.battle_test
      $game_album.battle_test = false
    else
      display_exp_and_gold
      display_drop_items
      display_level_up
    end
    battle_end(0)
  end
end

#==============================================================================
# * Scene_Menu
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::album
    s6 = Vocab::save
    s7 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)    # Disable item

      @command_window.draw_item(1, false)    # Disable skill
      @command_window.draw_item(2, false)    # Disable equipment
      @command_window.draw_item(3, false)    # Disable status
    end
    if $game_system.save_disabled            # If save is forbidden
      @command_window.draw_item(5, false)    # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 5
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 5
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # Album
        $scene = Scene_Album.new
      when 5      # Save
        $scene = Scene_File.new(true, false, false)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end
end


#==============================================================================
# Section IV: Data_Management
#------------------------------------------------------------------------------
#  This bundle of code is just the Scene Title, Save and Load classes with some
#  modified methods to handle, store, and retrieve the Bestairy data
#==============================================================================

#==============================================================================
# * Scene_Title
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Create Game Objects
  #--------------------------------------------------------------------------
  def create_game_objects
    $game_temp          = Game_Temp.new
    $game_message      = Game_Message.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables    = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_actors        = Game_Actors.new
    $game_party        = Game_Party.new
    $game_troop        = Game_Troop.new
    $game_map          = Game_Map.new
    $game_player        = Game_Player.new
    # Added code. Creates a new Album for new game
    $game_album        = Game_Album.new 
  end
end

#==============================================================================
# * Scene_Save
#==============================================================================

class Scene_File
  #--------------------------------------------------------------------------
  # * Write Save Data
  #    file : write file object (opened)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
      characters.push([actor.character_name, actor.character_index])
    end
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(characters,          file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,        file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,      file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  file)
    Marshal.dump($game_actors,        file)
    Marshal.dump($game_party,          file)
    Marshal.dump($game_troop,          file)
    Marshal.dump($game_map,            file)
    Marshal.dump($game_player,        file)
    # Added code. Stores the Album data on save command
    Marshal.dump($game_album, file)
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #    file : file object for reading (opened)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters          = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player        = Marshal.load(file)
    # Added code. Retrieves the Album data on load command
    $game_album        = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

#==============================================================================
# * Section V: Modules
#==============================================================================

#==============================================================================
# * Module Colors
#------------------------------------------------------------------------------
# Contains various defined colors for use in projects.
#==============================================================================

module Colors
  # CONSTANTS

  GREEN = Color.new(50, 200, 50, 255)
  RED = Color.new(200, 50, 50, 255)
  YELLOW = Color.new(200, 200, 0, 255)
  ORANGE = Color.new(220, 150, 0, 255)
  INDIGO = Color.new(50, 50, 200, 110)
  VIOLET = Color.new(120, 50, 180, 110)
  BLACK = Color.new(0, 0, 0, 255)
end

#==============================================================================
# * Vocab
#------------------------------------------------------------------------------
#  This module defines terms and messages. It defines some data as constant
# variables. Terms in the database are obtained from $data_system.
#==============================================================================

module Vocab
  # Monster Album
  def self.album
return 'Album'
  end
end
Vingador
Vingador
Iniciante
Iniciante

Número de Mensagens : 16
Idade : 35
Localização : Araguari
Premios : <br>Monster Book Medal_gold_3: 0 Monster Book Medal_silver_3: 0 Monster Book Medal_bronze_3: 0
Reputação : 13
Pontos : 90
Data de inscrição : 04/01/2010

Ficha do personagem
Raça: Lich
Nível Maker: Mestre
Mensagem Pessoal: Me dê as suas armas mágicas!!!

http://www.orkut.com.br/Main#Profile?uid=4395857722134662547

Ir para o topo Ir para baixo

Ir para o topo


 
Permissões neste sub-fórum
Não podes responder a tópicos