﻿#==============================================================================
# ★ ExState_UnEncounter
#------------------------------------------------------------------------------
# 　設定在地圖上不會遇敵的狀態。
#==============================================================================

# 遇敵無效化的識別用文字。直接寫在該狀態的備註裡面即可。
EXSTA_UNENCOUNTER_SIGNATURE = "*UNENCOUNTER"

#------------------------------------------------------------------------------

class Game_Actor
  #--------------------------------------------------------------------------
  # ☆ 判定是否不會遇敵
  #--------------------------------------------------------------------------
  def unencounter?
    for state in states
      return true if state.note.include?(EXSTA_UNENCOUNTER_SIGNATURE)
    end
    return false
  end
end

class Game_Party
  #--------------------------------------------------------------------------
  # ☆ 判定是否不會遇敵
  #--------------------------------------------------------------------------
  def unencounter?
    for actor in members
      return true if actor.unencounter?
    end
    return false
  end
end

class Game_Player
  alias _exsunenc_update_encounter update_encounter
  #--------------------------------------------------------------------------
  # ● 更新遇敵(追加定義)
  #--------------------------------------------------------------------------
  def update_encounter
    return if $game_party.unencounter?
    _exsunenc_update_encounter
  end
end
