查看: 1943|回复: 4

[已经解决] 光标脚本与sideview冲突

[复制链接]
梦石
0
星屑
1143
在线时间
186 小时
注册时间
2017-8-2
回帖
1
发表于 2019-10-24 18:46:24 | 显示全部楼层 |阅读模式
悬赏200星屑已解决
https://atelierrgss.wordpress.com/rgss3-battle-cursor/

先附上光标脚本的网址

问题是这样的,只要技能的目标是『自己』的时候,
就会卡在sideview特技待机的动画那里。
而技能的对象是『一个队员』的时候,
连光标都不会出现,
有什么方法能解决吗?

拜托各位大哥了

最佳答案

查看完整内容

396行跟397行,可以尝试一下加减数值
梦石
0
星屑
9968
在线时间
1649 小时
注册时间
2012-6-6
回帖
306
发表于 2019-10-24 18:46:25 | 显示全部楼层
fish12358 发表于 2019-10-25 18:06
昨天自己摸索了以后发现,只要把 On Skill OK跟 On Item OK这两段删了以后,对自己施放技能时就不会出错 ...

396行跟397行,可以尝试一下加减数值
回复

使用道具 举报

梦石
0
星屑
9968
在线时间
1649 小时
注册时间
2012-6-6
回帖
306
发表于 2019-10-25 09:16:37 | 显示全部楼层
把这放到Sideview下面试试看吧,不行的话那就没办法
  1. $imported = {} if $imported.nil?
  2. $imported[:mog_battle_cursor] = true

  3. #==============================================================================
  4. # ■ CURSOR SETTING
  5. #==============================================================================
  6. module MOG_BATTLE_CURSOR
  7.   #相对于目标的指针位置.
  8.   CURSOR_POSITION = [0, 48]
  9.   #目标名的位置.
  10.   CURSOR_NAME_POSITION = [-10, 46]
  11.   #指针是否左右滑动.
  12.   CURSOR_SLIDE_EFFECT = true
  13.   #指针是否上下浮动.
  14.   CURSOR_FLOAT_EFFECT = true
  15.   #指针的Z坐标.
  16.   CURSOR_Z = 155
  17.   #第二个指针的相对于目标的位置.
  18.   TARGET_CURSOR_2_POS = [0, 0]
  19.   #第二个指针是否有缩放效果.
  20.   TARGET_CURSOR_2_ZOOM_EFFECT = false
  21. end

  22. #==============================================================================
  23. # ■ Game Temp
  24. #==============================================================================
  25. class Game_Temp
  26.   
  27.   attr_accessor :battle_cursor
  28.   attr_accessor :battle_cursor_data
  29.   attr_accessor :target_skill
  30.   attr_accessor :battle_end
  31.   attr_accessor :sprite_visible
  32.   attr_accessor :battle_cursor_need_refresh
  33.   attr_accessor :battle_cursor_scope_refresh
  34.   attr_accessor :battle_cursor_target
  35.   attr_accessor :target_data
  36.   attr_accessor :target_cursor_need_refresh
  37.   attr_accessor :target_window_active
  38.   #--------------------------------------------------------------------------
  39.   # ● Initialize
  40.   #--------------------------------------------------------------------------  
  41.   alias mog_battle_cursor_initialize initialize
  42.   def initialize
  43.       @battle_cursor = [0,0,false,""] ; @target_skill = [] ; @battle_end = false
  44.       @battle_cursor_need_refresh = [false,false] ; @battle_cursor_target = [nil,nil]
  45.       @target_data = [nil,nil] ; @target_cursor_need_refresh = false
  46.       @target_window_active = [false,false] ; @battle_cursor_scope_refresh = false
  47.       mog_battle_cursor_initialize
  48.   end  
  49.   
  50.   #--------------------------------------------------------------------------
  51.   # ● Clear Target Temp
  52.   #--------------------------------------------------------------------------   
  53.   def clear_target_temp
  54.       $game_party.members.each {|t| t.target_temp = false } rescue nil
  55.       $game_troop.members.each {|t| t.target_temp = false } rescue nil   
  56.       @target_data = [nil,nil] ; @battle_cursor_target = [nil,nil]
  57.   end
  58.    
  59.   #--------------------------------------------------------------------------
  60.   # ● Sprite Visible
  61.   #--------------------------------------------------------------------------   
  62.   def sprite_visible
  63.       return false if $game_message.visible
  64.       return false if $game_temp.battle_end
  65.       return true
  66.   end
  67.   
  68. end

  69. #==============================================================================
  70. # ■ Spriteset Battle Cursor
  71. #==============================================================================
  72. class Sprite_Battle_Cursor < Sprite
  73.   include MOG_BATTLE_CURSOR
  74.   
  75.   #--------------------------------------------------------------------------
  76.   # ● Initialize
  77.   #--------------------------------------------------------------------------        
  78.   def initialize(viewport = nil)
  79.       super(viewport)
  80.       $game_temp.battle_cursor = [0,0,false,""] ; $game_temp.battle_end = false
  81.       self.bitmap = Cache.system("Battle_Cursor")
  82.       self.visible = $game_temp.battle_cursor[2] ; self.z = CURSOR_Z
  83.       @cw = self.bitmap.width / 2 ; @ch = [self.bitmap.height, Graphics.height - self.bitmap.height]
  84.       @cursor_name = Sprite.new ; @cursor_name.bitmap = Bitmap.new(120,32)
  85.       @cursor_name.z = self.z + 1 ; @cursor_name.bitmap.font.size = 16
  86.       @cursor_name_enemy = $game_temp.battle_cursor[3] ; @cs_x = 0
  87.       @cursor_name_position = [CURSOR_NAME_POSITION[0] ,CURSOR_NAME_POSITION[1]]
  88.       @cursor_float = [0,0] ;  refresh_cursor_name
  89.       @face_battler = SceneManager.face_battler? if $imported[:mog_battle_hud_ex]
  90.       @cs_x = (15 * MOG_SPRITE_ACTOR::SPRITE_ZOOM).truncate if $imported[:mog_sprite_actor]  
  91.   end

  92.   #--------------------------------------------------------------------------
  93.   # ● Dispose Sprite
  94.   #--------------------------------------------------------------------------         
  95.   def dispose
  96.       super
  97.       dispose_sprite_cursor
  98.   end
  99.   
  100.   #--------------------------------------------------------------------------
  101.   # ● Dispose Sprite Cursor
  102.   #--------------------------------------------------------------------------            
  103.   def dispose_sprite_cursor
  104.       @cursor_name.bitmap.dispose ; @cursor_name.dispose
  105.       self.bitmap.dispose ; $game_temp.clear_target_temp
  106.   end

  107.   #--------------------------------------------------------------------------
  108.   # ● Refresh Cursor Name
  109.   #--------------------------------------------------------------------------              
  110.   def refresh_cursor_name
  111.       @cursor_name_enemy = $game_temp.battle_cursor[3]
  112.       @cursor_name.bitmap.clear
  113.       @cursor_name.bitmap.draw_text(0,0,120,32,@cursor_name_enemy.to_s,1)
  114.   end

  115.   #--------------------------------------------------------------------------
  116.   # ● Update Sprite Cursor
  117.   #--------------------------------------------------------------------------              
  118.   def update_sprite_cursor
  119.       update_battle_camera_cursor if update_battle_cursor_r?
  120.       if force_hide? ; self.visible = false ; @cursor_name.visible = false ; return ; end
  121.       update_visible ; update_cursor_float_effect ; set_real_position
  122.       execute_move(0,self.x,$game_temp.battle_cursor[0])
  123.       execute_move(1,self.y,$game_temp.battle_cursor[1] + @cursor_float[1])
  124.       update_sprite_name
  125.       self.visible = false if !$game_temp.sprite_visible
  126.       @cursor_name.opacity = 0 if @cursor_name and !$game_temp.sprite_visible
  127.   end
  128.   
  129.   #--------------------------------------------------------------------------
  130.   # ● Process Cursor Move
  131.   #--------------------------------------------------------------------------
  132.   def process_cursor_move
  133.       return unless cursor_movable?
  134.       last_index = @index
  135.       cursor_move_index(1) if Input.repeat?(:DOWN)
  136.       cursor_move_index(-1) if Input.repeat?(:UP)
  137.       cursor_move_index(1) if Input.repeat?(:RIGHT)
  138.       cursor_move_index(-1) if Input.repeat?(:LEFT)
  139.       $game_temp.battle_cursor_data = $game_troop.alive_members[@index]
  140.       Sound.play_cursor if @index != last_index
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● Update Battle Cursor
  144.   #--------------------------------------------------------------------------              
  145.   def update_battle_cursor_r?
  146.       return false if $imported[:mog_battle_camera] == nil
  147.       if $imported[:mog_battle_hud_ex] and SceneManager.face_battler? and $game_temp.battle_cursor_target[0] != nil
  148.          self.ox = 0 ; self.oy = 0 ; @cursor_name.ox = 0 ; @cursor_name.oy = 0
  149.          return false
  150.       end   
  151.       return true
  152.    end   
  153.       
  154.   #--------------------------------------------------------------------------
  155.   # ● Update Battle Camera Cursor
  156.   #--------------------------------------------------------------------------              
  157.   def update_battle_camera_cursor
  158.       self.ox = $game_temp.viewport_oxy[0]
  159.       self.oy = $game_temp.viewport_oxy[1]
  160.       @cursor_name.ox = self.ox
  161.       @cursor_name.oy = self.oy
  162.   end

  163.   #--------------------------------------------------------------------------
  164.   # ● Set Real Position
  165.   #--------------------------------------------------------------------------              
  166.   def set_real_position  
  167.       return if $game_temp.target_data == [nil,nil]
  168.       return if $game_temp.battle_cursor_target == [nil,nil]
  169.       $game_temp.battle_cursor[0] = $game_temp.target_data[1].x - @cw + CURSOR_POSITION[0]
  170.       $game_temp.battle_cursor[1] = $game_temp.target_data[1].y + CURSOR_POSITION[1]
  171.       $game_temp.battle_cursor[1] -= ($game_temp.target_data[1].bitmap.height / 2) unless !$game_temp.target_data[1].bitmap
  172.       if $game_temp.target_data[0].is_a?(Game_Actor)
  173.          if $imported[:mog_sprite_actor] and $game_temp.target_data[0].dead?
  174.             if $game_temp.target_data[0].bact_sprite[5] == 6
  175.                $game_temp.battle_cursor[0] -= @cs_x
  176.             else
  177.                $game_temp.battle_cursor[0] += @cs_x
  178.             end   
  179.          end         
  180.          $game_temp.battle_cursor[1] -= @ch[0] if @face_battler and $game_temp.battle_cursor[1] > @ch[1]
  181.       end      
  182.   end
  183.    
  184.   #--------------------------------------------------------------------------
  185.   # ● Can Move Real Position?
  186.   #--------------------------------------------------------------------------               
  187.   def can_move_real_position?
  188.       return false if $game_temp.battle_cursor_data == nil
  189.       return false if $game_temp.battle_cursor_data.dead?
  190.       screen_x = $game_temp.battle_cursor_data.screen_x rescue nil
  191.       return false if screen_x == nil
  192.       return true
  193.   end   
  194.       
  195.   #--------------------------------------------------------------------------
  196.   # ● Force Hide
  197.   #--------------------------------------------------------------------------              
  198.   def force_hide?
  199.       return true if $game_temp.battle_cursor == nil
  200.       return true if $game_temp.battle_cursor[0] == nil
  201.       return true if $game_temp.battle_cursor[1] == nil   
  202.       return false
  203.   end
  204.   
  205.   #--------------------------------------------------------------------------
  206.   # ● Update Visible
  207.   #--------------------------------------------------------------------------               
  208.   def update_visible
  209.       $game_temp.battle_cursor_data = nil if !self.visible
  210.       if force_hide_battle_cursor?
  211.          self.visible = false ; return
  212.       end  
  213.       self.visible = $game_temp.battle_cursor[2]
  214.       (self.x = -64 ; self.y = -64) if !self.visible
  215.   end  
  216.   
  217.   #--------------------------------------------------------------------------
  218.   # ● Force Hide Battle Cursor
  219.   #--------------------------------------------------------------------------               
  220.   def force_hide_battle_cursor?
  221.       if $imported[:mog_sprite_actor] and !$game_temp.target_data.nil?
  222.          return true if !$game_temp.target_data[0].bact_sprite_visiblle
  223.       end  
  224.       return true if $imported[:mog_active_chain] and $game_temp.chain_action_phase
  225.       return true if $imported[:mog_atb_system] and BattleManager.actor == nil
  226. #      return true if $imported[:mog_blitz_commands] and $game_temp.blitz_commands_phase
  227.       return false
  228.   end
  229.   
  230.   #--------------------------------------------------------------------------
  231.   # ● Update Sprite Name
  232.   #--------------------------------------------------------------------------               
  233.   def update_sprite_name
  234.       return if @cursor_name == nil
  235.       refresh_cursor_name  if @cursor_name_enemy != $game_temp.battle_cursor[3]
  236.       @cursor_name.x = self.x + @cursor_name_position[0]
  237.       @cursor_name.y = self.y + @cursor_name_position[1]
  238.       @cursor_name.opacity = self.opacity ; @cursor_name.visible = self.visible
  239.   end  
  240.   
  241.   #--------------------------------------------------------------------------
  242.   # ● Update Cursor Float Effect
  243.   #--------------------------------------------------------------------------              
  244.   def update_cursor_float_effect
  245.       return if !CURSOR_FLOAT_EFFECT
  246.       @cursor_float[0] += 1
  247.       case @cursor_float[0]
  248.         when 0..20  ; @cursor_float[1] += 1
  249.         when 21..40 ; @cursor_float[1] -= 1
  250.         else
  251.           @cursor_float[0] = 0 ;   @cursor_float[1] = 0
  252.       end        
  253.   end  
  254.   
  255.   #--------------------------------------------------------------------------
  256.   # ● Execute Move
  257.   #--------------------------------------------------------------------------      
  258.   def execute_move(type,cp,np)
  259.       sp = 5 + ((cp - np).abs / 5)
  260.       if cp > np
  261.          cp -= sp ; cp = np if cp < np
  262.       elsif cp < np
  263.          cp += sp ; cp = np if cp > np
  264.       end     
  265.        self.x = cp if type == 0 ; self.y = cp if type == 1
  266.   end      
  267.   
  268. end

  269. #==============================================================================
  270. # ■ Spriteset Battle
  271. #==============================================================================
  272. class Spriteset_Battle
  273.   
  274.   #--------------------------------------------------------------------------
  275.   # ● Initialize
  276.   #--------------------------------------------------------------------------      
  277.   alias mog_battle_cursor_initialize initialize
  278.   def initialize
  279.       mog_battle_cursor_initialize
  280.       create_cursor
  281.   end
  282.   
  283.   #--------------------------------------------------------------------------
  284.   # ● Dispose
  285.   #--------------------------------------------------------------------------      
  286.   alias mog_battle_cursor_dispose dispose
  287.   def dispose
  288.       mog_battle_cursor_dispose
  289.       dispose_battle_cursor
  290.   end
  291.   
  292.   #--------------------------------------------------------------------------
  293.   # ● Update
  294.   #--------------------------------------------------------------------------         
  295.   alias mog_battle_cursor_update update
  296.   def update
  297.       mog_battle_cursor_update
  298.       update_battle_cursor
  299.   end  
  300.   
  301.   #--------------------------------------------------------------------------
  302.   # ● Create_Cursor
  303.   #--------------------------------------------------------------------------        
  304.   def create_cursor
  305.       return if @battle_cursor != nil
  306.       $game_temp.clear_target_temp ; @battle_cursor = Sprite_Battle_Cursor.new
  307.   end
  308.   
  309.   #--------------------------------------------------------------------------
  310.   # ● Dispose Cursor
  311.   #--------------------------------------------------------------------------        
  312.   def dispose_battle_cursor
  313.       return if @battle_cursor == nil
  314.       @battle_cursor.dispose ; @battle_cursor = nil
  315.   end  
  316.   
  317.   #--------------------------------------------------------------------------
  318.   # ● Update Battle Cursor
  319.   #--------------------------------------------------------------------------         
  320.   def update_battle_cursor
  321.       return if @battle_cursor == nil
  322.       @battle_cursor.update_sprite_cursor
  323.   end
  324.   
  325. end

  326. #==============================================================================
  327. # ■ Battle Cursor Index
  328. #==============================================================================
  329. module Battle_Cursor_index
  330.   
  331.   include MOG_BATTLE_CURSOR
  332.   
  333.   #--------------------------------------------------------------------------
  334.   # ● Check Index Limit
  335.   #--------------------------------------------------------------------------      
  336.   def check_index_limit
  337.       self.index = 0 if self.index >= item_max
  338.       self.index = (item_max - 1) if self.index < 0
  339.   end      
  340.   
  341.   #--------------------------------------------------------------------------
  342.   # ● Set Cursor Position Enemy
  343.   #--------------------------------------------------------------------------   
  344.   def set_cursor_position_enemy
  345.       return if !self.active
  346.       self.index = 0 if $game_troop.alive_members[self.index].nil?
  347.       @fcursor = nil ; $game_temp.battle_cursor_need_refresh[1] = false
  348.       $game_temp.battle_cursor[0] = $game_troop.alive_members[self.index].screen_x + CURSOR_POSITION[0] rescue nil
  349.       $game_temp.battle_cursor[1] = $game_troop.alive_members[self.index].screen_y + CURSOR_POSITION[1] rescue nil
  350.       $game_temp.battle_cursor[3] = $game_troop.alive_members[self.index].name rescue nil
  351.       $game_temp.battle_cursor_data = $game_troop.alive_members[self.index]
  352.       return if $game_temp.battle_cursor_data == nil
  353.       enable_target_sprites($game_temp.battle_cursor_data.index)
  354.   end

  355.   #--------------------------------------------------------------------------
  356.   # ● Enable Target Sprites
  357.   #--------------------------------------------------------------------------   
  358.   def enable_target_sprites(target_index)  
  359.       return if $game_temp.target_skill.empty?
  360.       if $imported[:mog_atb_system] and !BattleManager.subject.nil?
  361.          $game_temp.battle_cursor_scope_refresh = true
  362.       end   
  363.       $game_temp.clear_target_temp ; battler = $game_temp.target_skill[1]
  364.       type = $game_temp.target_skill[0].is_a?(RPG::Skill) ? 0 : 1
  365.       target_index = $game_temp.battle_cursor_data.index
  366.       battler.make_action_temp($game_temp.target_skill[0].id, target_index,type)      
  367.       targets = battler.action_temp.make_targets.compact
  368.       targets.each {|t| t.target_temp = true }
  369.   end  
  370.    
  371.   #--------------------------------------------------------------------------
  372.   # ● Refresh Scope Targets
  373.   #--------------------------------------------------------------------------   
  374.   def refresh_scope_targets
  375.       targets = battler.action_temp.make_targets.compact
  376.       targets.each {|t| t.target_temp = true }
  377.   end
  378.   
  379.   #--------------------------------------------------------------------------
  380.   # ● Set Cursor Position Actor
  381.   #--------------------------------------------------------------------------   
  382.   def set_cursor_position_actor
  383.       return if !self.active
  384.       self.index = 0 if $game_party.members[self.index].nil?
  385.       @fcursor = nil ; $game_temp.battle_cursor_need_refresh[0] = false
  386.       $game_temp.battle_cursor[0] = $game_party.members[self.index].sv.x + CURSOR_POSITION[0] rescue nil#screen_x + CURSOR_POSITION[0] rescue nil
  387.       $game_temp.battle_cursor[1] = $game_party.members[self.index].sv.y + CURSOR_POSITION[1] rescue nil#screen_y + CURSOR_POSITION[1] rescue nil
  388.       $game_temp.battle_cursor[3] = $game_party.members[self.index].name rescue nil
  389.       $game_temp.battle_cursor_data = $game_party.members[self.index]
  390.       $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil
  391.       enable_target_sprites(self.index)
  392.   end  
  393.       
  394.   #--------------------------------------------------------------------------
  395.   # ● Process Cursor Move Index
  396.   #--------------------------------------------------------------------------  
  397.   def cursor_move_index(value = 0)
  398.       self.index += value ;  check_index_limit
  399.   end

  400. end

  401. #==============================================================================
  402. # ■ Window_BattleActor
  403. #==============================================================================
  404. class Window_BattleActor < Window_BattleStatus
  405.   include Battle_Cursor_index
  406.   
  407.   #--------------------------------------------------------------------------
  408.   # ● Update
  409.   #--------------------------------------------------------------------------  
  410.   alias mog_battle_cursor_actor_update update
  411.   def update
  412.       pre_index = self.index
  413.       mog_battle_cursor_actor_update
  414.       $game_temp.battle_cursor_target[0] = $game_party.members[self.index]
  415.       $game_temp.battle_cursor_target[0] = nil if !self.active      
  416.       set_cursor_position_actor if refresh_cursor_position?(pre_index)
  417.       $game_temp.target_window_active[0] = self.active
  418.   end
  419.   
  420.   #--------------------------------------------------------------------------
  421.   # ● Refresh Cursor Position
  422.   #--------------------------------------------------------------------------  
  423.   def refresh_cursor_position?(pre_index)
  424.       return true if pre_index != self.index
  425.       return true if @fcursor
  426.       return true if $game_temp.battle_cursor_need_refresh[0]
  427.       return false
  428.   end

  429.   #--------------------------------------------------------------------------
  430.   # ● Show
  431.   #--------------------------------------------------------------------------
  432.   alias mog_battle_cursor_show show
  433.   def show
  434.       if @info_viewport
  435.          set_cursor_position_actor ; $game_temp.battle_cursor[2] = true
  436.          @fcursor = true
  437.       end
  438.       mog_battle_cursor_show
  439.   end

  440.   #--------------------------------------------------------------------------
  441.   # ● Hide
  442.   #--------------------------------------------------------------------------
  443.   alias mog_battle_cursor_hide hide
  444.   def hide
  445.       $game_temp.battle_cursor[2] = false if @info_viewport
  446.       if $game_temp.target_window_active[1] == false
  447.          ($game_temp.clear_target_temp ; $game_temp.target_skill.clear) unless self.active
  448.       end
  449.       mog_battle_cursor_hide
  450.   end  
  451.   
  452.   #--------------------------------------------------------------------------
  453.   # ● Process Cursor Move
  454.   #--------------------------------------------------------------------------
  455.   def process_cursor_move
  456.       return unless cursor_movable?
  457.       last_index = @index
  458.       cursor_move_index(1) if Input.repeat?(:DOWN)
  459.       cursor_move_index(-1) if Input.repeat?(:UP)
  460.       cursor_move_index(1) if Input.repeat?(:RIGHT)
  461.       cursor_move_index(-1) if Input.repeat?(:LEFT)
  462.       $game_temp.battle_cursor_data = $game_party.members[self.index]
  463.       Sound.play_cursor if @index != last_index
  464.   end
  465.   
  466. end

  467. #==============================================================================
  468. # ■ Game Enemy
  469. #==============================================================================
  470. class Game_Enemy < Game_Battler
  471.   attr_accessor :index
  472. end

  473. #==============================================================================
  474. # ■ Game Troop
  475. #==============================================================================
  476. class Game_Troop < Game_Unit
  477.    
  478.   #--------------------------------------------------------------------------
  479.   # * Setup
  480.   #--------------------------------------------------------------------------
  481.   alias mog_battle_cursor_setup setup
  482.   def setup(troop_id)
  483.       mog_battle_cursor_setup(troop_id)
  484.       if can_sort_index?
  485.          @enemies.sort! {|a,b| a.screen_x <=> b.screen_x}
  486.          @enemies.each_with_index {|e, i| e.index = i }
  487.       end
  488.   end
  489.   
  490.   #--------------------------------------------------------------------------
  491.   # * Can Sort Index?
  492.   #--------------------------------------------------------------------------
  493.   def can_sort_index?
  494.       return false if @enemies.size < 3
  495.       return false if troop.pages.size > 1
  496.       return false if !troop.pages[0].list[0].parameters.empty? rescue false
  497.       return true
  498.   end
  499.   
  500. end

  501. #==============================================================================
  502. # ■ Window_BattleEnemy
  503. #==============================================================================
  504. class Window_BattleEnemy < Window_Selectable
  505.   include Battle_Cursor_index
  506.   
  507.   #--------------------------------------------------------------------------
  508.   # ● Update
  509.   #--------------------------------------------------------------------------  
  510.   alias mog_battle_cursor_enemy_update update
  511.   def update
  512.       pre_index = self.index
  513.       mog_battle_cursor_enemy_update
  514.       $game_temp.battle_cursor_target[1] = $game_troop.alive_members[self.index]
  515.       $game_temp.battle_cursor_target[1] = nil if !self.active
  516.       set_cursor_position_enemy if refresh_cursor_position?(pre_index)
  517.       $game_temp.target_window_active[1] = self.active
  518.   end
  519.   
  520.   #--------------------------------------------------------------------------
  521.   # ● Refresh Cursor Position
  522.   #--------------------------------------------------------------------------  
  523.   def refresh_cursor_position?(pre_index)
  524.       return true if pre_index != self.index
  525.       return true if @fcursor
  526.       return true if $game_temp.battle_cursor_need_refresh[1]
  527.       return false
  528.   end   
  529.       
  530.   #--------------------------------------------------------------------------
  531.   # ● Show
  532.   #--------------------------------------------------------------------------
  533.   alias mog_battle_cursor_show show
  534.   def show
  535.       if @info_viewport
  536.          set_cursor_position_enemy ; $game_temp.battle_cursor[2] = true
  537.          @fcursor = true
  538.       end
  539.       mog_battle_cursor_show
  540.   end
  541.   
  542.   #--------------------------------------------------------------------------
  543.   # ● Hide
  544.   #--------------------------------------------------------------------------
  545.   alias mog_battle_cursor_hide hide
  546.   def hide
  547.       $game_temp.battle_cursor[2] = false if @info_viewport
  548.       if $game_temp.target_window_active[0] == false
  549.       ($game_temp.clear_target_temp ; $game_temp.target_skill.clear) unless self.active
  550.       end
  551.       mog_battle_cursor_hide
  552.   end  
  553.    
  554.   #--------------------------------------------------------------------------
  555.   # ● Process Cursor Move
  556.   #--------------------------------------------------------------------------
  557.   def process_cursor_move
  558.       return unless cursor_movable?
  559.       last_index = @index
  560.       cursor_move_index(1) if Input.repeat?(:DOWN)
  561.       cursor_move_index(-1) if Input.repeat?(:UP)
  562.       cursor_move_index(1) if Input.repeat?(:RIGHT)
  563.       cursor_move_index(-1) if Input.repeat?(:LEFT)
  564.       $game_temp.battle_cursor_data = $game_troop.alive_members[@index]
  565.       Sound.play_cursor if @index != last_index
  566.   end
  567.       
  568. end

  569. #==============================================================================
  570. # ■ Window Selectable
  571. #==============================================================================
  572. class Window_Selectable < Window_Base  

  573.   #--------------------------------------------------------------------------
  574.   # * Process OK
  575.   #-------------------------------------------------------------------------
  576.   alias mog_target_cursor_process_ok process_ok
  577.   def process_ok
  578.       mog_target_cursor_process_ok
  579.       execute_target_selection if can_execute_target_selection?
  580.   end
  581.   
  582.   #--------------------------------------------------------------------------
  583.   # * Can Execute Target Selection
  584.   #-------------------------------------------------------------------------
  585.   def can_execute_target_selection?
  586.       return false if !SceneManager.scene_is?(Scene_Battle)
  587.       return false if !current_item_enabled?
  588.       return true if self.is_a?(Window_BattleSkill)
  589.       return true if self.is_a?(Window_BattleItem)
  590.       return true if self.is_a?(Window_ActorCommand) and self.index == 0
  591.       return false
  592.   end

  593.   #--------------------------------------------------------------------------
  594.   # * Execute Target Selection
  595.   #-------------------------------------------------------------------------
  596.   def execute_target_selection      
  597.       return if BattleManager.actor == nil
  598.       $game_temp.target_skill.clear
  599.       item = @data[index] rescue nil      
  600.       item = $data_skills[BattleManager.actor.attack_skill_id] rescue nil if self.is_a?(Window_ActorCommand)
  601.       return if item == nil
  602.       if [2,8,10].include?(item.scope) or item.note =~ /<Scope Range = (\d+) - (\d+) - (\d+) - (\d+)>/   
  603.          $game_temp.target_skill = [item,BattleManager.actor]
  604.       end   
  605.   end  

  606. end

  607. #==============================================================================
  608. # ■ Game Battler
  609. #==============================================================================
  610. class Game_Battler < Game_BattlerBase
  611.   
  612.   attr_accessor :target_temp
  613.   attr_accessor :action_temp
  614.   
  615.   #--------------------------------------------------------------------------
  616.   # * Initialize
  617.   #--------------------------------------------------------------------------
  618.   alias mog_target_cursor_initialize initialize
  619.   def initialize
  620.       @target_cursor_temp = false
  621.       mog_target_cursor_initialize
  622.   end
  623.   
  624.   #--------------------------------------------------------------------------
  625.   # ● Make Action Temp
  626.   #--------------------------------------------------------------------------
  627.   def make_action_temp(action_id,target_index,type)
  628.       return if action_id == nil
  629.       action = Game_Action.new(self, true)
  630.       action.set_skill(action_id) if type == 0
  631.       action.set_item(action_id) if type == 1
  632.       action.target_index = target_index
  633.       @action_temp = action
  634.   end     
  635.   
  636.   #--------------------------------------------------------------------------
  637.   # ● Make Action Temp
  638.   #--------------------------------------------------------------------------
  639.   alias mog_battle_cursor_item_apply item_apply
  640.   def item_apply(user, item)
  641.       mog_battle_cursor_item_apply(user, item)
  642.       if self == $game_temp.battle_cursor_target[1]
  643.          $game_temp.battle_cursor_need_refresh[0] = true
  644.          $game_temp.battle_cursor_need_refresh[1] = true
  645.       end
  646.   end  
  647.   
  648. end

  649. #==============================================================================
  650. # ■ Game BattlerBase
  651. #==============================================================================
  652. class Game_BattlerBase
  653.    attr_accessor :hidden
  654. end

  655. #==============================================================================
  656. # ■ Sprite Battler
  657. #==============================================================================
  658. class Sprite_Battler < Sprite_Base
  659.   include MOG_BATTLE_CURSOR
  660.   #--------------------------------------------------------------------------
  661.   # * Initialize
  662.   #--------------------------------------------------------------------------
  663.   alias mog_target_cursor_initialize initialize
  664.   def initialize(viewport, battler = nil)
  665.       mog_target_cursor_initialize(viewport, battler)
  666.       create_target_cursor
  667.   end
  668.   
  669.   #--------------------------------------------------------------------------
  670.   # * Create Target Cursor
  671.   #--------------------------------------------------------------------------
  672.   def create_target_cursor
  673.       @target_cursor = Sprite.new
  674.       @target_cursor.bitmap = Cache.system("Battle_Cursor2")
  675.       @target_cursor.ox = @target_cursor.bitmap.width / 2
  676.       @target_cursor.oy = @target_cursor.bitmap.height / 2
  677.       @target_cursor_org = [@target_cursor.ox,@target_cursor.oy]
  678.       @target_cursor.visible = false
  679.       @target_visible_old = @target_cursor.visible
  680.       @tc_pos = [TARGET_CURSOR_2_POS[0],TARGET_CURSOR_2_POS[1] + @target_cursor.oy]
  681.       @face_battler = SceneManager.face_battler? if $imported[:mog_battle_hud_ex]
  682.       @target_cursor_ch = [@target_cursor.bitmap.height, Graphics.height - @target_cursor.bitmap.height]
  683.   end
  684.   
  685.   #--------------------------------------------------------------------------
  686.   # * Dispose
  687.   #--------------------------------------------------------------------------
  688.   alias mog_target_cursor_dispose dispose
  689.   def dispose
  690.       dispose_target_cursor
  691.       mog_target_cursor_dispose
  692.   end
  693.   
  694.   #--------------------------------------------------------------------------
  695.   # * Dispose Target Cursor
  696.   #--------------------------------------------------------------------------
  697.   def dispose_target_cursor
  698.       return if @target_cursor == nil
  699.       @target_cursor.bitmap.dispose ; @target_cursor.dispose
  700.   end
  701.   
  702.   #--------------------------------------------------------------------------
  703.   # * Update Postion
  704.   #--------------------------------------------------------------------------
  705.   alias mog_target_cursor_update_position update_position
  706.   def update_position
  707.       mog_target_cursor_update_position
  708.       update_battler_cursor_xy
  709.       update_target_cursor
  710.   end
  711.   
  712.   #--------------------------------------------------------------------------
  713.   # * Update Battler Cursor
  714.   #--------------------------------------------------------------------------
  715.   def update_battler_cursor_xy
  716.       return if @battler == nil
  717.       return if $game_temp.battle_cursor_target[0] != nil and @battler != $game_temp.battle_cursor_target[0]
  718.       return if $game_temp.battle_cursor_target[1] != nil and @battler != $game_temp.battle_cursor_target[1]
  719.       $game_temp.target_data = [@battler,self]
  720.   end  
  721.   
  722.   #--------------------------------------------------------------------------
  723.   # * Update Target Cursor
  724.   #--------------------------------------------------------------------------
  725.   def update_target_cursor
  726.       return if @target_cursor == nil
  727.       refresh_zoom if @target_visible_old != @target_cursor.visible
  728.       @target_cursor.visible = can_target_cursor_visible?
  729.       return if !@target_cursor.visible
  730.       @target_cursor.x = self.x + @tc_pos[0]
  731.       @target_cursor.y = self.y + @tc_pos[1]
  732.       @target_cursor.y -= (self.bitmap.height / 2) if self.bitmap
  733.       if @battler.is_a?(Game_Actor) and @face_battler
  734.          @target_cursor.y -= @target_cursor_ch[0] if @target_cursor.y > @target_cursor_ch[1]
  735.       end           
  736.       @target_cursor.z = CURSOR_Z + 1
  737.       @target_cursor.opacity = 130 + rand(125)
  738.       @target_cursor.zoom_x -= 0.05 if @target_cursor.zoom_x > 1.00
  739.       @target_cursor.zoom_x = 1.00 if @target_cursor.zoom_x < 1.00
  740.       @target_cursor.zoom_y = @target_cursor.zoom_x      
  741.       update_battle_camera_cursor_t if update_battle_camera_cursor_t?
  742.   end
  743.   
  744.   #--------------------------------------------------------------------------
  745.   # * Update Battle Camera Cursor T
  746.   #--------------------------------------------------------------------------
  747.   def update_battle_camera_cursor_t?
  748.       return false if $imported[:mog_battle_camera] == nil
  749.       return false if @battler == nil
  750.       if $imported[:mog_battle_hud_ex] and SceneManager.face_battler?
  751.          return false if @battler.is_a?(Game_Actor)
  752.       end  
  753.       return true
  754.   end
  755.      
  756.   #--------------------------------------------------------------------------
  757.   # ● Update Battle Camera Cursor
  758.   #--------------------------------------------------------------------------              
  759.   def update_battle_camera_cursor_t
  760.       @target_cursor.ox = $game_temp.viewport_oxy[0] + @target_cursor_org[0]
  761.       @target_cursor.oy = $game_temp.viewport_oxy[1] + @target_cursor_org[1]
  762.   end  
  763.   
  764.   #--------------------------------------------------------------------------
  765.   # * Refresh Zoom
  766.   #--------------------------------------------------------------------------
  767.   def refresh_zoom
  768.       @target_visible_old = @target_cursor.visible
  769.       @target_cursor.zoom_x = 1.50 if TARGET_CURSOR_2_ZOOM_EFFECT
  770.       @target_cursor.zoom_y = @target_cursor.zoom_x
  771.   end
  772.   
  773.   #--------------------------------------------------------------------------
  774.   # * Can Target Cursor Visible?
  775.   #--------------------------------------------------------------------------
  776.   def can_target_cursor_visible?
  777.       return false if !$game_temp.battle_cursor[2]
  778.       return false if @battler.dead?
  779.       return false if @battler.hidden
  780.       return false if !@battler.target_temp
  781.       return false if $game_message.visible
  782.       return false if $game_temp.battle_end
  783.       return false if $imported[:mog_sprite_actor] and !@battler.bact_sprite_visiblle
  784.       return false if $imported[:mog_active_chain] and $game_temp.chain_action_phase
  785.       return false if $imported[:mog_atb_system] and BattleManager.actor == nil
  786. #      return false if $imported[:mog_blitz_commands] and $game_temp.blitz_commands_phase
  787.       return true
  788.   end
  789.   
  790. end

  791. #==============================================================================
  792. # ■ Scene Battle
  793. #==============================================================================
  794. class Scene_Battle < Scene_Base
  795.   
  796.   #--------------------------------------------------------------------------
  797.   # * On Skill OK
  798.   #--------------------------------------------------------------------------
  799.   def on_skill_ok
  800.       if $imported[:mog_atb_system]
  801.          return if BattleManager.actor == nil
  802.          @skill_window.visible = false unless !@status_window.visible
  803.       end
  804.       @skill = @skill_window.item
  805.       @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  806.       BattleManager.actor.input.set_skill(@skill.id)
  807.       BattleManager.actor.last_skill.object = @skill
  808.      if [0,11].include?(@skill.scope)
  809.         @skill_window.hide
  810.         if $imported[:mog_atb_system]
  811.            next_command
  812.            BattleManager.command_end
  813.            hide_base_window
  814.         end               
  815.       elsif @skill.for_opponent?
  816.           select_enemy_selection
  817.       else
  818.           select_actor_selection
  819.       end
  820.   end
  821.   
  822.   #--------------------------------------------------------------------------
  823.   # * On Item OK
  824.   #--------------------------------------------------------------------------
  825.   def on_item_ok
  826.       if $imported[:mog_atb_system]
  827.          return if BattleManager.actor == nil
  828.          @item_window.visible = false unless !@status_window.visible
  829.       end   
  830.       @item = @item_window.item
  831.       @item_window.hide if @item.for_opponent? or @item.for_friend?
  832.       BattleManager.actor.input.set_item(@item.id)
  833.       if [0,11].include?(@item.scope)
  834.          @item_window.hide
  835.          next_command
  836.          if $imported[:mog_atb_system]
  837.             next_command
  838.             BattleManager.command_end
  839.             hide_base_window
  840.          end         
  841.       elsif @item.for_opponent?
  842.           select_enemy_selection
  843.       else
  844.           select_actor_selection
  845.       end
  846.       $game_party.last_item.object = @item
  847.   end  
  848.    
  849.   #--------------------------------------------------------------------------
  850.   # * Turn End
  851.   #--------------------------------------------------------------------------
  852.   alias mog_battle_cursor_turn_end turn_end
  853.   def turn_end
  854.       mog_battle_cursor_turn_end
  855.       if $game_temp.battle_cursor_scope_refresh
  856.          $game_temp.battle_cursor_scope_refresh = false
  857.          $game_temp.battle_cursor_need_refresh[0] = true
  858.          $game_temp.battle_cursor_need_refresh[1] = true
  859.       end        
  860.   end  
  861.   
  862. end
