设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1312|回复: 4
打印 上一主题 下一主题

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1078
在线时间
180 小时
注册时间
2017-8-2
帖子
3
跳转到指定楼层
1
发表于 2019-10-24 18:46:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
200星屑
https://atelierrgss.wordpress.com/rgss3-battle-cursor/

先附上光标脚本的网址

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

拜托各位大哥了

最佳答案

查看完整内容

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

Lv4.逐梦者

梦石
0
星屑
7693
在线时间
1342 小时
注册时间
2012-6-6
帖子
345
2
发表于 2019-10-24 18:46:25 | 只看该作者
fish12358 发表于 2019-10-25 18:06
昨天自己摸索了以后发现,只要把 On Skill OK跟 On Item OK这两段删了以后,对自己施放技能时就不会出错 ...

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7693
在线时间
1342 小时
注册时间
2012-6-6
帖子
345
3
发表于 2019-10-25 09:16:37 | 只看该作者
把这放到Sideview下面试试看吧,不行的话那就没办法
RUBY 代码复制
  1. $imported = {} if $imported.nil?
  2. $imported[:mog_battle_cursor] = true
  3.  
  4. #==============================================================================
  5. # ■ CURSOR SETTING
  6. #==============================================================================
  7. module MOG_BATTLE_CURSOR
  8.   #相对于目标的指针位置.
  9.   CURSOR_POSITION = [0, 48]
  10.   #目标名的位置.
  11.   CURSOR_NAME_POSITION = [-10, 46]
  12.   #指针是否左右滑动.
  13.   CURSOR_SLIDE_EFFECT = true
  14.   #指针是否上下浮动.
  15.   CURSOR_FLOAT_EFFECT = true
  16.   #指针的Z坐标.
  17.   CURSOR_Z = 155
  18.   #第二个指针的相对于目标的位置.
  19.   TARGET_CURSOR_2_POS = [0, 0]
  20.   #第二个指针是否有缩放效果.
  21.   TARGET_CURSOR_2_ZOOM_EFFECT = false
  22. end
  23.  
  24. #==============================================================================
  25. # ■ Game Temp
  26. #==============================================================================
  27. class Game_Temp
  28.  
  29.   attr_accessor :battle_cursor
  30.   attr_accessor :battle_cursor_data
  31.   attr_accessor :target_skill
  32.   attr_accessor :battle_end
  33.   attr_accessor :sprite_visible
  34.   attr_accessor :battle_cursor_need_refresh
  35.   attr_accessor :battle_cursor_scope_refresh
  36.   attr_accessor :battle_cursor_target
  37.   attr_accessor :target_data
  38.   attr_accessor :target_cursor_need_refresh
  39.   attr_accessor :target_window_active
  40.   #--------------------------------------------------------------------------
  41.   # ● Initialize
  42.   #--------------------------------------------------------------------------  
  43.   alias mog_battle_cursor_initialize initialize
  44.   def initialize
  45.       @battle_cursor = [0,0,false,""] ; @target_skill = [] ; @battle_end = false
  46.       @battle_cursor_need_refresh = [false,false] ; @battle_cursor_target = [nil,nil]
  47.       @target_data = [nil,nil] ; @target_cursor_need_refresh = false
  48.       @target_window_active = [false,false] ; @battle_cursor_scope_refresh = false
  49.       mog_battle_cursor_initialize
  50.   end  
  51.  
  52.   #--------------------------------------------------------------------------
  53.   # ● Clear Target Temp
  54.   #--------------------------------------------------------------------------   
  55.   def clear_target_temp
  56.       $game_party.members.each {|t| t.target_temp = false } rescue nil
  57.       $game_troop.members.each {|t| t.target_temp = false } rescue nil   
  58.       @target_data = [nil,nil] ; @battle_cursor_target = [nil,nil]
  59.   end
  60.  
  61.   #--------------------------------------------------------------------------
  62.   # ● Sprite Visible
  63.   #--------------------------------------------------------------------------   
  64.   def sprite_visible
  65.       return false if $game_message.visible
  66.       return false if $game_temp.battle_end
  67.       return true
  68.   end
  69.  
  70. end
  71.  
  72. #==============================================================================
  73. # ■ Spriteset Battle Cursor
  74. #==============================================================================
  75. class Sprite_Battle_Cursor < Sprite
  76.   include MOG_BATTLE_CURSOR
  77.  
  78.   #--------------------------------------------------------------------------
  79.   # ● Initialize
  80.   #--------------------------------------------------------------------------        
  81.   def initialize(viewport = nil)
  82.       super(viewport)
  83.       $game_temp.battle_cursor = [0,0,false,""] ; $game_temp.battle_end = false
  84.       self.bitmap = Cache.system("Battle_Cursor")
  85.       self.visible = $game_temp.battle_cursor[2] ; self.z = CURSOR_Z
  86.       @cw = self.bitmap.width / 2 ; @ch = [self.bitmap.height, Graphics.height - self.bitmap.height]
  87.       @cursor_name = Sprite.new ; @cursor_name.bitmap = Bitmap.new(120,32)
  88.       @cursor_name.z = self.z + 1 ; @cursor_name.bitmap.font.size = 16
  89.       @cursor_name_enemy = $game_temp.battle_cursor[3] ; @cs_x = 0
  90.       @cursor_name_position = [CURSOR_NAME_POSITION[0] ,CURSOR_NAME_POSITION[1]]
  91.       @cursor_float = [0,0] ;  refresh_cursor_name
  92.       @face_battler = SceneManager.face_battler? if $imported[:mog_battle_hud_ex]
  93.       @cs_x = (15 * MOG_SPRITE_ACTOR::SPRITE_ZOOM).truncate if $imported[:mog_sprite_actor]  
  94.   end
  95.  
  96.   #--------------------------------------------------------------------------
  97.   # ● Dispose Sprite
  98.   #--------------------------------------------------------------------------         
  99.   def dispose
  100.       super
  101.       dispose_sprite_cursor
  102.   end
  103.  
  104.   #--------------------------------------------------------------------------
  105.   # ● Dispose Sprite Cursor
  106.   #--------------------------------------------------------------------------            
  107.   def dispose_sprite_cursor
  108.       @cursor_name.bitmap.dispose ; @cursor_name.dispose
  109.       self.bitmap.dispose ; $game_temp.clear_target_temp
  110.   end
  111.  
  112.   #--------------------------------------------------------------------------
  113.   # ● Refresh Cursor Name
  114.   #--------------------------------------------------------------------------              
  115.   def refresh_cursor_name
  116.       @cursor_name_enemy = $game_temp.battle_cursor[3]
  117.       @cursor_name.bitmap.clear
  118.       @cursor_name.bitmap.draw_text(0,0,120,32,@cursor_name_enemy.to_s,1)
  119.   end
  120.  
  121.   #--------------------------------------------------------------------------
  122.   # ● Update Sprite Cursor
  123.   #--------------------------------------------------------------------------              
  124.   def update_sprite_cursor
  125.       update_battle_camera_cursor if update_battle_cursor_r?
  126.       if force_hide? ; self.visible = false ; @cursor_name.visible = false ; return ; end
  127.       update_visible ; update_cursor_float_effect ; set_real_position
  128.       execute_move(0,self.x,$game_temp.battle_cursor[0])
  129.       execute_move(1,self.y,$game_temp.battle_cursor[1] + @cursor_float[1])
  130.       update_sprite_name
  131.       self.visible = false if !$game_temp.sprite_visible
  132.       @cursor_name.opacity = 0 if @cursor_name and !$game_temp.sprite_visible
  133.   end
  134.  
  135.   #--------------------------------------------------------------------------
  136.   # ● Process Cursor Move
  137.   #--------------------------------------------------------------------------
  138.   def process_cursor_move
  139.       return unless cursor_movable?
  140.       last_index = @index
  141.       cursor_move_index(1) if Input.repeat?(:DOWN)
  142.       cursor_move_index(-1) if Input.repeat?(:UP)
  143.       cursor_move_index(1) if Input.repeat?(:RIGHT)
  144.       cursor_move_index(-1) if Input.repeat?(:LEFT)
  145.       $game_temp.battle_cursor_data = $game_troop.alive_members[@index]
  146.       Sound.play_cursor if @index != last_index
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● Update Battle Cursor
  150.   #--------------------------------------------------------------------------              
  151.   def update_battle_cursor_r?
  152.       return false if $imported[:mog_battle_camera] == nil
  153.       if $imported[:mog_battle_hud_ex] and SceneManager.face_battler? and $game_temp.battle_cursor_target[0] != nil
  154.          self.ox = 0 ; self.oy = 0 ; @cursor_name.ox = 0 ; @cursor_name.oy = 0
  155.          return false
  156.       end   
  157.       return true
  158.    end   
  159.  
  160.   #--------------------------------------------------------------------------
  161.   # ● Update Battle Camera Cursor
  162.   #--------------------------------------------------------------------------              
  163.   def update_battle_camera_cursor
  164.       self.ox = $game_temp.viewport_oxy[0]
  165.       self.oy = $game_temp.viewport_oxy[1]
  166.       @cursor_name.ox = self.ox
  167.       @cursor_name.oy = self.oy
  168.   end
  169.  
  170.   #--------------------------------------------------------------------------
  171.   # ● Set Real Position
  172.   #--------------------------------------------------------------------------              
  173.   def set_real_position  
  174.       return if $game_temp.target_data == [nil,nil]
  175.       return if $game_temp.battle_cursor_target == [nil,nil]
  176.       $game_temp.battle_cursor[0] = $game_temp.target_data[1].x - @cw + CURSOR_POSITION[0]
  177.       $game_temp.battle_cursor[1] = $game_temp.target_data[1].y + CURSOR_POSITION[1]
  178.       $game_temp.battle_cursor[1] -= ($game_temp.target_data[1].bitmap.height / 2) unless !$game_temp.target_data[1].bitmap
  179.       if $game_temp.target_data[0].is_a?(Game_Actor)
  180.          if $imported[:mog_sprite_actor] and $game_temp.target_data[0].dead?
  181.             if $game_temp.target_data[0].bact_sprite[5] == 6
  182.                $game_temp.battle_cursor[0] -= @cs_x
  183.             else
  184.                $game_temp.battle_cursor[0] += @cs_x
  185.             end   
  186.          end         
  187.          $game_temp.battle_cursor[1] -= @ch[0] if @face_battler and $game_temp.battle_cursor[1] > @ch[1]
  188.       end      
  189.   end
  190.  
  191.   #--------------------------------------------------------------------------
  192.   # ● Can Move Real Position?
  193.   #--------------------------------------------------------------------------               
  194.   def can_move_real_position?
  195.       return false if $game_temp.battle_cursor_data == nil
  196.       return false if $game_temp.battle_cursor_data.dead?
  197.       screen_x = $game_temp.battle_cursor_data.screen_x rescue nil
  198.       return false if screen_x == nil
  199.       return true
  200.   end   
  201.  
  202.   #--------------------------------------------------------------------------
  203.   # ● Force Hide
  204.   #--------------------------------------------------------------------------              
  205.   def force_hide?
  206.       return true if $game_temp.battle_cursor == nil
  207.       return true if $game_temp.battle_cursor[0] == nil
  208.       return true if $game_temp.battle_cursor[1] == nil   
  209.       return false
  210.   end
  211.  
  212.   #--------------------------------------------------------------------------
  213.   # ● Update Visible
  214.   #--------------------------------------------------------------------------               
  215.   def update_visible
  216.       $game_temp.battle_cursor_data = nil if !self.visible
  217.       if force_hide_battle_cursor?
  218.          self.visible = false ; return
  219.       end  
  220.       self.visible = $game_temp.battle_cursor[2]
  221.       (self.x = -64 ; self.y = -64) if !self.visible
  222.   end  
  223.  
  224.   #--------------------------------------------------------------------------
  225.   # ● Force Hide Battle Cursor
  226.   #--------------------------------------------------------------------------               
  227.   def force_hide_battle_cursor?
  228.       if $imported[:mog_sprite_actor] and !$game_temp.target_data.nil?
  229.          return true if !$game_temp.target_data[0].bact_sprite_visiblle
  230.       end  
  231.       return true if $imported[:mog_active_chain] and $game_temp.chain_action_phase
  232.       return true if $imported[:mog_atb_system] and BattleManager.actor == nil
  233. #      return true if $imported[:mog_blitz_commands] and $game_temp.blitz_commands_phase
  234.       return false
  235.   end
  236.  
  237.   #--------------------------------------------------------------------------
  238.   # ● Update Sprite Name
  239.   #--------------------------------------------------------------------------               
  240.   def update_sprite_name
  241.       return if @cursor_name == nil
  242.       refresh_cursor_name  if @cursor_name_enemy != $game_temp.battle_cursor[3]
  243.       @cursor_name.x = self.x + @cursor_name_position[0]
  244.       @cursor_name.y = self.y + @cursor_name_position[1]
  245.       @cursor_name.opacity = self.opacity ; @cursor_name.visible = self.visible
  246.   end  
  247.  
  248.   #--------------------------------------------------------------------------
  249.   # ● Update Cursor Float Effect
  250.   #--------------------------------------------------------------------------              
  251.   def update_cursor_float_effect
  252.       return if !CURSOR_FLOAT_EFFECT
  253.       @cursor_float[0] += 1
  254.       case @cursor_float[0]
  255.         when 0..20  ; @cursor_float[1] += 1
  256.         when 21..40 ; @cursor_float[1] -= 1
  257.         else
  258.           @cursor_float[0] = 0 ;   @cursor_float[1] = 0
  259.       end        
  260.   end  
  261.  
  262.   #--------------------------------------------------------------------------
  263.   # ● Execute Move
  264.   #--------------------------------------------------------------------------      
  265.   def execute_move(type,cp,np)
  266.       sp = 5 + ((cp - np).abs / 5)
  267.       if cp > np
  268.          cp -= sp ; cp = np if cp < np
  269.       elsif cp < np
  270.          cp += sp ; cp = np if cp > np
  271.       end     
  272.        self.x = cp if type == 0 ; self.y = cp if type == 1
  273.   end      
  274.  
  275. end
  276.  
  277. #==============================================================================
  278. # ■ Spriteset Battle
  279. #==============================================================================
  280. class Spriteset_Battle
  281.  
  282.   #--------------------------------------------------------------------------
  283.   # ● Initialize
  284.   #--------------------------------------------------------------------------      
  285.   alias mog_battle_cursor_initialize initialize
  286.   def initialize
  287.       mog_battle_cursor_initialize
  288.       create_cursor
  289.   end
  290.  
  291.   #--------------------------------------------------------------------------
  292.   # ● Dispose
  293.   #--------------------------------------------------------------------------      
  294.   alias mog_battle_cursor_dispose dispose
  295.   def dispose
  296.       mog_battle_cursor_dispose
  297.       dispose_battle_cursor
  298.   end
  299.  
  300.   #--------------------------------------------------------------------------
  301.   # ● Update
  302.   #--------------------------------------------------------------------------         
  303.   alias mog_battle_cursor_update update
  304.   def update
  305.       mog_battle_cursor_update
  306.       update_battle_cursor
  307.   end  
  308.  
  309.   #--------------------------------------------------------------------------
  310.   # ● Create_Cursor
  311.   #--------------------------------------------------------------------------        
  312.   def create_cursor
  313.       return if @battle_cursor != nil
  314.       $game_temp.clear_target_temp ; @battle_cursor = Sprite_Battle_Cursor.new
  315.   end
  316.  
  317.   #--------------------------------------------------------------------------
  318.   # ● Dispose Cursor
  319.   #--------------------------------------------------------------------------        
  320.   def dispose_battle_cursor
  321.       return if @battle_cursor == nil
  322.       @battle_cursor.dispose ; @battle_cursor = nil
  323.   end  
  324.  
  325.   #--------------------------------------------------------------------------
  326.   # ● Update Battle Cursor
  327.   #--------------------------------------------------------------------------         
  328.   def update_battle_cursor
  329.       return if @battle_cursor == nil
  330.       @battle_cursor.update_sprite_cursor
  331.   end
  332.  
  333. end
  334.  
  335. #==============================================================================
  336. # ■ Battle Cursor Index
  337. #==============================================================================
  338. module Battle_Cursor_index
  339.  
  340.   include MOG_BATTLE_CURSOR
  341.  
  342.   #--------------------------------------------------------------------------
  343.   # ● Check Index Limit
  344.   #--------------------------------------------------------------------------      
  345.   def check_index_limit
  346.       self.index = 0 if self.index >= item_max
  347.       self.index = (item_max - 1) if self.index < 0
  348.   end      
  349.  
  350.   #--------------------------------------------------------------------------
  351.   # ● Set Cursor Position Enemy
  352.   #--------------------------------------------------------------------------   
  353.   def set_cursor_position_enemy
  354.       return if !self.active
  355.       self.index = 0 if $game_troop.alive_members[self.index].nil?
  356.       @fcursor = nil ; $game_temp.battle_cursor_need_refresh[1] = false
  357.       $game_temp.battle_cursor[0] = $game_troop.alive_members[self.index].screen_x + CURSOR_POSITION[0] rescue nil
  358.       $game_temp.battle_cursor[1] = $game_troop.alive_members[self.index].screen_y + CURSOR_POSITION[1] rescue nil
  359.       $game_temp.battle_cursor[3] = $game_troop.alive_members[self.index].name rescue nil
  360.       $game_temp.battle_cursor_data = $game_troop.alive_members[self.index]
  361.       return if $game_temp.battle_cursor_data == nil
  362.       enable_target_sprites($game_temp.battle_cursor_data.index)
  363.   end
  364.  
  365.   #--------------------------------------------------------------------------
  366.   # ● Enable Target Sprites
  367.   #--------------------------------------------------------------------------   
  368.   def enable_target_sprites(target_index)  
  369.       return if $game_temp.target_skill.empty?
  370.       if $imported[:mog_atb_system] and !BattleManager.subject.nil?
  371.          $game_temp.battle_cursor_scope_refresh = true
  372.       end   
  373.       $game_temp.clear_target_temp ; battler = $game_temp.target_skill[1]
  374.       type = $game_temp.target_skill[0].is_a?(RPG::Skill) ? 0 : 1
  375.       target_index = $game_temp.battle_cursor_data.index
  376.       battler.make_action_temp($game_temp.target_skill[0].id, target_index,type)      
  377.       targets = battler.action_temp.make_targets.compact
  378.       targets.each {|t| t.target_temp = true }
  379.   end  
  380.  
  381.   #--------------------------------------------------------------------------
  382.   # ● Refresh Scope Targets
  383.   #--------------------------------------------------------------------------   
  384.   def refresh_scope_targets
  385.       targets = battler.action_temp.make_targets.compact
  386.       targets.each {|t| t.target_temp = true }
  387.   end
  388.  
  389.   #--------------------------------------------------------------------------
  390.   # ● Set Cursor Position Actor
  391.   #--------------------------------------------------------------------------   
  392.   def set_cursor_position_actor
  393.       return if !self.active
  394.       self.index = 0 if $game_party.members[self.index].nil?
  395.       @fcursor = nil ; $game_temp.battle_cursor_need_refresh[0] = false
  396.       $game_temp.battle_cursor[0] = $game_party.members[self.index].sv.x + CURSOR_POSITION[0] rescue nil#screen_x + CURSOR_POSITION[0] rescue nil
  397.       $game_temp.battle_cursor[1] = $game_party.members[self.index].sv.y + CURSOR_POSITION[1] rescue nil#screen_y + CURSOR_POSITION[1] rescue nil
  398.       $game_temp.battle_cursor[3] = $game_party.members[self.index].name rescue nil
  399.       $game_temp.battle_cursor_data = $game_party.members[self.index]
  400.       $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil
  401.       enable_target_sprites(self.index)
  402.   end  
  403.  
  404.   #--------------------------------------------------------------------------
  405.   # ● Process Cursor Move Index
  406.   #--------------------------------------------------------------------------  
  407.   def cursor_move_index(value = 0)
  408.       self.index += value ;  check_index_limit
  409.   end
  410.  
  411. end
  412.  
  413. #==============================================================================
  414. # ■ Window_BattleActor
  415. #==============================================================================
  416. class Window_BattleActor < Window_BattleStatus
  417.   include Battle_Cursor_index
  418.  
  419.   #--------------------------------------------------------------------------
  420.   # ● Update
  421.   #--------------------------------------------------------------------------  
  422.   alias mog_battle_cursor_actor_update update
  423.   def update
  424.       pre_index = self.index
  425.       mog_battle_cursor_actor_update
  426.       $game_temp.battle_cursor_target[0] = $game_party.members[self.index]
  427.       $game_temp.battle_cursor_target[0] = nil if !self.active      
  428.       set_cursor_position_actor if refresh_cursor_position?(pre_index)
  429.       $game_temp.target_window_active[0] = self.active
  430.   end
  431.  
  432.   #--------------------------------------------------------------------------
  433.   # ● Refresh Cursor Position
  434.   #--------------------------------------------------------------------------  
  435.   def refresh_cursor_position?(pre_index)
  436.       return true if pre_index != self.index
  437.       return true if @fcursor
  438.       return true if $game_temp.battle_cursor_need_refresh[0]
  439.       return false
  440.   end
  441.  
  442.   #--------------------------------------------------------------------------
  443.   # ● Show
  444.   #--------------------------------------------------------------------------
  445.   alias mog_battle_cursor_show show
  446.   def show
  447.       if @info_viewport
  448.          set_cursor_position_actor ; $game_temp.battle_cursor[2] = true
  449.          @fcursor = true
  450.       end
  451.       mog_battle_cursor_show
  452.   end
  453.  
  454.   #--------------------------------------------------------------------------
  455.   # ● Hide
  456.   #--------------------------------------------------------------------------
  457.   alias mog_battle_cursor_hide hide
  458.   def hide
  459.       $game_temp.battle_cursor[2] = false if @info_viewport
  460.       if $game_temp.target_window_active[1] == false
  461.          ($game_temp.clear_target_temp ; $game_temp.target_skill.clear) unless self.active
  462.       end
  463.       mog_battle_cursor_hide
  464.   end  
  465.  
  466.   #--------------------------------------------------------------------------
  467.   # ● Process Cursor Move
  468.   #--------------------------------------------------------------------------
  469.   def process_cursor_move
  470.       return unless cursor_movable?
  471.       last_index = @index
  472.       cursor_move_index(1) if Input.repeat?(:DOWN)
  473.       cursor_move_index(-1) if Input.repeat?(:UP)
  474.       cursor_move_index(1) if Input.repeat?(:RIGHT)
  475.       cursor_move_index(-1) if Input.repeat?(:LEFT)
  476.       $game_temp.battle_cursor_data = $game_party.members[self.index]
  477.       Sound.play_cursor if @index != last_index
  478.   end
  479.  
  480. end
  481.  
  482. #==============================================================================
  483. # ■ Game Enemy
  484. #==============================================================================
  485. class Game_Enemy < Game_Battler
  486.   attr_accessor :index
  487. end
  488.  
  489. #==============================================================================
  490. # ■ Game Troop
  491. #==============================================================================
  492. class Game_Troop < Game_Unit
  493.  
  494.   #--------------------------------------------------------------------------
  495.   # * Setup
  496.   #--------------------------------------------------------------------------
  497.   alias mog_battle_cursor_setup setup
  498.   def setup(troop_id)
  499.       mog_battle_cursor_setup(troop_id)
  500.       if can_sort_index?
  501.          @enemies.sort! {|a,b| a.screen_x <=> b.screen_x}
  502.          @enemies.each_with_index {|e, i| e.index = i }
  503.       end
  504.   end
  505.  
  506.   #--------------------------------------------------------------------------
  507.   # * Can Sort Index?
  508.   #--------------------------------------------------------------------------
  509.   def can_sort_index?
  510.       return false if @enemies.size < 3
  511.       return false if troop.pages.size > 1
  512.       return false if !troop.pages[0].list[0].parameters.empty? rescue false
  513.       return true
  514.   end
  515.  
  516. end
  517.  
  518. #==============================================================================
  519. # ■ Window_BattleEnemy
  520. #==============================================================================
  521. class Window_BattleEnemy < Window_Selectable
  522.   include Battle_Cursor_index
  523.  
  524.   #--------------------------------------------------------------------------
  525.   # ● Update
  526.   #--------------------------------------------------------------------------  
  527.   alias mog_battle_cursor_enemy_update update
  528.   def update
  529.       pre_index = self.index
  530.       mog_battle_cursor_enemy_update
  531.       $game_temp.battle_cursor_target[1] = $game_troop.alive_members[self.index]
  532.       $game_temp.battle_cursor_target[1] = nil if !self.active
  533.       set_cursor_position_enemy if refresh_cursor_position?(pre_index)
  534.       $game_temp.target_window_active[1] = self.active
  535.   end
  536.  
  537.   #--------------------------------------------------------------------------
  538.   # ● Refresh Cursor Position
  539.   #--------------------------------------------------------------------------  
  540.   def refresh_cursor_position?(pre_index)
  541.       return true if pre_index != self.index
  542.       return true if @fcursor
  543.       return true if $game_temp.battle_cursor_need_refresh[1]
  544.       return false
  545.   end   
  546.  
  547.   #--------------------------------------------------------------------------
  548.   # ● Show
  549.   #--------------------------------------------------------------------------
  550.   alias mog_battle_cursor_show show
  551.   def show
  552.       if @info_viewport
  553.          set_cursor_position_enemy ; $game_temp.battle_cursor[2] = true
  554.          @fcursor = true
  555.       end
  556.       mog_battle_cursor_show
  557.   end
  558.  
  559.   #--------------------------------------------------------------------------
  560.   # ● Hide
  561.   #--------------------------------------------------------------------------
  562.   alias mog_battle_cursor_hide hide
  563.   def hide
  564.       $game_temp.battle_cursor[2] = false if @info_viewport
  565.       if $game_temp.target_window_active[0] == false
  566.       ($game_temp.clear_target_temp ; $game_temp.target_skill.clear) unless self.active
  567.       end
  568.       mog_battle_cursor_hide
  569.   end  
  570.  
  571.   #--------------------------------------------------------------------------
  572.   # ● Process Cursor Move
  573.   #--------------------------------------------------------------------------
  574.   def process_cursor_move
  575.       return unless cursor_movable?
  576.       last_index = @index
  577.       cursor_move_index(1) if Input.repeat?(:DOWN)
  578.       cursor_move_index(-1) if Input.repeat?(:UP)
  579.       cursor_move_index(1) if Input.repeat?(:RIGHT)
  580.       cursor_move_index(-1) if Input.repeat?(:LEFT)
  581.       $game_temp.battle_cursor_data = $game_troop.alive_members[@index]
  582.       Sound.play_cursor if @index != last_index
  583.   end
  584.  
  585. end
  586.  
  587. #==============================================================================
  588. # ■ Window Selectable
  589. #==============================================================================
  590. class Window_Selectable < Window_Base  
  591.  
  592.   #--------------------------------------------------------------------------
  593.   # * Process OK
  594.   #-------------------------------------------------------------------------
  595.   alias mog_target_cursor_process_ok process_ok
  596.   def process_ok
  597.       mog_target_cursor_process_ok
  598.       execute_target_selection if can_execute_target_selection?
  599.   end
  600.  
  601.   #--------------------------------------------------------------------------
  602.   # * Can Execute Target Selection
  603.   #-------------------------------------------------------------------------
  604.   def can_execute_target_selection?
  605.       return false if !SceneManager.scene_is?(Scene_Battle)
  606.       return false if !current_item_enabled?
  607.       return true if self.is_a?(Window_BattleSkill)
  608.       return true if self.is_a?(Window_BattleItem)
  609.       return true if self.is_a?(Window_ActorCommand) and self.index == 0
  610.       return false
  611.   end
  612.  
  613.   #--------------------------------------------------------------------------
  614.   # * Execute Target Selection
  615.   #-------------------------------------------------------------------------
  616.   def execute_target_selection      
  617.       return if BattleManager.actor == nil
  618.       $game_temp.target_skill.clear
  619.       item = @data[index] rescue nil      
  620.       item = $data_skills[BattleManager.actor.attack_skill_id] rescue nil if self.is_a?(Window_ActorCommand)
  621.       return if item == nil
  622.       if [2,8,10].include?(item.scope) or item.note =~ /<Scope Range = (\d+) - (\d+) - (\d+) - (\d+)>/   
  623.          $game_temp.target_skill = [item,BattleManager.actor]
  624.       end   
  625.   end  
  626.  
  627. end
  628.  
  629. #==============================================================================
  630. # ■ Game Battler
  631. #==============================================================================
  632. class Game_Battler < Game_BattlerBase
  633.  
  634.   attr_accessor :target_temp
  635.   attr_accessor :action_temp
  636.  
  637.   #--------------------------------------------------------------------------
  638.   # * Initialize
  639.   #--------------------------------------------------------------------------
  640.   alias mog_target_cursor_initialize initialize
  641.   def initialize
  642.       @target_cursor_temp = false
  643.       mog_target_cursor_initialize
  644.   end
  645.  
  646.   #--------------------------------------------------------------------------
  647.   # ● Make Action Temp
  648.   #--------------------------------------------------------------------------
  649.   def make_action_temp(action_id,target_index,type)
  650.       return if action_id == nil
  651.       action = Game_Action.new(self, true)
  652.       action.set_skill(action_id) if type == 0
  653.       action.set_item(action_id) if type == 1
  654.       action.target_index = target_index
  655.       @action_temp = action
  656.   end     
  657.  
  658.   #--------------------------------------------------------------------------
  659.   # ● Make Action Temp
  660.   #--------------------------------------------------------------------------
  661.   alias mog_battle_cursor_item_apply item_apply
  662.   def item_apply(user, item)
  663.       mog_battle_cursor_item_apply(user, item)
  664.       if self == $game_temp.battle_cursor_target[1]
  665.          $game_temp.battle_cursor_need_refresh[0] = true
  666.          $game_temp.battle_cursor_need_refresh[1] = true
  667.       end
  668.   end  
  669.  
  670. end
  671.  
  672. #==============================================================================
  673. # ■ Game BattlerBase
  674. #==============================================================================
  675. class Game_BattlerBase
  676.    attr_accessor :hidden
  677. end
  678.  
  679. #==============================================================================
  680. # ■ Sprite Battler
  681. #==============================================================================
  682. class Sprite_Battler < Sprite_Base
  683.   include MOG_BATTLE_CURSOR
  684.   #--------------------------------------------------------------------------
  685.   # * Initialize
  686.   #--------------------------------------------------------------------------
  687.   alias mog_target_cursor_initialize initialize
  688.   def initialize(viewport, battler = nil)
  689.       mog_target_cursor_initialize(viewport, battler)
  690.       create_target_cursor
  691.   end
  692.  
  693.   #--------------------------------------------------------------------------
  694.   # * Create Target Cursor
  695.   #--------------------------------------------------------------------------
  696.   def create_target_cursor
  697.       @target_cursor = Sprite.new
  698.       @target_cursor.bitmap = Cache.system("Battle_Cursor2")
  699.       @target_cursor.ox = @target_cursor.bitmap.width / 2
  700.       @target_cursor.oy = @target_cursor.bitmap.height / 2
  701.       @target_cursor_org = [@target_cursor.ox,@target_cursor.oy]
  702.       @target_cursor.visible = false
  703.       @target_visible_old = @target_cursor.visible
  704.       @tc_pos = [TARGET_CURSOR_2_POS[0],TARGET_CURSOR_2_POS[1] + @target_cursor.oy]
  705.       @face_battler = SceneManager.face_battler? if $imported[:mog_battle_hud_ex]
  706.       @target_cursor_ch = [@target_cursor.bitmap.height, Graphics.height - @target_cursor.bitmap.height]
  707.   end
  708.  
  709.   #--------------------------------------------------------------------------
  710.   # * Dispose
  711.   #--------------------------------------------------------------------------
  712.   alias mog_target_cursor_dispose dispose
  713.   def dispose
  714.       dispose_target_cursor
  715.       mog_target_cursor_dispose
  716.   end
  717.  
  718.   #--------------------------------------------------------------------------
  719.   # * Dispose Target Cursor
  720.   #--------------------------------------------------------------------------
  721.   def dispose_target_cursor
  722.       return if @target_cursor == nil
  723.       @target_cursor.bitmap.dispose ; @target_cursor.dispose
  724.   end
  725.  
  726.   #--------------------------------------------------------------------------
  727.   # * Update Postion
  728.   #--------------------------------------------------------------------------
  729.   alias mog_target_cursor_update_position update_position
  730.   def update_position
  731.       mog_target_cursor_update_position
  732.       update_battler_cursor_xy
  733.       update_target_cursor
  734.   end
  735.  
  736.   #--------------------------------------------------------------------------
  737.   # * Update Battler Cursor
  738.   #--------------------------------------------------------------------------
  739.   def update_battler_cursor_xy
  740.       return if @battler == nil
  741.       return if $game_temp.battle_cursor_target[0] != nil and @battler != $game_temp.battle_cursor_target[0]
  742.       return if $game_temp.battle_cursor_target[1] != nil and @battler != $game_temp.battle_cursor_target[1]
  743.       $game_temp.target_data = [@battler,self]
  744.   end  
  745.  
  746.   #--------------------------------------------------------------------------
  747.   # * Update Target Cursor
  748.   #--------------------------------------------------------------------------
  749.   def update_target_cursor
  750.       return if @target_cursor == nil
  751.       refresh_zoom if @target_visible_old != @target_cursor.visible
  752.       @target_cursor.visible = can_target_cursor_visible?
  753.       return if !@target_cursor.visible
  754.       @target_cursor.x = self.x + @tc_pos[0]
  755.       @target_cursor.y = self.y + @tc_pos[1]
  756.       @target_cursor.y -= (self.bitmap.height / 2) if self.bitmap
  757.       if @battler.is_a?(Game_Actor) and @face_battler
  758.          @target_cursor.y -= @target_cursor_ch[0] if @target_cursor.y > @target_cursor_ch[1]
  759.       end           
  760.       @target_cursor.z = CURSOR_Z + 1
  761.       @target_cursor.opacity = 130 + rand(125)
  762.       @target_cursor.zoom_x -= 0.05 if @target_cursor.zoom_x > 1.00
  763.       @target_cursor.zoom_x = 1.00 if @target_cursor.zoom_x < 1.00
  764.       @target_cursor.zoom_y = @target_cursor.zoom_x      
  765.       update_battle_camera_cursor_t if update_battle_camera_cursor_t?
  766.   end
  767.  
  768.   #--------------------------------------------------------------------------
  769.   # * Update Battle Camera Cursor T
  770.   #--------------------------------------------------------------------------
  771.   def update_battle_camera_cursor_t?
  772.       return false if $imported[:mog_battle_camera] == nil
  773.       return false if @battler == nil
  774.       if $imported[:mog_battle_hud_ex] and SceneManager.face_battler?
  775.          return false if @battler.is_a?(Game_Actor)
  776.       end  
  777.       return true
  778.   end
  779.  
  780.   #--------------------------------------------------------------------------
  781.   # ● Update Battle Camera Cursor
  782.   #--------------------------------------------------------------------------              
  783.   def update_battle_camera_cursor_t
  784.       @target_cursor.ox = $game_temp.viewport_oxy[0] + @target_cursor_org[0]
  785.       @target_cursor.oy = $game_temp.viewport_oxy[1] + @target_cursor_org[1]
  786.   end  
  787.  
  788.   #--------------------------------------------------------------------------
  789.   # * Refresh Zoom
  790.   #--------------------------------------------------------------------------
  791.   def refresh_zoom
  792.       @target_visible_old = @target_cursor.visible
  793.       @target_cursor.zoom_x = 1.50 if TARGET_CURSOR_2_ZOOM_EFFECT
  794.       @target_cursor.zoom_y = @target_cursor.zoom_x
  795.   end
  796.  
  797.   #--------------------------------------------------------------------------
  798.   # * Can Target Cursor Visible?
  799.   #--------------------------------------------------------------------------
  800.   def can_target_cursor_visible?
  801.       return false if !$game_temp.battle_cursor[2]
  802.       return false if @battler.dead?
  803.       return false if @battler.hidden
  804.       return false if !@battler.target_temp
  805.       return false if $game_message.visible
  806.       return false if $game_temp.battle_end
  807.       return false if $imported[:mog_sprite_actor] and !@battler.bact_sprite_visiblle
  808.       return false if $imported[:mog_active_chain] and $game_temp.chain_action_phase
  809.       return false if $imported[:mog_atb_system] and BattleManager.actor == nil
  810. #      return false if $imported[:mog_blitz_commands] and $game_temp.blitz_commands_phase
  811.       return true
  812.   end
  813.  
  814. end
  815.  
  816. #==============================================================================
  817. # ■ Scene Battle
  818. #==============================================================================
  819. class Scene_Battle < Scene_Base
  820.  
  821.   #--------------------------------------------------------------------------
  822.   # * On Skill OK
  823.   #--------------------------------------------------------------------------
  824.   def on_skill_ok
  825.       if $imported[:mog_atb_system]
  826.          return if BattleManager.actor == nil
  827.          @skill_window.visible = false unless !@status_window.visible
  828.       end
  829.       @skill = @skill_window.item
  830.       @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  831.       BattleManager.actor.input.set_skill(@skill.id)
  832.       BattleManager.actor.last_skill.object = @skill
  833.      if [0,11].include?(@skill.scope)
  834.         @skill_window.hide
  835.         if $imported[:mog_atb_system]
  836.            next_command
  837.            BattleManager.command_end
  838.            hide_base_window
  839.         end               
  840.       elsif @skill.for_opponent?
  841.           select_enemy_selection
  842.       else
  843.           select_actor_selection
  844.       end
  845.   end
  846.  
  847.   #--------------------------------------------------------------------------
  848.   # * On Item OK
  849.   #--------------------------------------------------------------------------
  850.   def on_item_ok
  851.       if $imported[:mog_atb_system]
  852.          return if BattleManager.actor == nil
  853.          @item_window.visible = false unless !@status_window.visible
  854.       end   
  855.       @item = @item_window.item
  856.       @item_window.hide if @item.for_opponent? or @item.for_friend?
  857.       BattleManager.actor.input.set_item(@item.id)
  858.       if [0,11].include?(@item.scope)
  859.          @item_window.hide
  860.          next_command
  861.          if $imported[:mog_atb_system]
  862.             next_command
  863.             BattleManager.command_end
  864.             hide_base_window
  865.          end         
  866.       elsif @item.for_opponent?
  867.           select_enemy_selection
  868.       else
  869.           select_actor_selection
  870.       end
  871.       $game_party.last_item.object = @item
  872.   end  
  873.  
  874.   #--------------------------------------------------------------------------
  875.   # * Turn End
  876.   #--------------------------------------------------------------------------
  877.   alias mog_battle_cursor_turn_end turn_end
  878.   def turn_end
  879.       mog_battle_cursor_turn_end
  880.       if $game_temp.battle_cursor_scope_refresh
  881.          $game_temp.battle_cursor_scope_refresh = false
  882.          $game_temp.battle_cursor_need_refresh[0] = true
  883.          $game_temp.battle_cursor_need_refresh[1] = true
  884.       end        
  885.   end  
  886.  
  887. end
回复

使用道具 举报

Lv4.逐梦者

梦石
1
星屑
14504
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
4
发表于 2019-10-25 10:11:39 | 只看该作者
本帖最后由 Nil2018 于 2019-10-25 10:12 编辑

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



mog

victor
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1078
在线时间
180 小时
注册时间
2017-8-2
帖子
3
5
 楼主| 发表于 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的队员,不过有些跑位了,因为我有调整过默认的位子,想请问要在怎么在你改的这脚本调整呢?

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-26 00:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表