Accueil du SiteAccueil du Site  AccueilAccueil  Dernières imagesDernières images  RechercherRechercher  ConnexionConnexion  S'enregistrerS'enregistrer  



-17%
Le deal à ne pas rater :
SSD interne Crucial SSD P3 1To NVME à 49,99€
49.99 € 59.99 €
Voir le deal

Partagez
 

 [VX] Yanfly Engine RD - Bestiary + Scan

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Invité
Invité
Anonymous


[VX] Yanfly Engine RD - Bestiary + Scan Empty
MessageSujet: [VX] Yanfly Engine RD - Bestiary + Scan   [VX] Yanfly Engine RD - Bestiary + Scan EmptyLun 19 Sep 2011 - 16:25

Description
Ce script permet d'avoir un bestiaire dans con menu, les ennemis vaincus apparaissent dans le bestiaire et il est possible d'afficher les statistiques des monstres vaincus à l'aide d'une compétence.
Ce script possède aussi une compétence acuité qui est exactement la même que dans FF13, il est possible de connaitre les faiblesses et les résistances d'un ennemi en plein combat.

Compatibilité
-KGC Extra Drop Items
-KGC Steal

A l'aide d'un patch
-YERK Melody (script présent sur le forum)
-SBS Tankentai http://paste.awesom.eu/mHR

Auteur
-Yanfly
-Garruk pour les petites modifications et la traductions

Screen
J'ai traduit tout le script, mais j'avais la flemme de faire des screen, donc il est bien en français

[VX] Yanfly Engine RD - Bestiary + Scan 2cd8x9k
[VX] Yanfly Engine RD - Bestiary + Scan 4lrq88
[VX] Yanfly Engine RD - Bestiary + Scan 432926525parc

Script
Code:
#===============================================================================
#
# Yanfly Engine RD - Bestiary + Display Scanned Enemy
# Traduction by Garruk
# Last Date Updated: 2009.06.13
# Level: Easy, Normal, Hard, Lunatic
#
# Similar to the Display Skill Query script, I've made one for enemies. This was
# mostly to replace my Display Target Data script, considering it didn't display
# much data at all about the target. This one was also made on the account of
# making a proper scan skill property in addition to different parts of enemy
# data that it can scan.
#
# I've disliked scan systems where you would have to keep rescanning an enemy
# to see its HP, MP, etc. It felt counterproductive on the player side since
# valuable turns are wasted just to view some numbers. This system allows you to
# pull up enemy data upon enemy selection (where I believe it matters most).
# After all, providing convenience for the player is absolutely important since
# it reduces metagaming, which is something that should never have to happen
# for an RPG Maker project.
#
# For the users who fear giving too much information to their players, users can
# disable parts of the script and prevent certain pages from appear at all. You
# can limit how much and how little you want to show your players through <hide>
# tags, too, for the enemies' noteboxes.
#
# Since the May 27th update, a bestiary option is created for the main menu.
# You can access this menu and view all of the scanned data from the enemies
# you've discovered. This option is accessible once the bestiary switch is on.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# o 2009.06.10 - Compatibility added for Enemy Level Control.
# o 2009.06.09 - Small fix to bestiary calculation for not requiring scan.
# o 2009.05.27 - Bestiary added.
#                Monsters can now have more than one boss type.
# o 2009.04.27 - MAJOR BUGFIX: Fixed a save game corrupting bug.
# o 2009.04.21 - Finished and publicized.
# o 2009.04.20 - Started script.
#===============================================================================
# How to Use: Normal Mode
#===============================================================================
#
# La première serie comme <scan whole> est à placer dans les commentaires de la compétence
# La deuxième comme <hide whole> est à mettre dans les commentaires de l'ennemi
# Le bestiaire est desactivé par défaut
#
# ----------------------------------------------------------------------------
# Placing these tags into a skill's notebox will reveal specific scan data. The
# scan data will appear for all enemies of the same enemy type, but each indi-
# vidual enemy will still possess their own modifiers.
#
# <scan whole>
# Permet de voir toutes les fenêtre que l'ennemi cache
#
# <scan hp mp>
# Affiche seulement les HP et MP de l'ennemi
#
#
#
#
# <scan stats>
# Affiche les stats de l'ennemo
#
#
#
# <scan skills>
# Affiche les compétences de l'ennemi
#
#
#
# <scan elements>
# Affiche les resistance et faiblesse par rapport aux éléments
#
#
#
# <scan status effects> or <scan states>
# Affiche les resistance et faiblesse par rapport aux effets négatifs
#
#
#
# <scan steal>
# Permet de voir les objet à volé sur l'ennemi
#
#
# <scan spoils>
# Permet de voir différents informations comme l'argent et l'expérience
#
#
# <scan drops>
# Permet de voir les butin que l'ennemi laisse en fin de combat
#
#
# <scan description>
# Permet de voir la description de l'ennemi
#
#
#
#
#===============================================================================
# How to Use: Hard Mode
#===============================================================================
#
# <boss type x> or <boss type x,x>
#  A placer dans les commentaires de l'ennemi
# <boss type x> l'ennemi est un mini boss
# <boss type x,x> l'ennemi est un boss
#
# Ses commentaires sont à placer dans la partie ennemi
# Ils ne seront jamais visible. Si vous lancez un <scan hp mp> pour voir les HP et MP du monstres et que
# dans les commentaires de ce dernier vous avez mis <hide hp_mp> ils n'apparaitront pas
# <hide whole>
# Prevents everything from being shown at all for that enemy.
#
# <hide hp_mp>
# Cache les HP et MP
#
# <hide stats>
# Cache les stats
#
# <hide skills>
# Cache les sorts
#
# <hide elements>
# Cache la résistance et faiblesse par rapport aux éléments
#
# <hide status effects> or <hide states>
# Cache la résistance et faiblesse par rapport aux effets négatifs
#
# <hide steal>
# Cache les objets à voler
# <hide skills>
# <hide spoils>
# Prevents victory spoil information from being shown for that enemy.
#
# <hide drops>
# Cache les informations comme l'argent et l'expérience
#
# If you might have noticed, there's no hide version for description. This is
# because if you simply don't add the enemy extra notes description to the hash,
# they won't appear at all. It's easier to manage that way instead.
#
#===============================================================================
#
# Compatibility
# - Works With: KGC's ExtraDropItem, Steal
# - Alias: Game_Battler, skill_effect
# - Alias: Game_Enemy, initialize, transform, escape, perform_collapse
# - Alias: Scene_Battle, create_info_viewport, update_target_enemy_selection
#
#===============================================================================
# Credits:
# KGC for Window_Command imports.
#===============================================================================

$imported = {} if $imported == nil
$imported["DisplayScannedEnemy"] = true