复制代码
回复

使用道具 举报

梦石
1
星屑
14389
在线时间
2110 小时
注册时间
2017-9-28
回帖
607
发表于 2019-10-25 10:11:39 | 显示全部楼层
本帖最后由 Nil2018 于 2019-10-25 10:12 编辑

我是mog指针+victor指针一起用...两者还要修改部分内容才兼容
我不会写脚本就只能这样了

2333.gif

mog#==============================================================================
# +++ MOG - 战斗指针 (2.2) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# 战斗选择目标时显示动态指针.
#==============================================================================
# 需要以下图片. (Graphics/System)
#
# Battle_Cursor.png
# Battle_Cursor2.png *(需要脚本:"目标范围 EX")
#
#==============================================================================
# 注意 - 请把本脚本放在脚本:"MOG - 战斗图动态效果"之下
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# (2.2) Melhoria no sistema de posi??o da origem Z.
#==============================================================================

#==============================================================================
# ■ CURSOR SETTING
#==============================================================================
module MOG_BATTLE_CURSOR
  #相对于目标的指针位置.
  CURSOR_POSITION = [-5, -10]
  #目标名的位置.
  CURSOR_NAME_POSITION = [-20, 15]
  #指针是否左右滑动.
  CURSOR_SLIDE_EFFECT = true
  #指针是否上下浮动.
  CURSOR_FLOAT_EFFECT = false
  #指针的Z坐标.
  CURSOR_Z = 155
  #第二个指针的相对于目标的位置.
  TARGET_CURSOR_2_POS = [0, -48]
  #第二个指针是否有缩放效果.
  TARGET_CURSOR_2_ZOOM_EFFECT = false
