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
34 아이템 심플 액알 [리젠, 아이템 드롭] 18 file 백호 2009.02.21 3917
» 아이템 아이템창변경 27 카르닉스 2010.02.26 3629
32 아이템 아이템 인벤토리 2 file 백호 2009.02.22 3354
31 아이템 [LPG] 아이템 상세정보 - ◇ Last Update : 2009/08/11 ◇ 11 file Claymore 2009.08.16 3307
30 아이템 아이템획득스크립트 ps인간 2009.01.23 2993
29 아이템 [신기술 체험] 인벤토리 8 file 백호 2009.02.22 2962
28 아이템 CSSR14-아이템 합성 3 file 백호 2009.02.22 2833
27 아이템 mog-아이템창업그레이드? ps인간 2009.01.23 2555
26 아이템 아이템도감 14 키라링 2009.01.22 2299
25 아이템 아이템을 얻으면 자동으로 아이템 입수 메세지윈도우 띄우기 4 백호 2009.02.22 2279
24 아이템 아이템 선택하기 5 레핀 2009.01.29 2084
23 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
22 아이템 Categorized Items Menu 1.3 by albertfish 1 file Alkaid 2010.09.09 1795
21 아이템 아이템,돈 보관창고 스크립트 4 file 백호 2009.02.21 1769
20 아이템 아이템제한스크립트 ps인간 2009.01.23 1680
19 아이템 아이템소지수 한계돌파 (중복일지도) 12 카르닉스 2010.02.26 1498
18 아이템 아이템 소지수 한계돌파(중복일 확률 높음) 3 캉쿤 2011.09.13 1478
17 아이템 지정한 아이템 갯수 제한 3 백호 2009.02.22 1282
16 아이템 아이템 종류별로 분류시키는 스크립트 3 file 백호 2009.02.21 1259
15 아이템 아이템 단축키로 구입 스크립트 3 백호 2009.02.22 1243
Board Pagination Prev 1 2 Next
/ 2