| 赞 | 0  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 1 | 
 
| 经验 | 327 | 
 
| 最后登录 | 2013-5-12 | 
 
| 在线时间 | 12 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 50 
 
        - 在线时间
 - 12 小时
 
        - 注册时间
 - 2013-5-6
 
        - 帖子
 - 19
 
 
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
我有一个范例是魔法师的,发射出来是球,我新弄了一个弓箭手,发射出来的还是球,怎么改弓箭啊 ,里面有脚本,应该改哪 
#============================================================================== 
# ■ ARPG_Bullet 
#------------------------------------------------------------------------------ 
#  处理ARPG中的远程攻击。 
#============================================================================== 
class ARPG_Bullet < Game_Character 
  Hit_Se = "089-Attack01" 
  attr_reader   :hit_event    # 命中的事件 
  #-------------------------------------------------------------------------- 
  # ● 初始化对象 
  #-------------------------------------------------------------------------- 
  def initialize(char_name, x, y, d) 
    super() 
    @character_name = char_name 
    @direction = d 
    @x = x 
    @y = y 
    @oldx = @x 
    @oldy = @y 
    @move_speed = 6 
    @walk_anime = false 
    @hit_event = nil 
    bx = x + (d == 6 ? 1 : d == 4 ? -1 : 0) 
    by = y + (d == 2 ? 1 : d == 8 ? -1 : 0) 
    moveto(x, y) 
  end 
  #-------------------------------------------------------------------------- 
  # ● 刷新 
  #-------------------------------------------------------------------------- 
  def update 
    # 前进一步 
    if @hit_event != nil 
      @opacity -= 10 
      return 
    end 
    if (!moving?) && (@hit_event.nil?) 
      move_forward 
      return  
    end 
    super 
  end 
  #-------------------------------------------------------------------------- 
  # ● 接触事件 
  #-------------------------------------------------------------------------- 
  def check_event_trigger_touch(x, y) 
    @pattern = 1 
    case @direction 
    when 2 
      @real_y += 64 
    when 4 
      @real_x -= 64 
    when 6 
      @real_x += 64 
    when 8 
      @real_y -= 64 
    end 
    if $game_map.events[$game_map.check_event(x, y)].nil? 
      @hit_event = "障碍" 
      return  
    end 
    @hit_event = $game_map.events[$game_map.check_event(x, y)] 
  end 
  #-------------------------------------------------------------------------- 
  # ● 循环动画ID......... 
  #-------------------------------------------------------------------------- 
  def state_animation_id 
    return 0 
  end 
  #-------------------------------------------------------------------------- 
  # ● 可以通行判定 
  #-------------------------------------------------------------------------- 
  def passable?(x, y, d) 
    # 求得新的坐标 
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) 
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0) 
    # 坐标在地图以外的情况 
    unless $game_map.valid?(new_x, new_y) 
      # 不能通行 
      return false 
    end 
    # 穿透是 ON 的情况下 
    if @through 
      # 可以通行 
      return true 
    end 
    # 移动者的元件无法来到指定方向的情况下 
    unless $game_map.passable?(x, y, d, self) 
      # 通行不可 
      return false 
    end 
    # 从指定方向不能进入到移动处的元件的情况下 
    unless $game_map.passable?(new_x, new_y, 10 - d) 
      # 不能通行 
      return false 
    end 
    # 循环全部事件 
    for event in $game_map.events.values 
      # 事件坐标于移动目标坐标一致的情况下 
      if (event.real_x - self.real_x).abs < 28 and  
        (event.real_y - self.real_y).abs < 28 
        return event 
      end 
      if event.x == new_x and event.y == new_y 
        # 穿透为 ON 
        unless event.through 
          # 自己就是事件的情况下 
          if self != $game_player 
            # 不能通行 
            return false 
          end 
          # 自己是主角、对方的图形是角色的情况下 
          if event.character_name != "" 
            # 不能通行 
            return false 
          end 
        end 
      end 
    end 
    # 可以通行 
    return true 
  end 
end 
 
谢谢各位朋友了  
 
 
 
 
 |   
 
 
 
 |