module YE
  module MENU
    module MONSTER
     
      #------------------------------------------------------------------------
      # BESTIARY RELATED
      #------------------------------------------------------------------------
     
      # The following will govern the rules which the bestiary scene will abide
      # by. Be sure to adjust it accordingly to your needs.
      BESTIARY_TITLE  = "Bestiaire"    # Nom dans le menu.
      BESTIARY_SWITCH = 2            # Interrupteur pour activer le bestiaire dans le menu?
      BESTIARY_LIST  = "%s Liste"      # Le texte qui suit le type d'ennemi exemple "boss".
      BESTIARY_MASK  = "?"            # Masque les statistiques encore inconnus.
     
      #  La chose suivante est un tableau a eu l'habitude de cacher des monstres du bestiaire
      # Saisir l'ID'S des monstres que vous voulez cacher.
      # Par défaut les monstres sont automiquement cacher.
      HIDDEN_MONSTERS = []
     
      #La chose suivante détermine l'ordre de l'affichage des monstres dans le bestiaire
      # si vous alphabétisez la liste de monstre, ceci n'aura aucun effet..
      # 
      BESTIARY_ORDER = [1,2,3,4 ]
     
      # Informations des catégories dans le bestiaire
      #
      CATEGORIZE_TEXT = "Shift: changement de catégories"
      CATEGORIZE_HELP = "Sélectionner un type de catégorie"
      CATEGORIZE_VIEW = "Page %s"
      CATEGORIZE_BUTTON = Input::SHIFT
     
      # La page de droit dans le bestiaire les numéros sont les ICONS de l'iconsets
      #
      MENU_FONT_SIZE  = 16
      BESTIARY_INFO  = "Information Bestiaire"
      TEXT_COMPLETION = "Bestiaire d'achèvement"
      RATE_COMPLETION = ""
      ICON_COMPLETION = 141
      TEXT_DISCOVERED = "Ennemis découvert"
      ICON_DISCOVERED = 196
      TEXT_ENCOUNTERS = "Total d'ennemis rencontrés"
      TEXT_DEFEATED  = "Total d'ennemis vaincus"
      TEXT_ESCAPED    = "Total d'ennemis échappés"
      TEXT_TYPE_DIS  = "%s découvert"
      TEXT_TYPE_ENC  = "%s rencontrés"
      TEXT_TYPE_DEF  = "%s Vaincu"
      TEXT_TYPE_ESC  = "%s Echappé"
     
      #------------------------------------------------------------------------
      # SCAN WINDOW RELATED
      #------------------------------------------------------------------------
     
      # La touche pour faire apparaitre le scan en combat
      ENEMY_SCAN_BUTTON = Input::A
     
      # True vous devez utilisez une compétence pour voir les fenêtres
      # False aucune compétence n'est nécessaire
      REQUIRE_SCAN  = true
     
      # Informations pendant le combat.
      HELP_WINDOW_TX = "Appuyez sur Maj pour afficher les données ennemi."
      HELP_WINDOW_ON = true            # Activer le Windowskin .
      HELP_WINDOW_X  = 0              # La position X
      HELP_WINDOW_Y  = 0              # La position Y.
      HELP_WINDOW_W  = 544            # la largeur de la fenêtre.
      HELP_WINDOW_O  = 255            # L'oppacité du windowskins
     
      # This affects how you want the scan to appear.
      ENEMY_NAME = "%s données"
     
      # This displays the title information at the very top of the scan window.
      # Most of the strings are explained by the notes to the side.
      DATA_LEFT  = "<<"            # This appears if page can be moved back.
      DATA_PAGE1 = "Information"  # This appears if only one page of info.
      DATA_PAGES = "Page %d/%d"    # This appears if more than one page of info.
      DATA_RIGHT = ">>"            # This appears if page can move right.
      DATA_CATEGORY_COLOUR = 4    # This affects category text colour.
     
      # This is the sound played when flipping through the various pages.
      # Set it to nil if you don't want a sound to play.
      PAGE_SOUND = RPG::SE.new("Wind7", 80, 125)
     
      # Set this to true if you would rather the scan display the page info
      # type rather than Page X/Y. The titles following correspond to the pages'
      # titles should you decide to display them.
      REPLACE_PAGE_MSG = true
      TITLE_UNKNOWN    = "Inconnu"
     
      # This affects the information shown on the first page of the scan.
      # The first page shows HP, general stats, and states if the enemy is
      # under the effects of any.
      SHOW_GENERAL  = true
      TITLE_GENERAL  = "Infos générales"
      GAUGE_HEIGHT  = 9        # This affects the gauge height.
      EXHAUST_COLOUR = 7        # This adjusts the exhaustion colour.
      FONT_SIZE      = 16      # Sets font size for smaller text.
      HIDDEN_HP      = "?????"  # If the enemy is unscanned or hides HP.
      HIDDEN_MP      = "?????"  # If the enemy is unscanned or hides MP.
      DATA_STATES    = "Effets d'état"  # Category for affected states.
      HIDDEN_STAT    = "???"    # If the enemy is unscanned or hides stats.
      DATA_ATK      = "Attaque"    # For attack.
      DATA_DEF      = "Défense"    # For defense.
      DATA_SPI      = "Magie"    # For spirit.
      DATA_AGI      = "Dextérité"    # For agility.
      DATA_HIT      = "Parade"    # For hit rate.
      HIDE_HIT      = false    # Set this to true if you wish to hide Hit.
      DATA_EVA      = "Evasion"    # For evasion rate.
      HIDE_EVA      = false    # Set this to true if you wish to hide Eva.
      DATA_CRI      = "Critique"    # For critical rate.
      HIDE_CRI      = false    # Set this to true if you wish to hide Cri.
      DATA_ODDS      = "Chance"    # For odds value.
      HIDE_ODDS      = true    # Set this to true if you wish to hide Odds
     
      # The display types alter how HP and MP is shown for scanned enemies.
      # Type 1: Current HP
      # Type 2: Current HP/MaxHP
      # Type 3: Percentage of Current HP/MaxHP
      # The same goes for MP display type.
      HP_DISPLAY_TYPE = 2
      MP_DISPLAY_TYPE = 2
     
      # C'est ici que vous controlez les ennemis, boss, sous boss etc
      # Icon du type de monstres, la couleur des barres de HP
      # La couleur des barres de MP
      # Appellation de l'ennemi
      #
      BOSS_TYPES ={
      # Type  =>  [Icon,HPIc,HPC1,HPC2,MPIc,MPC1,MPC2, Type Name, Pural]
          0  =>  [ 118,  11664,  18,  20, 11665,  22,  23, "Monstre", "Monstres"],
          1  =>  [ 243, 11664,  18,  20, 11665,  22,  23, "Monstre de chasse", "Monstre de chasse"],
          2  =>  [ 6675,  11664,  18,  20, 11665,  22,  23, "Boss", "Boss"],
      } # Do not remove this.
     
      # This is for the bestiary and how you would like the order to appear.
      TYPE_ORDERING = [0, 1, 2]
     
      # Les ICON dans la page d'information
      ICON_HIGH = 9748  # Quand le monstre à un boost par exemple attaque +
      ICON_LOW  = 9764  #  Quand les statistiques du monstre sont afflaiblis par exemple attaque -
      ICON_ATK  = 11603    # Icon for ATK
      ICON_DEF  = 11604    # Icon for DEF
      ICON_SPI  = 11605    # Icon for SPI
      ICON_AGI  = 11607    # Icon for AGI
      ICON_HIT  = 11609  # Icon for HIT
      ICON_EVA  = 11610  # Icon for EVA
      ICON_CRI  = 11611  # Icon for CRI
      ICON_ODDS = 11613  # Icon for ODD
     
      # This affects info displayed on the skill info page. Skills only appear
      # if the monster has those skills in its action list. Otherwise, this
      # page will not appear at all.
      SHOW_SKILLS    = true
      TITLE_SKILLS  = "Info de compétences"
      DATA_SKILLS    = "Nom de compétences"
      VIEW_SKILLS1  = "%d ."
      VIEW_SKILLS2  = "%d ."
     
      #Les ICON qui représentent la faiblesse ou la resistance d'un monstres
      # par rapport à un élément
      SHOW_ELEMENTS  = true
      TITLE_ELEMENTS = "Affinité élément"
      ICON_E_RATE_U  = 9        # Icon used for unknown element rates
      ICON_E_RATE_Z  = 96      # Icon used for element rate Z.
      ICON_E_RATE_A  = 260      # Icon used for element rate A.
      ICON_E_RATE_B  = 261      # Icon used for element rate B.
      ICON_E_RATE_C  = 262      # Icon used for element rate C.
      ICON_E_RATE_D  = 263      # Icon used for element rate D.
      ICON_E_RATE_E  =  264    # Icon used for element rate E.
      ICON_E_RATE_F  = 265      # Icon used for element rate F.
      ELEMENT_HASH ={
      # These hashes allow you to construct various rows in the element page.
      # There's a maximum fit of 10 elements per row.
      "L'attaque physique" => [
      # These are the element ID's.
      [  11],
      # These are the element icons.
      [  1572]
      ], # Next row
     
      "Magie" => [
      # These are the element ID's.
      [  1,  2,  3,  4,  5,  6,  7,  8],
      # These are the element icons.
      [ 104, 105, 106, 108, 109, 107, 111, 110]
      ], # Next row
     
      } # Do not remove this.
     
      # Pareil qu'au dessus mais pour les états néfastes
      #
      SHOW_STATES    = true
      TITLE_STATES  = "Altération d'état"
      ICON_S_RATE_U  = 94      # Icon used for unknown status rates.
      ICON_S_RATE_Z  = 96      # Icon used for status rate Z.
      ICON_S_RATE_A  = 260      # Icon used for status rate A.
      ICON_S_RATE_B  = 261      # Icon used for status rate B.
      ICON_S_RATE_C  = 262      # Icon used for status rate C.
      ICON_S_RATE_D  = 263      # Icon used for status rate D.
      ICON_S_RATE_E  = 264      # Icon used for status rate E.
      ICON_S_RATE_F  = 265      # Icon used for status rate F.
      STATES_HASH ={
      # These hashes allow you to construct various rows in the states page.
      # There's a maximum fit of 10 states per row.
      "" => [1, 2, 3, 4, 5, 8],
    "Altération d'état" => [6, 7, 10, 11, 38, 26],
      "Diminution" => [18, 19, 20, 21], 
     
      } # Do not remove this.
     
      # Si vous utlisez le script de KGC qui permet de voler les objets
      #
      #
      SHOW_STEAL    = true
      TITLE_STEAL    = "Objet à voler"
      DATA_S_ITEM    = "Nom des objets"
      DATA_S_CHANCE  = "Chance"
     
      # This affects info displayed for the spoils page. Note that you can
      # choose to activate this page if an enemy of a type dies.
      SHOW_SPOILS    = true
      TITLE_SPOILS  = "Information sur l'ennemi"
      DEATH_SPOILS  = true      # Set to true if you wish to reveal spoils info
                                # when an enemy dies.
      DATA_GOLD      = "Xenny"    # Message used to indicate gold drop.
      VIEW_GOLD      = "%d Xenny" # How the gold gain will appear.
      ICON_GOLD      = 8386 #205      # Icon used for gold drop.
      DATA_EXP      = "Exp"    # Message used to indicate experience gain.
      VIEW_EXP      = "%d Exp"  # How the exp gain will appear.
      ICON_EXP      = 241# 62        # Icon used for exp gain.
      DATA_ENCOUNTER = "Rencontres" # Message used to indicate encounters.
      VIEW_ENC1      = "%d fois"    # How the encounters will appear. Singular.
      VIEW_ENC2      = "%d fois"  # How the encounters will appear. Plural.
      ICON_ENCOUNTER = 48 #63          # Icon used for encounters.
      DATA_KILLED    = "Vaincu"  # Message used to indicate defeats.
      VIEW_KILLED1  = "%d Tué"    # How the defeats will appear. Singular.
      VIEW_KILLED2  = "%d Tués"  # How the defeats will appear. Plural.
      ICON_KILLED    = 112 #157          # Icon used for defeats.
      DATA_ESCAPED  = "Echappé"    # Message used to indicate escapes.
      VIEW_ESCAPED1  = "%d Fuite"    # How the defeats will appear. Singular.
      VIEW_ESCAPED2  = "%d Fuite"    # How the defeats will appear. Plural.
      ICON_ESCAPED  = 9778 #155          # Icon used for escapes.
      SPOIL_DROPS    = false    # Draw drops for the Spoils page?
      DATA_DROPS    = "Drops"  # Message used to indicate drops.
     
      # For those that would like a separate page for drops, use this page.
      # This affects all of the information relative to drops anyway.
      SHOW_DROPS    = true
      TITLE_DROPS    = "butin de victoire"
      DEATH_DROPS    = true      # Set to true if you wish to reveal spoils info
                                # when an enemy dies.
      DATA_D_ITEM    = "Nom du butin"
      DATA_D_CHANCE  = "Chance"
     
     
      # This affects the enemy notes section which requires Lunatic modifying.
      # This page can be about anything you want to write about.
      SHOW_NOTES            = true
      TITLE_NOTES          = "Notes"
      NOTE_PAGE_WIDTH      = 700
      NOTE_PAGE_TEXT_SIZE  = 16
      NOTE_PAGE_TEXT_COLOUR = 0
     
    end # MONSTER
  end # MENU
end # YE

#===============================================================================
# How to Use: Lunatic Mode
#===============================================================================
#
# This part allows you to input your own custom notes and whatnot. Custom notes
# page will only appear for enemies that are listed in the note hash beneath the
# Lunatic Mode section.
#
# The process is pretty simple. Just follow the template below.
#
#    ENEMY_NOTES ={
#      enemy_id => "This would be the first line| and this would be the next!",
#    } # Do not remove this.
#
# Enter the enemy's ID number where "enemy_id" is. Following the "=>" input
# the custom notes you'd like for that enemy to display. If you wish to add
# line breaks to notes, add a | where you would like the break to appear. Now
# while they do appear in the notebox, they are confined by the note page's
# width and will shrink if the lines end up being too long. You can adjust the
# note page's width in the part before the Lunatic Mode instructions.
#
#===============================================================================

module YE
  module HASH
   
    ENEMY_NOTES ={  # On met ici la description des ennemis la barre | permet de faire un retour à la ligne
        1  => "Gluant|Un monstre qui sert à rien| Il est faible et aime fuir le combat",
        2  => "Le 2 est ID du monstres mettre la description ici",

 
    } # Ne pas retirer, inutile de modififier le reste
       
  end #module HASH
end #module YE

#===============================================================================
# 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 YE
  module REGEXP
    module BASEITEM
     
      SCAN_WHOLE = /<(?:SCAN_WHOLE|scan whole)>/i
      SCAN_HP_MP = /<(?:SCAN_HP_MP|scan hp mp)>/i
      SCAN_STATS = /<(?:SCAN_STATS|scan stats)>/i
      SCAN_SKILL = /<(?:SCAN_SKILLS|scan skills)>/i
      SCAN_ELEM  = /<(?:SCAN_ELEMENTS|scan elements)>/i
      SCAN_STATE = /<(?:SCAN_STATUS_EFFECTS|scan status effects|scan states)>/i
      SCAN_SPOIL = /<(?:SCAN_SPOILS|scan spoils)>/i
      SCAN_DROPS = /<(?:SCAN_DROPS|scan drops)>/i
      SCAN_STEAL = /<(?:SCAN_STEAL|scan steal)>/i
      SCAN_DESC  = /<(?:SCAN_DESCRIPTION|scan description)>/i
     
    end # BASEITEM
    module ENEMY
     
      BOSS_TYPE  = /<(?:BOSS_TYPE|boss type)[ ]*(\d+(?:\s*,\s*\d+)*)>/i
     
      HIDE_WHOLE = /<(?:HIDE_WHOLE|hide whole)>/i
      HIDE_HP_MP = /<(?:HIDE_HP_MP|hide hp mp)>/i
      HIDE_STATS = /<(?:HIDE_STATS|hide stats)>/i
      HIDE_SKILL = /<(?:HIDE_SKILLS|hide skills)>/i
      HIDE_ELEM  = /<(?:HIDE_ELEMENTS|hide elements)>/i
      HIDE_STATE = /<(?:HIDE_STATUS_EFFECTS|hide status effects|hide states)>/i
      HIDE_SPOIL = /<(?:HIDE_SPOILS|hide spoils)>/i
      HIDE_DROPS = /<(?:HIDE_DROPS|hide drops)>/i
      HIDE_STEAL = /<(?:HIDE_STEAL|hide steal)>/i
     
    end # ENEMY
  end # REGEXP
 
  module_function
  #--------------------------------------------------------------------------
  # Convert Array to Integer
  #--------------------------------------------------------------------------
  def convert_integer_array(array)
    result = []
    for i in array
      case i
      when Range; result += i.to_a
      when Integer; result.push(i)
      end
    end
    return result
  end
 
  #--------------------------------------------------------------------------
  # Converted Constants
  #--------------------------------------------------------------------------
  ENEMY_LIST = convert_integer_array(MENU::MONSTER::BESTIARY_ORDER)
  HIDDEN_ENEMY = convert_integer_array(MENU::MONSTER::HIDDEN_MONSTERS)
 
