Display Scanned Enemy
Página 1 de 1
Display Scanned Enemy
Display Scanned Enemy
Feito por YanFly
Feito por YanFly
Descrição :
Possibilita a visualização dos dados do inimigo durante a batalha.
Funções:
Ajuda muito na estratégia da batalha, pois, você saberá os pontos fracos e fortes do inimigo.
Instrução:
Cole o script acima do main.
ScreenShots
script
- Código:
#===============================================================================
#
# Yanfly Engine RD - Display Scanned Enemy
# Last Date Updated: 2009.04.27
# 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.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# 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
#===============================================================================
#
# 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>
# Causes the skill to unlock all scan data about the target enemy.
#
# <scan hp mp>
# Causes the skill to unlock only the HP and MP portion of the enemy data.
# Note that even if HP and MP were unscanned, the gauge bars will still move up
# and down as to give the player a general idea of how much health the enemy has
# before giving the player more accurate information.
#
# <scan stats>
# Causes the skill to unlock the ADSA and HECO stats for the target enemy scan
# data. On the HECO stats side, you can hide certain stats from appear. Odds is
# hidden by default with this script.
#
# <scan skills>
# Causes the skill to unlock the skill page for the target enemy scan data. This
# will list all of the skills the enemy will use in battle. Duplicate skills are
# condensed and removed from the listing.
#
# <scan elements>
# Causes the skill to unlock the elements page for the target enemy data. This
# provides a chart of the enemy's elemental affinities as to what will damage
# the enemy more or less.
#
# <scan status effects> or <scan states>
# Causes the skill to unlock the status effects page for the target enemy data.
# Like the elements page, this provides a listing of status effect chances to
# occur for the enemy.
#
# <scan steal>
# Only appears if you have KGC Steal. This page will reveal information about
# items that can be stolen form the enemy along with their steal rates.
#
# <scan spoils>
# Causes a skill to unlock the experience, gold, encounters page for target
# enemy data. This is pretty much stuff that comes out of an enemy after a
# battle is over. Can include drops (optional).
#
# <scan drops>
# Causes a skill to unlock the drops page. Use this if you use KGC's Extra Drops
# and if your enemies have huge drop lists. This will display way more.
#
# <scan description>
# Causes a skill to unlock the extra description page where you can make your
# own custom notes. Note that if you don't alter the Lunatic mode hash down
# below, even if you scan the enemy, the extra page won't show unless there is
# something to be shown.
#
#===============================================================================
# How to Use: Hard Mode
#===============================================================================
#
# For those that would like to prevent certain pages from showing up on specific
# enemies, you can use the following tags on those enemies to prevent those very
# pages from appearing without completely disabling a part of the scan set.
#
# <hide whole>
# Prevents everything from being shown at all for that enemy.
#
# <hide hp_mp>
# Prevents HP and MP from being displayed for that enemy.
#
# <hide stats>
# Prevents the ADSA and HECO stats from being displayed for that enemy.
#
# <hide skills>
# Prevents skills from being displayed for that enemy.
#
# <hide elements>
# Prevents element chart from being displayed for that enemy.
#
# <hide status effects> or <hide states>
# Prevents status effect probability chart from being displayed for that enemy.
#
# <hide steal>
# Prevents stolen items from being shown for that enemy.
#
# <hide spoils>
# Prevents victory spoil information from being shown for that enemy.
#
# <hide drops>
# Prevents drop information from being displayed for that enemy.
#
# 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
#
#===============================================================================
$imported = {} if $imported == nil
$imported["DisplayScannedEnemy"] = true
module YE
module MENU
module MONSTER
# This is the button pressed to trigger the enemy scan window in battle.
ENEMY_SCAN_BUTTON = Input::A
# If this is set to true, you must use scan skills on an enemy type before
# any data will be displayed at all.
REQUIRE_SCAN = false
# This allows you to adjust the help info window's properties in battle.
HELP_WINDOW_TX = "Aperte Shift para ver as informações do inimigo."
HELP_WINDOW_ON = true # This turns the window on and off.
HELP_WINDOW_X = 0 # This is where the X position is.
HELP_WINDOW_Y = 0 # This is where the Y position is.
HELP_WINDOW_W = 544 # This is what width the window is.
HELP_WINDOW_O = 255 # This is the window's opacity level.
# This affects how you want the scan to appear.
ENEMY_NAME = "Informações de %s"
# 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 = "Informação" # This appears if only one page of info.
DATA_PAGES = "Página %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 = "Unknown"
# 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 = "Informação Geral"
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 = "Status" # Category for affected states.
HIDDEN_STAT = "???" # If the enemy is unscanned or hides stats.
DATA_ATK = "ATK" # For attack.
DATA_DEF = "DEF" # For defense.
DATA_SPI = "SPI" # For spirit.
DATA_AGI = "AGI" # For agility.
DATA_HIT = "HIT" # For hit rate.
HIDE_HIT = false # Set this to true if you wish to hide Hit.
DATA_EVA = "EVA" # For evasion rate.
HIDE_EVA = false # Set this to true if you wish to hide Eva.
DATA_CRI = "CRI" # For critical rate.
HIDE_CRI = false # Set this to true if you wish to hide Cri.
DATA_ODDS = "LUK" # 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
# Here you can control boss types and whatnot. To use boss types, add
# the boss type category here and insert in the enemy's notebox the
# <boss type x> tag. It will reference to this hash as to how to display
# the following information: Boss Type Icon, HP Icon, HP Colour 1,
# HP Colour 2, MP Icon, MP Colour 1, and MP Colour 2.
BOSS_TYPES ={
# Type => [Icon,HPIc,HPC1,HPC2,MPIc,MPC1,MPC2,
0 => [ 0, 99, 20, 21, 100, 22, 23],
1 => [ 112, 208, 18, 20, 209, 11, 22],
2 => [ 157, 99, 20, 21, 100, 22, 23],
} # Do not remove this.
# This is all of the icon information for the first page.
ICON_HIGH = 142 # If a stat is higher than base stat.
ICON_LOW = 143 # If a stat is lower than base stat.
ICON_ATK = 2 # Icon for ATK
ICON_DEF = 52 # Icon for DEF
ICON_SPI = 21 # Icon for SPI
ICON_AGI = 48 # Icon for AGI
ICON_HIT = 135 # Icon for HIT
ICON_EVA = 158 # Icon for EVA
ICON_CRI = 119 # Icon for CRI
ICON_ODDS = 137 # 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 = "Habilidade Info"
DATA_SKILLS = "Nome da Habilidade"
VIEW_SKILLS1 = "%d Habilidade"
VIEW_SKILLS2 = "%d Habilidades"
# This affects info displayed for the element affinity info page.
# Elements will only show if they are listed in the hash below.
SHOW_ELEMENTS = true
TITLE_ELEMENTS = "Elementos Eficazes"
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 = 99 # Icon used for element rate A.
ICON_E_RATE_B = 99 # Icon used for element rate B.
ICON_E_RATE_C = 102 # Icon used for element rate C.
ICON_E_RATE_D = 101 # Icon used for element rate D.
ICON_E_RATE_E = 100 # Icon used for element rate E.
ICON_E_RATE_F = 103 # 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.
"Armas Eficazes" => [
# These are the element ID's.
[ 2, 3, 4, 5, 6],
# These are the element icons.
[ 10, 4, 14, 16, 12]
], # Next row
"Mágias Eficazes" => [
# These are the element ID's.
[ 9, 10, 11, 12, 13, 14, 15, 16],
# These are the element icons.
[ 104, 105, 106, 107, 108, 109, 110, 111]
], # Next row
} # Do not remove this.
# This affects info displayed for the status effect probability page.
# Status effect will only show if they're listed in the hash below.
SHOW_STATES = true
TITLE_STATES = "Fraqueza à Efeitos"
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 = 99 # Icon used for status rate A.
ICON_S_RATE_B = 99 # Icon used for status rate B.
ICON_S_RATE_C = 102 # Icon used for status rate C.
ICON_S_RATE_D = 101 # Icon used for status rate D.
ICON_S_RATE_E = 100 # Icon used for status rate E.
ICON_S_RATE_F = 103 # 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.
"Estado" => [ 2, 3, 4, 5, 6, 7, 8],
"Efeitos Positivos" => [ 9, 10, 11, 12],
"Efeitos Negativos" => [13, 14, 15, 16],
} # Do not remove this.
# The following portion requires KGC's Steal script to show, but doesn't
# affect the rest of this script. This page shows a list of stealable
# goodies you can nab using KGC's Steal script.
SHOW_STEAL = true
TITLE_STEAL = "Steal Info"
DATA_S_ITEM = "Nome do Item"
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 = "Informações de Encontros"
DEATH_SPOILS = true # Set to true if you wish to reveal spoils info
# when an enemy dies.
DATA_GOLD = "Gold" # Message used to indicate gold drop.
VIEW_GOLD = "%d Gold" # How the gold gain will appear.
ICON_GOLD = 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 = 62 # Icon used for exp gain.
DATA_ENCOUNTER = "Encontrou" # Message used to indicate encounters.
VIEW_ENC1 = "%d vezes" # How the encounters will appear. Singular.
VIEW_ENC2 = "%d vezes" # How the encounters will appear. Plural.
ICON_ENCOUNTER = 63 # Icon used for encounters.
DATA_KILLED = "Derrotou" # Message used to indicate defeats.
VIEW_KILLED1 = "%d Vezes" # How the defeats will appear. Singular.
VIEW_KILLED2 = "%d Vezes" # How the defeats will appear. Plural.
ICON_KILLED = 157 # Icon used for defeats.
DATA_ESCAPED = "Escapou" # Message used to indicate escapes.
VIEW_ESCAPED1 = "%d Vezes" # How the defeats will appear. Singular.
VIEW_ESCAPED2 = "%d Vezes" # How the defeats will appear. Plural.
ICON_ESCAPED = 155 # Icon used for escapes.
SPOIL_DROPS = false # Draw drops for the Spoils page?
DATA_DROPS = "Item Deixado" # 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 = "Info do Item Deixado"
DEATH_DROPS = true # Set to true if you wish to reveal spoils info
# when an enemy dies.
DATA_D_ITEM = "Item Deixado"
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 = "Notas"
NOTE_PAGE_WIDTH = 240
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 ={
26 => "Vampires are mythological or|folkloric revenants who sub-|sist by feeding on the blood|of the living. In folkloric|tales, the undead vampires|often visited loved ones and|caused mischief or deaths in|the neighbourhoods they in-|habited when they were alive.",
1200 => "Hello, world.|It's nice to meet you.",
1201 => "Good bye, world.|It was nice meeting you.",
} # Do not remove this.
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+)>/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
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 = 0
self.note.split(/[\r\n]+/).each { |line|
case line
when YE::REGEXP::ENEMY::BOSS_TYPE
@boss_type = $1.to_i
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
}
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_system.scan_hp_mp.push(enemy.id) unless $game_system.scan_hp_mp.include?(enemy.id)
end
if skill.scan_stats or skill.scan_whole
$game_system.scan_stats.push(enemy.id) unless $game_system.scan_stats.include?(enemy.id)
end
if skill.scan_skill or skill.scan_whole
$game_system.scan_skill.push(enemy.id) unless $game_system.scan_skill.include?(enemy.id)
end
if skill.scan_state or skill.scan_whole
$game_system.scan_state.push(enemy.id) unless $game_system.scan_state.include?(enemy.id)
end
if skill.scan_elem or skill.scan_whole
$game_system.scan_elem.push(enemy.id) unless $game_system.scan_elem.include?(enemy.id)
end
if skill.scan_spoil or skill.scan_whole
$game_system.scan_spoil.push(enemy.id) unless $game_system.scan_spoil.include?(enemy.id)
end
if skill.scan_drops or skill.scan_whole
$game_system.scan_drops.push(enemy.id) unless $game_system.scan_drops.include?(enemy.id)
end
if skill.scan_steal or skill.scan_whole
$game_system.scan_steal.push(enemy.id) unless $game_system.scan_steal.include?(enemy.id)
end
if skill.scan_desc or skill.scan_whole
$game_system.scan_desc.push(enemy.id) unless $game_system.scan_desc.include?(enemy.id)
end
end
end
end # Game_Battler
#===============================================================================
# Game System
#===============================================================================
class Game_System
#--------------------------------------------------------------------------
# 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_system.monsters_encounter = {} if $game_system.monsters_encounter == nil
if $game_system.monsters_encounter[enemy_id] == nil
$game_system.monsters_encounter[enemy_id] = 0
end
$game_system.monsters_encounter[enemy_id] += 1
end
#--------------------------------------------------------------------------
# alias Transform
#--------------------------------------------------------------------------
alias transform_dse transform unless $@
def transform(enemy_id)
transform_dse(enemy_id)
$game_system.monsters_encounter = {} if $game_system.monsters_encounter == nil
if $game_system.monsters_encounter[enemy_id] == nil
$game_system.monsters_encounter[enemy_id] = 0
end
$game_system.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_system.scan_spoil.push(enemy.id) unless $game_system.scan_spoil.include?(enemy.id)
end
if YE::MENU::MONSTER::DEATH_DROPS
$game_system.scan_drops.push(enemy.id) unless $game_system.scan_drops.include?(enemy.id)
end
$game_system.monsters_defeated = {} if $game_system.monsters_defeated == nil
if $game_system.monsters_defeated[enemy_id] == nil
$game_system.monsters_defeated[enemy_id] = 0
end
$game_system.monsters_defeated[enemy.id] += 1
end
end
#--------------------------------------------------------------------------
# alias Escape
#--------------------------------------------------------------------------
alias escape_dse escape unless $@
def escape
$game_system.monsters_escaped = {} if $game_system.monsters_escaped == nil
if $game_system.monsters_escaped[enemy_id] == nil
$game_system.monsters_escaped[enemy_id] = 0
end
$game_system.monsters_escaped[enemy.id] += 1
escape_dse
end
#--------------------------------------------------------------------------
# Encounter Details
#--------------------------------------------------------------------------
def encounters_dse
if $game_system.monsters_encounter[enemy.id] == nil
$game_system.monsters_encounter[enemy.id] = 0
end
return $game_system.monsters_encounter[enemy.id]
end
def defeated_dse
if $game_system.monsters_defeated[enemy.id] == nil
$game_system.monsters_defeated[enemy.id] = 0
end
return $game_system.monsters_defeated[enemy.id]
end
def escaped_dse
if $game_system.monsters_escaped[enemy.id] == nil
$game_system.monsters_escaped[enemy.id] = 0
end
return $game_system.monsters_escaped[enemy.id]
end
end # Game_Enemy
#===============================================================================
# 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
#===============================================================================
# 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)
@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)
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)
@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)
@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
dsearray = YE::MENU::MONSTER::BOSS_TYPES[@enemy.enemy.boss_type]
icon = dsearray[0]
draw_icon(icon, sw/2-12, y, true)
#--------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
Neon Knight- Mensagens : 15
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|