end

$imported = {} if $imported.nil?
$imported[:mog_battle_cursor] = true

#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
  
  attr_accessor :battle_cursor
  attr_accessor :battle_cursor_data
  attr_accessor :target_skill
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------  
  alias mog_battle_cursor_initialize initialize
  def initialize
      @battle_cursor = [0,0,false,""] ; @target_skill = []
      mog_battle_cursor_initialize
  end  
  
  #--------------------------------------------------------------------------
  # ● Clear Target Temp
  #--------------------------------------------------------------------------   
  def clear_target_temp
      $game_party.members.each {|t| t.target_temp = false } rescue nil
      $game_troop.members.each {|t| t.target_temp = false } rescue nil      
  end
   
end

#==============================================================================
# ■ Spriteset Battle Cursor
#==============================================================================
class Sprite_Battle_Cursor < Sprite
  include MOG_BATTLE_CURSOR
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------        
  def initialize(viewport = nil)
      super(viewport)
      $game_temp.battle_cursor = [0,0,false,""]
      self.bitmap = Cache.system("Battle_Cursor")
      self.visible = $game_temp.battle_cursor[2] ; self.z = CURSOR_Z
      @cursor_name = Sprite.new ; @cursor_name.bitmap = Bitmap.new(120,32)
      @cursor_name.z = self.z + 1 ; @cursor_name.bitmap.font.size = 16
      @cursor_name_enemy = $game_temp.battle_cursor[3]
      @cursor_name_position = [CURSOR_NAME_POSITION[0] ,CURSOR_NAME_POSITION[1]]
      @cursor_float = [0,0] ;  refresh_cursor_name
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose Sprite
  #--------------------------------------------------------------------------         
  def dispose
      super
      dispose_sprite_cursor
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose Sprite Cursor
  #--------------------------------------------------------------------------            
  def dispose_sprite_cursor
      @cursor_name.bitmap.dispose ; @cursor_name.dispose
      self.bitmap.dispose ; $game_temp.clear_target_temp
  end

  #--------------------------------------------------------------------------
  # ● Refresh Cursor Name
  #--------------------------------------------------------------------------              
  def refresh_cursor_name
      @cursor_name_enemy = $game_temp.battle_cursor[3]
      @cursor_name.bitmap.clear
      @cursor_name.bitmap.draw_text(0,0,120,32,@cursor_name_enemy.to_s,1)
  end

  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------            
  def update
      super
      update_sprite_cursor
  end

  #--------------------------------------------------------------------------
  # ● Update Sprite Cursor
  #--------------------------------------------------------------------------              
  def update_sprite_cursor
      update_visible ; update_cursor_float_effect
      execute_move(0,self.x,$game_temp.battle_cursor[0])
      execute_move(1,self.y,$game_temp.battle_cursor[1] + @cursor_float[1])
      update_sprite_name
  end

  #--------------------------------------------------------------------------
  # ● Update Visible
  #--------------------------------------------------------------------------               
  def update_visible
      self.visible = $game_temp.battle_cursor[2]
      (self.x = -64 ; self.y = -64) if !self.visible
  end  
  
  #--------------------------------------------------------------------------
  # ● Update Sprite Name
  #--------------------------------------------------------------------------               
  def update_sprite_name
      return if @cursor_name == nil
      refresh_cursor_name  if @cursor_name_enemy != $game_temp.battle_cursor[3]
      @cursor_name.x = self.x + @cursor_name_position[0]
      @cursor_name.y = self.y + @cursor_name_position[1]
      @cursor_name.opacity = self.opacity ; @cursor_name.visible = self.visible
  end  
  
  #--------------------------------------------------------------------------
  # ● Update Cursor Float Effect
  #--------------------------------------------------------------------------              
  def update_cursor_float_effect
      return if !CURSOR_FLOAT_EFFECT
      @cursor_float[0] += 1
      case @cursor_float[0]
        when 0..20  ; @cursor_float[1] += 1
        when 21..40 ; @cursor_float[1] -= 1
        else
          @cursor_float[0] = 0 ;   @cursor_float[1] = 0
      end        
  end  
  
  #--------------------------------------------------------------------------
  # ● Execute Move
  #--------------------------------------------------------------------------      
  def execute_move(type,cp,np)
      sp = 5 + ((cp - np).abs / 5)
      if cp > np
         cp -= sp ; cp = np if cp < np
      elsif cp < np
         cp += sp ; cp = np if cp > np
      end     
      self.x = cp if type == 0 ; self.y = cp if type == 1
  end      
  
