查看: 4941|回复: 1

[已经过期] 怎么能让 鼠标指针 直接选择敌人战斗图

[复制链接]
梦石
8
星屑
6443
在线时间
1029 小时
注册时间
2010-7-26
回帖
277
发表于 2011-2-15 21:47:51 | 显示全部楼层 |阅读模式
悬赏7星屑未解决
原贴地址
http://rpg.blue/forum.php?m ... =%E9%BC%A0%E6%A0%87
以下这一段应该就是 鼠标系统选择敌人的方法吧。。
  1. #==============================================================================
  2. # ** Window_Message
  3. #==============================================================================
  4. class Window_Message < Window_Selectable
  5.   def update_mouse
  6.     (0..@item_max - 1).each do |i|
  7.       irect = item_rect(i)
  8.       irx = self.x + 16 + irect.x - self.ox
  9.       iry = self.y + 16 + irect.y - self.oy + ($game_message.choice_start * WLH)
  10.       result = Mouse.area?(irx, iry, irect.width, irect.height)
  11.       self.index = i if result
  12.       ## 控制单击条件
  13.       $click_abled = false if i == @index and !result
  14.     end
  15.   end
  16. end
复制代码
以下 是赵云的指向脚本:
  1. #本脚本来自66RPG,作者趙雲,如需转载请保留本信息。
  2. #==============================================================================
  3. # ■ Arrow_Base
  4. #------------------------------------------------------------------------------
  5. #  在战斗画面使用的箭头光标的活动块。本类作为
  6. # Arrow_Enemy 类与 Arrow_Actor 类的超级类使用。
  7. #==============================================================================

  8. class Arrow_Base < Sprite
  9.   #--------------------------------------------------------------------------
  10.   # ● 定义实例变量
  11.   #--------------------------------------------------------------------------
  12.   attr_reader   :index                    # 光标位置
  13.   attr_reader   :help_window              # 帮助窗口
  14.   #--------------------------------------------------------------------------
  15.   # ● 初始化对像
  16.   #     viewport : 显示端口
  17.   #--------------------------------------------------------------------------
  18.   def initialize(viewport)
  19.     super(viewport)
  20.     self.bitmap = Cache.system("Arrow")
  21.     self.ox = 16
  22.     self.oy = 64
  23.     self.z = 2500
  24.     @blink_count = 0
  25.     @index = 0
  26.     @help_window = nil
  27.     update
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 设置光标位置
  31.   #     index : 新的光标位置
  32.   #--------------------------------------------------------------------------
  33.   def index=(index)
  34.     @index = index
  35.     update
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ● 设置帮助窗口
  39.   #     help_window : 新的帮助窗口
  40.   #--------------------------------------------------------------------------
  41.   def help_window=(help_window)
  42.     @help_window = help_window
  43.     # 刷新帮助文本 (update_help 定义了继承目标)
  44.     if @help_window != nil
  45.       update_help
  46.     end
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 刷新画面
  50.   #--------------------------------------------------------------------------
  51.   def update
  52.     # 刷新点灭记数
  53.     @blink_count = (@blink_count + 1) % 12
  54.     # 设置传送源矩形
  55.     if @blink_count < 6
  56.       self.src_rect.set(0, 0, 32, 32)
  57.     else
  58.       self.src_rect.set(32, 0, 32, 32)
  59.     end
  60.     # 刷新帮助文本 (update_help 定义了继承目标)
  61.     if @help_window != nil
  62.       update_help
  63.     end
  64.   end
  65. end
  66. #==============================================================================
  67. # ■ Arrow_Enemy
  68. #------------------------------------------------------------------------------
  69. #  选择敌人的箭头光标。本类继承 Arrow_Base
  70. # 类。
  71. #==============================================================================

  72. class Arrow_Enemy < Arrow_Base
  73.   #--------------------------------------------------------------------------
  74.   # ● 获取光标指向的敌人
  75.   #--------------------------------------------------------------------------
  76.   def enemy
  77.     return $game_troop.members[@index]
  78.   end
  79.   
  80.   def dispose
  81.     @enemy.loop_white_flash = false unless @enemy.nil?
  82.     super
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 刷新画面
  86.   #--------------------------------------------------------------------------
  87.   def update
  88.     super
  89.      if @enemy != enemy and enemy.exist?
  90.         @enemy.loop_white_flash = false unless @enemy.nil?
  91.         enemy.loop_white_flash = true
  92.         @enemy = enemy
  93.       end  
  94.    
  95.     # 如果指向不存在的敌人就离开
  96.     $game_troop.members.size.times do
  97.       break if self.enemy.exist?
  98.       @index += 1
  99.       @index %= $game_troop.members.size
  100.     end
  101.     # 光标右
  102.     if Input.repeat?(Input::RIGHT) or Input.repeat?(Input::DOWN)
  103.       Sound.play_cursor
  104.       $game_troop.members.size.times do
  105.         @index += 1
  106.         @index %= $game_troop.members.size
  107.         break if self.enemy.exist?
  108.       end
  109.     end
  110.     # 光标左
  111.     if Input.repeat?(Input::LEFT) or Input.repeat?(Input::UP)
  112.      Sound.play_cursor
  113.       $game_troop.members.size.times do
  114.         @index += $game_troop.members.size - 1
  115.         @index %= $game_troop.members.size
  116.         break if self.enemy.exist?
  117.       end
  118.     end
  119.     # 设置活动块坐标
  120.     if self.enemy != nil
  121.       self.x = self.enemy.screen_x
  122.       self.y = self.enemy.screen_y
  123.     end
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 刷新帮助文本
  127.   #--------------------------------------------------------------------------
  128.   def update_help
  129.     # 帮助窗口显示敌人的名字与状态
  130.     @help_window.set_enemy(self.enemy)
  131.   end
  132. end





  133. class Scene_Battle ##
  134.   
  135.   
  136.   #--------------------------------------------------------------------------
  137.   # ● 更新画面
  138.   #--------------------------------------------------------------------------
  139.   def update
  140.     super
  141.     update_basic(true)
  142.     update_info_viewport                  # 更新显示信息的视区
  143.     if $game_message.visible
  144.       @info_viewport.visible = false
  145.       @message_window.visible = true
  146.     end
  147.     unless $game_message.visible          # 在显示消息以外的情况
  148.       return if judge_win_loss            # 判断胜败
  149.       update_scene_change
  150.       if @enemy_arrow != nil
  151.         update_target_enemy_selection     # 选择敌方对象
  152.       elsif @target_actor_window != nil
  153.         update_target_actor_selection     # 选择对象角色
  154.       elsif @skill_window != nil
  155.         update_skill_selection            # 选择特技
  156.       elsif @item_window != nil
  157.         update_item_selection             # 选择物品
  158.       elsif @party_command_window.active
  159.         update_party_command_selection    # 选择同伴指令
  160.       elsif @actor_command_window.active
  161.         update_actor_command_selection    # 选择角色指令
  162.       else
  163.         process_battle_event              # 战斗处理
  164.         process_action                    # 战斗行动
  165.         process_battle_event              # 处理战斗事件
  166.       end
  167.     end
  168.   end
  169.   

  170.   
  171.   def set_window(visible)
  172.     if !@skill_window.nil?
  173.       @skill_window.visible = visible
  174.     elsif !@item_window.nil?
  175.       @item_window.visible = visible
  176.     end
  177.   end

  178.   #--------------------------------------------------------------------------
  179.   # ● 开始选择对象的敌方角色
  180.   #--------------------------------------------------------------------------
  181.   def start_target_enemy_selection
  182.     set_window(false)
  183.     @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport3)
  184.     @enemy_window = Window_Enemy.new(176,0)
  185.     @enemy_arrow.help_window = @enemy_window
  186.     @actor_command_window.active = false
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 选择对象敌方角色结束
  190.   #--------------------------------------------------------------------------
  191.   def end_target_enemy_selection
  192.     @enemy_arrow.dispose
  193.     @enemy_arrow = nil
  194.     @enemy_window.dispose
  195.     set_window(true)
  196.     if @actor_command_window.index == 0
  197.       @actor_command_window.active = true
  198.     end
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 更新选择对象敌方角色
  202.   #--------------------------------------------------------------------------
  203.   def update_target_enemy_selection
  204.      @enemy_arrow.update
  205.     if Input.trigger?(Input::B)
  206.       Sound.play_cancel
  207.       end_target_enemy_selection
  208.     elsif Input.trigger?(Input::C)
  209.       Sound.play_decision
  210.       @active_battler.action.target_index = @enemy_arrow.enemy.index
  211.       end_target_enemy_selection
  212.       end_skill_selection
  213.       end_item_selection
  214.       next_actor
  215.     end
  216.   end


  217. end


  218. class Spriteset_Battle ##
  219.   def viewport3
  220.     return @viewport3
  221.   end  
  222. end

  223. class Game_Battler
  224.   attr_accessor :loop_white_flash              # 循环白色闪烁标记
  225. end

  226. class Sprite_Battler ##
  227.   alias old_setup_new_effect setup_new_effect
  228.   def setup_new_effect
  229.     if @battler.loop_white_flash and @effect_duration == 0
  230.       @battler.white_flash = true
  231.     end
  232.     old_setup_new_effect
  233.   end
  234. end


  235. #==============================================================================
  236. # ■ Window_Enemy
  237. #------------------------------------------------------------------------------
  238. #  显示敌人信息的窗口,光标Arrow用。
  239. #==============================================================================

  240. class Window_Enemy < Window_Base
  241.   #--------------------------------------------------------------------------
  242.   # ● 初始化窗口
  243.   #     x : 窗口的X坐标
  244.   #     y : 窗口的Y坐标
  245.   #--------------------------------------------------------------------------
  246.   def initialize(x, y)
  247.     super(x, y, 288, WLH * 2 + 32)   
  248.    self.opacity = 0

  249.    self.contents.font.size = 13           ####字号
  250.    self.x=130                             ##### x
  251.    self.y=35                              ##### y

  252.   end

  253.   #--------------------------------------------------------------------------
  254.   # ● 设置文本
  255.   #     text  : 窗口显示的字符串
  256.   #     align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
  257.   #--------------------------------------------------------------------------
  258.   def set_text(text, align = 0)
  259.     # 如果文本和对齐方式的至少一方与上次的不同
  260.     if text != @text or align != @align
  261.       # 再描绘文本
  262.       self.contents.clear
  263.       self.contents.font.color = normal_color
  264.       self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  265.       @text = text
  266.       @align = align
  267.       @actor = nil
  268.     end
  269.     self.visible = true
  270.   end
  271.   
  272.   
  273.   #--------------------------------------------------------------------------
  274.   # ● 设置敌人
  275.   #     enemy : 要显示名字和状态的敌人
  276.   #--------------------------------------------------------------------------
  277.   def set_enemy(enemy)
  278.     if @enemy != enemy
  279.     text = enemy.name
  280.     set_text(text)
  281.     w = enemy.states.size * 24
  282.     draw_actor_state(enemy, contents.width - w , 0, w)
  283.     draw_actor_hp(enemy, 0 , WLH  )
  284.     draw_actor_mp(enemy, contents.width - 120 , WLH )  
  285.     @enemy = enemy
  286.     end
  287.   end
  288. end
