질문과 답변

Extra Form

#_/ ̄    ◆ 아이템 상세정보 - 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

 

이걸 어떻게 적용해야

 

아이템 색을 바꿀수 있는지 읽어봐도 이해가 안되네요 ㅜㅜ

 

누가 깔삼하게 정리해서 장비나 무기 아이템에 색을 부여하는 방법좀 말해주세요, 부탁드립니당...


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12387
RMXP xp안움직여저요 10 2014.02.04 746
RMXP 제가 디지몬게임을 만들고있는데요 3 그림용휘발유 2014.02.02 736
RMXP 아이템 색 바꾸는 스크립트 적용법.. 윌리스 2014.02.01 532
RMXP 변수를 이용한 아이템 세트효과 만들기. 4 file 윌리스 2014.02.01 592
RMXP 맵에 들어가면 맵이름이 뭔지 나오는걸 하고싶어요 4 도사 2014.02.01 831
RMXP 스크립트 작성 도와주세요 2 SPMgames 2014.01.30 761
RMXP 스크립트 적용 시 오류 1 file Fernandez 2014.01.30 669
RMXP 빈이벤트를 통해 통행 금지 구역 만들기 14 file LoLiL 2014.01.30 561
RMXP 턴알) 10회 (단일)공격하는 이벤트 만들기. 5 file 윌리스 2014.01.29 713
RMXP 장비, 아이템, 스킬등 데이터 베이스에 있는 아이템 이름색 바꾸기. 2 윌리스 2014.01.29 862
RMXP 문장 타이핑을 할 때 ! 글쳐지는 속도 강약조절을 어떻게 하는건가요? 4 file 내손목아지 2014.01.29 950
RMXP 아이템창이 뜨질 않습니다;; 3 file 흰고양이 2014.01.28 649
RMXP 선택지의 갯수를 늘릴 수 있나요? 2 shsQk 2014.01.27 825
RMXP SRPG 제작 시스템 "GubiD's Tactical Battle System"질문이요! 2 file Blur 2014.01.26 925
RMXP 특정 아이템의 소지수 제한 2 shsQk 2014.01.25 719
RMXP (턴제)도발스킬 만드는법. 5 윌리스 2014.01.25 1168
RMXP 이 스크립트를 사용하는 방법을 가르쳐주세요 10 이룩 2014.01.24 435
RMXP RPG XP 칩 적용 어떻게 하나요. 2 훤>선 2014.01.23 1083
RMXP 프로젝트 안에 BGM이 재생되지 않습니다 4 이룩 2014.01.22 744
RMXP 애니메이션을 이미지로 만들고 싶습니다 5 file 이룩 2014.01.21 825
Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ... 90 Next
/ 90