Project1

标题: 怎么设置船大小船固定地方停靠啊,但不能影响飞行器喔! [打印本页]

作者: lixinglixing022    时间: 2018-12-19 15:35
标题: 怎么设置船大小船固定地方停靠啊,但不能影响飞行器喔!
我只要船只的固定停靠,但飞行船还是不受到这个的影响!
作者: 丰富多彩    时间: 2018-12-19 15:35
本帖最后由 丰富多彩 于 2018-12-20 01:17 编辑

  class Game_Vehicle < Game_Character
#--------------------------------------------------------------------------
  # ● 判定是否可以靠岸/着陆
  #     d : 方向(2,4,6,8)
  #--------------------------------------------------------------------------
  def land_ok?(x, y, d)
    if @type == :airship
      return false unless $game_map.airship_land_ok?(x, y)
      return false unless $game_map.events_xy(x, y).empty?
    else
      x2 = $game_map.round_x_with_direction(x, d)
      y2 = $game_map.round_y_with_direction(y, d)
      return false unless $game_map.valid?(x2, y2)
      return false unless $game_map.passable?(x2, y2, reverse_dir(d))
      return false if collide_with_characters?(x2, y2)
      return true if @type == :boat && $game_map.region_id(x2, y2) == 60
      return true if @type == :ship && $game_map.region_id(x2, y2) == 61
    end   
     return true if @type == :airship
  end
end
#小舟在区域 ID 60靠岸 大船 区域 ID 61靠岸
作者: lixinglixing022    时间: 2018-12-19 19:19
有大神知道吗?

作者: 丰富多彩    时间: 2018-12-20 09:09
class Game_Player < Game_Character
#--------------------------------------------------------------------------
  # ● 执行遇敌处理
  #--------------------------------------------------------------------------
  def encounter
    return false if $game_map.interpreter.running?
    return false if $game_system.encounter_disabled
    return false if @encounter_count > 0
    make_encounter_count
    troop_id = make_encounter_troop_id
    troop_id += 1 if in_airship? #敌群ID 加 1
    return false unless $data_troops[troop_id]
    BattleManager.setup(troop_id)
    BattleManager.on_encounter
    return true
  end
  #--------------------------------------------------------------------------
  # ● 更新遇敌
  #--------------------------------------------------------------------------
  def update_encounter
    return if $TEST && Input.press?(:CTRL)
    return if $game_party.encounter_none?
#     return if in_airship?
    return if @move_route_forcing
    @encounter_count -= encounter_progress_value
  end
end

作者: lixinglixing022    时间: 2018-12-21 09:15
大神不在了...
作者: lixinglixing022    时间: 2018-12-21 10:17
丰富多彩 发表于 2018-12-19 15:35
class Game_Vehicle < Game_Character
#------------------------------------------------------------ ...

大神 你快回来喔..




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