复制代码
其中中这:
  1. class Arrow_Enemy < Arrow_Base
  2.   #--------------------------------------------------------------------------
  3.   # ● 获取光标指向的敌人
  4.   #--------------------------------------------------------------------------
  5.   def enemy
  6.     return $game_troop.members[@index]
  7.   end
  8.   
  9.   def dispose
  10.     @enemy.loop_white_flash = false unless @enemy.nil?
  11.     super
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 刷新画面
  15.   #--------------------------------------------------------------------------
  16.   def update
  17.     super
  18.      if @enemy != enemy and enemy.exist?
  19.         @enemy.loop_white_flash = false unless @enemy.nil?
  20.         enemy.loop_white_flash = true
  21.         @enemy = enemy
  22.       end  
  23.    
  24.     # 如果指向不存在的敌人就离开
  25.     $game_troop.members.size.times do
  26.       break if self.enemy.exist?
  27.       @index += 1
  28.       @index %= $game_troop.members.size
  29.     end
  30.     # 光标右
  31.     if Input.repeat?(Input::RIGHT) or Input.repeat?(Input::DOWN)
  32.       Sound.play_cursor
  33.       $game_troop.members.size.times do
  34.         @index += 1
  35.         @index %= $game_troop.members.size
  36.         break if self.enemy.exist?
  37.       end
  38.     end
  39.     # 光标左
  40.     if Input.repeat?(Input::LEFT) or Input.repeat?(Input::UP)
  41.      Sound.play_cursor
  42.       $game_troop.members.size.times do
  43.         @index += $game_troop.members.size - 1
  44.         @index %= $game_troop.members.size
  45.         break if self.enemy.exist?
  46.       end
  47.     end
  48.     # 设置活动块坐标
  49.     if self.enemy != nil
  50.       self.x = self.enemy.screen_x
  51.       self.y = self.enemy.screen_y
  52.     end
  53.   end
