XP 스크립트

아이템창변경

 

 


#_/ ̄    ◆ 아이템 상세정보 - LPG_ItemStatusMode ◆
#_/ ̄    ◇ Last update : 2009/08/11 ◇
#------------------------------------------------------------------------------
#   아이템 화면을 업그레이드 시켜 상세정보를 보여줍니다.
#   - 스크립트 제작자 : Claymore   저작권 : L PROJECT GAME -
#_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/

#==============================================================================
# ★ 커스터마이즈 항목 - Customize ★
#==============================================================================

module LPG
module ItemStatusMode
  $LPG_imported = {} if $LPG_imported == nil
  $LPG_imported["ItemStatusMode"] = true
 
  # ◆ 이름 색짓기 스크립트 사용 여부 ( 있다면... )
  TEXT_COLOR_SCRIPT = false
 
  # ◆ 비트맵(테두리/그림자 효과) 사용 여부 ( 역시 있다면... )
  BITMAP_SCRIPT = false
 
  # ◆ 아이템의 사용 가능한 상황 텍스트
  # ◇ 평상, 전투
  ALL_OCCASION = "평상, 전투 모두 사용 가능"
  # ◇ 전투
  BATTLE_OCCASION = "전투시 사용 가능"
  # ◇ 평상
  MENU_OCCASION = "평상시 사용 가능"
  # ◇ 사용 불가
  IMPOSSIBLE_OCCASION = "사용 불가"
end

#_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/
#         [ ‡ 소규모 스크립트 ‡ ]
#_/ ̄   ◆ 아이템 상세정보 - LPG_ItemNameExtension ◆
#------------------------------------------------------------------------------
#/ ̄_   아이템 화면을 업그레이드 시켜 상세정보를 보여줍니다.
#        
#_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/

module ItemNameExtension
  $LPG_imported = {} if $LPG_imported == nil
  $LPG_imported["ItemNameExtension"] = true

  # ◆ 정의되있지 않은 아이템/무기/방어구 - 확장
  DEFAULT_EX_NAME = "" # 공백으로 표시합니다.
 
  # ◆ 아이템 이름 정의 - 확장
  ITEM_EX_NAME = { # ← 지우지 마세요 ▒
   # 아이템 ID => "확장이름"

  } # ← 지우지 마세요 ▒
  # ◆ 무기 이름 정의 - 확장
  WEAPON_EX_NAME = { # ← 지우지 마세요 ▒
   # 무기 ID => "확장이름"

  } # ← 지우지 마세요 ▒
  # ◆ 방어구 이름 정의 - 확장
  ARMOR_EX_NAME = { # ← 지우지 마세요 ▒
   # 방어구 ID => "확장이름"

  } # ← 지우지 마세요 ▒
end
end

=begin

! 해당 스크립트는 아이콘 크기(32x32)를 중심으로한 스크립트입니다.
! 해당 스크립트는 글자크기 15pt를 중심으로한 스크립트입니다.
※ 해당 스크립트를 사용시
  약간의 멋을 내줄 수 있지만, TEXT_COLOR_SCRIPT 또는 BITMAP_SCRIPT 를 활성화시키면
  커서 이동시 업데이트 속도가 다소 느려질 수 있습니다.
문제 있으시면 dkrlgns@naver.com 으로 쪽지 보내주시거나 아래 주소에 댓글을 남겨주시면 감사하겠습니다.
http://cafe.naver.com/ArticleRead.nhn?clubid=10738640&page=1&menuid=14&boardtype=L&articleid=46939

=end

#==============================================================================
# ■ RPG::Weapon
#==============================================================================

class RPG::Weapon
  #--------------------------------------------------------------------------
  # ○ 회피 수정
  #--------------------------------------------------------------------------
  def eva
    return 0
  end
  #--------------------------------------------------------------------------
  # ○ 명중률
  #--------------------------------------------------------------------------
  def hit
    return 0
  end
end
#==============================================================================
# ■ RPG::Armor
#==============================================================================

class RPG::Armor
  #--------------------------------------------------------------------------
  # ○ 공격력
  #--------------------------------------------------------------------------
  def atk
    return 0
  end
  #--------------------------------------------------------------------------
  # ○ 명중률
  #--------------------------------------------------------------------------
  def hit
    return 0
  end
end

#==============================================================================
# ■ Window_Item
#------------------------------------------------------------------------------
#  아이템 화면, 배틀 화면에서, 소지 아이템의 일람을 표시하는 윈도우입니다.
#==============================================================================