end

#==============================================================================
# ■ Spriteset Battle
#==============================================================================
class Spriteset_Battle
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------      
  alias mog_battle_cursor_initialize initialize
  def initialize
      mog_battle_cursor_initialize
      create_cursor
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------      
  alias mog_battle_cursor_dispose dispose
  def dispose
      mog_battle_cursor_dispose
      dispose_cursor
  end
  
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------         
  alias mog_battle_cursor_update update
  def update
      mog_battle_cursor_update
      update_battle_cursor
  end  
  
  #--------------------------------------------------------------------------
  # ● Create_Cursor
  #--------------------------------------------------------------------------        
  def create_cursor
      return if @battle_cursor != nil
      $game_temp.clear_target_temp ; @battle_cursor = Sprite_Battle_Cursor.new      
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose Cursor
  #--------------------------------------------------------------------------        
  def dispose_cursor
      return if @battle_cursor == nil
      @battle_cursor.dispose
  end  
  
  #--------------------------------------------------------------------------
  # ● Update Battle Cursor
  #--------------------------------------------------------------------------         
  def update_battle_cursor
      return if @battle_cursor == nil
      @battle_cursor.update      
  end
  
end

#==============================================================================
# ■ Battle Cursor Index
#==============================================================================
module Battle_Cursor_index
  
  include MOG_BATTLE_CURSOR
  
  #--------------------------------------------------------------------------
  # ● Check Index Limit
  #--------------------------------------------------------------------------      
  def check_index_limit
      self.index = 0 if self.index >= item_max
      self.index = (item_max - 1) if self.index < 0
  end      
  
  #--------------------------------------------------------------------------
  # ● Set Cursor Position Enemy
  #--------------------------------------------------------------------------   
  def set_cursor_position_enemy