复制代码
应该是判断敌人坐标的。。。

我想请教下 懂一些脚本的高手,,,怎么把  画面上的坐标  赋予 那个鼠标指针,,,,,应该不难吧。。。求教。。


《尘沙的选择》2D动作射击剧情解谜末世题材独立游戏
STEAM地址
《午餐13:血肉机器 》全新故事线版本
STEAM连接
梦石
0
星屑
50
在线时间
251 小时
注册时间
2010-7-22
回帖
70
发表于 2012-5-31 13:24:56 | 显示全部楼层
本人新手 但是发现直接用 最终幻想战斗系统就可以点选敌人。
看到帖子 也许时间很长了。不要鄙视我
有必要 留下QQ我传给你 2314996150


‘‘──szcszc156于2012-5-31 13:28补充以下内容:

[url]http://kuai.xunlei.com/d/YWQODTKRAYHY[/url]
这是我的工程 虽然只是硬凑但是我试了好几次绝对可以点选敌人
’’


‘‘──szcszc156于2012-5-31 13:38补充以下内容:

或者最推荐的是 vx官方范例Dragoness
用这个鼠标脚本[code]#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

#=================以下两个用来调整战斗时的手感问题,可以自己试试。
$敌人选框扩大 = 20
$角色选框扩大 = 30