end # YE

#===============================================================================
# RPG::Enemy
#===============================================================================

class RPG::Enemy
 
  #--------------------------------------------------------------------------
  # Yanfly_Cache_DSE
  #--------------------------------------------------------------------------
  def yanfly_cache_enemy_dse
    @hide_whole = false; @hide_hp_mp = false; @hide_stats = false
    @hide_elem = false; @hide_state = false; @hide_desc = false
    @hide_skill = false; @hide_spoil = false; @hide_drops = false
    @hide_steal = false
    @boss_type = []
   
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when YE::REGEXP::ENEMY::BOSS_TYPE
        $1.scan(/\d+/).each { |num|
        if num.to_i >= 0
          @boss_type.push(num.to_i)
        end }
       
      when YE::REGEXP::ENEMY::HIDE_WHOLE
        @hide_whole = true
      when YE::REGEXP::ENEMY::HIDE_HP_MP
        @hide_hp_mp = true
      when YE::REGEXP::ENEMY::HIDE_STATS
        @hide_stats = true
      when YE::REGEXP::ENEMY::HIDE_SKILL
        @hide_skill = true
      when YE::REGEXP::ENEMY::HIDE_ELEM
        @hide_elem = true
      when YE::REGEXP::ENEMY::HIDE_STATE
        @hide_state = true
      when YE::REGEXP::ENEMY::HIDE_SPOIL
        @hide_spoil = true
      when YE::REGEXP::ENEMY::HIDE_DROPS
        @hide_drops = true
      when YE::REGEXP::ENEMY::HIDE_STEAL
        @hide_steal = true
     
      end
    }
    @boss_type = [0] if @boss_type == []
  end # end yanfly_cache_cse
 
  #--------------------------------------------------------------------------
  # Boss Type
  #--------------------------------------------------------------------------
  def boss_type
    yanfly_cache_enemy_dse if @boss_type == nil
    return @boss_type
  end
 
  #--------------------------------------------------------------------------
  # Hide Scan
  #--------------------------------------------------------------------------
  def hide_whole
    yanfly_cache_enemy_dse if @hide_whole == nil
    return @hide_whole
  end
  def hide_hp_mp
    yanfly_cache_enemy_dse if @hide_hp_mp == nil
    return @hide_hp_mp
  end
  def hide_stats
    yanfly_cache_enemy_dse if @hide_stats == nil
    return @hide_stats
  end
  def hide_skill
    yanfly_cache_enemy_dse if @hide_skill == nil
    return @hide_skill
  end
  def hide_elem
    yanfly_cache_enemy_dse if @hide_elem == nil
    return @hide_elem
  end
  def hide_state
    yanfly_cache_enemy_dse if @hide_state == nil
    return @hide_state
  end
  def hide_spoil
    yanfly_cache_enemy_dse if @hide_spoil == nil
    return @hide_spoil
  end
  def hide_drops
    yanfly_cache_enemy_dse if @hide_drops == nil
    return @hide_drops
  end
  def hide_steal
    yanfly_cache_enemy_dse if @hide_steal == nil
    return @hide_steal
  end
 
end # RPG::Enemy

#===============================================================================
# RPG::BaseItem
#===============================================================================
class RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # Yanfly_Cache_DSE
  #--------------------------------------------------------------------------
  def yanfly_cache_baseitem_dse
    @scan_whole = false; @scan_hp_mp = false; @scan_stats = false
    @scan_elem = false; @scan_state = false; @scan_desc = false
    @scan_skill = false; @scan_spoil = false; @scan_drops = false
    @scan_steal = false
   
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when YE::REGEXP::BASEITEM::SCAN_WHOLE
        @scan_whole = true
      when YE::REGEXP::BASEITEM::SCAN_HP_MP
        @scan_hp_mp = true
      when YE::REGEXP::BASEITEM::SCAN_STATS
        @scan_stats = true
      when YE::REGEXP::BASEITEM::SCAN_SKILL
        @scan_skill = true
      when YE::REGEXP::BASEITEM::SCAN_ELEM
        @scan_elem = true
      when YE::REGEXP::BASEITEM::SCAN_STATE
        @scan_state = true
      when YE::REGEXP::BASEITEM::SCAN_SPOIL
        @scan_spoil = true
      when YE::REGEXP::BASEITEM::SCAN_DROPS
        @scan_drops = true
      when YE::REGEXP::BASEITEM::SCAN_STEAL
        @scan_steal = true
      when YE::REGEXP::BASEITEM::SCAN_DESC
        @scan_desc = true
     
      end
    }
  end # end yanfly_cache_cse
 
  #--------------------------------------------------------------------------
  # Skill Scan
  #--------------------------------------------------------------------------
  def scan_whole
    yanfly_cache_baseitem_dse if @scan_whole == nil
    return @scan_whole
  end
  def scan_hp_mp
    yanfly_cache_baseitem_dse if @scan_hp_mp == nil
    return @scan_hp_mp
  end
  def scan_stats
    yanfly_cache_baseitem_dse if @scan_stats == nil
    return @scan_stats
  end
  def scan_skill
    yanfly_cache_enemy_dse if @scan_skill == nil
    return @scan_skill
  end
  def scan_elem
    yanfly_cache_baseitem_dse if @scan_elem == nil
    return @scan_elem
  end
  def scan_state
    yanfly_cache_baseitem_dse if @scan_state == nil
    return @scan_state
  end
  def scan_spoil
    yanfly_cache_baseitem_dse if @scan_spoil == nil
    return @scan_spoil
  end
  def scan_drops
    yanfly_cache_baseitem_dse if @scan_drops == nil
    return @scan_drops
  end
  def scan_steal
    yanfly_cache_baseitem_dse if @scan_steal == nil
    return @scan_steal
  end
  def scan_desc
    yanfly_cache_baseitem_dse if @scan_desc == nil
    return @scan_desc
  end
 
end # RPG::BaseItem

#===============================================================================
# Game Battler
#===============================================================================

class Game_Battler

  #--------------------------------------------------------------------------
  # alias skill_effect
  #--------------------------------------------------------------------------
  alias skill_effect_dse skill_effect unless $@
  def skill_effect(user, skill)
    skill_effect_dse(user, skill)
    if user.actor? and !self.actor?
      if skill.scan_hp_mp or skill.scan_whole
        $game_party.scan_hp_mp.push(enemy.id) unless $game_party.scan_hp_mp.include?(enemy.id)
      end
      if skill.scan_stats or skill.scan_whole
        $game_party.scan_stats.push(enemy.id) unless $game_party.scan_stats.include?(enemy.id)
      end
      if skill.scan_skill or skill.scan_whole
        $game_party.scan_skill.push(enemy.id) unless $game_party.scan_skill.include?(enemy.id)
      end
      if skill.scan_state or skill.scan_whole
        $game_party.scan_state.push(enemy.id) unless $game_party.scan_state.include?(enemy.id)
      end
      if skill.scan_elem or skill.scan_whole
        $game_party.scan_elem.push(enemy.id) unless $game_party.scan_elem.include?(enemy.id)
      end
      if skill.scan_spoil or skill.scan_whole
        $game_party.scan_spoil.push(enemy.id) unless $game_party.scan_spoil.include?(enemy.id)
      end
      if skill.scan_drops or skill.scan_whole
        $game_party.scan_drops.push(enemy.id) unless $game_party.scan_drops.include?(enemy.id)
      end
      if skill.scan_steal or skill.scan_whole
        $game_party.scan_steal.push(enemy.id) unless $game_party.scan_steal.include?(enemy.id)
      end
      if skill.scan_desc or skill.scan_whole
        $game_party.scan_desc.push(enemy.id) unless $game_party.scan_desc.include?(enemy.id)
      end
    end
  end
 
end # Game_Battler

#===============================================================================
# Game Party
#===============================================================================

class Game_Party < Game_Unit
 
  #--------------------------------------------------------------------------
  # Public Instance Variables
  #--------------------------------------------------------------------------
  attr_writer :monsters_encounter
  attr_writer :monsters_defeated
  attr_writer :monsters_escaped
 
  attr_writer :scan_hp_mp
  attr_writer :scan_stats
  attr_writer :scan_skill
  attr_writer :scan_state
  attr_writer :scan_elem
  attr_writer :scan_spoil
  attr_writer :scan_drops
  attr_writer :scan_steal
  attr_writer :scan_desc
 
  #--------------------------------------------------------------------------
  # Definitions
  #--------------------------------------------------------------------------
  def monsters_encounter
    @monsters_encounter = {} if @monsters_encounter == nil
    return @monsters_encounter
  end
  def monsters_defeated
    @monsters_defeated = {} if @monsters_defeated == nil
    return @monsters_defeated
  end
  def monsters_escaped
    @monsters_escaped = {} if @monsters_escaped == nil
    return @monsters_escaped
  end
 
  #--------------------------------------------------------------------------
  # Definitions
  #--------------------------------------------------------------------------
  def scan_hp_mp
    @scan_hp_mp = [] if @scan_hp_mp == nil
    return @scan_hp_mp
  end
  def scan_stats
    @scan_stats = [] if @scan_stats == nil
    return @scan_stats
  end
  def scan_skill
    @scan_skill = [] if @scan_skill == nil
    return @scan_skill
  end
  def scan_state
    @scan_state = [] if @scan_state == nil
    return @scan_state
  end
  def scan_elem
    @scan_elem = [] if @scan_elem == nil
    return @scan_elem
  end
  def scan_spoil
    @scan_spoil = [] if @scan_spoil == nil
    return @scan_spoil
  end
  def scan_drops
    @scan_drops = [] if @scan_drops == nil
    return @scan_drops
  end
  def scan_steal
    @scan_steal = [] if @scan_steal == nil
    return @scan_steal
  end
  def scan_desc
    @scan_desc = [] if @scan_desc == nil
    return @scan_desc
  end
 
end

#===============================================================================
# Game Enemy
#===============================================================================