#~       return if !self.active
#~       @fcursor = nil
#~       $game_temp.battle_cursor[0] = $game_troop.alive_members[self.index].screen_x + CURSOR_POSITION[0] rescue nil
#~       $game_temp.battle_cursor[1] = $game_troop.alive_members[self.index].screen_y + CURSOR_POSITION[1] rescue nil
#~       $game_temp.battle_cursor[3] = $game_troop.alive_members[self.index].name rescue nil
#~       $game_temp.battle_cursor_data = $game_troop.alive_members[self.index]
#~       $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil
#~       enable_target_sprites($game_temp.battle_cursor_data.index)
  end
  
  #--------------------------------------------------------------------------
  # ● Enable Target Sprites
  #--------------------------------------------------------------------------   
  def enable_target_sprites(target_index)  
      return if $game_temp.target_skill.empty?
      $game_temp.clear_target_temp ; battler = $game_temp.target_skill[1]
      type = $game_temp.target_skill[0].is_a?(RPG::Skill) ? 0 : 1
      target_index = $game_temp.battle_cursor_data.index
      battler.make_action_temp($game_temp.target_skill[0].id, target_index,type)      
      targets = battler.action_temp.make_targets.compact
      targets.each {|t| t.target_temp = true }
  end  
   
  #--------------------------------------------------------------------------
  # ● Set Cursor Position Actor
  #--------------------------------------------------------------------------   
  def set_cursor_position_actor
      return if !self.active      
      @fcursor = nil
      $game_temp.battle_cursor[0] = $game_party.members[self.index].screen_x + CURSOR_POSITION[0] rescue nil
      $game_temp.battle_cursor[1] = $game_party.members[self.index].screen_y + CURSOR_POSITION[1] rescue nil
      $game_temp.battle_cursor[3] = $game_party.members[self.index].name rescue nil
      $game_temp.battle_cursor_data = $game_party.members[self.index]
      $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil
      enable_target_sprites(self.index)
  end  
  
  #--------------------------------------------------------------------------
  # ● Process Cursor Move
  #--------------------------------------------------------------------------
  def process_cursor_move
      $game_temp.battle_cursor_data = nil
      return unless cursor_movable?
      last_index = @index
      cursor_move_index(1) if Input.repeat?(:DOWN)
      cursor_move_index(-1) if Input.repeat?(:UP)
      cursor_move_index(1) if Input.repeat?(:RIGHT)
      cursor_move_index(-1) if Input.repeat?(:LEFT)
      $game_temp.battle_cursor_data = $game_troop.alive_members[@index]
      Sound.play_cursor if @index != last_index
  end
      
  #--------------------------------------------------------------------------
  # ● Process Cursor Move Index
  #--------------------------------------------------------------------------  
  def cursor_move_index(value = 0)
      self.index += value ;  check_index_limit
  end

end

#==============================================================================
# ■ Window_BattleActor
#==============================================================================
class Window_BattleActor < Window_BattleStatus
  include Battle_Cursor_index
  
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------  
  alias mog_battle_cursor_actor_update update
  def update
      pre_index = self.index
      mog_battle_cursor_actor_update
      set_cursor_position_actor if pre_index != self.index or @fcursor
  end  

  #--------------------------------------------------------------------------
  # ● Show
  #--------------------------------------------------------------------------
  alias mog_battle_cursor_show show
  def show
      if @info_viewport
         set_cursor_position_actor ; $game_temp.battle_cursor[2] = true
         @fcursor = true
      end
      mog_battle_cursor_show
  end

  #--------------------------------------------------------------------------
  # ● Hide
  #--------------------------------------------------------------------------
  alias mog_battle_cursor_hide hide
  def hide
      $game_temp.battle_cursor[2] = false if @info_viewport
      $game_temp.clear_target_temp ; $game_temp.target_skill.clear
      mog_battle_cursor_hide
  end  
  
end

#==============================================================================
# ■ Game Enemy
#==============================================================================
class Game_Enemy < Game_Battler
  attr_accessor :index
end

#==============================================================================
# ■ Game Troop
#==============================================================================
class Game_Troop < Game_Unit
   
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  alias mog_battle_cursor_setup setup
  def setup(troop_id)
      mog_battle_cursor_setup(troop_id)
      if can_sort_index?
         @enemies.sort! {|a,b| a.screen_x <=> b.screen_x}
         @enemies.each_with_index {|e, i| e.index = i }
      end
  end
  
  #--------------------------------------------------------------------------
  # * Can Sort Index?
  #--------------------------------------------------------------------------
  def can_sort_index?
      return false if @enemies.size < 3
      return false if troop.pages.size > 1
      return false if !troop.pages[0].list[0].parameters.empty? rescue false
      return true
  end
  
end

#==============================================================================
# ■ Window_BattleEnemy
#==============================================================================
#~ class Window_BattleEnemy < Window_Selectable
#~   include Battle_Cursor_index
#~   
#~   #--------------------------------------------------------------------------
#~   # ● Update
#~   #--------------------------------------------------------------------------  
#~   alias mog_battle_cursor_enemy_update update
#~   def update
#~       pre_index = self.index
#~       mog_battle_cursor_enemy_update
#~       set_cursor_position_enemy if pre_index != self.index or @fcursor
#~   end
#~   
#~   #--------------------------------------------------------------------------
#~   # ● Show
#~   #--------------------------------------------------------------------------
#~   alias mog_battle_cursor_show show
#~   def show
#~       if @info_viewport
#~          set_cursor_position_enemy ; $game_temp.battle_cursor[2] = true
#~          @fcursor = true
#~       end
#~       mog_battle_cursor_show
#~   end
#~   
#~   #--------------------------------------------------------------------------
#~   # ● Hide
#~   #--------------------------------------------------------------------------
#~   alias mog_battle_cursor_hide hide
#~   def hide
#~       $game_temp.battle_cursor[2] = false if @info_viewport
#~       $game_temp.clear_target_temp ; $game_temp.target_skill.clear
#~       mog_battle_cursor_hide
#~   end  
#~   
#~ end

#==============================================================================
# ■ Window Selectable
#==============================================================================
class Window_Selectable < Window_Base  

  #--------------------------------------------------------------------------
  # * Process OK
  #-------------------------------------------------------------------------
  alias mog_target_cursor_process_ok process_ok
  def process_ok
      mog_target_cursor_process_ok
      execute_target_selection if can_execute_target_selection?
  end
  
  #--------------------------------------------------------------------------
  # * Can Execute Target Selection
  #-------------------------------------------------------------------------
  def can_execute_target_selection?
      return false if !SceneManager.scene_is?(Scene_Battle)
      return false if !current_item_enabled?
      return true if self.is_a?(Window_BattleSkill)
      return true if self.is_a?(Window_BattleItem)
      return true if self.is_a?(Window_ActorCommand) and self.index == 0
      return false
  end

  #--------------------------------------------------------------------------
  # * Execute Target Selection
  #-------------------------------------------------------------------------
  def execute_target_selection
      return if BattleManager.actor == nil
      $game_temp.target_skill.clear
      item = @data[index] rescue nil
      item = $data_skills[BattleManager.actor.attack_skill_id] rescue nil if self.is_a?(Window_ActorCommand)
      return if item == nil
      if [2,8,10].include?(item.scope) or item.note =~ /<Scope Range = (\d+) - (\d+) - (\d+) - (\d+)>/   
         $game_temp.target_skill = [item,BattleManager.actor]
      end   
  end  
  
end

#==============================================================================
# ■ Game Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
  
  attr_accessor :target_temp
  attr_accessor :action_temp
  
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  alias mog_target_cursor_initialize initialize
  def initialize
      @target_cursor_temp = false
      mog_target_cursor_initialize
  end
  
  #--------------------------------------------------------------------------
  # ● Make Action Temp
  #--------------------------------------------------------------------------
  def make_action_temp(action_id,target_index,type)
      return if action_id == nil
      action = Game_Action.new(self, true)
      action.set_skill(action_id) if type == 0
      action.set_item(action_id) if type == 1
      action.target_index = target_index
      @action_temp = action
  end     
  
end

#==============================================================================
# ■ Game BattlerBase
#==============================================================================
class Game_BattlerBase
   attr_accessor :hidden
end

#==============================================================================
# ■ Scene Battler
#==============================================================================
class Scene_Battle < Scene_Base

  #--------------------------------------------------------------------------
  # * On Skill OK
  #--------------------------------------------------------------------------
  def on_skill_ok
      @skill = @skill_window.item
      BattleManager.actor.input.set_skill(@skill.id)
      BattleManager.actor.last_skill.object = @skill
      if [0,11].include?(@skill.scope)
         @skill_window.hide ; next_command
      elsif @skill.for_opponent?
         select_enemy_selection
      else
         select_actor_selection
      end
  end
  
  #--------------------------------------------------------------------------
  # * On Item OK
  #--------------------------------------------------------------------------
  def on_item_ok
      @item = @item_window.item
      BattleManager.actor.input.set_item(@item.id)
      if [0,11].include?(@item.scope)
         @item_window.hide ; next_command
      elsif @item.for_opponent?
         select_enemy_selection
      else
         select_actor_selection
      end
      $game_party.last_item.object = @item
  end
  
end