#==============================================================================
# API调用
#==============================================================================
$ShowCursor = Win32API.new("user32", "ShowCursor", 'i', 'l')
$GetCursorPos = Win32API.new("user32", "GetCursorPos", 'p', 'i')
$ScreenToClient = Win32API.new("user32", "ScreenToClient", 'ip', 'i')
$GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
$Window_HWND = $GetActiveWindow.call
$GetKeyState = Win32API.new("user32", "GetKeyState", 'i', 'i')
#$FindWindow = Win32API.new("user32", "FindWindow", 'pp', 'i')
#$HookStart  = Win32API.new("mouse_hook.dll", "HookStart", 'i', nil)
#$HookEnd  = Win32API.new("mouse_hook.dll", "HookEnd", nil, nil)
#$GetMouseStatus  = Win32API.new("mouse_hook.dll", "GetMouseStatus", 'i', 'i')
#$Window_HWND = $FindWindow.call(nil, 'mousetry')

module Mouse  
  LEFT = 0x01
  RIGHT = 0x02

  def self.init(sprite = nil)
#   $HookStart.call($Window_HWND)
    $ShowCursor.call(0)
   
    @show_cursor = false
   
    @mouse_sprite = Sprite.new
    @mouse_sprite.z = 99999
    @mouse_sprite.bitmap = Bitmap.new('Graphics/Icons/001-Weapon01.png')
    #@mouse_sprite.bitmap.fill_rect(Rect.new(0, 0, 32, 32), Color.new(0, 0, 0))

    @left_press = false
    @right_press = false
    @left_trigger = false
    @right_trigger = false
    @left_repeat = false
    @right_repeat = false
    @click_lock = false
   
    update
  end
  def self.exit
    @mouse_sprite.bitmap.dispose
    @mouse_sprite.dispose
    @show_cursor = true