class Game_Enemy < Game_Battler
 
  #--------------------------------------------------------------------------
  # alias initialize
  #--------------------------------------------------------------------------
  alias initialize_dse initialize unless $@
  def initialize(index, enemy_id)
    initialize_dse(index, enemy_id)
    $game_party.monsters_encounter = {} if $game_party.monsters_encounter == nil
    if $game_party.monsters_encounter[enemy_id] == nil
      $game_party.monsters_encounter[enemy_id] = 0
    end
    $game_party.monsters_encounter[enemy_id] += 1 unless $scene.is_a?(Scene_Bestiary)
  end
 
  #--------------------------------------------------------------------------
  # alias Transform
  #--------------------------------------------------------------------------
  alias transform_dse transform unless $@
  def transform(enemy_id)
    transform_dse(enemy_id)
    $game_party.monsters_encounter = {} if $game_party.monsters_encounter == nil
    if $game_party.monsters_encounter[enemy_id] == nil
      $game_party.monsters_encounter[enemy_id] = 0
    end
    $game_party.monsters_encounter[enemy_id] += 1
  end
 
  #--------------------------------------------------------------------------
  # alias Collapse
  #--------------------------------------------------------------------------
  alias perform_collapse_dse perform_collapse unless $@
  def perform_collapse
    perform_collapse_dse
    if $game_temp.in_battle and dead?
      if YE::MENU::MONSTER::DEATH_SPOILS
        $game_party.scan_spoil.push(enemy.id) unless $game_party.scan_spoil.include?(enemy.id)
      end
      if YE::MENU::MONSTER::DEATH_DROPS
        $game_party.scan_drops.push(enemy.id) unless $game_party.scan_drops.include?(enemy.id)
      end
      $game_party.monsters_defeated  = {} if $game_party.monsters_defeated == nil
      if $game_party.monsters_defeated[enemy_id] == nil
        $game_party.monsters_defeated[enemy_id] = 0
      end
      $game_party.monsters_defeated[enemy.id] += 1
    end
   
  end
 
  #--------------------------------------------------------------------------
  # alias Escape
  #--------------------------------------------------------------------------
  alias escape_dse escape unless $@
  def escape
    $game_party.monsters_escaped  = {} if $game_party.monsters_escaped == nil
    if $game_party.monsters_escaped[enemy_id] == nil
      $game_party.monsters_escaped[enemy_id] = 0
    end
    $game_party.monsters_escaped[enemy.id] += 1
    escape_dse
  end
 
  #--------------------------------------------------------------------------
  # Encounter Details
  #--------------------------------------------------------------------------
  def encounters_dse
    if $game_party.monsters_encounter[enemy.id] == nil
      $game_party.monsters_encounter[enemy.id] = 0
    end
    return $game_party.monsters_encounter[enemy.id]
  end
  def defeated_dse
    if $game_party.monsters_defeated[enemy.id] == nil
      $game_party.monsters_defeated[enemy.id] = 0
    end
    return $game_party.monsters_defeated[enemy.id]
  end
  def escaped_dse
    if $game_party.monsters_escaped[enemy.id] == nil
      $game_party.monsters_escaped[enemy.id] = 0
    end
    return $game_party.monsters_escaped[enemy.id]
  end
 
end # Game_Enemy

#==============================================================================
# Window_Command (imported from KGC)
#==============================================================================

class Window_Command < Window_Selectable
unless method_defined?(:add_command)
  #--------------------------------------------------------------------------
  # add command
  #--------------------------------------------------------------------------
  def add_command(command)
    @commands << command
    @item_max = @commands.size
    item_index = @item_max - 1
    refresh_command
    draw_item(item_index)
    return item_index
  end
  #--------------------------------------------------------------------------
  # refresh command
  #--------------------------------------------------------------------------
  def refresh_command
    buf = self.contents.clone
    self.height = [self.height, row_max * WLH + 32].max
    create_contents
    self.contents.blt(0, 0, buf, buf.rect)
    buf.dispose
  end
  #--------------------------------------------------------------------------
  # insert command
  #--------------------------------------------------------------------------
  def insert_command(index, command)
    @commands.insert(index, command)
    @item_max = @commands.size
    refresh_command
    refresh
  end
  #--------------------------------------------------------------------------
  # remove command
  #--------------------------------------------------------------------------
  def remove_command(command)
    @commands.delete(command)
    @item_max = @commands.size
    refresh
  end
end
end

#===============================================================================
# Scene Menu
#===============================================================================

class Scene_Menu < Scene_Base
 
  #--------------------------------------------------------------------------
  # alias create command window
  #--------------------------------------------------------------------------
  alias create_command_window_dse create_command_window unless $@
  def create_command_window
    create_command_window_dse
    return if $imported["CustomMenuCommand"]
    if $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH]
      scc_text = YE::MENU::MONSTER::BESTIARY_TITLE
      @command_bestiary = @command_window.add_command(scc_text)
      if @command_window.oy > 0
        @command_window.oy -= Window_Base::WLH
      end
    end
    @command_window.index = @menu_index
  end
 
  #--------------------------------------------------------------------------
  # alias update command selection
  #--------------------------------------------------------------------------
  alias update_command_selection_dse update_command_selection unless $@
  def update_command_selection
    call_yerd_command = 0
    if Input.trigger?(Input::C)
      case @command_window.index
      when @command_bestiary
        Sound.play_decision
        $scene = Scene_Bestiary.new(@command_window.index)
      end
    end
    update_command_selection_dse
  end
 
end # Scene Menu

#===============================================================================
# Scene Title
#===============================================================================

class Scene_Title < Scene_Base
 
  #--------------------------------------------------------------------------
  # alias create game objects
  #--------------------------------------------------------------------------
  alias create_game_objects_dse create_game_objects unless $@
  def create_game_objects
    create_game_objects_dse
    $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH] = true
  end
 
end # Scene_Title

#===============================================================================
# Scene Battle
#===============================================================================

class Scene_Battle
 
  #--------------------------------------------------------------------------
  # alias create_info_viewport
  #--------------------------------------------------------------------------
  alias create_info_viewport_dse create_info_viewport unless $@
  def create_info_viewport
    create_info_viewport_dse
    #---
    @enemy_name_window = Window_Enemy_Name.new(0, 0, 272, 56)
    @enemy_name_window.visible = false
    @enemy_name_window.active = false
    #---
    @enemy_image_window = Window_Enemy_Image.new(0, 56, 272, 232)
    @enemy_image_window.visible = false
    @enemy_image_window.active = false
    #---
    @enemy_scan_window = Window_Enemy_Scan.new(272, 0, 272, 288, true)
    @enemy_scan_window.visible = false
    @enemy_scan_window.active = false
    #---
    hix = YE::MENU::MONSTER::HELP_WINDOW_X
    hiy = YE::MENU::MONSTER::HELP_WINDOW_Y
    hiw = YE::MENU::MONSTER::HELP_WINDOW_W
    text = YE::MENU::MONSTER::HELP_WINDOW_TX
    @scan_info_window = Window_Base.new(hix, hiy, hiw, 56)
    @scan_info_window.back_opacity = YE::MENU::MONSTER::HELP_WINDOW_O
    @scan_info_window.contents.draw_text(2, 0, hiw - 32, 24, text, 1)
    @scan_info_window.visible = false
    @scan_info_window.z = 200
  end
 
  #--------------------------------------------------------------------------
  # alias terminate
  #--------------------------------------------------------------------------
  alias terminate_dse terminate unless $@
  def terminate
    @enemy_scan_window.dispose if @enemy_scan_window != nil
    @enemy_image_window.dispose if @enemy_image_window != nil
    @enemy_name_window.dispose if @enemy_name_window != nil
    @scan_info_window.dispose if @scan_info_window != nil
    terminate_dse
  end
 
  #--------------------------------------------------------------------------
  # alias update_target_enemy_selection
  #--------------------------------------------------------------------------
  alias update_target_enemy_selection_dse update_target_enemy_selection unless $@
  def update_target_enemy_selection
    if YE::MENU::MONSTER::HELP_WINDOW_ON
      if @enemy_scan_window.active
        @scan_info_window.visible = false
      elsif @target_enemy_window.active
        @scan_info_window.visible = true
      else
        @scan_info_window.visible = false
      end
    else
      @scan_info_window.visible = false
    end
    #------------------------------------------
    # If the Enemy Scan Window is active
    #------------------------------------------
    if @enemy_scan_window != nil and @enemy_scan_window.active
      @enemy_scan_window.update
      @enemy_image_window.update
      @enemy_name_window.update
      if Input.trigger?(Input::B) #end1
        Sound.play_cancel
        @enemy_scan_window.disappear
        @enemy_image_window.disappear
        @enemy_name_window.visible = false
        @target_enemy_window.active = true
      elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
        @enemy_scan_window.previous_page
      elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
        @enemy_scan_window.next_page
      elsif Input.trigger?(Input::L)
        @enemy_scan_window.top_page
      elsif Input.trigger?(Input::R)
        @enemy_scan_window.bottom_page
      end
    #------------------------------------------
    # If the Target Window is Active
    #------------------------------------------
    else
      if Input.trigger?(Input::B)
        @scan_info_window.visible = false
      elsif Input.trigger?(Input::C)
        @scan_info_window.visible = false
      elsif Input.trigger?(YE::MENU::MONSTER::ENEMY_SCAN_BUTTON)
        Sound.play_decision
        enemy = @target_enemy_window.enemy
        @enemy_scan_window.appear(enemy, @target_enemy_window)
        @enemy_image_window.appear(enemy, @target_enemy_window)
        @enemy_name_window.appear(enemy, @target_enemy_window)
        @target_enemy_window.active = false
      end
      update_target_enemy_selection_dse
      #---------
    end
  end
 
  #--------------------------------------------------------------------------
  # update enemy name window
  #--------------------------------------------------------------------------
  def update_enemy_name_window(enemy, window)
    @enemy_name_window.visible = true
    @enemy_name_window.contents.clear
    name = window.enemy.name
    @enemy_name_window.contents.draw_text(0, 0, 240, 32, name, 1)
    @enemy_name_window.update
  end
 
end # Scene_Battle

#===============================================================================
# Scene Bestiary
#===============================================================================