#==============================================================================
# ■ Sprite Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
  include MOG_BATTLE_CURSOR
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  alias mog_target_cursor_initialize initialize
  def initialize(viewport, battler = nil)
      mog_target_cursor_initialize(viewport, battler)
      create_target_cursor
  end
  
  #--------------------------------------------------------------------------
  # * Create Target Cursor
  #--------------------------------------------------------------------------
  def create_target_cursor
      @target_cursor = Sprite.new
      @target_cursor.bitmap = Cache.system("Battle_Cursor2")
      @target_cursor.ox = @target_cursor.bitmap.width / 2
      @target_cursor.oy = @target_cursor.bitmap.height / 2
      @target_cursor.visible = false
      @target_visible_old = @target_cursor.visible
      @tc_pos = [TARGET_CURSOR_2_POS[0],TARGET_CURSOR_2_POS[1] + @target_cursor.oy]
  end
  
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  alias mog_target_cursor_dispose dispose
  def dispose
      dispose_target_cursor
      mog_target_cursor_dispose
  end
  
  #--------------------------------------------------------------------------
  # * Dispose Target Cursor
  #--------------------------------------------------------------------------
  def dispose_target_cursor
      return if @target_cursor == nil
      @target_cursor.bitmap.dispose ; @target_cursor.dispose
  end
  
  #--------------------------------------------------------------------------
  # * Update Postion
  #--------------------------------------------------------------------------
  alias mog_target_cursor_update_position update_position
  def update_position
      mog_target_cursor_update_position
      update_target_cursor
  end
  
  #--------------------------------------------------------------------------
  # * Update Target Cursor
  #--------------------------------------------------------------------------
  def update_target_cursor
      return if @target_cursor == nil
      refresh_zoom if @target_visible_old != @target_cursor.visible
      @target_cursor.visible = can_target_cursor_visible?
      return if !@target_cursor.visible
      @target_cursor.x = self.x + @tc_pos[0]
      @target_cursor.y = self.y + @tc_pos[1]
      @target_cursor.z = CURSOR_Z + 1
      @target_cursor.opacity = 130 + rand(125)
      @target_cursor.zoom_x -= 0.05 if @target_cursor.zoom_x > 1.00
      @target_cursor.zoom_x = 1.00 if @target_cursor.zoom_x < 1.00
      @target_cursor.zoom_y = @target_cursor.zoom_x            
  end
  
  #--------------------------------------------------------------------------
  # * Refresh Zoom
  #--------------------------------------------------------------------------
  def refresh_zoom
      @target_visible_old = @target_cursor.visible
      @target_cursor.zoom_x = 1.50 if TARGET_CURSOR_2_ZOOM_EFFECT
      @target_cursor.zoom_y = @target_cursor.zoom_x
  end
  
  #--------------------------------------------------------------------------
  # * Can Target Cursor Visible?
  #--------------------------------------------------------------------------
  def can_target_cursor_visible?
      return false if @battler.dead?
      return false if @battler.hidden
      return false if !@battler.target_temp
      return true
  end
  
end


victor#==============================================================================
# ** Victor Engine - Target Arrow
#------------------------------------------------------------------------------
# Author : Victor Sant
#
# Version History:
#  v 1.00 - 2012.01.15 > First release
#  v 1.01 - 2012.03.08 > Fixed self action help name display
#  v 1.02 - 2012.05.30 > Fixed bug with Loop Animation arrow
#  v 1.03 - 2012.08.02 > Compatibility with Basic Module 1.27
#  v 1.04 - 2012.11.03 > Compatibility with Direct Commands
#                      > Fixed issue with line 408 undefined method
#  v 1.05 - 2012.12.24 > Compatibility with Active Time Battle
#  v 1.06 - 2012.12.30 > Fixed issue with enemy name when cancel selection
#  v 1.07 - 2013.01.07 > Improved arrow movement
#  v 1.08 - 2013.01.24 > Compatibility with Toggle Target
#------------------------------------------------------------------------------
#  This script allows to change target selection to a arrow like selection.
# It's possible to make it animated and set different graphics for enemies
# and actors target selections.
# 如果使用 'Victor Engine - Loop Animation'脚本,那指针还可以用动画来表示
#
#------------------------------------------------------------------------------
# 兼容性
#   需要脚本 'Victor Engine - Basic Module' v 1.27 或者更高的版本
#   并且将本脚本放在 'Victor Engine - Custom Basic Actions' 之下.
#
# * 重写方法
#   class RPG::UsableItem < RPG::BaseItem
#     def need_selection?
#
#   class Window_BattleEnemy < Window_Selectable
#     def show
#     def hide
#     def cursor_movable?
#     def cursor_down(wrap = false)
#     def cursor_up(wrap = false)
#     def cursor_right(wrap = false)
#     def cursor_left(wrap = false)
#     def update_help
#
#   class Window_BattleActor < Window_BattleStatus
#     def cursor_movable?
#     def cursor_down(wrap = false)
#     def cursor_up(wrap = false)
#     def cursor_right(wrap = false)
#     def cursor_left(wrap = false)
#     def update_help
#     def update_cursor
#
# * 重名方法
#   class Window_BattleEnemy < Window_Selectable
#     def initialize(info_viewport)
#     def update
#     def dispose
#
#   class Window_BattleActor < Window_BattleStatus
#     def initialize(info_viewport)
#     def update
#     def show
#     def hide
#     def update_cursor
#     def dispose
#
#   class Scene_Battle < Scene_Base
#     def create_actor_window
#     def create_enemy_window
#     def command_attack
#     def on_skill_ok
#     def on_item_ok
#     def on_enemy_cancel
#     def on_actor_cancel
#
#------------------------------------------------------------------------------
# Instructions:
#  To instal the script, open you script editor and paste this script on
#  a new section bellow the Materials section. This script must also
#  be bellow the scripts 'Victor Engine - Basic'
#
#------------------------------------------------------------------------------
# 技能和物品的备注栏写上:
#   
#  <target description>
#  string
#  </target description>
#   这是设定指向目标时显示的文本描述,“string”是描述的内容
#   使用  \\n  来换行.
#
#------------------------------------------------------------------------------
# 附加介绍:
#
#  指针图片必须放在 Graphics/System.
#
#  如果你想用一个动画来表示指针,你需要脚本
#  'Victor Engine - Loop Animation' v 1.02 或更高版本.
#
#==============================================================================

#==============================================================================
# ** Victor Engine
#------------------------------------------------------------------------------
#   Setting module for the Victor Engine
#==============================================================================

module Victor_Engine
  #--------------------------------------------------------------------------
  # * Set the automatic text control codes
  #   when false, it's needed to add \# on the start of the text to use
  #   control codes
  #--------------------------------------------------------------------------
  VE_ARROW_DEFAULT = {
    name:   "MenuCursor", # 指针图片文件名 ("文件名")
    frames: 1,        #指针的帧数 (1 则为无动画)
    speed:  5,       # 等待时间 (60 帧 = 1 秒)
    height: true,     # 根据目标的高度自动调整指针位置
    help:   true,     # 当选择目标时弹出帮助窗口
    x:      -18,        # 调整x坐标
    y:      3,        # 调整y坐标
    move:   0,        # 移动类型. 0 :全方向移动, 1 : 横向移动
                      # 2 : 纵向移动
    anim:   111,        # 作为指针的动画id. 本操作需要脚本
                      # "Victor Engine - Loop Animation",

                     
  } # 别动这个括号
  #--------------------------------------------------------------------------
  # * 自动定义指针设定
  #    将角色和敌人的指针区别开.
  #--------------------------------------------------------------------------
  VE_ARROW_CUSTOM = {
    actor: {name: "MenuCursor"},  #指向角色的指针图片文件名
    enemy: {name: "MenuCursor"},  #指向敌人的指针图片文件名
  } # Don't remove
  #--------------------------------------------------------------------------
  # * 在选择目标时隐藏技能窗口
  #    因为技能窗口覆盖在战斗画面之上,所以你可以设定在选择目标时隐藏技能窗口Since the window is placed above the battlers, the arrow stay behind
  #    若你的技能窗口已修改为不遮挡战斗画面,你也可以将true改为false
  #--------------------------------------------------------------------------
  VE_HIDE_SKILL_WINDOW = false
  #--------------------------------------------------------------------------
  # * 在选择目标时隐藏物品窗口
  #--------------------------------------------------------------------------
  VE_HIDE_ITEM_WINDOW = false
  #--------------------------------------------------------------------------
  # * 使用帮助窗口 (不能修改)
  #--------------------------------------------------------------------------
  VE_USE_TARGET_HELP = true
  #--------------------------------------------------------------------------
  # * 帮助窗口设定.
  #--------------------------------------------------------------------------
  VE_TARGET_HELP_WINDOW = {
    text_align:    1,    # 文本对齐, 0: 左, 1: 中, 2: 右
    target_info:   true, # 如果是true将显示目标名称和状态,false则显示技能名
    all_enemies:   "全部敌人",   # 选择全体敌人时的文本
    all_actors:    "全部队友",    # 选择全体队友时的文本
    all_target:    "全部目标",   # 选择全体目标时的文本
    random_enemy:  "随机敌人",  # 选择随机敌人时的文本
    random_actor:  "随机队友",   # 选择随机队友时的文本
    random_target: "随机目标", # 选择随机目标时的文本
  } # 别动这个括号
  #--------------------------------------------------------------------------
  # * 需要
  #   这个方法将检查你是否有 basic module 或其他本脚本需要用到的
  #   VE 脚本, 这里不需要编辑
  #--------------------------------------------------------------------------
  def self.required(name, req, version, type = nil)
    if !$imported[:ve_basic_module]
      msg = "The script '%s' requires the script\n"
      msg += "'VE - Basic Module' v%s or higher above it to work properly\n"
      msg += "Go to http://victorenginescripts.wordpress.com/ to download this script."
      msgbox(sprintf(msg, self.script_name(name), version))
      exit
    else
      self.required_script(name, req, version, type)
    end
  end
  #--------------------------------------------------------------------------
  # * script_name
  #   Get the script name base on the imported value, 不需要编辑
  #--------------------------------------------------------------------------
  def self.script_name(name, ext = "VE")
    name = name.to_s.gsub("_", " ").upcase.split
    name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
    name.join(" ")
  end
end

$imported ||= {}
$imported[:ve_target_arrow] = 1.08
Victor_Engine.required(:ve_target_arrow, :ve_basic_module, 1.27, :above)
Victor_Engine.required(:ve_target_arrow, :ve_toggle_target, 1.00, :bellow)

#==============================================================================
# ** RPG::UsableItem
#------------------------------------------------------------------------------
#  This is the superclass for skills and items.
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
  #--------------------------------------------------------------------------
  # * Overwrite method: need_selection?
  #--------------------------------------------------------------------------
  def need_selection?
    @scope > 0
  end
end

#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
#  This window contains cursor movement and scroll functions.
#==============================================================================