#    $HookEnd.call
    $ShowCursor.call(1)
  end
  def self.mouse_debug
    return @mouse_debug.bitmap
  end
  def self.update
    left_down = $GetKeyState.call(0x01)
    right_down = $GetKeyState.call(0x02)
   
    @click_lock = false
    mouse_x, mouse_y = self.get_mouse_pos
    if @mouse_sprite != nil
      @mouse_sprite.x = mouse_x
      @mouse_sprite.y = mouse_y
    end
    if left_down[7] == 1
      @left_repeat = (not @left_repeat)
      @left_trigger = (not @left_press)
      @left_press = true
    else
      @left_press = false
      @left_trigger = false
      @left_repeat = false
    end
    if right_down[7] == 1
      @right_repeat = (not @right_repeat)
      @right_trigger = (not @right_press)
      @right_press = true
    else
      @right_press = false
      @right_trigger = false
      @right_repeat = false
    end
  end
  def self.get_mouse_pos
    point_var = [0, 0].pack('ll')
    if $GetCursorPos.call(point_var) != 0
      if $ScreenToClient.call($Window_HWND, point_var) != 0
        x, y = point_var.unpack('ll')
        if (x < 0) or (x > 10000) then x = 0 end
        if (y < 0) or (y > 10000) then y = 0 end
        if x > 544 then x = 544 end
        if y > 416 then y = 416 end
        return x, y
      else
        return 0, 0
      end
    else
      return 0, 0
    end
  end
  def self.press?(mouse_code)
    if mouse_code == LEFT
      if @click_lock
        return false
      else
        return @left_press
      end
    elsif mouse_code == RIGHT
      return @right_press
    else
      return false
    end
  end
  def self.trigger?(mouse_code)
    if mouse_code == LEFT
      if @click_lock
        return false
      else
        return @left_trigger
      end
    elsif mouse_code == RIGHT
      return @right_trigger
    else
      return false
    end
  end
  def self.repeat?(mouse_code)
    if mouse_code == LEFT
      if @click_lock
        return false
      else
        return @left_repeat
      end
    elsif mouse_code == RIGHT
      return @right_repeat
    else
      return false
    end
  end
  def self.click_lock?
    return @click_lock
  end
  def self.click_lock
    @click_lock = true
  end
  def self.click_unlock
    @click_lock = false
  end
end
module Input
  if @self_update == nil
    @self_update = method('update')
    @self_press = method('press?')
    @self_trigger = method('trigger?')
    @self_repeat = method('repeat?')
  end
  def self.update
    @self_update.call
    Mouse.update
  end
  def self.press?(key_code)
    if @self_press.call(key_code)
      return true
    end
    if key_code == C
      return Mouse.press?(Mouse::LEFT)
    elsif key_code == B
      return Mouse.press?(Mouse::RIGHT)
    else
      return @self_press.call(key_code)
    end
  end
  def self.trigger?(key_code)
    if @self_trigger.call(key_code)
      return true
    end
    if key_code == C
      return Mouse.trigger?(Mouse::LEFT)
    elsif key_code == B
      return Mouse.trigger?(Mouse::RIGHT)
    else
      return @self_trigger.call(key_code)
    end
  end
  def self.repeat?(key_code)
    if @self_repeat.call(key_code)
      return true
    end
    if key_code == C
      return Mouse.repeat?(Mouse::LEFT)
    elsif key_code == B
      return Mouse.repeat?(Mouse::RIGHT)
    else
      return @self_repeat.call(key_code)
    end
  end
end

class Window_Selectable
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    #self.cursor_rect.empty
    self_update
    if self.active and @item_max > 0
      index_var = @index
      tp_index = @index
      mouse_x, mouse_y = Mouse.get_mouse_pos
      mouse_not_in_rect = true
      for i in 0...@item_max
        @index = i
        update_cursor
        top_x = self.cursor_rect.x + self.x + 16
        top_y = self.cursor_rect.y + self.y + 16
        bottom_x = top_x + self.cursor_rect.width
        bottom_y = top_y + self.cursor_rect.height
        
          top_x += self.x_mod
          top_y += self.y_mod
          bottom_x += self.x_mod
          bottom_y += self.y_mod
        
        if (mouse_x > top_x) and (mouse_y > top_y) and
           (mouse_x < bottom_x) and (mouse_y < bottom_y)
          mouse_not_in_rect = false
          if tp_index != @index
            tp_index = @index
            $data_system.sounds[0].play
          end
          break
        end
      end
    if Input.trigger?(Input::F9)
    p top_x,top_y,Mouse.get_mouse_pos
    end
      if mouse_not_in_rect
        @index = index_var
        update_cursor
        Mouse.click_lock
      else
        Mouse.click_unlock               
      end
    end
  end
end




class Window_NameInput
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    #self.cursor_rect.empty
    self_update
    if self.active
      index_var = @index
      mouse_x, mouse_y = Mouse.get_mouse_pos
      mouse_not_in_rect = true
      for i in (0...HIRAGANA.size).to_a.push(180)
        @index = i
        update_cursor
        top_x = self.cursor_rect.x + self.x + 16
        top_y = self.cursor_rect.y + self.y + 16
        bottom_x = top_x + self.cursor_rect.width
        bottom_y = top_y + self.cursor_rect.height
        #
        if (mouse_x > top_x) and (mouse_y > top_y) and
           (mouse_x < bottom_x) and (mouse_y < bottom_y)
          mouse_not_in_rect = false
          break
        end
      end
      if mouse_not_in_rect
        @index = index_var
        update_cursor
        Mouse.click_lock
      else
        Mouse.click_unlock
      end
    end
  end
