#==============================================================================
# Name [ EnemyVisualZoom ( 敌人视觉缩放 ) ]
# Apply To [ RPG Maker XP & RPG Maker VX & RPG Maker VX Ace ]
#------------------------------------------------------------------------------
# Author [ 忧雪の伤 ]
# Last Update [ 2012.1.25 ]
#------------------------------------------------------------------------------
# Link [ 66RPG Ideal Script Association ]
# => [url]http://rpg.blue/group-215-1.html[/url]
# Link [ OWL Authors' Protection Organization ]
# => [url]http://oapo.qzworld.net/index.html[/url]
#==============================================================================
#==============================================================================
# * Test Section
#==============================================================================
unless Module.constants.include? RUBY_VERSION == '1.9.2' ? :ISA : 'ISA'
message = "You'd better use that script over this."
method(RUBY_VERSION == '1.9.2' ? :msgbox : :p)[message]
`start [url]http://rpg.blue/thread-181551-1-1.html`[/url]
end
#==============================================================================
# * Registered Section
#==============================================================================
$imported['EnemyVisualZoom'] = '2012.1.25'
#==============================================================================
# * Running Section
#==============================================================================
module ISA::EnemyVisualZoom
#--------------------------------------------------------------------------
# * Setup Section
#--------------------------------------------------------------------------
# Default : 默认功能开关 ( true or false )
#--------------------------------------------------------------------------
Default = true
end
Game_Troop.class_eval {
next unless ISA::Edition.equal? :xp
alias isa_setup_for_enemy_visual_zoom setup
def setup *args
isa_setup_for_enemy_visual_zoom *args
@troop_id = args[0] if defined?(@troop_id).nil?
nil
end
}
class RPG::Troop
alias isa_name_for_enemy_visual_zoom name unless $@
def name *args
regexp = ISA::EnemyVisualZoom::Regexp
isa_name_for_enemy_visual_zoom(*args).sub regexp, ''
end
end
class Sprite_Battler
alias isa_update_for_enemy_visual_zoom update
def update *args
isa_update_for_enemy_visual_zoom *args
return unless battler.is_a? Game_Enemy
if defined?(@isa_first_update_for_enemy_visual_zoom).nil?
return @isa_first_update_for_enemy_visual_zoom = nil
end
regexp = /<visual zoom\((true|false)\)>/
troop_id = $game_troop.instance_variable_get :@troop_id
$data_troops[troop_id].isa_name_for_enemy_visual_zoom[regexp]
return unless $1.nil? ? ISA::EnemyVisualZoom::Default : eval($1)
screen_height = ISA::Edition.equal?(:xp) ? 480 : Graphics.height
scene = ISA::Edition.equal?(:va) ? SceneManager.scene : $scene
# 0 0
# window_height = scene.instance_variable_get(:@status_window).height
window_height = 280
self.zoom_x = self.zoom_y = window_height.to_f / (screen_height - self.y)
nil
end
end