class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # * New method: init_arrow
  #--------------------------------------------------------------------------
  def init_arrow
    @arrows = []
    @arrows_anim = 0
    @arrows_value = VE_ARROW_CUSTOM.dup
    @arrows_value.default = VE_ARROW_DEFAULT.dup
    @arrows_value.each do |key, value|
      arrow = @arrows_value[key]
      arrow[:x]      = VE_ARROW_DEFAULT[:x]      if !value[:x]
      arrow[:y]      = VE_ARROW_DEFAULT[:y]      if !value[:y]
      arrow[:name]   = VE_ARROW_DEFAULT[:name]   if !value[:name]
      arrow[:frames] = VE_ARROW_DEFAULT[:frames] if !value[:frames]
      arrow[:rect]   = VE_ARROW_DEFAULT[:rect]   if !value[:rect]
      arrow[:speed]  = VE_ARROW_DEFAULT[:speed]  if !value[:speed]
      arrow[:anim]   = VE_ARROW_DEFAULT[:anim]   if !value[:anim]
      arrow[:move]   = VE_ARROW_DEFAULT[:move]   if !value[:move]
      arrow[:height] = VE_ARROW_DEFAULT[:height] if !value[:height]
    end
  end
  #--------------------------------------------------------------------------
  # * New method: init_arrow_sprite
  #--------------------------------------------------------------------------
  def init_arrow_sprite(forced = false)
    dispose_arrow if @arrows_index != @index || forced || item_max == 0
    return unless active
    if target_all? && item_max > 0
      item_max.times {|i| create_arrow_sprite(i) }
    elsif @index > -1 && item_max > 0
      create_arrow_sprite(0)
    end
    @arrows_index = @index
    update_arrow_sprite
  end
  #--------------------------------------------------------------------------
  # * New method: set_action
  #--------------------------------------------------------------------------
  def set_action(action)
    @action = action
  end
  #--------------------------------------------------------------------------
  # * New method: target_all?
  #--------------------------------------------------------------------------
  def target_all?
    @action && (@action.for_all? || @action.for_random?)
  end
  #--------------------------------------------------------------------------
  # * New method: target_self?
  #--------------------------------------------------------------------------
  def target_self?
    @action && @action.for_user?
  end
  #--------------------------------------------------------------------------
  # * New method: create_arrow_sprite
  #--------------------------------------------------------------------------
  def create_arrow_sprite(i)
    return if @arrows
    @arrows = Sprite_Base.new
    @arrows.bitmap = Cache.system(arrow_filename)
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_animation
  #--------------------------------------------------------------------------
  def arrow_animation?
    arrow_animation != 0 && $imported[:ve_loop_animation]
  end
  #--------------------------------------------------------------------------
  # * New method: update_arrow_sprite
  #--------------------------------------------------------------------------
  def update_arrow_sprite
    @arrows.each_index do |i|
      next unless @arrows && target(i)
      @arrows.viewport = target(i).sprite.viewport
      arrow_animation? ? set_arrow_animation(i) : set_arrow_bitmap(i)
      update_arrow_position(i)
    end
    update_all_arrows
  end
  #--------------------------------------------------------------------------
  # * New method: set_arrow_bitmap
  #--------------------------------------------------------------------------
  def set_arrow_bitmap(i)
    bitmap = @arrows.bitmap
    arrow_width   = bitmap.width / arrow_frames
    current_frame = arrow_width * @arrows_anim
    @arrows.src_rect.set(current_frame, 0, arrow_width, bitmap.height)
  end
  #--------------------------------------------------------------------------
  # * New method: set_arrow_animation
  #--------------------------------------------------------------------------
  def set_arrow_animation(i)
    target = target(i)
    return if !target || target.sprite.loop_anim?(:arrow)
    settings = {anim: arrow_animation, type: :arrow, loop: 1}
    target.sprite.add_loop_animation(settings)
  end
  #--------------------------------------------------------------------------
  # * New method: update_arrow_position
  #--------------------------------------------------------------------------
  def update_arrow_position(i)
    adjust = arrow_height ? target(i).sprite.oy / 2 : 0
    @arrows.x  = position_x(i) + arrow_x
    @arrows.y  = position_y(i) + arrow_y - adjust
    @arrows.z  = self.z + 1000
    @arrows.ox = @arrows.width  / 2
    @arrows.oy = @arrows.height / 2
  end
  #--------------------------------------------------------------------------
  # * New method: position_x
  #--------------------------------------------------------------------------
  def position_x(i)
    $imported[:ve_animated_battle] ? target(i).current_x : target(i).screen_x
  end
  #--------------------------------------------------------------------------
  # * New method: position_y
  #--------------------------------------------------------------------------
  def position_y(i)
    $imported[:ve_animated_battle] ? target(i).current_y : target(i).screen_y
  end
  #--------------------------------------------------------------------------
  # * New method: update_all_arrows
  #--------------------------------------------------------------------------
  def update_all_arrows
    @arrows.each {|arrow| arrow.update }
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_frames
  #--------------------------------------------------------------------------
  def target_window_type
    instance_of?(Window_BattleEnemy) ? :enemy : :actor
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_filename
  #--------------------------------------------------------------------------
  def arrow_filename
    arrow_animation? ? "" : @arrows_value[target_window_type][:name]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_frames
  #--------------------------------------------------------------------------
  def arrow_frames
    [@arrows_value[target_window_type][:frames], 1].max
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_old_rect
  #--------------------------------------------------------------------------
  def arrow_old_rect
    @arrows_value[target_window_type][:rect]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_animspeed
  #--------------------------------------------------------------------------
  def arrow_animspeed
    [@arrows_value[target_window_type][:speed], 1].max
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_x
  #--------------------------------------------------------------------------
  def arrow_x
    @arrows_value[target_window_type][:x]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_y
  #--------------------------------------------------------------------------
  def arrow_y
    @arrows_value[target_window_type][:y]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_animation
  #--------------------------------------------------------------------------
  def arrow_animation
    @arrows_value[target_window_type][:anim]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_height
  #--------------------------------------------------------------------------
  def arrow_height
    @arrows_value[target_window_type][:height]
  end
  #--------------------------------------------------------------------------
  # * New method: arrow_move
  #--------------------------------------------------------------------------
  def arrow_move
    @arrows_value[target_window_type][:move]
  end
  #--------------------------------------------------------------------------
  # * New method: help_info
  #--------------------------------------------------------------------------
  def help_info
    VE_TARGET_HELP_WINDOW
  end
  #--------------------------------------------------------------------------
  # * New method: target_description
  #--------------------------------------------------------------------------
  def target_description
    return "" unless @action
    regexp = get_all_values("TARGET DESCRIPTION")
    text   = ""
    @action.note.scan(regexp) do
      info = $1.dup
      info.gsub!(/\r\n/) { "" }
      info.gsub!(/\\n/)  { "\r\n" }
      text += info
    end
    text
  end
  #--------------------------------------------------------------------------
  # * New method: update_target_help
  #--------------------------------------------------------------------------  
  def update_target_help
    text  = target_description
    align = help_info[:text_align]
    @help_window.visible = true
    if text != ""
      @help_window.set_info_text(text, align)
    else
      if help_info[:target_info]
        draw_tartge_info(align)
      else
        @help_window.set_item_text(@action, align)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * New method: draw_tartge_inf
  #--------------------------------------------------------------------------  
  def draw_tartge_info(align)
#~     if @action.for_one?
#~       @help_window.set_target_text(target(0), align)
#~     elsif @action.for_all? && @action.for_random?
#~       text = help_info[:random_enemies] if @action.for_opponent?
#~       text = help_info[:random_actors]  if @action.for_friend?
#~       text = help_info[:random_target]  if @action.for_all_targets?
#~       @help_window.set_info_text(text, align)
#~     elsif @action.for_all? && !@action.for_random?
#~       text = help_info[:all_enemies] if @action.for_opponent?
#~       text = help_info[:all_actors]  if @action.for_friend?
#~       text = help_info[:all_target]  if @action.for_all_targets?
#~       @help_window.set_info_text(text, align)
#~     end
  end
end

#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
#  This window shows skill and item explanations along with actor status.
#==============================================================================

#~ class Window_Help < Window_Base
#~   #--------------------------------------------------------------------------
#~   # * Alias method: set_item
#~   #--------------------------------------------------------------------------
#~   alias :set_item_ve_arrow_arrow :set_item
#~   def set_item(item)
#~     set_item_ve_arrow_arrow(item)
#~     refresh
#~   end
#~   #--------------------------------------------------------------------------
#~   # * New method: set_target_text
#~   #--------------------------------------------------------------------------
#~   def set_target_text(target, align = 0)
#~     if target && (target != @target || @target.name != @text)
#~       @text   = ""
#~       @target = target
#~       @align  = align
#~       target_info
#~     end
#~   end
#~   #--------------------------------------------------------------------------
#~   # * New method: set_info_text
#~   #--------------------------------------------------------------------------
#~   def set_info_text(text, align = 0)
#~     if text != @text
#~       @text = text
#~       contents.clear
#~       adj = @text[/\r\n/i]
#~       draw_text(0, 0, width, line_height * (adj ? 1 : 2), @text, align)
#~     end
#~   end
#~   #--------------------------------------------------------------------------
#~   # * New method: set_item_text
#~   #--------------------------------------------------------------------------
#~   def set_item_text(item, align = 0)
#~     if item.name != @text
#~       @text = item.name
#~       contents.clear
#~       iw = item.icon_index == 0 ? 0 : 24
#~       text_width = text_size(@text).width
#~       x = align == 0 ? 0 : (contents_width - 24 - text_width) / (3 - align)
#~       draw_icon(item.icon_index, x, line_height / 2, true)
#~       draw_text(iw + 2, 0, contents_width - iw, line_height * 2, @text, align)
#~     end
#~   end
#~   #--------------------------------------------------------------------------
#~   # * New method: target_info
#~   #--------------------------------------------------------------------------
#~   def target_info
#~     contents.clear
#~     change_color(hp_color(@target))
#~     adj = (@target.state_icons + @target.buff_icons).size == 0
#~     height = line_height * (adj ? 2 : 1)
#~     draw_text(0, 0, contents_width, height, @target.name, @align)
#~     draw_target_icons
#~   end
#~   #--------------------------------------------------------------------------
#~   # * New method: draw_target_icons
#~   #--------------------------------------------------------------------------
#~   def draw_target_icons
#~     icons = (@target.state_icons + @target.buff_icons)[0, contents_width / 24]
#~     x = @align == 0 ? 0 : (contents_width - icons.size * 24) / (3 - @align)
#~     icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, line_height) }
#~   end
#~ end

#==============================================================================
# ** Window_BattleEnemy
#------------------------------------------------------------------------------
#  This window display a list of enemies on the battle screen.
#==============================================================================

