Project1

标题: EnemyVisualZoom ( 敌人视觉缩放 ) [2012.2.3] [打印本页]

作者: 忧雪の伤    时间: 2012-1-25 20:51
标题: EnemyVisualZoom ( 敌人视觉缩放 ) [2012.2.3]
本帖最后由 忧雪の伤 于 2012-8-2 16:14 编辑
  1. #==============================================================================
  2. #  Name [ EnemyVisualZoom ( 敌人视觉缩放 ) ]
  3. #  Apply To [ RPG Maker XP & RPG Maker VX & RPG Maker VX Ace ]
  4. #------------------------------------------------------------------------------
  5. #  Author [ 忧雪の伤 ]
  6. #  Last Update [ 2012.2.3 ]
  7. #------------------------------------------------------------------------------
  8. #  Link [ 66RPG Ideal Script Association ]
  9. #  => http://rpg.blue/group-215-1.html
  10. #  Link [ OWL Authors' Protection Organization ]
  11. #  => http://oapo.qzworld.net/index.html
  12. #==============================================================================

  13. #==============================================================================
  14. # * Test Section
  15. #==============================================================================

  16. unless Module.constants.include? RUBY_VERSION == '1.9.2' ? :ISA : 'ISA'
  17.   message = "You need to add that script over this."
  18.   method(RUBY_VERSION == '1.9.2' ? :msgbox : :p)[message]
  19.   `start http://rpg.blue/thread-181551-1-1.html`
  20. end

  21. #==============================================================================
  22. # * Registered Section
  23. #==============================================================================

  24. $imported['EnemyVisualZoom'] = '2012.2.3'

  25. #==============================================================================
  26. # * Running Section
  27. #==============================================================================

  28. module ISA::EnemyVisualZoom
  29.   #--------------------------------------------------------------------------
  30.   # * Setup Section
  31.   #--------------------------------------------------------------------------
  32.   #    Default : 默认功能开关 ( true or false )
  33.   #--------------------------------------------------------------------------
  34.   Default = true
  35. end

  36. Game_Troop.class_eval {
  37.   next unless ISA::Edition.equal? :xp
  38.   alias isa_setup_for_enemy_visual_zoom setup
  39.   def setup *args
  40.     isa_setup_for_enemy_visual_zoom *args
  41.     @troop_id = args[0] if defined?(@troop_id).nil?
  42.     nil
  43.   end
  44. }

  45. class RPG::Troop
  46.   alias isa_name_for_enemy_visual_zoom name unless $@
  47.   def name *args
  48.     regexp = ISA::EnemyVisualZoom::Regexp
  49.     isa_name_for_enemy_visual_zoom(*args).sub regexp, ''
  50.   end
  51. end

  52. class Sprite_Battler
  53.   alias isa_update_for_enemy_visual_zoom update
  54.   def update *args
  55.     isa_update_for_enemy_visual_zoom *args
  56.     return unless battler.is_a? Game_Enemy
  57.     if defined?(@isa_first_update_for_enemy_visual_zoom).nil?
  58.       return @isa_first_update_for_enemy_visual_zoom = nil
  59.     end
  60.     regexp = /<visual zoom\((true|false)\)>/
  61.     troop_id = $game_troop.instance_variable_get :@troop_id
  62.     $data_troops[troop_id].isa_name_for_enemy_visual_zoom[regexp]
  63.     return unless $1.nil? ? ISA::EnemyVisualZoom::Default : eval($1)
  64.     screen_height = ISA::Edition.equal?(:xp) ? 480 : Graphics.height
  65.     scene = ISA::Edition.equal?(:va) ? SceneManager.scene : $scene
  66.     window_height = scene.instance_variable_get(:@status_window).height rescue 0
  67.     self.zoom_x = self.zoom_y = window_height.to_f / (screen_height - y)
  68.     nil
  69.   end
  70. end
复制代码

作者: 时光机    时间: 2012-4-29 23:28
英文+无注释各种压力啊orz
作者: 盖亚    时间: 2013-5-31 20:44
不错~= =




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1