class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(320, 0, 320, 176)
    @column_max = 8
    refresh
    self.index = 0
    # 전투중의 경우는 윈도우를 화면 중앙에 이동해, 반투명으로 한다
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 취득
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # 아이템을 추가
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
    # 전투중 이외라면 무기와 방어구도 추가
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    end
    # 항목수가 0 이 아니면 비트 맵을 작성해, 전항목을 묘화
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 36) # row_max * (아이콘 크기) + 4
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 항목의 묘화
  #     index : 항목 번호
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if LPG::ItemStatusMode::TEXT_COLOR_SCRIPT   
      self.contents.font.color = sg_artifact_colors(item)
    else
      self.contents.font.color = normal_color
    end
    x = 4 + index % 8 * 36 # 8 * (아이콘 크기+4)
    y = index / 8 * 36 # 8 * (아이콘 크기+4)
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = 255
    self.contents.blt(x - 2, y + 2, bitmap, Rect.new(0, 0, 32, 32), opacity)
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_frame_text(x - 4, y + 10, 32, 32, number.to_s, 2)
    else
      self.contents.draw_text(x - 4, y + 10, 32, 32, number.to_s, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 취득
  #--------------------------------------------------------------------------
  def top_row
    # 윈도우 내용의 전송원 Y 좌표를, 1 행의 높이 22 로 나눈다
    return self.oy / 36 # self.oy / (아이콘 크기) + 4
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 설정
  #     row : 선두에 표시하는 행
  #--------------------------------------------------------------------------
  def top_row=(row)
    # row 가 0 미만의 경우는 0 에 수정
    if row < 0
      row = 0
    end
    # row 가 row_max - 1 초의 경우는 row_max - 1 에 수정
    if row > row_max - 1
      row = row_max - 1
    end
    # row 에 1 행의 높이 36 를 걸어 윈도우 내용의 전송원 Y 좌표로 한다
    self.oy = row * 36 # row * (아이콘 크기) + 4
  end
  #--------------------------------------------------------------------------
  # ● 1 페이지에 표시할 수 있는 행수의 취득
  #--------------------------------------------------------------------------
  def page_row_max
    # 윈도우의 높이로부터, 프레임의 높이 32 를 빼, 1 행의 높이 32 로 나눈다
    return (self.height - 32) / 36 # (self.height - 32) / (아이콘 크기) + 4
  end
  #--------------------------------------------------------------------------
  # ● 커서의 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치가 0 미만의 경우
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 현재의 행을 취득
    row = @index / @column_max
    # 현재의 행이, 표시되고 있는 선두의 행보다 전의 경우
    if row < self.top_row
      # 현재의 행이 선두가 되도록(듯이) 스크롤
      self.top_row = row
    end
    # 현재의 행이, 표시되고 있는 최후미의 행부터 뒤의 경우
    if row > self.top_row + (self.page_row_max - 1)
      # 현재의 행이 최후미가 되도록(듯이) 스크롤
      self.top_row = row - (self.page_row_max - 1)
    end
    # 커서의 좌표를 계산
    x = @index % @column_max * 36 # @index % @column_max * (아이콘 크기) + 4
    y = @index / @column_max * 36 - self.oy # @index / @column_max * (아이콘 크기) + 4 - self.oy
    # 커서의 구형을 갱신
    self.cursor_rect.set(x, y, 36, 36) # (x, y, 아이콘 가로길이, 아이콘 세로길이)
  end
end

#==============================================================================
# ■ Window_ItemStatus
#------------------------------------------------------------------------------
#  아이템 화면에서 소지 아이템의 상세정보를 표시하는 윈도우입니다.
#==============================================================================

class Window_ItemStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 320, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(nil)
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 취득
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh(item)
    self.contents.clear
    if item.is_a?(RPG::Weapon) or item.is_a?(RPG::Armor)
      draw_parameter(item)
    elsif item.is_a?(RPG::Item)
      draw_item_info(item)
    else
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ 파라미터 묘화
  #--------------------------------------------------------------------------
  def draw_parameter(item)
    self.contents.font.size = 15
    self.contents.font.color = LPG::ItemStatusMode::TEXT_COLOR_SCRIPT ? sg_artifact_colors(item) : normal_color
    if $LPG_imported["ItemNameExtension"]
      if item.is_a?(RPG::Weapon)
        ex_name = LPG::ItemNameExtension::WEAPON_EX_NAME[item.id]
      elsif ex_name == nil
        ex_name = LPG::ItemNameExtension::DEFAULT_EX_NAME
      end
      if item.is_a?(RPG::Armor)
        ex_name = LPG::ItemNameExtension::ARMOR_EX_NAME[item.id]
      elsif ex_name == nil
        ex_name = LPG::ItemNameExtension::DEFAULT_EX_NAME
      end
    end
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_shadow_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_shadow_text(4,    16, 288, 32, ex_name.to_s)
    else
      self.contents.draw_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_text(4,    16, 288, 32, ex_name.to_s)
    end
    self.contents.font.color = normal_color
    self.contents.draw_text(4,    32, 288, 32, "________________________________________________________")
    if LPG::ItemStatusMode::TEXT_COLOR_SCRIPT
      if item.is_a?(RPG::Weapon)
        if $imported["EquipExtension"]
          conditions = KGC::ER_WEAPON_RESTRICTION[item.id]
        end
        sg_temp = 'element_set'
      elsif item.is_a?(RPG::Armor)
        if $imported["EquipExtension"]
          conditions = KGC::ER_ARMOR_RESTRICTION[item.id]
        end
        sg_temp = 'guard_element_set'
      end
    end
    if item.is_a?(RPG::Armor)
      # 방어구 타입
      # 무기에 속성 ID (n)이 체크되었을 경우
      # 장비확장 스크립트
      if item.kind == 0
        kind = $data_system.words.armor1
      elsif item.kind == 1
        kind = $data_system.words.armor2
      elsif item.kind == 2
        kind = $data_system.words.armor3
      elsif item.kind == 3
        kind = $data_system.words.armor4
      end
    end
    self.contents.draw_text(4,    48, 120, 32, conditions.to_s)
    self.contents.draw_text(-4,    48, 288, 32, item.price.to_s + " " + $data_system.words.gold, 2)
    self.contents.draw_text(-4,    64, 288, 32, kind.to_s, 2)
    self.contents.font.color = system_color
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_frame_text(4,    80, 120, 32, $data_system.words.atk)
      self.contents.draw_frame_text(4,    96, 120, 32, $data_system.words.pdef)
      self.contents.draw_frame_text(4,   112, 120, 32, $data_system.words.mdef)
      self.contents.draw_frame_text(4,   144, 120, 32, $data_system.words.str)
      self.contents.draw_frame_text(4,   160, 120, 32, $data_system.words.dex)
      self.contents.draw_frame_text(4,   176, 120, 32, $data_system.words.agi)
      self.contents.draw_frame_text(4,   192, 120, 32, $data_system.words.int)
      self.contents.font.color = system_color
      self.contents.draw_frame_text(4,   224, 120, 32, "명중률")
      self.contents.draw_frame_text(4,   240, 120, 32, "회피율")
      self.contents.font.color = normal_color
      self.contents.draw_frame_text(72,   80, 96, 32, "+"+item.atk.to_s, 0)
      self.contents.draw_frame_text(72,   96, 96, 32, "+"+item.pdef.to_s, 0)
      self.contents.draw_frame_text(72,  112, 96, 32, "+"+item.mdef.to_s, 0)
      self.contents.font.color = crisis_color
      self.contents.draw_frame_text(72,  144, 96, 32, ": "+item.str_plus.to_s, 0)
      self.contents.draw_frame_text(72,  160, 96, 32, ": "+item.dex_plus.to_s, 0)
      self.contents.draw_frame_text(72,  176, 96, 32, ": "+item.agi_plus.to_s, 0)
      self.contents.draw_frame_text(72,  192, 96, 32, ": "+item.int_plus.to_s, 0)
      self.contents.font.color = system_color
      self.contents.draw_frame_text(72,  224, 96, 32, ": "+item.eva.to_s+"%", 0)
      self.contents.draw_frame_text(72,  240, 96, 32, ": "+item.hit.to_s+"%", 0)
      self.contents.font.color = Color.new(128, 128, 128)
      self.contents.draw_frame_text(4, 272, 288, 32, item.description.to_s, 0)
    else
      self.contents.draw_text(4,    80, 120, 32, $data_system.words.atk)
      self.contents.draw_text(4,    96, 120, 32, $data_system.words.pdef)
      self.contents.draw_text(4,   112, 120, 32, $data_system.words.mdef)
      self.contents.draw_text(4,   144, 120, 32, $data_system.words.str)
      self.contents.draw_text(4,   160, 120, 32, $data_system.words.dex)
      self.contents.draw_text(4,   176, 120, 32, $data_system.words.agi)
      self.contents.draw_text(4,   192, 120, 32, $data_system.words.int)
      atk_x = self.contents.text_size($data_system.words.atk).width
      pdef_x = self.contents.text_size($data_system.words.pdef).width
      mdef_x = self.contents.text_size($data_system.words.pdef).width
      str_x = self.contents.text_size($data_system.words.str).width
      dex_x = self.contents.text_size($data_system.words.dex).width
      agi_x = self.contents.text_size($data_system.words.agi).width
      int_x = self.contents.text_size($data_system.words.int).width
      eva_x = self.contents.text_size("회피율").width
      hit_x = self.contents.text_size("명중률").width
      self.contents.font.color = normal_color
      self.contents.draw_text(atk_x + 15,   80, 96, 32, "+"+item.atk.to_s, 0)
      self.contents.draw_text(pdef_x + 15,   96, 96, 32, "+"+item.pdef.to_s, 0)
      self.contents.draw_text(mdef_x + 15,  112, 96, 32, "+"+item.mdef.to_s, 0)     
      self.contents.font.color = system_color
      self.contents.draw_text(4,   224, 120, 32, "회피율")     
      self.contents.draw_text(4,   240, 120, 32, "명중률")
      self.contents.font.color = crisis_color
      self.contents.draw_text(str_x + 15,  144, 96, 32, ": "+item.str_plus.to_s, 0)
      self.contents.draw_text(dex_x + 15,  160, 96, 32, ": "+item.dex_plus.to_s, 0)
      self.contents.draw_text(agi_x + 15,  176, 96, 32, ": "+item.agi_plus.to_s, 0)
      self.contents.draw_text(int_x + 15,  192, 96, 32, ": "+item.int_plus.to_s, 0)
      self.contents.font.color = system_color
      self.contents.draw_text(eva_x + 15,  224, 96, 32, ": "+item.eva.to_s+"%", 0)
      self.contents.draw_text(hit_x + 15,  240, 96, 32, ": "+item.hit.to_s+"%", 0)
      self.contents.font.color = Color.new(128, 128, 128)
      self.contents.draw_text(4, 272, 288, 32, item.description.to_s, 0)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 아이템 정보 묘화
  #--------------------------------------------------------------------------
  def draw_item_info(item)
    self.contents.font.size = 15
    self.contents.font.color = LPG::ItemStatusMode::TEXT_COLOR_SCRIPT ? sg_artifact_colors(item) : normal_color
    if $LPG_imported["ItemNameExtension"]
      ex_name = LPG::ItemNameExtension::ITEM_EX_NAME[item.id]
      if ex_name == nil
        ex_name = LPG::ItemNameExtension::DEFAULT_EX_NAME
      end
    end
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_shadow_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_shadow_text(4,    16, 288, 32, ex_name.to_s)
    else
      self.contents.draw_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_text(4,    16, 288, 32, ex_name.to_s)
    end
    self.contents.font.color = normal_color
    self.contents.draw_text(4,    32, 288, 32, "________________________________________________________")
    self.contents.draw_text(-4,    48, 288, 32, item.price.to_s + " " + $data_system.words.gold, 2)
    number = $game_party.item_number(item.id)
    self.contents.font.color = system_color
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      if $LPG_imported["ItemLimit"]
        # 아이템의 현재 소지수와 소지 한도를 표시한다.
        item_limit = LPG::ItemLimit::ITEM_LIMIT[item.id]
        self.contents.draw_frame_text(4,    64, 120, 32, "수량 : "+number.to_s+" / "+item_limit.to_s)
      else
        # 아이템의 현재 소지수만 표시한다.
        self.contents.draw_frame_text(4,    64, 120, 32, "수량 : "+number.to_s)
      end
    else
      self.contents.draw_text(4,    64, 120, 32, "수량 : "+number.to_s)
    end
    if item.occasion == 0
      use_text = LPG::ItemStatusMode::ALL_OCCASION
    elsif item.occasion == 1
      use_text = LPG::ItemStatusMode::BATTLE_OCCASION
    elsif item.occasion == 2
      use_text = LPG::ItemStatusMode::MENU_OCCASION
    elsif item.occasion == 3
      use_text = LPG::ItemStatusMode::IMPOSSIBLE_OCCASION
    end
    self.contents.font.color = item.occasion == 3 ? knockout_color : normal_color
    if LPG::ItemStatusMode::BITMAP_SCRIPT   
      self.contents.draw_frame_text(-4,    80, 288, 32, use_text.to_s, 2)
    else
      self.contents.draw_text(-4,    80, 288, 32, use_text.to_s, 2)
    end
    self.contents.font.color = normal_color
    if item.scope == 0
      range_text = ""
    elsif item.scope == 1
      range_text = "적 단체"
    elsif item.scope == 2
      range_text = "적 범위"
    elsif item.scope == 3
      range_text = "아군 단체"
    elsif item.scope == 4
      range_text = "아군 범위"
    elsif item.scope == 5
      range_text = "아군 단체 (HP 0)"
      self.contents.font.color = crisis_color
    elsif item.scope == 6
      range_text = "아군 범위 (HP 0)"
      self.contents.font.color = crisis_color
    elsif item.scope == 7
      range_text = "사용자"
    end
    if LPG::ItemStatusMode::BITMAP_SCRIPT   
      self.contents.draw_frame_text(-4,    96, 288, 32, range_text.to_s, 2)
      self.contents.font.color = system_color
      self.contents.draw_frame_text(4,    128, 288, 32, item.description.to_s, 0)
    else
      self.contents.draw_text(-4,    96, 288, 32, range_text.to_s, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(4,    128, 288, 32, item.description.to_s, 0)
    end
  end
end

#==============================================================================
# ■ Scene_Item
#------------------------------------------------------------------------------
#  아이템 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Item
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    start
    # 아이템 윈도우를 작성
    @item_window = Window_Item.new
    @status_window = Window_ItemStatus.new
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 480 - @gold_window.height
    # 헬프 윈도우를 관련지어
    # 타겟 윈도우를 작성 (불가시·비액티브하게 설정)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
   
    @item_window.index = 0
    @status_window.refresh(@item_window.item)
   
    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면 루프를 중단
      if $scene != self
        break
      end
    end
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @item_window.dispose
    @status_window.dispose
    @gold_window.dispose
    @target_window.dispose
    @spriteset.dispose
  end
  #--------------------------------------------------------------------------
  # ○ 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    @item_window.refresh
    @status_window.refresh(nil)
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우를 갱신
    @item_window.update
    @status_window.update
    @gold_window.update
    @target_window.update
    @spriteset.update
    # 아이템 윈도우가 액티브의 경우: update_item 를 부른다
    if @item_window.active
      update_item
      return
    end
    # 타겟 윈도우가 액티브의 경우: update_target 를 부른다
    if @target_window.active
      update_target
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ 개시 처리
  #--------------------------------------------------------------------------
  def start
    @spriteset = Spriteset_Map.new
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (아이템 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_item
    if @now_sel_item != @item_window.index
      # 스테이터스 윈도우를 리프레쉬
      @status_window.refresh(@item_window.item)
      @now_sel_item = @item_window.index
    end
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 메뉴 화면으로 전환해
      $scene = Scene_Menu.new(0)
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 아이템 윈도우로 현재 선택되고 있는 데이터를 취득
      @item = @item_window.item
      # 사용 아이템이 아닌 경우
      unless @item.is_a?(RPG::Item)
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 사용할 수 없는 경우
      unless $game_party.item_can_use?(@item.id)
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 결정 SE 를 연주
      $game_system.se_play($data_system.decision_se)
      # 효과 범위가 아군의 경우
      if @item.scope >= 3
        # 타겟 윈도우를 액티브화
        @item_window.active = false
        @target_window.x = (@item_window.index + 1) % 2 * 304
        @target_window.visible = true
        @target_window.active = true
        # 효과 범위 (단체/전체)에 따라 커서 위치를 설정
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      # 효과 범위가 아군 이외의 경우
      else
        # 코먼 이벤트 ID 가 유효의 경우
        if @item.common_event_id > 0
          # 코먼 이벤트 호출 예약
          $game_temp.common_event_id = @item.common_event_id
          # 아이템의 사용시 SE 를 연주
          $game_system.se_play(@item.menu_se)
          # 소모품의 경우
          if @item.consumable
            # 사용한 아이템을 1 줄인다
            $game_party.lose_item(@item.id, 1)
            # 아이템 윈도우의 항목을 재묘화
            @item_window.draw_item(@item_window.index)
          end
          # 맵 화면으로 전환해
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (타겟 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_target
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 아이템 조각등에서 사용할 수 없게 되었을 경우
      unless $game_party.item_can_use?(@item.id)
        # 아이템 윈도우의 내용을 재작성
        @item_window.refresh
      end
      # 타겟 윈도우를 소거
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 아이템을 다 사용했을 경우
      if $game_party.item_number(@item.id) == 0
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 타겟이 전체의 경우
      if @target_window.index == -1
        # 파티 전체에 아이템의 사용 효과를 적용
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      # 타겟이 단체의 경우
      if @target_window.index >= 0
        # 타겟의 액터에게 아이템의 사용 효과를 적용
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      # 아이템을 사용했을 경우
      if used
        # 아이템의 사용시 SE 를 연주
        $game_system.se_play(@item.menu_se)
        # 소모품의 경우
        if @item.consumable
          # 사용한 아이템을 1 줄인다
          $game_party.lose_item(@item.id, 1)
          # 아이템 윈도우의 항목을 재묘화
          @item_window.draw_item(@item_window.index)
        end
        # 타겟 윈도우의 내용을 재작성
        @target_window.refresh
        # 전멸의 경우
        if $game_party.all_dead?
          # 게임 오버 화면으로 전환해
          $scene = Scene_Gameover.new
          return
        end
        # 코먼 이벤트 ID 가 유효의 경우
        if @item.common_event_id > 0
          # 코먼 이벤트 호출 예약
          $game_temp.common_event_id = @item.common_event_id
          # 맵 화면으로 전환해
          $scene = Scene_Map.new
          return
        end
      end
      # 아이템을 사용하지 않았던 경우
      unless used
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end

#_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/
#_/ ̄    ◆ 아이템 상세정보 - LPG_ItemStatusMode ◆
#_/ ̄    ◇ Last update : 2009/08/11 ◇
#------------------------------------------------------------------------------
#   아이템 화면을 업그레이드 시켜 상세정보를 보여줍니다.
#   - 스크립트 제작자 : Claymore   저작권 : L PROJECT GAME -
#_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/

#==============================================================================
# ★ 커스터마이즈 항목 - Customize ★
#==============================================================================

module LPG
module ItemStatusMode
  $LPG_imported = {} if $LPG_imported == nil
  $LPG_imported["ItemStatusMode"] = true
 
  # ◆ 이름 색짓기 스크립트 사용 여부 ( 있다면... )
  TEXT_COLOR_SCRIPT = false
 
  # ◆ 비트맵(테두리/그림자 효과) 사용 여부 ( 역시 있다면... )
  BITMAP_SCRIPT = false
 
  # ◆ 아이템의 사용 가능한 상황 텍스트
  # ◇ 평상, 전투
  ALL_OCCASION = "평상, 전투 모두 사용 가능"
  # ◇ 전투
  BATTLE_OCCASION = "전투시 사용 가능"
  # ◇ 평상
  MENU_OCCASION = "평상시 사용 가능"
  # ◇ 사용 불가
  IMPOSSIBLE_OCCASION = "사용 불가"
end

#_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/
#         [ ‡ 소규모 스크립트 ‡ ]
#_/ ̄   ◆ 아이템 상세정보 - LPG_ItemNameExtension ◆
#------------------------------------------------------------------------------
#/ ̄_   아이템 화면을 업그레이드 시켜 상세정보를 보여줍니다.
#        
#_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/ ̄_/

module ItemNameExtension
  $LPG_imported = {} if $LPG_imported == nil
  $LPG_imported["ItemNameExtension"] = true

  # ◆ 정의되있지 않은 아이템/무기/방어구 - 확장
  DEFAULT_EX_NAME = "" # 공백으로 표시합니다.
 
  # ◆ 아이템 이름 정의 - 확장
  ITEM_EX_NAME = { # ← 지우지 마세요 ▒
   # 아이템 ID => "확장이름"

  } # ← 지우지 마세요 ▒
  # ◆ 무기 이름 정의 - 확장
  WEAPON_EX_NAME = { # ← 지우지 마세요 ▒
   # 무기 ID => "확장이름"

  } # ← 지우지 마세요 ▒
  # ◆ 방어구 이름 정의 - 확장
  ARMOR_EX_NAME = { # ← 지우지 마세요 ▒
   # 방어구 ID => "확장이름"

  } # ← 지우지 마세요 ▒
end
end

=begin

! 해당 스크립트는 아이콘 크기(32x32)를 중심으로한 스크립트입니다.
! 해당 스크립트는 글자크기 15pt를 중심으로한 스크립트입니다.
※ 해당 스크립트를 사용시
  약간의 멋을 내줄 수 있지만, TEXT_COLOR_SCRIPT 또는 BITMAP_SCRIPT 를 활성화시키면
  커서 이동시 업데이트 속도가 다소 느려질 수 있습니다.
문제 있으시면 dkrlgns@naver.com 으로 쪽지 보내주시거나 아래 주소에 댓글을 남겨주시면 감사하겠습니다.
http://cafe.naver.com/ArticleRead.nhn?clubid=10738640&page=1&menuid=14&boardtype=L&articleid=46939

=end

#==============================================================================
# ■ RPG::Weapon
#==============================================================================

class RPG::Weapon
  #--------------------------------------------------------------------------
  # ○ 회피 수정
  #--------------------------------------------------------------------------
  def eva
    return 0
  end
  #--------------------------------------------------------------------------
  # ○ 명중률
  #--------------------------------------------------------------------------
  def hit
    return 0
  end
end
#==============================================================================
# ■ RPG::Armor
#==============================================================================

class RPG::Armor
  #--------------------------------------------------------------------------
  # ○ 공격력
  #--------------------------------------------------------------------------
  def atk
    return 0
  end
  #--------------------------------------------------------------------------
  # ○ 명중률
  #--------------------------------------------------------------------------
  def hit
    return 0
  end
end

#==============================================================================
# ■ Window_Item
#------------------------------------------------------------------------------
#  아이템 화면, 배틀 화면에서, 소지 아이템의 일람을 표시하는 윈도우입니다.
#==============================================================================

class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(320, 0, 320, 176)
    @column_max = 8
    refresh
    self.index = 0
    # 전투중의 경우는 윈도우를 화면 중앙에 이동해, 반투명으로 한다
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 취득
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # 아이템을 추가
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
    # 전투중 이외라면 무기와 방어구도 추가
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    end
    # 항목수가 0 이 아니면 비트 맵을 작성해, 전항목을 묘화
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 36) # row_max * (아이콘 크기) + 4
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 항목의 묘화
  #     index : 항목 번호
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if LPG::ItemStatusMode::TEXT_COLOR_SCRIPT   
      self.contents.font.color = sg_artifact_colors(item)
    else
      self.contents.font.color = normal_color
    end
    x = 4 + index % 8 * 36 # 8 * (아이콘 크기+4)
    y = index / 8 * 36 # 8 * (아이콘 크기+4)
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = 255
    self.contents.blt(x - 2, y + 2, bitmap, Rect.new(0, 0, 32, 32), opacity)
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_frame_text(x - 4, y + 10, 32, 32, number.to_s, 2)
    else
      self.contents.draw_text(x - 4, y + 10, 32, 32, number.to_s, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 취득
  #--------------------------------------------------------------------------
  def top_row
    # 윈도우 내용의 전송원 Y 좌표를, 1 행의 높이 22 로 나눈다
    return self.oy / 36 # self.oy / (아이콘 크기) + 4
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 설정
  #     row : 선두에 표시하는 행
  #--------------------------------------------------------------------------
  def top_row=(row)
    # row 가 0 미만의 경우는 0 에 수정
    if row < 0
      row = 0
    end
    # row 가 row_max - 1 초의 경우는 row_max - 1 에 수정
    if row > row_max - 1
      row = row_max - 1
    end
    # row 에 1 행의 높이 36 를 걸어 윈도우 내용의 전송원 Y 좌표로 한다
    self.oy = row * 36 # row * (아이콘 크기) + 4
  end
  #--------------------------------------------------------------------------
  # ● 1 페이지에 표시할 수 있는 행수의 취득
  #--------------------------------------------------------------------------
  def page_row_max
    # 윈도우의 높이로부터, 프레임의 높이 32 를 빼, 1 행의 높이 32 로 나눈다
    return (self.height - 32) / 36 # (self.height - 32) / (아이콘 크기) + 4
  end
  #--------------------------------------------------------------------------
  # ● 커서의 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치가 0 미만의 경우
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 현재의 행을 취득
    row = @index / @column_max
    # 현재의 행이, 표시되고 있는 선두의 행보다 전의 경우
    if row < self.top_row
      # 현재의 행이 선두가 되도록(듯이) 스크롤
      self.top_row = row
    end
    # 현재의 행이, 표시되고 있는 최후미의 행부터 뒤의 경우
    if row > self.top_row + (self.page_row_max - 1)
      # 현재의 행이 최후미가 되도록(듯이) 스크롤
      self.top_row = row - (self.page_row_max - 1)
    end
    # 커서의 좌표를 계산
    x = @index % @column_max * 36 # @index % @column_max * (아이콘 크기) + 4
    y = @index / @column_max * 36 - self.oy # @index / @column_max * (아이콘 크기) + 4 - self.oy
    # 커서의 구형을 갱신
    self.cursor_rect.set(x, y, 36, 36) # (x, y, 아이콘 가로길이, 아이콘 세로길이)
  end
end

#==============================================================================
# ■ Window_ItemStatus
#------------------------------------------------------------------------------
#  아이템 화면에서 소지 아이템의 상세정보를 표시하는 윈도우입니다.
#==============================================================================

class Window_ItemStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 320, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(nil)
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 취득
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh(item)
    self.contents.clear
    if item.is_a?(RPG::Weapon) or item.is_a?(RPG::Armor)
      draw_parameter(item)
    elsif item.is_a?(RPG::Item)
      draw_item_info(item)
    else
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ 파라미터 묘화
  #--------------------------------------------------------------------------
  def draw_parameter(item)
    self.contents.font.size = 15
    self.contents.font.color = LPG::ItemStatusMode::TEXT_COLOR_SCRIPT ? sg_artifact_colors(item) : normal_color
    if $LPG_imported["ItemNameExtension"]
      if item.is_a?(RPG::Weapon)
        ex_name = LPG::ItemNameExtension::WEAPON_EX_NAME[item.id]
      elsif ex_name == nil
        ex_name = LPG::ItemNameExtension::DEFAULT_EX_NAME
      end
      if item.is_a?(RPG::Armor)
        ex_name = LPG::ItemNameExtension::ARMOR_EX_NAME[item.id]
      elsif ex_name == nil
        ex_name = LPG::ItemNameExtension::DEFAULT_EX_NAME
      end
    end
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_shadow_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_shadow_text(4,    16, 288, 32, ex_name.to_s)
    else
      self.contents.draw_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_text(4,    16, 288, 32, ex_name.to_s)
    end
    self.contents.font.color = normal_color
    self.contents.draw_text(4,    32, 288, 32, "________________________________________________________")
    if LPG::ItemStatusMode::TEXT_COLOR_SCRIPT
      if item.is_a?(RPG::Weapon)
        if $imported["EquipExtension"]
          conditions = KGC::ER_WEAPON_RESTRICTION[item.id]
        end
        sg_temp = 'element_set'
      elsif item.is_a?(RPG::Armor)
        if $imported["EquipExtension"]
          conditions = KGC::ER_ARMOR_RESTRICTION[item.id]
        end
        sg_temp = 'guard_element_set'
      end
    end
    if item.is_a?(RPG::Armor)
      # 방어구 타입
      # 무기에 속성 ID (n)이 체크되었을 경우
      # 장비확장 스크립트
      if item.kind == 0
        kind = $data_system.words.armor1
      elsif item.kind == 1
        kind = $data_system.words.armor2
      elsif item.kind == 2
        kind = $data_system.words.armor3
      elsif item.kind == 3
        kind = $data_system.words.armor4
      end
    end
    self.contents.draw_text(4,    48, 120, 32, conditions.to_s)
    self.contents.draw_text(-4,    48, 288, 32, item.price.to_s + " " + $data_system.words.gold, 2)
    self.contents.draw_text(-4,    64, 288, 32, kind.to_s, 2)
    self.contents.font.color = system_color
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_frame_text(4,    80, 120, 32, $data_system.words.atk)
      self.contents.draw_frame_text(4,    96, 120, 32, $data_system.words.pdef)
      self.contents.draw_frame_text(4,   112, 120, 32, $data_system.words.mdef)
      self.contents.draw_frame_text(4,   144, 120, 32, $data_system.words.str)
      self.contents.draw_frame_text(4,   160, 120, 32, $data_system.words.dex)
      self.contents.draw_frame_text(4,   176, 120, 32, $data_system.words.agi)
      self.contents.draw_frame_text(4,   192, 120, 32, $data_system.words.int)
      self.contents.font.color = system_color
      self.contents.draw_frame_text(4,   224, 120, 32, "명중률")
      self.contents.draw_frame_text(4,   240, 120, 32, "회피율")
      self.contents.font.color = normal_color
      self.contents.draw_frame_text(72,   80, 96, 32, "+"+item.atk.to_s, 0)
      self.contents.draw_frame_text(72,   96, 96, 32, "+"+item.pdef.to_s, 0)
      self.contents.draw_frame_text(72,  112, 96, 32, "+"+item.mdef.to_s, 0)
      self.contents.font.color = crisis_color
      self.contents.draw_frame_text(72,  144, 96, 32, ": "+item.str_plus.to_s, 0)
      self.contents.draw_frame_text(72,  160, 96, 32, ": "+item.dex_plus.to_s, 0)
      self.contents.draw_frame_text(72,  176, 96, 32, ": "+item.agi_plus.to_s, 0)
      self.contents.draw_frame_text(72,  192, 96, 32, ": "+item.int_plus.to_s, 0)
      self.contents.font.color = system_color
      self.contents.draw_frame_text(72,  224, 96, 32, ": "+item.eva.to_s+"%", 0)
      self.contents.draw_frame_text(72,  240, 96, 32, ": "+item.hit.to_s+"%", 0)
      self.contents.font.color = Color.new(128, 128, 128)
      self.contents.draw_frame_text(4, 272, 288, 32, item.description.to_s, 0)
    else
      self.contents.draw_text(4,    80, 120, 32, $data_system.words.atk)
      self.contents.draw_text(4,    96, 120, 32, $data_system.words.pdef)
      self.contents.draw_text(4,   112, 120, 32, $data_system.words.mdef)
      self.contents.draw_text(4,   144, 120, 32, $data_system.words.str)
      self.contents.draw_text(4,   160, 120, 32, $data_system.words.dex)
      self.contents.draw_text(4,   176, 120, 32, $data_system.words.agi)
      self.contents.draw_text(4,   192, 120, 32, $data_system.words.int)
      atk_x = self.contents.text_size($data_system.words.atk).width
      pdef_x = self.contents.text_size($data_system.words.pdef).width
      mdef_x = self.contents.text_size($data_system.words.pdef).width
      str_x = self.contents.text_size($data_system.words.str).width
      dex_x = self.contents.text_size($data_system.words.dex).width
      agi_x = self.contents.text_size($data_system.words.agi).width
      int_x = self.contents.text_size($data_system.words.int).width
      eva_x = self.contents.text_size("회피율").width
      hit_x = self.contents.text_size("명중률").width
      self.contents.font.color = normal_color
      self.contents.draw_text(atk_x + 15,   80, 96, 32, "+"+item.atk.to_s, 0)
      self.contents.draw_text(pdef_x + 15,   96, 96, 32, "+"+item.pdef.to_s, 0)
      self.contents.draw_text(mdef_x + 15,  112, 96, 32, "+"+item.mdef.to_s, 0)     
      self.contents.font.color = system_color
      self.contents.draw_text(4,   224, 120, 32, "회피율")     
      self.contents.draw_text(4,   240, 120, 32, "명중률")
      self.contents.font.color = crisis_color
      self.contents.draw_text(str_x + 15,  144, 96, 32, ": "+item.str_plus.to_s, 0)
      self.contents.draw_text(dex_x + 15,  160, 96, 32, ": "+item.dex_plus.to_s, 0)
      self.contents.draw_text(agi_x + 15,  176, 96, 32, ": "+item.agi_plus.to_s, 0)
      self.contents.draw_text(int_x + 15,  192, 96, 32, ": "+item.int_plus.to_s, 0)
      self.contents.font.color = system_color
      self.contents.draw_text(eva_x + 15,  224, 96, 32, ": "+item.eva.to_s+"%", 0)
      self.contents.draw_text(hit_x + 15,  240, 96, 32, ": "+item.hit.to_s+"%", 0)
      self.contents.font.color = Color.new(128, 128, 128)
      self.contents.draw_text(4, 272, 288, 32, item.description.to_s, 0)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 아이템 정보 묘화
  #--------------------------------------------------------------------------
  def draw_item_info(item)
    self.contents.font.size = 15
    self.contents.font.color = LPG::ItemStatusMode::TEXT_COLOR_SCRIPT ? sg_artifact_colors(item) : normal_color
    if $LPG_imported["ItemNameExtension"]
      ex_name = LPG::ItemNameExtension::ITEM_EX_NAME[item.id]
      if ex_name == nil
        ex_name = LPG::ItemNameExtension::DEFAULT_EX_NAME
      end
    end
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      self.contents.draw_shadow_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_shadow_text(4,    16, 288, 32, ex_name.to_s)
    else
      self.contents.draw_text(4,     0, 288, 32, item.name.to_s)
      self.contents.draw_text(4,    16, 288, 32, ex_name.to_s)
    end
    self.contents.font.color = normal_color
    self.contents.draw_text(4,    32, 288, 32, "________________________________________________________")
    self.contents.draw_text(-4,    48, 288, 32, item.price.to_s + " " + $data_system.words.gold, 2)
    number = $game_party.item_number(item.id)
    self.contents.font.color = system_color
    if LPG::ItemStatusMode::BITMAP_SCRIPT
      if $LPG_imported["ItemLimit"]
        # 아이템의 현재 소지수와 소지 한도를 표시한다.
        item_limit = LPG::ItemLimit::ITEM_LIMIT[item.id]
        self.contents.draw_frame_text(4,    64, 120, 32, "수량 : "+number.to_s+" / "+item_limit.to_s)
      else
        # 아이템의 현재 소지수만 표시한다.
        self.contents.draw_frame_text(4,    64, 120, 32, "수량 : "+number.to_s)
      end
    else
      self.contents.draw_text(4,    64, 120, 32, "수량 : "+number.to_s)
    end
    if item.occasion == 0
      use_text = LPG::ItemStatusMode::ALL_OCCASION
    elsif item.occasion == 1
      use_text = LPG::ItemStatusMode::BATTLE_OCCASION
    elsif item.occasion == 2
      use_text = LPG::ItemStatusMode::MENU_OCCASION
    elsif item.occasion == 3
      use_text = LPG::ItemStatusMode::IMPOSSIBLE_OCCASION
    end
    self.contents.font.color = item.occasion == 3 ? knockout_color : normal_color
    if LPG::ItemStatusMode::BITMAP_SCRIPT   
      self.contents.draw_frame_text(-4,    80, 288, 32, use_text.to_s, 2)
    else
      self.contents.draw_text(-4,    80, 288, 32, use_text.to_s, 2)
    end
    self.contents.font.color = normal_color
    if item.scope == 0
      range_text = ""
    elsif item.scope == 1
      range_text = "적 단체"
    elsif item.scope == 2
      range_text = "적 범위"
    elsif item.scope == 3
      range_text = "아군 단체"
    elsif item.scope == 4
      range_text = "아군 범위"
    elsif item.scope == 5
      range_text = "아군 단체 (HP 0)"
      self.contents.font.color = crisis_color
    elsif item.scope == 6
      range_text = "아군 범위 (HP 0)"
      self.contents.font.color = crisis_color
    elsif item.scope == 7
      range_text = "사용자"
    end
    if LPG::ItemStatusMode::BITMAP_SCRIPT   
      self.contents.draw_frame_text(-4,    96, 288, 32, range_text.to_s, 2)
      self.contents.font.color = system_color
      self.contents.draw_frame_text(4,    128, 288, 32, item.description.to_s, 0)
    else
      self.contents.draw_text(-4,    96, 288, 32, range_text.to_s, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(4,    128, 288, 32, item.description.to_s, 0)
    end
  end
end

#==============================================================================
# ■ Scene_Item
#------------------------------------------------------------------------------
#  아이템 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Item
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    start
    # 아이템 윈도우를 작성
    @item_window = Window_Item.new
    @status_window = Window_ItemStatus.new
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 480 - @gold_window.height
    # 헬프 윈도우를 관련지어
    # 타겟 윈도우를 작성 (불가시·비액티브하게 설정)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
   
    @item_window.index = 0
    @status_window.refresh(@item_window.item)
   
    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면 루프를 중단
      if $scene != self
        break
      end
    end
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @item_window.dispose
    @status_window.dispose
    @gold_window.dispose
    @target_window.dispose
    @spriteset.dispose
  end
  #--------------------------------------------------------------------------
  # ○ 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    @item_window.refresh
    @status_window.refresh(nil)
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우를 갱신
    @item_window.update
    @status_window.update
    @gold_window.update
    @target_window.update
    @spriteset.update
    # 아이템 윈도우가 액티브의 경우: update_item 를 부른다
    if @item_window.active
      update_item
      return
    end
    # 타겟 윈도우가 액티브의 경우: update_target 를 부른다
    if @target_window.active
      update_target
      return
    end
  end
  #--------------------------------------------------------------------------
  # ○ 개시 처리
  #--------------------------------------------------------------------------
  def start
    @spriteset = Spriteset_Map.new
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (아이템 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_item
    if @now_sel_item != @item_window.index
      # 스테이터스 윈도우를 리프레쉬
      @status_window.refresh(@item_window.item)
      @now_sel_item = @item_window.index
    end
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 메뉴 화면으로 전환해
      $scene = Scene_Menu.new(0)
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 아이템 윈도우로 현재 선택되고 있는 데이터를 취득
      @item = @item_window.item
      # 사용 아이템이 아닌 경우
      unless @item.is_a?(RPG::Item)
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 사용할 수 없는 경우
      unless $game_party.item_can_use?(@item.id)
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 결정 SE 를 연주
      $game_system.se_play($data_system.decision_se)
      # 효과 범위가 아군의 경우
      if @item.scope >= 3
        # 타겟 윈도우를 액티브화
        @item_window.active = false
        @target_window.x = (@item_window.index + 1) % 2 * 304
        @target_window.visible = true
        @target_window.active = true
        # 효과 범위 (단체/전체)에 따라 커서 위치를 설정
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      # 효과 범위가 아군 이외의 경우
      else
        # 코먼 이벤트 ID 가 유효의 경우
        if @item.common_event_id > 0
          # 코먼 이벤트 호출 예약
          $game_temp.common_event_id = @item.common_event_id
          # 아이템의 사용시 SE 를 연주
          $game_system.se_play(@item.menu_se)
          # 소모품의 경우
          if @item.consumable
            # 사용한 아이템을 1 줄인다
            $game_party.lose_item(@item.id, 1)
            # 아이템 윈도우의 항목을 재묘화
            @item_window.draw_item(@item_window.index)
          end
          # 맵 화면으로 전환해
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (타겟 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_target
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 아이템 조각등에서 사용할 수 없게 되었을 경우
      unless $game_party.item_can_use?(@item.id)
        # 아이템 윈도우의 내용을 재작성
        @item_window.refresh
      end
      # 타겟 윈도우를 소거
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 아이템을 다 사용했을 경우
      if $game_party.item_number(@item.id) == 0
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 타겟이 전체의 경우
      if @target_window.index == -1
        # 파티 전체에 아이템의 사용 효과를 적용
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      # 타겟이 단체의 경우
      if @target_window.index >= 0
        # 타겟의 액터에게 아이템의 사용 효과를 적용
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      # 아이템을 사용했을 경우
      if used
        # 아이템의 사용시 SE 를 연주
        $game_system.se_play(@item.menu_se)
        # 소모품의 경우
        if @item.consumable
          # 사용한 아이템을 1 줄인다
          $game_party.lose_item(@item.id, 1)
          # 아이템 윈도우의 항목을 재묘화
          @item_window.draw_item(@item_window.index)
        end
        # 타겟 윈도우의 내용을 재작성
        @target_window.refresh
        # 전멸의 경우
        if $game_party.all_dead?
          # 게임 오버 화면으로 전환해
          $scene = Scene_Gameover.new
          return
        end
        # 코먼 이벤트 ID 가 유효의 경우
        if @item.common_event_id > 0
          # 코먼 이벤트 호출 예약
          $game_temp.common_event_id = @item.common_event_id
          # 맵 화면으로 전환해
          $scene = Scene_Map.new
          return
        end
      end
      # 아이템을 사용하지 않았던 경우
      unless used
        # 버저 SE 를 연주
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end



Comment '27'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
781 전투 Mr. Mo's ABS Ultimate by DerVVulfman Alkaid 2011.09.05 1438
780 온라인 Mr.Metring NPE 1.0 [RPG XP 온라인 스크립트] 35 아방스 2009.01.07 6535
779 전투 Mr.Mo's ABS Ultimate 2.6 by DerVVulfman Alkaid 2012.01.04 1820
778 전투 Mr.Mo's ABS Ultimate 3.4 by DerVVulfman Alkaid 2012.03.14 1803
777 전투 Mr.Mo's ABS Ultimate 7.0 by DerVVulfman 4 Alkaid 2012.08.26 2587
776 전투 Mr.mo's SBABS Lite 5 6 아방스마니아 2010.11.14 2947
775 전투 MrMo DVV Add-On #13: Tinuke's Smart Missiles 2 Alkaid 2011.01.24 1843
774 장비 Multi Equip 3.1.4 by Trickster (SDK2 호환, Method & Class Li… 4 file WMN 2008.04.06 1597
773 장비 Multi-equip script 2 file 백호 2009.02.21 1101
772 장비 Multi-equip script ver.6 by Guillaume777 4 file 백호 2009.02.22 1210
771 장비 Multi-equip script 노신버전 2 file 백호 2009.02.22 1129
770 온라인 Multi-Netplay Extended (신버전) 10 백호 2009.02.22 2864
769 온라인 Multi-Netplay Extended[구버전용] 3 백호 2009.02.22 2176
768 기타 Multiple Currencies(여러 개의 통화단위 사용) 2 백호 2009.02.22 1124
767 기타 Multiple Languages v2 by SephirothSpawn (SDK호환) file 백호 2009.02.22 1404
766 장비 Multislots! 2.1 by DerVVulfman 3 file Alkaid 2010.09.02 1537
765 장비 Multislots! 2.2 by DerVVulfman 4 file Alkaid 2011.02.18 1611
764 장비 MultiSlots! 2.4 by DerVVulfman 2 Alkaid 2011.09.05 1466
763 온라인 multy-netplay 로그인창에서 비밀번호를 ***표시해주는 script~! 1 백호 2009.02.22 1889
762 기타 My메세지(메세지 출력 스크립트) 1 file 백호 2009.02.22 1533
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 52 Next
/ 52