class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Overwrite method: show
  #--------------------------------------------------------------------------
  def show
    result = super
    fix_selection(arrow_move == 1 ? :horz : :vert)
    select(0)
    init_arrow_sprite(true)
    self.visible = false
    result
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: hide
  #--------------------------------------------------------------------------
  def hide
    result = super
    dispose_arrow
    result
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: enemy
  #--------------------------------------------------------------------------
  def enemy
    enemy_list[@index]
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_movable?
  #--------------------------------------------------------------------------
  def cursor_movable?
    super && active && !cursor_all && !target_all? && !target_self?
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    fix_selection(:vert) if arrow_move != 1 && @mode == :horz
    select((index - 1 + item_max) % item_max) if arrow_move != 1
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    fix_selection(:vert) if arrow_move != 1 && @mode == :horz
    select((index + 1) % item_max) if arrow_move != 1
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_right
  #--------------------------------------------------------------------------
  def cursor_right(wrap = false)
    fix_selection(:horz) if arrow_move != 2 && @mode == :vert
    select((index + 1) % item_max) if arrow_move != 2
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_left
  #--------------------------------------------------------------------------
  def cursor_left(wrap = false)
    fix_selection(:horz) if arrow_move != 2 && @mode == :vert
    select((index - 1 + item_max) % item_max) if arrow_move != 2
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: update_help
  #--------------------------------------------------------------------------
  def update_help
    update_target_help
  end
  #--------------------------------------------------------------------------
  # * Alias method: initialize
  #--------------------------------------------------------------------------
  alias :initialize_ve_arrow_arrow :initialize
  def initialize(info_viewport)
    initialize_ve_arrow_arrow(info_viewport)
    init_arrow
  end
  #--------------------------------------------------------------------------
  # * Alias method: update
  #--------------------------------------------------------------------------
  alias :update_ve_arrow_arrow :update
  def update
    update_ve_arrow_arrow
    init_arrow_sprite
    update_arrow_sprite
    return if Graphics.frame_count % arrow_animspeed != 0
    @arrows_anim = (@arrows_anim + 1) % arrow_frames
  end
  #--------------------------------------------------------------------------
  # * Alias method: dispose
  #--------------------------------------------------------------------------
  alias :dispose_ve_arrow_arrow :dispose
  def dispose
    dispose_ve_arrow_arrow
    dispose_arrow
  end
  #--------------------------------------------------------------------------
  # * New method: enemies
  #--------------------------------------------------------------------------
  def enemies
    enemy_list
  end
  #--------------------------------------------------------------------------
  # * New method: enemy_list
  #--------------------------------------------------------------------------
  def enemy_list
    enemies = $game_troop.alive_members.dup
    enemies.sort! {|a, b| b.screen_y <=> a.screen_y } if @mode == :vert
    enemies.sort! {|a, b| a.screen_x <=> b.screen_x } if @mode == :horz
    enemies
  end
  #--------------------------------------------------------------------------
  # * New method: fix_selection
  #--------------------------------------------------------------------------
  def fix_selection(type)
    current = enemy
    @mode   = type
    @index  = enemy_list.index(current)
  end
  #--------------------------------------------------------------------------
  # * New method: target
  #--------------------------------------------------------------------------
  def target(i)
    target_all? ? enemies : enemy
  end
  #--------------------------------------------------------------------------
  # * New method: dispose_arrow
  #--------------------------------------------------------------------------
  def dispose_arrow
    if arrow_animation?
      enemies.each do |enemy|
        enemy.sprite && enemy.sprite.end_loop_anim(:arrow)
      end
    end
    @arrows.each {|arrow| arrow.dispose }
    @arrows.clear
  end
end

#==============================================================================
# ** Window_BattleActor
#------------------------------------------------------------------------------
#  This window display a list of actors on the battle screen.
#==============================================================================

class Window_BattleActor < Window_BattleStatus
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_movable?
  #--------------------------------------------------------------------------
  def cursor_movable?
    super && active && !cursor_all && !target_all? && !target_self?
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    return if show_actor && arrow_move == 1
    fix_selection(:vert) if show_actor && arrow_move != 1 && @mode == :horz
    show_actor ? select((index + 1) % item_max) : super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    return if show_actor && arrow_move == 1
    fix_selection(:vert) if show_actor && arrow_move != 1 && @mode == :horz
    show_actor ? select((index - 1 + item_max) % item_max) : super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_right(
  #--------------------------------------------------------------------------
  def cursor_right(wrap = false)
    return if show_actor && arrow_move == 2
    fix_selection(:horz) if show_actor && arrow_move != 2 && @mode == :vert
    show_actor ? select((index + 1) % item_max) : super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: cursor_left
  #--------------------------------------------------------------------------
  def cursor_left(wrap = false)
    return if show_actor && arrow_move == 2
    fix_selection(:horz) if show_actor && arrow_move != 2 && @mode == :vert
    show_actor ? select((index - 1 + item_max) % item_max) :  super
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: update_help
  #--------------------------------------------------------------------------
  def update_help
    update_target_help
  end
  #--------------------------------------------------------------------------
  # * Overwrite method: update_cursor
  #--------------------------------------------------------------------------
  def update_cursor
    @cursor_all = cursor_all
    super
  end
  #--------------------------------------------------------------------------
  # * Alias method: initialize
  #--------------------------------------------------------------------------
  alias :initialize_ve_arrow_arrow :initialize
  def initialize(info_viewport)
    initialize_ve_arrow_arrow(info_viewport)
    init_arrow if show_actor
  end
  #--------------------------------------------------------------------------
  # * Alias method: update
  #--------------------------------------------------------------------------
  alias :update_ve_arrow_arrow :update
  def update
    update_ve_arrow_arrow
    return unless show_actor
    init_arrow_sprite
    update_arrow_sprite
    return if Graphics.frame_count % arrow_animspeed != 0
    @arrows_anim = (@arrows_anim + 1) % arrow_frames
  end
  #--------------------------------------------------------------------------
  # * Alias method: show
  #--------------------------------------------------------------------------
  alias :show_ve_arrow_arrow :show
  def show
    if show_actor
      result = super
      self.visible = false
      select(0)
      result
    else
      show_ve_arrow_arrow
    end
  end
  #--------------------------------------------------------------------------
  # * Alias method: hide
  #--------------------------------------------------------------------------
  alias :hide_ve_arrow_arrow :hide
  def hide
    result = hide_ve_arrow_arrow
    dispose_arrow if show_actor
    result
  end
  #--------------------------------------------------------------------------
  # * Alias method: dispose
  #--------------------------------------------------------------------------
  alias :update_cursor_ve_arrow_arrow :update_cursor
  def update_cursor
    show_actor ? cursor_rect.empty : update_cursor_ve_arrow_arrow
  end
  #--------------------------------------------------------------------------
  # * Alias method: dispose
  #--------------------------------------------------------------------------
  alias :dispose_ve_arrow_arrow :dispose
  def dispose
    dispose_ve_arrow_arrow
    dispose_arrow if show_actor
  end
  #--------------------------------------------------------------------------
  # * New method: cursor_all
  #--------------------------------------------------------------------------
  def cursor_all
    @action && @action.for_all?
  end
  #--------------------------------------------------------------------------
  # * New method: actor
  #--------------------------------------------------------------------------
  def actor
    actor_list[@index]
  end
  #--------------------------------------------------------------------------
  # * New method: actors
  #--------------------------------------------------------------------------
  def actors
    actor_list
  end
  #--------------------------------------------------------------------------
  # * New method: enemy_list
  #--------------------------------------------------------------------------
  def actor_list
    actors = $game_party.battle_members.dup
    actors.sort! {|a, b| b.screen_y <=> a.screen_y } if @mode == :vert
    actors.sort! {|a, b| a.screen_x <=> b.screen_x } if @mode == :horz
    actors
  end
  #--------------------------------------------------------------------------
  # * New method: fix_selection
  #--------------------------------------------------------------------------
  def fix_selection(type)
    current = actor
    @mode   = type
    @index  = actor_list.index(current)
  end
  #--------------------------------------------------------------------------
  # * New method: target
  #--------------------------------------------------------------------------
  def target(i)
    @index = BattleManager.actor.index if @action.for_user?
    target_all? ? actors : actor
  end
  #--------------------------------------------------------------------------
  # * New method: show_actor
  #--------------------------------------------------------------------------
  def show_actor
    $imported[:ve_actor_battlers]
  end
  #--------------------------------------------------------------------------
  # * New method: dispose_arrow
  #--------------------------------------------------------------------------
  def dispose_arrow
    if arrow_animation?
      actors.each {|actor| actor.sprite.end_loop_anim(:arrow) if actor.sprite }
    end
    @arrows.each {|arrow| arrow.dispose }
    @arrows.clear
  end
end

#~ #==============================================================================
#~ # ** Scene_Battle
#~ #------------------------------------------------------------------------------
#~ #  This class performs battle screen processing.
#~ #==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias method: create_actor_window
  #--------------------------------------------------------------------------
  alias :create_actor_window_ve_arrow_arrow :create_actor_window
  def create_actor_window
    create_actor_window_ve_arrow_arrow
    @actor_window.help_window = @help_window if VE_USE_TARGET_HELP
  end
  #--------------------------------------------------------------------------
  # * Alias method: create_enemy_window
  #--------------------------------------------------------------------------
  alias :create_enemy_window_ve_arrow_arrow :create_enemy_window
  def create_enemy_window
    create_enemy_window_ve_arrow_arrow
    @enemy_window.help_window = @help_window if VE_USE_TARGET_HELP
  end
  #--------------------------------------------------------------------------
  # * Alias method: command_attack
  #--------------------------------------------------------------------------
  alias :command_attack_ve_arrow_arrow :command_attack
  def command_attack
    set_window_action($data_skills[BattleManager.actor.attack_skill_id])
    command_attack_ve_arrow_arrow
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_skill_ok
  #--------------------------------------------------------------------------
  alias :on_skill_ok_ve_arrow_arrow :on_skill_ok
  def on_skill_ok
    set_window_action(@skill_window.item)
    on_skill_ok_ve_arrow_arrow
    @skill_window.visible = false if VE_HIDE_SKILL_WINDOW
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_item_ok
  #--------------------------------------------------------------------------
  alias :on_item_ok_ve_arrow_arrow :on_item_ok
  def on_item_ok
    set_window_action(@item_window.item)
    on_item_ok_ve_arrow_arrow
    @item_window.visible = false if VE_HIDE_ITEM_WINDOW
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_enemy_cancel
  #--------------------------------------------------------------------------
  alias :on_enemy_cancel_ve_arrow_arrow :on_enemy_cancel
  def on_enemy_cancel
    on_enemy_cancel_ve_arrow_arrow
    case @actor_command_window.current_symbol
    when :skill then @skill_window.visible = true
    when :item  then @item_window.visible  = true
    when :attack, :direct_skill, :direct_item
      @help_window.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # * Alias method: on_actor_cancel
  #--------------------------------------------------------------------------
  alias :on_actor_cancel_ve_arrow_arrow :on_actor_cancel
  def on_actor_cancel
    on_actor_cancel_ve_arrow_arrow
    case @actor_command_window.current_symbol
    when :skill then @skill_window.visible = true
    when :item  then @item_window.visible  = true
    when :attack, :direct_skill, :direct_item
      @help_window.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # * New method: set_window_action
  #--------------------------------------------------------------------------
  def set_window_action(item)
    @enemy_window.set_action(item) if item.for_opponent?
    @enemy_window.update_help      if item.for_opponent?
    @actor_window.set_action(item) if item.for_friend?
    @actor_window.update_help      if item.for_friend?
  end
end
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复

使用道具 举报

梦石
0
星屑
1143
在线时间
186 小时
注册时间
2017-8-2
回帖
1
 楼主| 发表于 2019-10-25 18:06:18 | 显示全部楼层
本帖最后由 fish12358 于 2019-10-25 18:08 编辑
流浪杰哥 发表于 2019-10-25 09:16
把这放到Sideview下面试试看吧,不行的话那就没办法
$imported = {} if $imported.nil?
$imported[:mog_bat ...


昨天自己摸索了以后发现,只要把 On Skill OK跟 On Item OK这两段删了以后,对自己施放技能时就不会出错,只是这样会有别的问题吗?
我完全没用到他们的ATB脚本

你改的这个的确能选择sideview的队员,不过有些跑位了,因为我有调整过默认的位子,想请问要在怎么在你改的这脚本调整呢?

现在好像只剩这问题了!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部