class Scene_Bestiary < Scene_Base
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(menu_index = nil)
    @menu_index = menu_index
  end
 
  #--------------------------------------------------------------------------
  # start
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @boss_type = 0
    @enemy_list_window = Window_Enemy_List.new(@boss_type)
    @enemy_data_window = Window_Type_Data.new(@boss_type)
    @enemy_type_window = Window_Base.new(0, 0, 272, 56)
    refresh_type_window
    @enemy_help_category = Window_Base.new(272, 0, 272, 56)
    text = YE::MENU::MONSTER::CATEGORIZE_TEXT
    @enemy_help_category.contents.draw_text(0, 0, 240, 24, text, 1)
    @boss_help_window = Window_Base.new(136, 56, 272, 304)
    text = YE::MENU::MONSTER::CATEGORIZE_HELP
    @boss_help_window.back_opacity = 255
    @boss_help_window.contents.draw_text(0, 0, 240, 24, text, 1)
    @boss_help_window.visible = false
    @boss_type_window = Window_Boss_Types.new
    #---
    @enemy_name_window = Window_Enemy_Name.new(0, 0, 272, 56)
    @enemy_name_window.visible = false
    @enemy_name_window.active = false
    #---
    @enemy_image_window = Window_Enemy_Image.new(0, 56, 272, 360)
    @enemy_image_window.visible = false
    @enemy_image_window.active = false
    #---
    @enemy_scan_window = Window_Enemy_Scan.new(272, 0, 272, 416, true)
    @enemy_scan_window.visible = false
    @enemy_scan_window.active = false
    #---
  end
 
  #--------------------------------------------------------------------------
  # terminate
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @boss_type_window.dispose if @boss_type_window != nil
    @boss_help_window.dispose if @boss_help_window != nil
    @enemy_name_window.dispose if @enemy_name_window != nil
    @enemy_data_window.dispose if @enemy_data_window != nil
    @enemy_image_window.dispose if @enemy_image_window != nil
    @enemy_scan_window.dispose if @enemy_scan_window != nil
    @enemy_list_window.dispose if @enemy_list_window != nil
    @enemy_type_window.dispose if @enemy_type_window != nil
    @enemy_help_category.dispose if @enemy_help_category != nil
  end
 
  #--------------------------------------------------------------------------
  # return scene
  #--------------------------------------------------------------------------
  def return_scene
    if @menu_index == nil
      $scene = Scene_Menu.new($game_temp.menu_command_index[:bestiary])
    else
      $scene = Scene_Menu.new(@menu_index) ######
    end
  end
 
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    if @boss_type_window.active
      update_type_window
    elsif @enemy_scan_window.active
      update_scan_window
    elsif @enemy_list_window.active
      update_enemy_list
    end
  end
 
  #--------------------------------------------------------------------------
  # update_type_window
  #--------------------------------------------------------------------------
  def update_type_window
    @boss_type_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @boss_type_window.visible = false
      @boss_help_window.visible = false
      @boss_type_window.active = false
      @enemy_list_window.active = true
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      last_boss_type = @boss_type
      @boss_type = @boss_type_window.type
      @enemy_list_window.refresh(@boss_type)
      @enemy_list_window.index = 0 unless last_boss_type == @boss_type
      @enemy_data_window.refresh(@boss_type)
      refresh_type_window
      @boss_type_window.visible = false
      @boss_help_window.visible = false
      @boss_type_window.active = false
      @enemy_list_window.active = true
    end
  end
 
  #--------------------------------------------------------------------------
  # update_scan_window
  #--------------------------------------------------------------------------
  def update_scan_window
    @enemy_scan_window.update
    @enemy_image_window.update
    @enemy_name_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @enemy_scan_window.disappear
      @enemy_image_window.disappear
      @enemy_name_window.visible = false
      @enemy_list_window.active = true
      @enemy = nil
    elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
      @enemy_scan_window.previous_page
    elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
      @enemy_scan_window.next_page
    elsif Input.trigger?(Input::L)
      @enemy_scan_window.top_page
    elsif Input.trigger?(Input::R)
      @enemy_scan_window.bottom_page
    end
  end
 
  #--------------------------------------------------------------------------
  # update_enemy_list
  #--------------------------------------------------------------------------
  def update_enemy_list
    @enemy_list_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    elsif Input.trigger?(Input::C)
      if @enemy_list_window.enemy == nil
        Sound.play_buzzer
      elsif !viewable?(@enemy_list_window.enemy)
        Sound.play_buzzer
      else
        Sound.play_decision
        @enemy = Game_Enemy.new(0, @enemy_list_window.enemy.id)
        @enemy_scan_window.appear(@enemy)
        @enemy_image_window.appear(@enemy)
        @enemy_name_window.appear(@enemy)
        @enemy_list_window.active = false
      end
    elsif Input.trigger?(YE::MENU::MONSTER::CATEGORIZE_BUTTON)
      Sound.play_decision
      @boss_type_window.visible = true
      @boss_help_window.visible = true
      @boss_type_window.active = true
      @enemy_list_window.active = false
    end
  end
 
  #--------------------------------------------------------------------------
  # viewable?
  #--------------------------------------------------------------------------
  def viewable?(enemy)
    $game_party.monsters_encounter[enemy.id] = 0 if
      $game_party.monsters_encounter[enemy.id] == nil
    return false if $game_party.monsters_encounter[enemy.id] <= 0
    return true
  end
 
  #--------------------------------------------------------------------------
  # refresh type window
  #--------------------------------------------------------------------------
  def refresh_type_window
    @enemy_type_window.contents.clear
    array = YE::MENU::MONSTER::BOSS_TYPES[@boss_type]
    icon = array[0]
    text = sprintf(YE::MENU::MONSTER::BESTIARY_LIST, array[7])
    @enemy_type_window.draw_icon(icon, 0, 0)
    @enemy_type_window.contents.draw_text(24, 0, 216, 24, text, 0)
  end
 
end # Scene_Bestiary


Dernière édition par Happyroms le Mar 12 Mar 2013 - 14:34, édité 1 fois
Revenir en haut Aller en bas
Invité
Invité
Anonymous


[VX] Yanfly Engine RD - Bestiary + Scan Empty
MessageSujet: Re: [VX] Yanfly Engine RD - Bestiary + Scan   [VX] Yanfly Engine RD - Bestiary + Scan EmptyLun 19 Sep 2011 - 16:25

La suite ! Il est très long plus de 3 000 lignes. ^^

Code:

#==============================================================================
# Window_Enemy_List
#==============================================================================

class Window_Enemy_List < Window_Selectable
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(boss_type)
    super(0, 56, 272, 360)
    self.index = 0
    refresh(boss_type)
  end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh(boss_type)
    @boss_type = boss_type
    @data = []
    for enemy in monster_list
      @data.push(enemy)
    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)
    enemy = @data[index]
    $game_party.monsters_encounter[enemy.id] = 0 if
      $game_party.monsters_encounter[enemy.id] == nil
    if $game_party.monsters_encounter[enemy.id] > 0
      text = enemy.name.gsub(/\[.*\]/) { "" }
      self.contents.font.color.alpha = 255
    else
      mask = YE::MENU::MONSTER::BESTIARY_MASK
      if mask.scan(/./).size == 1
        mask = mask * enemy.name.scan(/./).size
      end
      text = mask
      self.contents.font.color.alpha = 128
    end
    self.contents.draw_text(rect.x+4, rect.y, rect.width-4, WLH, text)
  end
 
  #--------------------------------------------------------------------------
  # include?
  #--------------------------------------------------------------------------
  def include?(enemy)
    return false if enemy == nil
    return false unless enemy.boss_type.include?(@boss_type)
    return false if YE::HIDDEN_ENEMY.include?(enemy.id)
    return false if $imported["SwapDummyMonster"] and
      YE::SWAP::DUMMY_MONSTER.include?(enemy.id)
    return true
  end
 
  #--------------------------------------------------------------------------
  # monster_list
  #--------------------------------------------------------------------------
  def monster_list
    result = []
    for enemy_id in YE::ENEMY_LIST
      result.push($data_enemies[enemy_id]) if include?($data_enemies[enemy_id])
    end
    return result
  end
 
  #--------------------------------------------------------------------------
  # return enemy
  #--------------------------------------------------------------------------
  def enemy
    return @data[self.index]
  end
 
end # Window_Enemy_list

#==============================================================================
# Window_Type_Data
#==============================================================================

class Window_Type_Data < Window_Base
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(boss_type)
    super(272, 56, 272, 360)
    refresh(boss_type)
  end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh(boss_type = 0)
    self.contents.clear
    self.contents.font.size = Font.default_size
    @boss_type = boss_type
    sw = self.width - 32
    @category_colour = YE::MENU::MONSTER::DATA_CATEGORY_COLOUR
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::BESTIARY_INFO
    self.contents.draw_text(0, 0, sw, WLH, text, 1)
   
    unique_discovered = 0
    unique_type_enc = 0
    unique_encounters = 0
    unique_defeated = 0
    unique_escaped = 0
    total_encountered = 0
    total_defeated = 0
    total_escaped = 0
    type_encountered = 0
    type_defeated = 0
    type_escaped = 0
   
    for key in $game_party.monsters_encounter
      next if key[1] == nil or key[1] <= 0
      unique_encounters += 1
      total_encountered += key[1]
      if $data_enemies[key[0]].boss_type.include?(@boss_type)
        unique_discovered += 1
        unique_type_enc += key[1]
      end
    end
    for key in $game_party.monsters_defeated
      next if key[1] == nil or key[1] <= 0
      total_defeated += key[1]
      if $data_enemies[key[0]].boss_type.include?(@boss_type)
        unique_defeated += key[1]
      end
    end
    for key in $game_party.monsters_escaped
      next if key[1] == nil or key[1] <= 0
      total_escaped += key[1]
      if $data_enemies[key[0]].boss_type.include?(@boss_type)
        unique_escaped += key[1]
      end
    end
    total_size = YE::ENEMY_LIST.size - YE::HIDDEN_ENEMY.size
   
    self.contents.font.size = YE::MENU::MONSTER::MENU_FONT_SIZE
    #---
    dy = WLH + WLH / 2
    boss_type_name = YE::MENU::MONSTER::BOSS_TYPES[@boss_type][8]
    icon = YE::MENU::MONSTER::BOSS_TYPES[@boss_type][0]
    #---
    self.contents.font.color = text_color(@category_colour)
    draw_icon(YE::MENU::MONSTER::ICON_COMPLETION, 0, dy)
    text = YE::MENU::MONSTER::TEXT_COMPLETION
    self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
    self.contents.font.color = normal_color
    text = sprintf(YE::MENU::MONSTER::RATE_COMPLETION, bestiary_completion)
    self.contents.draw_text(24, dy, sw-24, WLH, text, 2)
    #---
    dy += WLH + WLH / 2
    self.contents.font.color = text_color(@category_colour)
    draw_icon(YE::MENU::MONSTER::ICON_DISCOVERED, 0, dy)
    text = YE::MENU::MONSTER::TEXT_DISCOVERED
    self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(24, dy, sw-24, WLH, unique_encounters, 2)
    #---
    dy += WLH
    self.contents.font.color = text_color(@category_colour)
    draw_icon(icon, 12, dy)
    text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_DIS, boss_type_name)
    self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(36, dy, sw-36, WLH, unique_discovered, 2)
    #---
    dy += WLH
    self.contents.font.color = text_color(@category_colour)
    draw_icon(YE::MENU::MONSTER::ICON_ENCOUNTER, 0, dy)
    text = YE::MENU::MONSTER::TEXT_ENCOUNTERS
    self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(24, dy, sw-24, WLH, total_encountered, 2)
    #---
    dy += WLH
    self.contents.font.color = text_color(@category_colour)
    draw_icon(icon, 12, dy)
    text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_ENC, boss_type_name)
    self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(36, dy, sw-36, WLH, unique_type_enc, 2)
    #---
    dy += WLH
    self.contents.font.color = text_color(@category_colour)
    draw_icon(YE::MENU::MONSTER::ICON_KILLED, 0, dy)
    text = YE::MENU::MONSTER::TEXT_DEFEATED
    self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(24, dy, sw-24, WLH, total_defeated, 2)
    #---
    dy += WLH
    self.contents.font.color = text_color(@category_colour)
    draw_icon(icon, 12, dy)
    text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_DEF, boss_type_name)
    self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(36, dy, sw-36, WLH, unique_defeated, 2)
    #---
    dy += WLH
    self.contents.font.color = text_color(@category_colour)
    draw_icon(YE::MENU::MONSTER::ICON_ESCAPED, 0, dy)
    text = YE::MENU::MONSTER::TEXT_ESCAPED
    self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(24, dy, sw-24, WLH, total_escaped, 2)
    #---
    dy += WLH
    self.contents.font.color = text_color(@category_colour)
    draw_icon(icon, 12, dy)
    text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_ESC, boss_type_name)
    self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(36, dy, sw-36, WLH, unique_escaped, 2)
  end
 
  #--------------------------------------------------------------------------
  # bestiary_completion
  #--------------------------------------------------------------------------
  def bestiary_completion
    total = 0; result = 0
    for enemy in $data_enemies
      next if $imported["SwapDummyMonster"] and
        YE::SWAP::DUMMY_MONSTER.include?(enemy.id)
      next if YE::HIDDEN_ENEMY.include?(enemy.id)
      next if enemy == nil
      total += 1
      if $game_party.monsters_encounter.include?(enemy.id) and
        $game_party.monsters_encounter[enemy.id] > 0
        result += 1
      end
      next unless YE::MENU::MONSTER::REQUIRE_SCAN
      next if enemy.hide_whole
      total += 1 if YE::MENU::MONSTER::SHOW_GENERAL and !enemy.hide_hp_mp
      total += 1 if YE::MENU::MONSTER::SHOW_GENERAL and !enemy.hide_stats
      total += 1 if YE::MENU::MONSTER::SHOW_SKILLS and !enemy.hide_skill
      total += 1 if YE::MENU::MONSTER::SHOW_ELEMENTS and !enemy.hide_elem
      total += 1 if YE::MENU::MONSTER::SHOW_STATES and !enemy.hide_state
      total += 1 if YE::MENU::MONSTER::SHOW_SPOILS and !enemy.hide_spoil
      if YE::MENU::MONSTER::SPOIL_DROPS or (YE::MENU::MONSTER::SHOW_DROPS and
        $imported["ExtraDropItem"]) and !enemy.hide_drops
        total += 1
      end
      if $imported["Steal"] and YE::MENU::MONSTER::SHOW_STEAL and
        !enemy.hide_steal
        total += 1
      end
      if YE::MENU::MONSTER::SHOW_NOTES and YE::HASH::ENEMY_NOTES.include?(enemy.id)
        total += 1
      end
    end
    if YE::MENU::MONSTER::REQUIRE_SCAN
      result += $game_party.scan_hp_mp.size
      result += $game_party.scan_stats.size
      result += $game_party.scan_skill.size
      result += $game_party.scan_state.size
      result += $game_party.scan_spoil.size
      result += $game_party.scan_drops.size
      result += $game_party.scan_steal.size
      result += $game_party.scan_desc.size
    end
    result *= 100.0
    result /= total
    return result
  end
 