end
=begin

class Window_InputNumber
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    #self.cursor_rect.empty
    self_update
    mouse_x, mouse_y = Mouse.get_mouse_pos
    if self.active and @digits_max > 0
      index_var = @index
      mouse_not_in_rect = true
      for i in 0...@digits_max
        @index = i
        #update_cursor
        top_x = self.cursor_rect.x + self.x + 16
        bottom_x = top_x + self.cursor_rect.width
        #
        if (mouse_x > top_x) and (mouse_x < bottom_x)
          mouse_not_in_rect = false
          break
        end
      end
      if mouse_not_in_rect
        @index = index_var
        #update_cursor
        Mouse.click_lock
      else
        Mouse.click_unlock
      end
    end
    if @last_mouse_y == nil
      @last_mouse_y = mouse_y
    end
    check_pos = (@last_mouse_y - mouse_y).abs
    if check_pos > 10
      #$game_system.se_play($data_system.cursor_se)
      place = 10 ** (@digits_max - 1 - @index)
      n = @number / place % 10
      @number -= n * place
      n = (n + 1) % 10 if mouse_y < @last_mouse_y
      n = (n + 9) % 10 if mouse_y > @last_mouse_y
      @number += n * place
      refresh
      @last_mouse_y = mouse_y
    end
  end
end
=end
class Scene_File
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    mouse_x, mouse_y = Mouse.get_mouse_pos
    Mouse.click_lock
    idx = 0
    for i in @savefile_windows
      top_x = i.x + 16
      top_y = i.y + 16
      bottom_x = top_x + i.width
      bottom_y = top_y + i.height
      if (mouse_x > top_x) and (mouse_y > top_y) and
         (mouse_x < bottom_x) and (mouse_y < bottom_y)
        i.selected = true
        if @file_index != idx
          @file_index = idx
          $data_system.sounds[0].play
        end            
        Mouse.click_unlock
      else
        i.selected = false
      end
      idx += 1
    end
    self_update
  end
end

class Game_Player
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    mouse_x, mouse_y = Mouse.get_mouse_pos
    if @last_move_x == nil
      @last_move_x = false
    end
    if Mouse.press?(Mouse::LEFT)
   #for event in $game_map.events.values
   #if event.screen_x/32 == mouse_x/32 and event.screen_y/32-1 == mouse_y/32
   #event.start
   #end
   #end
      last_moving = moving?
      last_direction = @direction
    #  return unless movable?
    #  return if $game_map.interpreter.running?
      unless moving? or $game_map.interpreter.running?
      last_x = @x
        if @last_move_x
          @last_move_x = false
        elsif mouse_x > screen_x + 16
          move_right
        elsif mouse_x < screen_x - 16
          move_left
        end
        last_y = @y
        if last_x != @x
          @last_move_x = true
        elsif mouse_y > screen_y
          move_down
        elsif mouse_y < screen_y - 32
          move_up
        end
=begin        
        if last_y != @y
          @last_move_x = false
        elsif not @last_move_x
          case last_direction
          when 2
            turn_down
          when 4
            turn_left
          when 6
            turn_right
          when 8
            turn_up
          end        
        end
=end         
      end
    end
    self_update
  end
end
Mouse.init
END { Mouse.exit }


class Window_Base < Window
  attr_accessor :x_mod
  attr_accessor :y_mod
  alias ka_initialize initialize
  def initialize(x, y, width, height)
    ka_initialize(x, y, width, height)
    self.x_mod = 0
    self.y_mod = 0
  end
end
class Window_PartyCommand < Window_Command
  alias ka1_initialize initialize
  def initialize
    ka1_initialize
    self.y_mod = 288
  end
end
class Window_ActorCommand < Window_Command
  alias ka2_initialize initialize
  def initialize
    ka2_initialize
    self.x_mod = -128
    self.y_mod = 288
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#============================================================================== [/code]不用那些选择脚本直接就可以选择敌人
试过N遍无冲突

’’
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部