end # Window_Type_Data

#==============================================================================
# Window_Boss_Types
#==============================================================================

class Window_Boss_Types < Window_Selectable
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(136, 80, 272, 280)
    self.index = 0
    self.opacity = 0
    self.visible = false
    self.active = false
    refresh
  end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    @data = YE::MENU::MONSTER::TYPE_ORDERING
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
 
  #--------------------------------------------------------------------------
  # type
  #--------------------------------------------------------------------------
  def type
    return @data[self.index]
  end
 
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    type = @data[index]
    icon = YE::MENU::MONSTER::BOSS_TYPES[type][0]
    name = YE::MENU::MONSTER::BOSS_TYPES[type][8]
    text = sprintf(YE::MENU::MONSTER::CATEGORIZE_VIEW, name)
    draw_icon(icon, rect.x+4, rect.y)
    self.contents.draw_text(rect.x+28, rect.y, rect.width-28, WLH, text)
  end
 
end # Window_Boss_Types

#===============================================================================
# Window Enemy Name
#===============================================================================

class Window_Enemy_Name < Window_Base
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    self.back_opacity = 255
    @target_enemy_window = nil
    self.z = 200
    self.visible = false
  end
 
  #--------------------------------------------------------------------------
  # appear and disappear
  #--------------------------------------------------------------------------
  def appear(enemy, window = nil)
    @enemy = enemy
    @target_enemy_window = window
    self.openness = 128
    @opening = true
    self.visible = true
    draw_content
  end
 
  def disappear
    self.visible = false
  end
 
  #--------------------------------------------------------------------------
  # draw content
  #--------------------------------------------------------------------------
  def draw_content
    self.contents.clear
    text = sprintf(YE::MENU::MONSTER::ENEMY_NAME, @enemy.name)
    if $imported["EnemyLevelControl"]
      level = @enemy.level
      text = sprintf(YE::BATTLE::ENEMY::SCANNED_ENEMY_LEVEL, level, text)
    end
    self.contents.draw_text(0, 0, 240, 24, text, 1)
  end
 
end # Window_Enemy_Name

#===============================================================================
# Window Enemy Image
#===============================================================================

class Window_Enemy_Image < Window_Base
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    self.back_opacity = 255
    @target_enemy_window = nil
    self.z = 200
    self.visible = false
  end
 
  #--------------------------------------------------------------------------
  # appear and disappear
  #--------------------------------------------------------------------------
  def appear (enemy, window = nil)
    @enemy = enemy
    @target_enemy_window = window
    self.openness = 128
    @opening = true
    self.visible = true
    draw_content
  end
 
  def disappear
    self.visible = false
  end
 
  #--------------------------------------------------------------------------
  # draw content
  #--------------------------------------------------------------------------
  def draw_content
    self.contents.clear
    enemybit = Cache.battler(@enemy.battler_name, @enemy.battler_hue)
    bw = enemybit.width
    bh = enemybit.height
    if bw > (self.width - 32)
      bw = (self.width - 32)
      bh *= (self.width - 32)
      bh /= enemybit.width
    end
    if bh > (self.height - 32)
      bh = (self.height - 32)
      bw *= (self.height - 32)
      bw /= enemybit.height
    end
    rect = Rect.new(0, 0, bw, bh)
    #---------
    rect.x = (self.width - 32 - rect.width) / 2
    rect.y = (self.height - 32 - rect.height) / 2
    #---------
    self.contents.stretch_blt(rect, enemybit, enemybit.rect)
  end
 
end # Window_Enemy_Image

#===============================================================================
# Window Enemy Scan
#===============================================================================

class Window_Enemy_Scan < Window_Base
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height, inbattle)
    super(x, y, width, height)
    self.back_opacity = 255
    @target_enemy_window = nil
    @inbattle = inbattle
    @require = YE::MENU::MONSTER::REQUIRE_SCAN
    self.z = 200
    self.visible = false
  end
 
  #--------------------------------------------------------------------------
  # appear and disappear
  #--------------------------------------------------------------------------
  def appear (enemy, window = nil)
    @enemy = enemy
    @target_enemy_window = window
    @page = 1
    @total_pages = create_total_pages
    draw_enemy_data
    self.openness = 128
    @opening = true
    self.active = true
    self.visible = true
  end
 
  def disappear
    self.active = false
    self.visible = false
  end
 
  #--------------------------------------------------------------------------
  # page switching
  #--------------------------------------------------------------------------
  def next_page
    if @page != @total_pages
      @page += 1
    else
      @page = 1
    end
    turn_sound
    draw_enemy_data
  end
 
  def previous_page
    if @page != 1
      @page -= 1
    else
      @page = @total_pages
    end
    turn_sound
    draw_enemy_data
  end
 
  def top_page
    @page = 1
    turn_sound
    draw_enemy_data
  end
 
  def bottom_page
    @page = @total_pages
    turn_sound
    draw_enemy_data
  end
 
  #--------------------------------------------------------------------------
  # turn sound
  #--------------------------------------------------------------------------
  def turn_sound
    unless YE::MENU::MONSTER::PAGE_SOUND == nil
      sound = YE::MENU::MONSTER::PAGE_SOUND
      sound.play
    end
  end
 
  #--------------------------------------------------------------------------
  # draw enemy data
  #--------------------------------------------------------------------------
  def draw_enemy_data
    self.contents.clear
    self.contents.font.color.alpha = 255
    self.contents.font.size = Font.default_size
    self.contents.font.color = normal_color
    @category_colour = YE::MENU::MONSTER::DATA_CATEGORY_COLOUR
    #--------------------
    pagecase = @contents[@page - 1]
    if @page == 1 and !YE::MENU::MONSTER::REPLACE_PAGE_MSG
      text1 = ""
    else
      text1 = YE::MENU::MONSTER::DATA_LEFT
    end
    if YE::MENU::MONSTER::REPLACE_PAGE_MSG #--------------------------------------
     
      text2 = case_page_name(pagecase)
     
    else #----------------------------------------------------------------------
      text2 = sprintf(YE::MENU::MONSTER::DATA_PAGES, @page, @total_pages)
    end
    if @page == @total_pages and !YE::MENU::MONSTER::REPLACE_PAGE_MSG
      text3 = ""
    else
      text3 = YE::MENU::MONSTER::DATA_RIGHT
    end
    #--------------------
    self.contents.draw_text(2, 0, 232, WLH, text1, 0)
    self.contents.draw_text(2, 0, 232, WLH, text2, 1)
    self.contents.draw_text(2, 0, 232, WLH, text3, 2)
    #--------------------
    if @enemy != nil
      case_page_run(pagecase)
    end
  end
 
  #--------------------------------------------------------------------------
  # make general page
  #--------------------------------------------------------------------------
  def make_general_page
    y = WLH
    x = 0
    sw = self.width - 32
    gc0 = gauge_back_color
    gce = text_color(YE::MENU::MONSTER::EXHAUST_COLOUR)
    gh = YE::MENU::MONSTER::GAUGE_HEIGHT
    dx = (sw - (24 * @enemy.enemy.boss_type.size)) / 2
    for boss_type in @enemy.enemy.boss_type
      array = YE::MENU::MONSTER::BOSS_TYPES[boss_type]
      icon = array[0]
      draw_icon(icon, dx, y, true)
      dx += 24
    end
    dsearray = YE::MENU::MONSTER::BOSS_TYPES[@enemy.enemy.boss_type[0]]
    #--------Draw HP--------
    y += WLH
    if @enemy.maxhp > @enemy.base_maxhp
      icon = YE::MENU::MONSTER::ICON_HIGH
    elsif @enemy.maxhp < @enemy.base_maxhp
      icon = YE::MENU::MONSTER::ICON_LOW
    else
      icon = dsearray[1]
    end
    @enemy.hp = @enemy.maxhp if @enemy.hp > @enemy.maxhp
    gc1 = text_color(dsearray[2])
    gc2 = text_color(dsearray[3])
    gy = y + WLH - 8 - (gh - 6)
    if @enemy.maxhp < @enemy.base_maxhp and @enemy.base_maxhp > 0
      gb = sw * @enemy.maxhp / @enemy.base_maxhp
      self.contents.fill_rect(x, gy, sw, gh, gce)
    else
      gb = sw
    end
    self.contents.fill_rect(x, gy, gb, gh, gc0)
    if @enemy.maxhp <= 0
      if @enemy.base_maxhp <= 0
        gw = sw
      else
        gw = 0
      end
    else
      gw = gb * @enemy.hp / @enemy.maxhp
      self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
    end
    draw_icon(icon, x, y, true)
    text = Vocab::hp
    self.contents.font.color = text_color(@category_colour)
    self.contents.draw_text(24, y, sw-24, WLH, text, 0)
    self.contents.font.color = normal_color
    hidehp = false
    if @require
      hidehp = true unless $game_party.scan_hp_mp.include?(@enemy.enemy_id)
    end
    if hidehp or @enemy.enemy.hide_hp_mp
      text = YE::MENU::MONSTER::HIDDEN_HP
    elsif YE::MENU::MONSTER::HP_DISPLAY_TYPE == 1
      text = @enemy.hp
    elsif YE::MENU::MONSTER::HP_DISPLAY_TYPE == 2
      text = sprintf("%d/%d",@enemy.hp,@enemy.maxhp)
    else
      text = sprintf("%#.05g%%",@enemy.hp * 100.000 / @enemy.maxhp)
    end
    self.contents.draw_text(0, y, sw, WLH, text, 2)
    #--------Draw MP--------
    y += WLH
    if @enemy.maxmp > @enemy.base_maxmp
      icon = YE::MENU::MONSTER::ICON_HIGH
    elsif @enemy.maxmp < @enemy.base_maxmp
      icon = YE::MENU::MONSTER::ICON_LOW
    else
      icon = dsearray[4]
    end
    @enemy.mp = @enemy.maxmp if @enemy.mp > @enemy.maxmp
    gc1 = text_color(dsearray[5])
    gc2 = text_color(dsearray[6])
    gy = y + WLH - 8 - (gh - 6)
    if @enemy.maxmp < @enemy.base_maxmp and @enemy.base_maxmp > 0
      gb = sw * @enemy.maxmp / @enemy.base_maxmp
      self.contents.fill_rect(x, gy, sw, gh, gce)
    else
      gb = sw
    end
    self.contents.fill_rect(x, gy, gb, gh, gc0)
    if @enemy.maxmp <= 0
      if @enemy.base_maxmp <= 0
        gw = sw
      else
        gw = 0
      end
    else
      gw = gb * @enemy.mp / @enemy.maxmp
    end
    self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
    draw_icon(icon, x, y, true)
    text = Vocab::mp
    self.contents.font.color = text_color(@category_colour)
    self.contents.draw_text(24, y, sw-24, WLH, text, 0)
    self.contents.font.color = normal_color
    hidemp = false
    if @require
      hidemp = true unless $game_party.scan_hp_mp.include?(@enemy.enemy_id)
    end
    if hidemp or @enemy.enemy.hide_hp_mp
      text = YE::MENU::MONSTER::HIDDEN_MP
    elsif YE::MENU::MONSTER::MP_DISPLAY_TYPE == 1
      text = @enemy.mp
    elsif YE::MENU::MONSTER::MP_DISPLAY_TYPE == 2
      text = sprintf("%d/%d",@enemy.mp,@enemy.maxmp)
    else
      if @enemy.maxmp
        text = sprintf("%#.05g%%", 100.000)
      else
        text = sprintf("%#.05g%%",@enemy.mp * 100.000 / @enemy.maxmp)
      end
    end
    self.contents.draw_text(0, y, sw, WLH, text, 2)
    #--------Draw ADSA and HECO Stats--------
    self.contents.font.size = YE::MENU::MONSTER::FONT_SIZE
    hide = YE::MENU::MONSTER::HIDDEN_STAT
    hidestats = false
    if @require
      hidestats = true unless $game_party.scan_stats.include?(@enemy.enemy_id)
    end
    if hidestats or @enemy.enemy.hide_stats
      textatk = hide; textdef = hide; textspi = hide; textagi = hide
      texthit = hide; texteva = hide; textcri = hide; textodds = hide
    else
      textatk = @enemy.atk; textdef = @enemy.def
      textspi = @enemy.spi; textagi = @enemy.agi
      texthit = sprintf("%d%%",@enemy.hit)
      texteva = sprintf("%d%%",@enemy.eva)
      textcri = sprintf("%d%%",@enemy.cri)
      textodds = sprintf("%d", @enemy.odds)
    end
    #---ATK---
    y += WLH + WLH / 4
    if @enemy.atk > @enemy.base_atk
      icon = YE::MENU::MONSTER::ICON_HIGH
    elsif @enemy.atk < @enemy.base_atk
      icon = YE::MENU::MONSTER::ICON_LOW
    else
      icon = YE::MENU::MONSTER::ICON_ATK
    end
    draw_icon(icon, 0, y, true)
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_ATK
    self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(sw/4, y, sw/4-12, WLH, textatk, 2)
    #---HIT---
    unless YE::MENU::MONSTER::HIDE_HIT
      icon = YE::MENU::MONSTER::ICON_HIT
      draw_icon(icon, sw/2, y, true)
      self.contents.font.color = text_color(@category_colour)
      text = YE::MENU::MONSTER::DATA_HIT
      self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
      self.contents.font.color = normal_color
      self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, texthit, 2)
    end
    #---DEF---
    y += WLH
    if @enemy.def > @enemy.base_def
      icon = YE::MENU::MONSTER::ICON_HIGH
    elsif @enemy.def < @enemy.base_def
      icon = YE::MENU::MONSTER::ICON_LOW
    else
      icon = YE::MENU::MONSTER::ICON_DEF
    end
    draw_icon(icon, 0, y, true)
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_DEF
    self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(sw/4, y, sw/4-12, WLH, textdef, 2)
    #---EVA---
    unless YE::MENU::MONSTER::HIDE_EVA
      icon = YE::MENU::MONSTER::ICON_EVA
      draw_icon(icon, sw/2, y, true)
      self.contents.font.color = text_color(@category_colour)
      text = YE::MENU::MONSTER::DATA_EVA
      self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
      self.contents.font.color = normal_color
      self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, texteva, 2)
    end
    #---SPI---
    y += WLH
    if @enemy.spi > @enemy.base_spi
      icon = YE::MENU::MONSTER::ICON_HIGH
    elsif @enemy.spi < @enemy.base_spi
      icon = YE::MENU::MONSTER::ICON_LOW
    else
      icon = YE::MENU::MONSTER::ICON_SPI
    end
    draw_icon(icon, 0, y, true)
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_SPI
    self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(sw/4, y, sw/4-12, WLH, textspi, 2)
    #---CRI---
    unless YE::MENU::MONSTER::HIDE_CRI
      icon = YE::MENU::MONSTER::ICON_CRI
      draw_icon(icon, sw/2, y, true)
      self.contents.font.color = text_color(@category_colour)
      text = YE::MENU::MONSTER::DATA_CRI
      self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
      self.contents.font.color = normal_color
      self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, textcri, 2)
    end
    #---AGI---
    y += WLH
    if @enemy.agi > @enemy.base_agi
      icon = YE::MENU::MONSTER::ICON_HIGH
    elsif @enemy.agi < @enemy.base_agi
      icon = YE::MENU::MONSTER::ICON_LOW
    else
      icon = YE::MENU::MONSTER::ICON_AGI
    end
    draw_icon(icon, 0, y, true)
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_AGI
    self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(sw/4, y, sw/4-12, WLH, textagi, 2)
    #---ODDS---
    unless YE::MENU::MONSTER::HIDE_ODDS
      icon = YE::MENU::MONSTER::ICON_ODDS
      draw_icon(icon, sw/2, y, true)
      self.contents.font.color = text_color(@category_colour)
      text = YE::MENU::MONSTER::DATA_ODDS
      self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
      self.contents.font.color = normal_color
      self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, textodds, 2)
    end
    #--------STATUS EFFECTS--------
    y += WLH + WLH / 4
    state_draw = @enemy.states
    for state in state_draw
      state_draw.delete(state) if state.icon_index == 0
    end
    unless state_draw == []
      self.contents.font.size = Font.default_size
      self.contents.font.color = text_color(@category_colour)
      text = YE::MENU::MONSTER::DATA_STATES
      self.contents.draw_text(0, y, sw, WLH, text, 1)
      y += WLH
      draw_actor_state(@enemy, 0, y, sw + 12)
    end
  end # make general page
 
  #--------------------------------------------------------------------------
  # make skills page
  #--------------------------------------------------------------------------
  def make_skills_page
    x = 0
    y = WLH
    sw = self.width - 32
    action_list = []
    skilltotal = 0
    for action in @enemy.enemy.actions
      if action.kind == 1
        obj = $data_skills[action.skill_id]
        unless action_list.include?(obj)
          action_list.push(obj)
          skilltotal += 1
        end
      end
    end
    y += WLH
    self.contents.font.color = normal_color
    for obj in action_list
      break if (y + 24) > (self.height - 32)
      draw_item_name(obj, x, y, true)
      y += WLH
    end
    y = WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_SKILLS
    self.contents.draw_text(0, y, sw, WLH, text, 0)
    if skilltotal == 1
      text = sprintf(YE::MENU::MONSTER::VIEW_SKILLS1, skilltotal)
    else
      text = sprintf(YE::MENU::MONSTER::VIEW_SKILLS2, skilltotal)
    end
    self.contents.draw_text(0, y, sw, WLH, text, 2)
  end # end make skills page
 
  #--------------------------------------------------------------------------
  # make elements page
  #--------------------------------------------------------------------------
  def make_elements_page
    x = 0
    y = WLH
    sw = self.width - 32
    for key in YE::MENU::MONSTER::ELEMENT_HASH
      doublearr = key[1]
      ele_array = doublearr[0]
      ele_icon  = doublearr[1]
      self.contents.font.color = text_color(@category_colour)
      text = key[0]
      self.contents.draw_text(0, y, sw, WLH, text, 1)
      y += WLH
      x = (sw - ele_array.size * 24) / 2
      for icon in ele_icon
        draw_icon(icon, x, y, true)
        x += 24
      end
      y += WLH
      x = (sw - ele_array.size * 24) / 2
      for element in ele_array
        rank = @enemy.enemy.element_ranks[element]
        result = [0,1,2,3,4,5,6][rank]
        if result == 0
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_Z, x, y, true)
        elsif result == 1
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_A, x, y, true)
        elsif result == 2
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_B, x, y, true)
        elsif result == 3
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_C, x, y, true)
        elsif result == 4
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_D, x, y, true)
        elsif result == 5
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_E, x, y, true)
        elsif result == 6
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_F, x, y, true)
        else
          draw_icon(YE::MENU::MONSTER::ICON_E_RATE_U, x, y, true)
        end
        x += 24
      end
      y += WLH * 2
    end
  end # make elements page
 
  #--------------------------------------------------------------------------
  # make states page
  #--------------------------------------------------------------------------
  def make_states_page
    x = 0
    y = WLH
    sw = self.width - 32
    for key in YE::MENU::MONSTER::STATES_HASH
      states_array = key[1]
      self.contents.font.color = text_color(@category_colour)
      text = key[0]
      self.contents.draw_text(0, y, sw, WLH, text, 1)
      y += WLH
      x = (sw - states_array.size * 24) / 2
      for state_id in states_array
        icon = $data_states[state_id].icon_index
        draw_icon(icon, x, y, true)
        x += 24
      end
      y += WLH
      x = (sw - states_array.size * 24) / 2
      for state_id in states_array
        icon = $data_states[state_id].icon_index
        rank = @enemy.enemy.state_ranks[state_id]
        result = [0,1,2,3,4,5,6][rank]
        if result == 0
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_Z, x, y, true)
        elsif result == 1
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_A, x, y, true)
        elsif result == 2
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_B, x, y, true)
        elsif result == 3
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_C, x, y, true)
        elsif result == 4
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_D, x, y, true)
        elsif result == 5
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_E, x, y, true)
        elsif result == 6
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_F, x, y, true)
        else
          draw_icon(YE::MENU::MONSTER::ICON_S_RATE_U, x, y, true)
        end
        x += 24
      end
      y += WLH
    end
  end # make states page
 
  #--------------------------------------------------------------------------
  # make steal page
  #--------------------------------------------------------------------------
  def make_steal_page
    return unless $imported["Steal"]
    x = 0
    y = 0
    sw = self.width - 32
    y += WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_S_ITEM
    self.contents.draw_text(0, y, sw, WLH, text, 0)
    text = YE::MENU::MONSTER::DATA_S_CHANCE
    self.contents.draw_text(0, y, sw, WLH, text, 2)
    y += WLH
    steal_objects = @enemy.steal_objects.clone
    steal_objects.each_with_index { |item, i|
      break if (y + 24) > (self.height - 32)
      next if item == nil
      case item.kind
      when 0
        next
      when 1
        steal_item = $data_items[item.item_id]
      when 2
        steal_item = $data_weapons[item.weapon_id]
      when 3
        steal_item = $data_armors[item.armor_id]
      end
      draw_item_name(steal_item, 0, y)
      text = sprintf("%d%%", item.success_prob)
      self.contents.draw_text(0, y, sw, WLH, text, 2)
      y += WLH
    }
  end # make steal page
 
  #--------------------------------------------------------------------------
  # make spoils page
  #--------------------------------------------------------------------------
  def make_spoils_page
    x = 0
    y = 0
    sw = self.width - 32
    #---Encounters---
    y += WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_ENCOUNTER
    self.contents.draw_text(24, y, sw-24, WLH, text, 0)
    draw_icon(YE::MENU::MONSTER::ICON_ENCOUNTER, 0, y, true)
    self.contents.font.color = normal_color
    if @enemy.encounters_dse == 1
      text = sprintf(YE::MENU::MONSTER::VIEW_ENC1, @enemy.encounters_dse)
    else
      text = sprintf(YE::MENU::MONSTER::VIEW_ENC2, @enemy.encounters_dse)
    end
    self.contents.draw_text(24, y, sw-24, WLH, text, 2)
    #---Defeated---
    y += WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_KILLED
    self.contents.draw_text(24, y, sw-24, WLH, text, 0)
    draw_icon(YE::MENU::MONSTER::ICON_KILLED, 0, y, true)
    self.contents.font.color = normal_color
    if @enemy.defeated_dse == 1
      text = sprintf(YE::MENU::MONSTER::VIEW_KILLED1, @enemy.defeated_dse)
    else
      text = sprintf(YE::MENU::MONSTER::VIEW_KILLED2, @enemy.defeated_dse)
    end
    self.contents.draw_text(24, y, sw-24, WLH, text, 2)
    #---Escaped---
    y += WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_ESCAPED
    self.contents.draw_text(24, y, sw-24, WLH, text, 0)
    draw_icon(YE::MENU::MONSTER::ICON_ESCAPED, 0, y, true)
    self.contents.font.color = normal_color
    if @enemy.escaped_dse == 1
      text = sprintf(YE::MENU::MONSTER::VIEW_ESCAPED1, @enemy.escaped_dse)
    else
      text = sprintf(YE::MENU::MONSTER::VIEW_ESCAPED2, @enemy.escaped_dse)
    end
    self.contents.draw_text(24, y, sw-24, WLH, text, 2)
    #---Gold---
    y += WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_GOLD
    self.contents.draw_text(24, y, sw-24, WLH, text, 0)
    draw_icon(YE::MENU::MONSTER::ICON_GOLD, 0, y, true)
    self.contents.font.color = normal_color
    text = sprintf(YE::MENU::MONSTER::VIEW_GOLD, @enemy.gold)
    self.contents.draw_text(24, y, sw-24, WLH, text, 2)
    #---Exp---
    y += WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_EXP
    self.contents.draw_text(24, y, sw-24, WLH, text, 0)
    draw_icon(YE::MENU::MONSTER::ICON_EXP, 0, y, true)
    self.contents.font.color = normal_color
    text = sprintf(YE::MENU::MONSTER::VIEW_EXP, @enemy.exp)
    self.contents.draw_text(24, y, sw-24, WLH, text, 2)
    #---Drops---
    if YE::MENU::MONSTER::SPOIL_DROPS and !@enemy.enemy.hide_drops
      y += WLH
      drop_items = [@enemy.drop_item1, @enemy.drop_item2]
      if $imported["ExtraDropItem"]
        drop_items += @enemy.extra_drop_items
      end
      self.contents.font.color = text_color(@category_colour)
      text = YE::MENU::MONSTER::DATA_DROPS
      self.contents.draw_text(0, y, sw, WLH, text, 1)
      y += WLH
      drop_items.each_with_index { |item, i|
        break if (y + 24) > (self.height - 32)
        case item.kind
        when 0
          next
        when 1
          drop_item = $data_items[item.item_id]
        when 2
          drop_item = $data_weapons[item.weapon_id]
        when 3
          drop_item = $data_armors[item.armor_id]
        end
        draw_item_name(drop_item, 0, y)
        if $imported["ExtraDropItem"] && item.drop_prob > 0
          text = sprintf("%d%%", item.drop_prob)
        else
          text = sprintf("%d%%", 1 * 100 /item.denominator)
        end
        self.contents.draw_text(0, y, sw, WLH, text, 2)
        y += WLH
      }
    end
  end # make spoils page
 
  #--------------------------------------------------------------------------
  # make drops page
  #--------------------------------------------------------------------------
  def make_drops_page
    x = 0
    y = 0
    sw = self.width - 32
    y += WLH
    self.contents.font.color = text_color(@category_colour)
    text = YE::MENU::MONSTER::DATA_D_ITEM
    self.contents.draw_text(0, y, sw, WLH, text, 0)
    text = YE::MENU::MONSTER::DATA_D_CHANCE
    self.contents.draw_text(0, y, sw, WLH, text, 2)
    y += WLH
    drop_items = [@enemy.drop_item1, @enemy.drop_item2]
    if $imported["ExtraDropItem"]
      drop_items += @enemy.extra_drop_items
    end
    drop_items.each_with_index { |item, i|
      break if (y + 24) > (self.height - 32)
      case item.kind
      when 0
        next
      when 1
        drop_item = $data_items[item.item_id]
      when 2
        drop_item = $data_weapons[item.weapon_id]
      when 3
        drop_item = $data_armors[item.armor_id]
      end
      draw_item_name(drop_item, 0, y)
      if $imported["ExtraDropItem"] && item.drop_prob > 0
        text = sprintf("%d%%", item.drop_prob)
      else
        text = sprintf("%d%%", 1 * 100 /item.denominator)
      end
      self.contents.draw_text(0, y, sw, WLH, text, 2)
      y += WLH
    }
  end # make drops page
 
  #--------------------------------------------------------------------------
  # make notes page
  #--------------------------------------------------------------------------
  def make_notes_page
    self.contents.font.color.alpha = 255
    self.contents.font.size = YE::MENU::MONSTER::NOTE_PAGE_TEXT_SIZE
    self.contents.font.color = text_color(YE::MENU::MONSTER::NOTE_PAGE_TEXT_COLOUR)
    y = 24
    txsize = YE::MENU::MONSTER::NOTE_PAGE_TEXT_SIZE + 4
    text = YE::HASH::ENEMY_NOTES[@enemy.enemy_id]
    nwidth = YE::MENU::MONSTER::NOTE_PAGE_WIDTH
    buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
    lines = buf.split(/(?:[|]|\\n)/i)
    lines.each_with_index { |l, i|
      l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
      self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
    }
  end #end def
 
  #--------------------------------------------------------------------------
  # create_total_pages
  #--------------------------------------------------------------------------
  def create_total_pages
    @contents = []
    @contents.push(0) if YE::MENU::MONSTER::SHOW_GENERAL
    #----------------
    action_list = []
    for action in @enemy.enemy.actions
      if action.kind == 1
        obj = $data_skills[action.skill_id]
        action_list.push(obj) unless action_list.include?(obj)
      end
    end
    if YE::MENU::MONSTER::SHOW_SKILLS and action_list != []
      if @require
        if $game_party.scan_skill.include?(@enemy.enemy_id)
          @contents.push(1) unless @enemy.enemy.hide_skill
        end
      else
        @contents.push(1) unless @enemy.enemy.hide_skill
      end
    end
    #----------------
    if YE::MENU::MONSTER::SHOW_ELEMENTS
      if @require
        if $game_party.scan_elem.include?(@enemy.enemy_id)
          @contents.push(2) unless @enemy.enemy.hide_elem
        end
      else
        @contents.push(2) unless @enemy.enemy.hide_elem
      end
    end
    #----------------
    if YE::MENU::MONSTER::SHOW_STATES
      if @require
        if $game_party.scan_state.include?(@enemy.enemy_id)
          @contents.push(3) unless @enemy.enemy.hide_state
        end
      else
        @contents.push(3) unless @enemy.enemy.hide_state
      end
    end
    #----------------
    if YE::MENU::MONSTER::SHOW_STEAL and $imported["Steal"]
      if @require
        if $game_party.scan_steal.include?(@enemy.enemy_id)
          @contents.push(80) unless @enemy.enemy.hide_steal
        end
      else
        @contents.push(80) unless @enemy.enemy.hide_steal
      end
    end
    #----------------
    if YE::MENU::MONSTER::SHOW_SPOILS
      if @require
        if $game_party.scan_spoil.include?(@enemy.enemy_id)
          @contents.push(90) unless @enemy.enemy.hide_spoil
        end
      else
        @contents.push(90) unless @enemy.enemy.hide_spoil
      end
    end
    #----------------
    if YE::MENU::MONSTER::SHOW_DROPS
      if @require
        if $game_party.scan_drops.include?(@enemy.enemy_id)
          @contents.push(91) unless @enemy.enemy.hide_drops
        end
      else
        @contents.push(91) unless @enemy.enemy.hide_drops
      end
    end
    #----------------
    if YE::MENU::MONSTER::SHOW_NOTES
      if @require
        if YE::HASH::ENEMY_NOTES.include?(@enemy.enemy_id)
          @contents.push(100) if $game_party.scan_desc.include?(@enemy.enemy_id)
        end
      else
        if YE::HASH::ENEMY_NOTES.include?(@enemy.enemy_id)
          @contents.push(100)
        end
      end
    end
    #----------------
    n = @contents.size
    return n
  end
 
  #--------------------------------------------------------------------------
  # case_page_name
  #--------------------------------------------------------------------------
  def case_page_name(pagecase)
    if pagecase == 0
      text = YE::MENU::MONSTER::TITLE_GENERAL
    elsif pagecase == 1
      text = YE::MENU::MONSTER::TITLE_SKILLS
    elsif pagecase == 2
      text = YE::MENU::MONSTER::TITLE_ELEMENTS
    elsif pagecase == 3
      text = YE::MENU::MONSTER::TITLE_STATES
    elsif pagecase == 80
      text = YE::MENU::MONSTER::TITLE_STEAL
    elsif pagecase == 90
      text = YE::MENU::MONSTER::TITLE_SPOILS
    elsif pagecase == 91
      text = YE::MENU::MONSTER::TITLE_DROPS
    elsif pagecase == 100
      text = YE::MENU::MONSTER::TITLE_NOTES
    else
      text = YE::MENU::MONSTER::TITLE_UNKNOWN
    end
    return text
  end
 
  #--------------------------------------------------------------------------
  # case_page_run
  #--------------------------------------------------------------------------
  def case_page_run(pagecase)
    if pagecase == 0
      make_general_page
    elsif pagecase == 1
      make_skills_page
    elsif pagecase == 2
      make_elements_page
    elsif pagecase == 3
      make_states_page
    elsif pagecase == 80
      make_steal_page
    elsif pagecase == 90
      make_spoils_page
    elsif pagecase == 91
      make_drops_page
    elsif pagecase == 100
      make_notes_page
    end
  end
 
end # Window_Enemy_Scan

#===============================================================================
#
# END OF FILE
#
#===============================================================================
Revenir en haut Aller en bas
 
[VX] Yanfly Engine RD - Bestiary + Scan
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» // Yanfly Engine Message Core System
» [Mv] Multi-target animation avec Yanfly action sequence pack
» [XP] Compétence Scan
» [RPG Maker VX] Add_on SBS - Scan
» Problème lors de l'utilisation du script de scan.

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Le Palais Créatif :: ~ PARTAGE ~ :: Scripts et plugins :: RPG Maker VX :: Autres-
Sauter vers: