VX 스크립트


아이미르님의 카드 슬롯 장비 스크립트





#==============================================================================
# RGSS2_카드 슬롯 장비 Ver0. 12
# tomoaky (http://hikimoki.web.infoseek.co.jp/)
#
# 2011/02/08 Ver0. 12
# ·조건 분기:엑터의 장비품 판정에 대응
# ·숍에서의 장비품 소지수가 올바르게 표시되지 않는 불편을 수정
# ·일부 윈도우의 거동을 변경
#
# 2010/04/16  Ver0. 11
# 2010/03/25  Ver0. 1 공개
#
# RPG 트크르 VX에 이하의 기능을 추가하는 스크립트 소재입니다
# ·동종의 장비품을 개개에 관리하는 사양으로 변경
# ·강화 아이템에 의한 장비품 강화
# ·카드에 의한 장비품 커스터마이즈
# ·장비 중량에 의한 민첩성과 회피율의 보정
#
# 또 , 이하의 제한이 더해집니다
# ·장비품의 소지수취득이나 증감에 있어서의 「장비품도 포함한다」가 무효
# ·무기(방어용 기구)의 증감 커맨드에서는 전에 있는 것으로부터 순서로 줄인다
#
# 다른 스크립트와의 병용을 고려하지 않는 만들기가 되어 있습니다,
# 경합에 의한 불편은 포기할까 자력으로 수정해 주세요.
#
# 자세한 사용법등은 사이트의 해설 페이지를 참조해 주세요.
#==============================================================================

$include_tiex = true

#==============================================================================
# ■ 設定項目
#==============================================================================
module TIEX
  # 속성 아이콘 인덱스(속성 ID 순서에 칸마로 단락지어 늘어놓는 , 선두는 nil)
  ELEMENT_ICON = [
    nil , 132, 2, 4, 14, 16, 12, 20, 135,
    104, 105, 106, 107, 108, 109, 110, 111
  ]
  # 빈카드 슬롯 아이콘 인덱스
  ICON_CARD_SLOT = 240
  
  # 직업마다의 최대 적재량(직업 ID 순서에 칸마로 단락지어 늘어놓는 , 선두는 nil)
  JOB_WEIGHT_MAX = [
    nil , 100, 100, 100, 100, 100, 100, 100, 100
  ]
end

module Vocab
  def self.hit            # 命中率パラメータの名前(メモ欄には影響しません)
    return "명중율"
  end
  def self.eva            # 回避率パラメータの名前(メモ欄には影響しません)
    return "회피율"
  end
  def self.cri            # クリティカルパラメータの名前(メモ欄には影響しません)
    return "치명타"
  end
end

module Sound
  def self.play_item_power_up
    Audio.se_play("Audio/SE/Saint9", 80, 100)
  end
  def self.play_item_break
    Audio.se_play("Audio/SE/Crash", 80, 100)
  end
  def self.play_item_garbage
    Audio.se_play("Audio/SE/Crash", 80, 100)
  end
end

#==============================================================================
# ■ Game_System
#==============================================================================
class Game_System
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :item_check_number        # 装備品の個体識別ナンバーカウンタ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias tiex_game_system_initialize initialize
  def initialize
    tiex_game_system_initialize
    @item_check_number = 0
  end
end

#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :weapon                   # 武器 ID
  attr_reader   :armor1                   # 盾 ID
  attr_reader   :armor2                   # 頭防具 ID
  attr_reader   :armor3                   # 体防具 ID
  attr_reader   :armor4                   # 装飾品 ID
  #--------------------------------------------------------------------------
  # ● セットアップ
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  alias tiex_game_actor_setup setup
  def setup(actor_id)
    tiex_game_actor_setup(actor_id)
    @weapon = WeaponEx.new(actor.weapon_id) if actor.weapon_id > 0
    if actor.armor1_id > 0
      @armor1 = two_swords_style ? WeaponEx.new(actor.armor1_id) : ArmorEx.new(actor.armor1_id)
    end
    @armor2 = ArmorEx.new(actor.armor2_id) if actor.armor2_id > 0
    @armor3 = ArmorEx.new(actor.armor3_id) if actor.armor3_id > 0
    @armor4 = ArmorEx.new(actor.armor4_id) if actor.armor4_id > 0
  end
  #--------------------------------------------------------------------------
  # ● 武器オブジェクトの配列取得
  #--------------------------------------------------------------------------
  def weapons
    result = []
    result.push(@weapon)
    result.push(@armor1) if two_swords_style
    return result
  end
  #--------------------------------------------------------------------------
  # ● 防具オブジェクトの配列取得
  #--------------------------------------------------------------------------
  def armors
    result = []
    result.push(@armor1) unless two_swords_style
    result.push(@armor2)
    result.push(@armor3)
    result.push(@armor4)
    return result
  end
  #--------------------------------------------------------------------------
  # ● 기본 민첩성의 취득
  #--------------------------------------------------------------------------
  alias tiex_game_actor_base_agi base_agi
  def base_agi
    return 0 if over_weight?    # 重量過多なら0を返す
    return tiex_game_actor_base_agi
  end
  #--------------------------------------------------------------------------
  # ● 명중율의 취득
  #--------------------------------------------------------------------------
  alias tiex_game_actor_hit hit
  def hit
    n = tiex_game_actor_hit
    for item in armors.compact do n += item.hit end
    return n
  end
  #--------------------------------------------------------------------------
  # ● 회피율의 취득
  #--------------------------------------------------------------------------
  alias tiex_game_actor_eva eva
  def eva
    return 0 if over_weight?    # 重量過多なら0を返す
    n = tiex_game_actor_eva
    for item in weapons.compact do n += item.eva end
    return n
  end
  #--------------------------------------------------------------------------
  # ● 치명타 비율의 취득
  #--------------------------------------------------------------------------
  alias tiex_game_actor_cri cri
  def cri
    n = tiex_game_actor_cri
    for item in equips.compact do n += item.cri end
    return n
  end
  #--------------------------------------------------------------------------
  # ○ 장비 중량의 취득
  #--------------------------------------------------------------------------
  def weight
    n = 0
    for item in equips.compact do n += item.weight end
    return n
  end
  #--------------------------------------------------------------------------
  # ○ 중량 과다 상태의 취득
  #--------------------------------------------------------------------------
  def over_weight?
    return (weight > TIEX::JOB_WEIGHT_MAX[@class_id])
  end
  #--------------------------------------------------------------------------
  # ● 装備の変更 (ID で指定)
  #     equip_type : 装備部位 (0..4)
  #     item_id    : 武器 ID or 防具 ID
  #     test       : テストフラグ (戦闘テスト、または装備画面での一時装備)
  #    イベントコマンド、および戦闘テストの準備で使用する。
  #--------------------------------------------------------------------------
  def change_equip_by_id(equip_type, item_id, test = false)
    if equip_type == 0 or (equip_type == 1 and two_swords_style)
      change_equip(equip_type, WeaponEx.new(item_id), test)
    else
      change_equip(equip_type, ArmorEx.new(item_id), test)
    end
  end
  #--------------------------------------------------------------------------
  # ● 装備の変更 (オブジェクトで指定)
  #     equip_type : 装備部位 (0..4)
  #     item       : 武器 or 防具 (nil なら装備解除)
  #     test       : テストフラグ (戦闘テスト、または装備画面での一時装備)
  #--------------------------------------------------------------------------
  def change_equip(equip_type, item, test = false)
    last_item = equips[equip_type]
    unless test
      return if $game_party.item_number(item) == 0 if item != nil
      $game_party.gain_item(last_item, 1)
      if item.is_a?(WeaponEx)
        $game_party.weapons = $game_party.weapons - [item]
      elsif item.is_a?(ArmorEx)
        $game_party.armors = $game_party.armors - [item]
      end
    end
    case equip_type
    when 0  # 무기
      @weapon = item
      change_equip(1, nil, test) unless two_hands_legal? # 両手持ち違反
    when 1  # 방패
      @armor1 = item
      change_equip(0, nil, test) unless two_hands_legal? # 両手持ち違反
    when 2  # 머리
      @armor2 = item
    when 3  # 신체
      @armor3 = item
    when 4  # 장식품
      @armor4 = item
    end
  end
  #--------------------------------------------------------------------------
  # ● 양손 장비 합법 판정
  #--------------------------------------------------------------------------
  def two_hands_legal?
    if weapons[0] != nil and weapons[0].two_handed
      return false if @armor1 != nil
    end
    if weapons[1] != nil and weapons[1].two_handed
      return false if @weapon != nil
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● 장비 가능 판정
  #     item : アイテム
  #--------------------------------------------------------------------------
  def equippable?(item)
    if item.is_a?(RPG::Weapon) or item.is_a?(WeaponEx)
      return self.class.weapon_set.include?(item.id)
    elsif item.is_a?(RPG::Armor) or item.is_a?(ArmorEx)
      return false if two_swords_style and item.kind == 0
      return self.class.armor_set.include?(item.id)
    end
    return false
  end
end

#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :weapons                  # 所持品配列(武器)
  attr_accessor :armors                   # 所持品配列(防具)
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias tiex_game_party_initialize initialize
  def initialize
    tiex_game_party_initialize
    @weapons = []     # 所持品配列 (武器Exオブジェクト)
    @armors  = []     # 所持品配列 (防具Exオブジェクト)
  end
  #--------------------------------------------------------------------------
  # ● アイテムオブジェクトの配列取得 (武器と防具を含む)
  #--------------------------------------------------------------------------
  def items
    result = []
    for i in @items.keys.sort
      result.push($data_items[i]) if @items[i] > 0
    end
    for item in @weapons
      result.push(item)
    end
    for item in @armors
      result.push(item)
    end
    return result
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 소지수취득
  #     item : アイテム
  #--------------------------------------------------------------------------
  def item_number(item)
    case item
    when RPG::Item
      number = @items[item.id]
    when WeaponEx, RPG::Weapon
      number = 0
      for weapon in @weapons
        number += 1 if item.id == weapon.id
      end
    when ArmorEx, RPG::Armor
      number = 0
      for armor in @armors
        number += 1 if item.id == armor.id
      end
    end
    return number == nil ? 0 : number
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 소지 판정
  #     item          : アイテム
  #     include_equip : 装備品も含める(未実装)
  #--------------------------------------------------------------------------
  def has_item?(item, include_equip = false)
    return true if item_number(item) > 0
    return false
  end
  #--------------------------------------------------------------------------
  # ● 아이템의 증가 (감소)
  #     item          : アイテム
  #     n             : 個数
  #     include_equip : 装備品も含める(未実装)
  #--------------------------------------------------------------------------
  def gain_item(item, n, include_equip = false)
    number = item_number(item)
    case item
    when RPG::Item
      @items[item.id] = [[number + n, 0].max, 99].min
    when WeaponEx
      if n > 0
        @weapons.push(item)
      elsif n < 0
        for i in 0...@weapons.size
          if @weapons[i].id == item.id
            @weapons[i] = nil
            n += 1
          end
          break if n == 0
        end
        @weapons.compact!
      end
    when ArmorEx
      if n > 0
        @armors.push(item)
      elsif n < 0
        for i in 0...@armors.size
          if @armors[i].id == item.id
            @armors[i] = nil
            n += 1
          end
          break if n == 0
        end
        @armors.compact!
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ アイテムの並び替え
  #--------------------------------------------------------------------------
  def sort_item
    unless @weapons.empty?
      @weapons.sort! do |a, b|
        a.id <=> b.id
      end
    end
    unless @armors.empty?
      @armors.sort! do |a, b|
        a.id <=> b.id
      end
    end
  end
end

#==============================================================================
# ■ Game_Interpreter
#==============================================================================
class Game_Interpreter
  #--------------------------------------------------------------------------
  # ● 조건분기
  #--------------------------------------------------------------------------
  alias tiex_game_interpreter_command_111 command_111
  def command_111
    result = false
    if @params[0] == 4  # 엑터
      actor = $game_actors[@params[1]]
      if actor != nil
        case @params[2]
        when 0  # 파티에 있다
          result = ($game_party.members.include?(actor))
        when 1  # 이름
          result = (actor.name == @params[3])
        when 2  # 스킬
          result = (actor.skill_learn?($data_skills[@params[3]]))
        when 3  # 무기
          for item in actor.weapons
            result = true if item.id == @params[3]
          end
        when 4  # 갑옷
          for item in actor.armors
            result = true if item.id == @params[3]
          end
        when 5  # 상태
          result = (actor.state?(@params[3]))
        end
        @branch[@indent] = result     # 判定結果をハッシュに格納
        if @branch[@indent] == true
          @branch.delete(@indent)
          return true
        end
        return command_skip
      end
    end
    tiex_game_interpreter_command_111
  end
  #--------------------------------------------------------------------------
  # ● 무기의 증감
  #--------------------------------------------------------------------------
  def command_127
    value = operate_value(@params[1], @params[2], @params[3])
    if value > 0
      for i in 0...value
        $game_party.gain_item(WeaponEx.new(@params[0]), 1, @params[4])
      end
    else
      $game_party.gain_item(WeaponEx.new(@params[0]), value, @params[4])
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● 갑옷의 증감
  #--------------------------------------------------------------------------
  def command_128
    value = operate_value(@params[1], @params[2], @params[3])
    if value > 0
      for i in 0...value
        $game_party.gain_item(ArmorEx.new(@params[0]), 1, @params[4])
      end
    else
      $game_party.gain_item(ArmorEx.new(@params[0]), value, @params[4])
    end
    return true
  end
end

#==============================================================================
# ■ Window_Item
#==============================================================================
class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 오브젝트의 초기화
  #     x      : 윈도우의 X좌표
  #     y      : 윈도우의 Y좌표
  #     width  : 윈도우의 폭
  #     height : 윈도우의 높이
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    if (width == 544 and height == 360)
      super(x, y, width, 208, 0)
      @column_max = 16
    elsif self.is_a?(Window_ShopSell)
      super(x, y, width, 152, 0)
      @column_max = 16
    else
      super(x, y, width, height)
      @column_max = 2
    end
    self.index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ リフレッシュ(素材の使用先選択中)
  #--------------------------------------------------------------------------
  def refresh_material(material)
    @material = material
    @data = []
    for item in $game_party.items
      next if item.is_a?(RPG::Item)
      @data.push(item)
    end
    self.index = 0
    @data.push(nil) if include?(nil)
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
    @material = nil
  end
  #--------------------------------------------------------------------------
  # ○ 리 프 레 시(버리는 아이템 선택중)
  #--------------------------------------------------------------------------
  def refresh_garbage(garbage)
    @garbage = garbage
    @data = [@garbage]
    self.index = 0
    @data.push(nil) if include?(nil)
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
    @garbage = nil
  end
  #--------------------------------------------------------------------------
  # ● 항목의 묘화
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    item = @data[index]
    if item != nil
      number = $game_party.item_number(item)
      if @garbage != nil
        enabled = true
      elsif @material == nil
        enabled = enable?(item)
      else
        enabled = item.material_can_use?(@material)
      end
      rect.width -= 4
      if @column_max == 16    # 아이콘 모드라면 아이콘만 표기
        draw_icon(item.icon_index, rect.x + 4, rect.y, enabled)
        if item.is_a?(RPG::Item)  # 아이템만 개수 표기
          self.contents.font.size = 12
          rect.y += 4
          self.contents.draw_text(rect, number, 2)
        end
      else                    # 통상 모드라면 아이템명을 표기
        draw_item_name(item, rect.x, rect.y, enabled)
        if item.is_a?(RPG::Item)  # 아이템만 개수 표기
          self.contents.draw_text(rect, sprintf(":%2d", number), 2)
        end
      end
    end
  end
end

#==============================================================================
# ■ Window_ItemStatus
#==============================================================================
class Window_ItemStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 264, 544, 152)
    @item = nil
    refresh
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update(item)
    super()
    if @item != item
      @item = item
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    return if @item == nil
    self.contents.font.size = Font.default_size
    draw_icon(@item.icon_index, 0, 0, true)
    self.contents.draw_text(24, 0, 288, WLH, @item.name)
    self.contents.draw_text(4,   WLH * 1, 504, WLH, @item.description)
    unless @item.is_a?(RPG::Item)     # アイテム以外の場合
      rect = self.contents.text_size(@item.name)
      for i in 0...@item.slot_max
        draw_icon(TIEX::ICON_CARD_SLOT, rect.width + i * 24 + 32, 0, true)
        if i < @item.slot.size
          icon_index = $data_items[@item.slot[i]].icon_index
          draw_icon(icon_index, rect.width + i * 24 + 32, 0, true)
        end
      end
      self.contents.font.size = 16
      self.contents.font.color = system_color
      self.contents.draw_text(4,   WLH * 2, 48, WLH, "장비레벨")
      self.contents.draw_text(106, WLH * 2, 48, WLH, Vocab::atk)
      self.contents.draw_text(208, WLH * 2, 48, WLH, Vocab::def)
      self.contents.draw_text(310, WLH * 2, 48, WLH, Vocab::spi)
      self.contents.draw_text(412, WLH * 2, 48, WLH, Vocab::agi)
      self.contents.draw_text(4,   WLH * 3, 48, WLH, "내구도")
      self.contents.draw_text(106, WLH * 3, 48, WLH, "명중율")
      self.contents.draw_text(208, WLH * 3, 48, WLH, "회피율")
      self.contents.draw_text(310, WLH * 3, 48, WLH, "치명타")
      self.contents.draw_text(412, WLH * 3, 48, WLH, "중량")
      if @item.is_a?(WeaponEx)
        self.contents.draw_text(4,   WLH * 4, 96, WLH, "속성")
        self.contents.draw_text(256, WLH * 4, 96, WLH, "부가")
      else
        self.contents.draw_text(4,   WLH * 4, 96, WLH, "반감")
        self.contents.draw_text(256, WLH * 4, 96, WLH, "방지")
      end
      self.contents.font.size = Font.default_size
      self.contents.font.color = normal_color
      self.contents.draw_text(52,   WLH * 2, 46, WLH, @item.level, 2)
      self.contents.draw_text(154, WLH * 2, 46, WLH, @item.atk, 2)
      self.contents.draw_text(256, WLH * 2, 46, WLH, @item.def, 2)
      self.contents.draw_text(358, WLH * 2, 46, WLH, @item.spi, 2)
      self.contents.draw_text(460, WLH * 2, 46, WLH, @item.agi, 2)
      self.contents.draw_text(52,   WLH * 3, 46, WLH, @item.durability, 2)
      self.contents.draw_text(154, WLH * 3, 46, WLH, @item.hit, 2)
      self.contents.draw_text(256, WLH * 3, 46, WLH, @item.eva, 2)
      self.contents.draw_text(358, WLH * 3, 46, WLH, @item.cri, 2)
      self.contents.draw_text(460, WLH * 3, 46, WLH, @item.weight, 2)
      x = 56
      for id in @item.element_set
        draw_icon(TIEX::ELEMENT_ICON[id], x, WLH * 4, true)
        x += 24
      end 
      x = 312
      for id in @item.state_set
        draw_icon($data_states[id].icon_index, x, WLH * 4, true)
        x += 24
      end 
    end
  end
end

#==============================================================================
# ■ Window_EquipItem
#==============================================================================
class Window_EquipItem < Window_Item
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    @column_max = 1
    super
  end
  #--------------------------------------------------------------------------
  # ● アイテムをリストに含めるかどうか
  #     item : アイテム
  #--------------------------------------------------------------------------
  def include?(item)
    return true if item == nil
    if @equip_type == 0
      return false unless item.is_a?(WeaponEx)
    else
      return false unless item.is_a?(ArmorEx)
      return false unless item.kind == @equip_type - 1
    end
    return @actor.equippable?(item)
  end
end

#==============================================================================
# ■ Window_EquipStatus
#==============================================================================
class Window_EquipStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     x     : ウィンドウの X 座標
  #     y     : ウィンドウの Y 座標
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(x, y, actor)
    super(x, y, 208, 360)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    for i in 0..6
      draw_parameter(0, WLH * (i + 1), i)
    end
    # 重量の表示
    x, y = 0, WLH * (8 + 1)
    self.contents.font.color = system_color
    self.contents.draw_text(x + 4, y, 80, WLH, "중량")
    self.contents.font.color = @actor.over_weight? ? knockout_color : normal_color
    self.contents.draw_text(x + 90, y, 30, WLH, @actor.weight, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(x + 122, y, 20, WLH, "→", 1)
    if @new_weight != nil
      if @new_weight > TIEX::JOB_WEIGHT_MAX[@actor.class_id]
        self.contents.font.color = knockout_color
      else
        self.contents.font.color = normal_color
      end
      self.contents.draw_text(x + 142, y, 30, WLH, @new_weight, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 装備変更後の能力値設定
  #     temp_actor : 装備変更後のダミーアクター
  #--------------------------------------------------------------------------
  def set_new_parameters(new_atk, new_def, new_spi, new_agi, new_hit,
      new_eva, new_cri, new_weight)
    if @new_atk != new_atk or @new_def != new_def or @new_spi != new_spi or
       @new_agi != new_agi or @new_hit != new_hit or @new_eva != new_eva or
       @new_cri != new_cri or @new_weight != new_weight
      @new_atk = new_atk
      @new_def = new_def
      @new_spi = new_spi
      @new_agi = new_agi
      @new_hit = new_hit
      @new_eva = new_eva
      @new_cri = new_cri
      @new_weight = new_weight
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 능력치의 묘화
  #     x    : 描画先 X 座標
  #     y    : 描画先 Y 座標
  #     type : 能力値の種類 (0~3)
  #--------------------------------------------------------------------------
  def draw_parameter(x, y, type)
    case type
    when 0
      name = Vocab::atk
      value = @actor.atk
      new_value = @new_atk
    when 1
      name = Vocab::def
      value = @actor.def
      new_value = @new_def
    when 2
      name = Vocab::spi
      value = @actor.spi
      new_value = @new_spi
    when 3
      name = Vocab::agi
      value = @actor.agi
      new_value = @new_agi
    when 4
      name = Vocab::hit
      value = @actor.hit
      new_value = @new_hit
    when 5
      name = Vocab::eva
      value = @actor.eva
      new_value = @new_eva
    when 6
      name = Vocab::cri
      value = @actor.cri
      new_value = @new_cri
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x + 4, y, 80, WLH, name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 90, y, 30, WLH, value, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(x + 122, y, 20, WLH, "→", 1)
    if new_value != nil
      self.contents.font.color = new_parameter_color(value, new_value)
      self.contents.draw_text(x + 142, y, 30, WLH, new_value, 2)
    end
  end
end

#==============================================================================
# ■ Window_Status
#==============================================================================
class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● 능력치의 묘화
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #     type  : 能力値の種類 (0~3)
  #--------------------------------------------------------------------------
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      parameter_name = Vocab::atk
      parameter_value = actor.atk
    when 1
      parameter_name = Vocab::def
      parameter_value = actor.def
    when 2
      parameter_name = Vocab::spi
      parameter_value = actor.spi
    when 3
      parameter_name = Vocab::agi
      parameter_value = actor.agi
    when 4
      parameter_name = Vocab::hit
      parameter_value = actor.hit
    when 5
      parameter_name = Vocab::eva
      parameter_value = actor.eva
    when 6
      parameter_name = Vocab::cri
      parameter_value = actor.cri
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, WLH, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 36, WLH, parameter_value, 2)
  end
  #--------------------------------------------------------------------------
  # ● 능력치의 묘화
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_parameters(x, y)
    for i in 0..6
      draw_actor_parameter(@actor, x, y + WLH * i, i)
    end
  end
  #--------------------------------------------------------------------------
  # ● 装備品の描画
  #     x : 描画先 X 座標
  #     y : 描画先 Y 座標
  #--------------------------------------------------------------------------
  alias tiex_window_status_draw_equipments draw_equipments
  def draw_equipments(x, y)
    tiex_window_status_draw_equipments(x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y + 168, 120, WLH, "중량")
    self.contents.font.color = @actor.over_weight? ? knockout_color : normal_color
    self.contents.draw_text(x + 64, y + 168, 52, WLH, @actor.weight, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 116, y + 168, 24, WLH, "/", 1)
    self.contents.draw_text(x + 140, y + 168, 52, WLH, TIEX::JOB_WEIGHT_MAX[@actor.class_id], 2)
  end
end

#==============================================================================
# ■ Window_ShopSell
#==============================================================================
class Window_ShopSell < Window_Item
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(item == nil ? "" : item.name)
  end
end

#==============================================================================
# ■ Window_ShopStatus
#==============================================================================
class Window_ShopStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● アクターの現装備と能力値変化の描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #--------------------------------------------------------------------------
  def draw_actor_parameter_change(actor, x, y)
    return if @item.is_a?(RPG::Item)
    enabled = actor.equippable?(@item)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x, y, 200, WLH, actor.name)
    if @item.is_a?(RPG::Weapon) or @item.is_a?(WeaponEx)
      item1 = weaker_weapon(actor)
    elsif actor.two_swords_style and @item.kind == 0
      item1 = nil
    else
      item1 = actor.equips[1 + @item.kind]
    end
    if enabled
      if @item.is_a?(RPG::Weapon) or @item.is_a?(WeaponEx)
        atk1 = item1 == nil ? 0 : item1.atk
        atk2 = @item == nil ? 0 : @item.atk
        change = atk2 - atk1
      else
        def1 = item1 == nil ? 0 : item1.def
        def2 = @item == nil ? 0 : @item.def
        change = def2 - def1
      end
      self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
    end
    draw_item_name(item1, x, y + WLH, enabled)
  end
end

#==============================================================================
# ■ Scene_Item
#==============================================================================
class Scene_Item < Scene_Base
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  alias tiex_scene_item_start start
  def start
    @status_window = Window_ItemStatus.new
    tiex_scene_item_start
    @item_window.help_window = nil
    @help_window.set_text("Z,Enter … 사용 / X,Esc … 취소 / Shift … 정돈 / A … 파기")
  end
  #--------------------------------------------------------------------------
  # ● 終了処理
  #--------------------------------------------------------------------------
  alias tiex_scene_item_terminate terminate
  def terminate
    @status_window.dispose
    tiex_scene_item_terminate
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @help_window.update
    @item_window.update
    @target_window.update
    @status_window.update(@item_window.item)
    if @material != nil
      update_material_selection
    elsif @garbage != nil
      update_garbage_selection
    elsif @item_window.active
      update_item_selection
    elsif @target_window.active
      update_target_selection
    end
  end
  #--------------------------------------------------------------------------
  # ● アイテム選択の更新
  #--------------------------------------------------------------------------
  alias tiex_scene_item_update_item_selection update_item_selection
  def update_item_selection
    if Input.trigger?(Input::X)   # アイテムを捨てる
      if @item_window.item == nil
        Sound.play_buzzer
      elsif @item_window.item.price == 0  # 귀중품은 버리지 못한다
        Sound.play_buzzer
      else
        Sound.play_decision
        @garbage = @item_window.item
        @item_window.refresh_garbage(@garbage)
        @help_window.set_text("Z,Enter … 파기한다 / X,Esc … 취소한다")
      end
    elsif Input.trigger?(Input::A) # 武器と防具を整頓する
      Sound.play_equip
      $game_party.sort_item
      @item_window.refresh
    else
      tiex_scene_item_update_item_selection
    end
  end
  #--------------------------------------------------------------------------
  # ● アイテムの使用 (味方対象以外の使用効果を適用)
  #--------------------------------------------------------------------------
  alias tiex_scene_item_use_item_nontarget use_item_nontarget
  def use_item_nontarget
    if @item.material?
      @material = @item
      @item_window.refresh_material(@material)
      @help_window.set_text(sprintf("Z,Enter … %s 사용 / X,Esc … 취소", @material.name))
    else
      tiex_scene_item_use_item_nontarget
    end
  end
  #--------------------------------------------------------------------------
  # ● 素材適用アイテム選択の更新
  #--------------------------------------------------------------------------
  def update_material_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @material = nil
      @item_window.refresh
      @help_window.set_text("Z,Enter … 사용 / X,Esc … 취소 / Shift … 정돈 / A … 파기")
    elsif Input.trigger?(Input::C)
      @item = @item_window.item
      if @item == nil or @item.is_a?(RPG::Item)
        Sound.play_buzzer
        return
      end
      result = @item.material_can_use?(@material) # 素材が適用できるかどうか
      if result
        if @material.card_material? >= 0  # 소재가 카드일때
          @item.card_set(@material)
          Sound.play_item_power_up
        else                              # 소재가 강화 아이템일때
          if @item.power_up   # 강화 성공시
            Sound.play_item_power_up
          else                # 강화 실패시
            if @item.is_a?(WeaponEx)
              $game_party.weapons = $game_party.weapons - [@item]
            elsif @item.is_a?(ArmorEx)
              $game_party.armors = $game_party.armors - [@item]
            end
            Sound.play_item_break
          end
        end
        $game_party.consume_item(@material)   # 사용한 소재는 소비한다
        @material = nil
        @item_window.refresh
        @help_window.set_text("Z,Enter … 사용 / X,Esc … 취소 / Shift … 정돈 / A … 파기")
      else
        Sound.play_buzzer
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 捨てるアイテム選択の更新
  #--------------------------------------------------------------------------
  def update_garbage_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @garbage = nil
      @item_window.refresh
      @help_window.set_text("Z,Enter … 사용 / X,Esc … 취소 / Shift … 정돈 / A … 파기")
    elsif Input.trigger?(Input::C)
      Sound.play_item_garbage
      if @garbage.is_a?(RPG::Item)
        $game_party.lose_item(@garbage, 99)
      elsif @garbage.is_a?(WeaponEx)
        $game_party.weapons = $game_party.weapons - [@garbage]
      elsif @garbage.is_a?(ArmorEx)
        $game_party.armors = $game_party.armors - [@garbage]
      end
      @garbage = nil
      @item_window.refresh
      @help_window.set_text("Z,Enter … 사용 / X,Esc … 취소 / Shift … 정돈 / A … 파기")
    end
  end
  #--------------------------------------------------------------------------
  # ● ターゲットウィンドウの表示
  #     right : 오른쪽 정렬 (false 라면 왼쪽 정렬)
  #--------------------------------------------------------------------------
  alias tiex_scene_item_show_target_window show_target_window
  def show_target_window(right)
    tiex_scene_item_show_target_window(true)
    @status_window.close
  end
  #--------------------------------------------------------------------------
  # ● ターゲットウィンドウの非表示
  #--------------------------------------------------------------------------
  alias tiex_scene_item_hide_target_window hide_target_window
  def hide_target_window
    tiex_scene_item_hide_target_window
    @status_window.open
  end
end

#==============================================================================
# ■ Scene_Equip
#==============================================================================
class Scene_Equip < Scene_Base
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  alias tiex_scene_equip_start start
  def start
    tiex_scene_equip_start
    @item_status_window = Window_ItemStatus.new
    @item_status_window.visible = false
  end
  #--------------------------------------------------------------------------
  # ● 終了処理
  #--------------------------------------------------------------------------
  alias tiex_scene_equip_terminate terminate
  def terminate
    @item_status_window.dispose
    tiex_scene_equip_terminate
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias tiex_scene_equip_update update
  def update
    tiex_scene_equip_update
    if Input.trigger?(Input::A)
      if @item_status_window.visible
        Sound.play_cancel
        @item_status_window.visible = false
      else
        Sound.play_decision
        @item_status_window.visible = true
      end
    end
    if @equip_window.active
      @item_status_window.update(@equip_window.item)
      @item_status_window.y = 236
    elsif @item_window.active
      @item_status_window.update(@item_window.item)
      @item_status_window.y = 56
    end
  end
  #--------------------------------------------------------------------------
  # ● アイテムウィンドウの作成
  #--------------------------------------------------------------------------
  def create_item_windows
    @item_windows = []
    for i in 0...EQUIP_TYPE_MAX
      @item_windows[i] = Window_EquipItem.new(208, 208, 336, 208, @actor, i)
      @item_windows[i].help_window = @help_window
      @item_windows[i].visible = (@equip_index == i)
      @item_windows[i].y = 208
      @item_windows[i].height = 208
      @item_windows[i].active = false
      @item_windows[i].index = -1
    end
  end
  #--------------------------------------------------------------------------
  # ● ステータスウィンドウの更新
  #--------------------------------------------------------------------------
  def update_status_window
    if @equip_window.active
      @status_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
    elsif @item_window.active
      temp_actor = @actor.clone
      temp_actor.change_equip(@equip_window.index, @item_window.item, true)
      new_atk = temp_actor.atk
      new_def = temp_actor.def
      new_spi = temp_actor.spi
      new_agi = temp_actor.agi
      new_hit = temp_actor.hit
      new_eva = temp_actor.eva
      new_cri = temp_actor.cri
      new_weight = temp_actor.weight
      @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi,
        new_hit, new_eva, new_cri, new_weight)
    end
    @status_window.update
  end
end

#==============================================================================
# ■ Scene_Shop
#==============================================================================
class Scene_Shop < Scene_Base
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  alias tiex_scene_shop_start start
  def start
    tiex_scene_shop_start
    @item_status_window = Window_ItemStatus.new
    @item_status_window.visible = false
  end
  #--------------------------------------------------------------------------
  # ● 終了処理
  #--------------------------------------------------------------------------
  alias tiex_scene_shop_terminate terminate
  def terminate
    @item_status_window.dispose
    tiex_scene_shop_terminate
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias tiex_scene_shop_update update
  def update
    tiex_scene_shop_update
    @item_status_window.visible = @sell_window.active
  end
  #--------------------------------------------------------------------------
  # ● 売却アイテム選択の更新
  #--------------------------------------------------------------------------
  def update_sell_selection
    @item_status_window.update(@sell_window.item)
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @command_window.active = true
      @dummy_window.visible = true
      @sell_window.active = false
      @sell_window.visible = false
      @status_window.item = nil
      @help_window.set_text("")
    elsif Input.trigger?(Input::C)
      @item = @sell_window.item
      @status_window.item = @item
      if @item == nil or @item.price == 0
        Sound.play_buzzer
      else
        Sound.play_decision
        max = $game_party.item_number(@item)
        @sell_window.active = false
        @sell_window.visible = false
        if @item.is_a?(RPG::Item)
          @number_window.set(@item, max, @item.price / 2)
        else
          @number_window.set(@item, 1, @item.price / 2)
        end
        @number_window.active = true
        @number_window.visible = true
        @status_window.visible = true
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 個数入力の決定
  #--------------------------------------------------------------------------
  def decide_number_input
    Sound.play_shop
    @number_window.active = false
    @number_window.visible = false
    case @command_window.index
    when 0  # 구입한다
      $game_party.lose_gold(@number_window.number * @item.price)
      if @item.is_a?(RPG::Item)
        $game_party.gain_item(@item, @number_window.number)
      else
        for i in 0...@number_window.number
          if @item.is_a?(RPG::Weapon)
            $game_party.gain_item(WeaponEx.new(@item.id), 1)
          else
            $game_party.gain_item(ArmorEx.new(@item.id), 1)
          end
        end
      end
      @gold_window.refresh
      @buy_window.refresh
      @status_window.refresh
      @buy_window.active = true
      @buy_window.visible = true
    when 1  # 매각한다
      $game_party.gain_gold(@number_window.number * (@item.price / 2))
      if @item.is_a?(RPG::Item)
        $game_party.lose_item(@item, @number_window.number)
      else
        if @item.is_a?(WeaponEx)
          $game_party.weapons = $game_party.weapons - [@item]
        elsif @item.is_a?(ArmorEx)
          $game_party.armors = $game_party.armors - [@item]
        end
      end
      @gold_window.refresh
      @sell_window.refresh
      @status_window.refresh
      @sell_window.active = true
      @sell_window.visible = true
      @status_window.visible = false
    end
  end
end

module RPG
class Item < UsableItem
  def material?         # アイテムが素材かどうかを返す
    return true if power_material? >= 0
    return true if card_material? >= 0
    return false
  end
  def power_material?   # アイテムが強化素材なら対象種別を返す
    return 0 if @note =~ /<무기 강화>/
    return 1 if @note =~ /<방패 강화>/
    return 2 if @note =~ /<투구 강화>/
    return 3 if @note =~ /<갑옷 강화>/
    return 4 if @note =~ /<장식품 강화>/
    return -1
  end
  def card_material?    # アイテムがカードなら対象種別を返す
    return 0 if @note =~ /<무기 카드>/
    return 1 if @note =~ /<방패 카드>/
    return 2 if @note =~ /<투구 카드>/
    return 3 if @note =~ /<갑옷 카드>/
    return 4 if @note =~ /<장식품 카드>/
    return -1
  end
  def card_atk    # 카드 공격력 보정치 취득
    return (@note =~ /<공격력\s*\=\s*(\-*\d+)>/i ? $1.to_i : 0)
  end
  def card_def    # 카드 방어력 보정치 취득
    return (@note =~ /<방어력\s*\=\s*(\-*\d+)>/i ? $1.to_i : 0)
  end
  def card_spi    # 카드 정신력 보정치 취득
    return (@note =~ /<정신력\s*\=\s*(\-*\d+)>/i ? $1.to_i : 0)
  end
  def card_agi    # 카드 민첩성 보정치 취득
    return (@note =~ /<민첩성\s*\=\s*(\-*\d+)>/i ? $1.to_i : 0)
  end
  def card_hit    # 카드 명중율 보정치 취득
    return (@note =~ /<명중율\s*\=\s*(\-*\d+)>/i ? $1.to_i : 0)
  end
  def card_eva    # 카드 회피율 보정치 취득
    return (@note =~ /<회피율\s*\=\s*(\-*\d+)>/i ? $1.to_i : 0)
  end
  def card_cri    # 카드 치명타 보정치 취득
    return (@note =~ /<치명타\s*\=\s*(\-*\d+)>/i ? $1.to_i : 0)
  end
  def header_name # 카드의 접두어를 취득
    return (@note =~ /<접두어\s*\=\s*(\S+?)>/i ? $1 : "")
  end
end
end

class BaseItemEx
  attr_reader   :level
  attr_reader   :durability
  attr_reader   :weight
  attr_reader   :plus_power
  attr_reader   :slot
  attr_reader   :slot_max
  attr_reader   :note
  def initialize
    # 個体識別ナンバー
    @check_number = $game_system.item_check_number
    $game_system.item_check_number += 1
    # レベル
    @level = note =~ /<레벨\s*\=\s*(\d+)>/i ? $1.to_i : 1
    # 강화치
    @plus_power = 0
    # 랜덤 취득
    @atk = rand(rand(note =~ /<랜덤 공격력\s*\=\s*(\d+)>/i ? $1.to_i : 0) + 1)
    @def = rand(rand(note =~ /<랜덤 방어력\s*\=\s*(\d+)>/i ? $1.to_i : 0) + 1)
    @spi = rand(rand(note =~ /<랜덤 정신력\s*\=\s*(\d+)>/i ? $1.to_i : 0) + 1)
    @agi = rand(rand(note =~ /<랜덤 민첩성\s*\=\s*(\d+)>/i ? $1.to_i : 0) + 1)
    @hit = rand(rand(note =~ /<랜덤 명중율\s*\=\s*(\d+)>/i ? $1.to_i : 0) + 1)
    @eva = rand(rand(note =~ /<랜덤 회피율\s*\=\s*(\d+)>/i ? $1.to_i : 0) + 1)
    @cri = rand(rand(note =~ /<랜덤 치명타\s*\=\s*(\d+)>/i ? $1.to_i : 0) + 1)
    # 耐久性
    @durability = 100 + rand(rand(101) + 1)
    # スロット
    @slot = []
    @slot_max = note =~ /<슬롯\s*\=\s*(\d+)>/i ? $1.to_i : 0
    # 重量
    @weight = note =~ /<중량\s*\=\s*(\d+)>/i ? $1.to_i : 10
    # メモ
    @note = note
  end
  def id          # IDの取得
    return @original_item.id
  end
  def name        # 名前の取得
    text = @original_item.name
    unless @slot.empty?   # スロットが空でなければカードの接頭語を付加
      dummy_slot = @slot.clone
      while(dummy_slot.size > 0)
        id = dummy_slot.shift
        item = $data_items[id]
        text = sprintf("%s%s", item.header_name, text)
        n = 1
        for i in 0...dummy_slot.size
          if dummy_slot[i] == id
            n += 1
            dummy_slot[i] = nil
          end
        end
        dummy_slot.compact!
        case n
        when 2; text = sprintf("더블 %s", text)
        when 3; text = sprintf("트리플 %s", text)
        when 4; text = sprintf("쿼드러플 %s", text)
        end
      end
    end
    text = sprintf("+%d%s", @plus_power, text) if @plus_power > 0 # 強化値
    return text
  end
  def icon_index  # アイコンインデックスの取得
    return @original_item.icon_index
  end
  def description # 説明の取得
    return @original_item.description
  end
  def note        # メモの取得
    return @original_item.note
  end
  def price       # 価格の取得
    return @original_item.price
  end
  def atk         # 攻撃力の取得
    n = @original_item.atk + @atk
    n += @level * @plus_power if @main_param == "공격력"
    for id in @slot do n += $data_items[id].card_atk end
    return n
  end
  def def         # 防御力の取得
    n = @original_item.def + @def
    n += @level * @plus_power if @main_param == "방어력"
    for id in @slot do n += $data_items[id].card_def end
    return n
  end
  def spi         # 精神力の取得
    n = @original_item.spi + @spi
    n += @level * @plus_power if @main_param == "정신력"
    for id in @slot do n += $data_items[id].card_spi end
    return n
  end
  def agi         # 敏捷性の取得
    n = @original_item.agi + @agi
    n += @level * @plus_power if @main_param == "민첩성"
    for id in @slot do n += $data_items[id].card_agi end
    return n
  end
  def hit         # 命中率の取得
    n = @hit
    n += @plus_power if @main_param == "명중율"
    for id in @slot do n += $data_items[id].card_hit end
    return n
  end
  def eva         # 回避率の取得
    n = @eva
    n += @plus_power if @main_param == "회피율"
    for id in @slot do n += $data_items[id].card_eva end
    return n
  end
  def cri         # 会心率の取得
    n = @cri
    n += @plus_power if @main_param == "치명타"
    for id in @slot do n += $data_items[id].card_cri end
    return n
  end
  def element_set # 属性ID配列の取得
    result = @original_item.element_set.clone
    for id in @slot
      result = result + $data_items[id].element_set
    end
    return result.uniq
  end
  def state_set   # 付加(防止)ステート配列の取得
    result = @original_item.state_set.clone
    for id in @slot
      result = result + $data_items[id].plus_state_set
      result = result - $data_items[id].minus_state_set
    end
    return result.uniq
  end
  def material_can_use?(item) # 指定したアイテムを素材として適用できるかを返す
    type = item.power_material?
    if (@plus_power < 10) and (self.level == item.base_damage) and
       (self.is_a?(WeaponEx) and type == 0) or
       (self.is_a?(ArmorEx) and type == kind + 1)
      return true
    end
    type = item.card_material?
    if (@slot_max > @slot.size) and ((self.is_a?(WeaponEx) and type == 0) or
       (self.is_a?(ArmorEx) and type == kind + 1))
      return true
    end
    return false
  end
  def power_up        # 강화
    if rand(100) < @durability
      @plus_power += 1
      @durability -= 20
      return true
    end
    return false
  end
  def card_set(item)  # 카드 설정
    @slot.push(item.id)
  end
end

class WeaponEx < BaseItemEx
  def initialize(weapon_id)
    @original_item = $data_weapons[weapon_id]
    super()
    # メインパラメータ
    if note =~ /<성능강화\s*\=\s*(공격력|방어력|정신력|민첩성|명중율|회피율|회심율)>/i
      @main_param = $1
    else
      @main_param = "공격력"
    end
    # ランダム値
    @atk = rand(rand(note =~ /<랜덤 공격력\s*\=\s*(\d+)>/i ? $1.to_i : 4) + 1)
  end
  def animation_id    # アニメーションIDの取得
    return @original_item.animation_id
  end
  def hit             # 命中率の取得
    return super + @original_item.hit
  end
  def two_handed      # 両手持ちフラグの取得
    return @original_item.two_handed
  end
  def fast_attack     # ターン内先制フラグの取得
    return @original_item.fast_attack
  end
  def dual_attack     # 連続攻撃フラグの取得
    return @original_item.dual_attack
  end
  def critical_bonus  # クリティカル頻発フラグの取得
    return @original_item.critical_bonus
  end
end

class ArmorEx < BaseItemEx
  def initialize(armor_id)
    @original_item = $data_armors[armor_id]
    super()
    # メインパラメータ
    if note =~ /<성능강화\s*\=\s*(공격력|방어력|정신력|민첩성|명중율|회피율|치명타)>/i
      @main_param = $1
    else
      @main_param = "방어력"
    end
    # ランダム値
    @def = rand(rand(note =~ /<랜덤 방어력\s*\=\s*(\d+)>/i ? $1.to_i : 4) + 1)
  end
  def kind  # 種別の取得
    return @original_item.kind
  end
  def eva   # 回避率の取得
    return super + @original_item.eva
  end
  def prevent_critical  # クリティカル防止フラグの取得
    return @original_item.prevent_critical
  end
  def half_mp_cost      # 消費MP半分フラグの取得
    return @original_item.half_mp_cost
  end
  def double_exp_gain   # 取得経験値2倍フラグの取得
    return @original_item.double_exp_gain
  end
  def auto_hp_recover   # HP自動回復フラグの取得
    return @original_item.auto_hp_recover
  end
end







사용법은 아이미르님의 것과 같습니다만, 회심율 대신에 치명타를 사용했습니다.
그리고 아이미르님의 스크립트와는 다르게 [=]표시를 사이에 두고 띄어쓰기를 하실 필요가 없습니다. 라기보단 하시면 안됩니다.
속성 아이콘이나 카드 빈슬롯 아이콘을 바꾸시는 경우는 가장 위의 속성 아이콘 인덱스와 빈카드 슬롯 인덱스에서 숫자를 바꿔주세요.
아이콘 셋에서 가장 윗줄 왼쪽것이 0번, 그리고 다음칸부터 우측으로 이동할때마다 숫자가 1씩 늘어납니다.
아래로 내려갈때는 16만큼 숫자가 늘어나지요.
아이미르님것이 스크립트 오류가 발생한 이유는 단 하나입니다.
[\]문자가 전부 실종되어있다는거......
드물게 번역기에 넣고 돌리면 [\]문자가 실종되는 경우가 생긴다더군요.
하하하.....

Who's 빙하

profile

첨가물과 방부제를 이용해 키운 무기농 빙냥이입니다!

Comment '2'
  • profile
    빙하 2012.11.11 20:35
    그리고 여담이지만....

    1322번째 줄인가?
    거기의 빈 슬롯수를
    @slot_max = rand(rand(note =~ /<슬롯\s*\=\s*(\d+)>/i ? $1.to_i : 3) + 1)
    로 고치면 설정하지 않아도 빈 슬롯이 0~2개로 무작위로 추가되는듯 합니다.
  • profile
    하늘바라KSND 2012.11.11 23:45
    오호 고생많으셨습니다!

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
23 장비 방어구 착용시 최대HP, MP증가 스크립트(턴알) 3 file 기관차 2014.11.06 1222
» 장비 카드 슬롯 장비 스크립트[수정] 2 빙하 2012.11.11 2058
21 장비 카드 슬롯 장비 스크립트 18 file 아이미르 2011.10.13 4131
20 장비 초보적인 장비레벨 개념 스크립트 - 수정 및 덤 9 아이미르 2011.09.06 2657
19 장비 장비 레벨 개념 추가 스크립트 14 아방스 2010.12.06 3275
18 장비 KGC 확장 장비 화면 2009/02/15 13 시트르산 2010.09.25 3112
17 장비 장비의 착용조건 설정 v1.0 27 file 까까까 2010.09.20 3740
16 장비 장비에 레벨제한 스크립트!! 21 ijsh515 2010.09.19 3040
15 장비 Equipment Constraints 2.5b by Modern Algebra 3 Alkaid 2010.09.17 2001
14 장비 Multi-Slot Equipment VX 1.6 by DerVVulfman 1 file Alkaid 2010.09.02 1637
13 장비 아이템 장비시 스킬습득, 'SW_EquipFinisher' by Siot Warrior 19 file 시옷전사 2010.08.31 3029
12 장비 루시퍼님이올리신 rei의 보이는 장비 아주 조금 해석본 2 file 비류 2010.01.08 2184
11 장비 남성 / 여성전용 장비 스크립트 (수정 v1.1) 16 Evangelista 2009.11.15 3070
10 장비 YERD - Extra Equipment Options ReDONE 7 훈덕 2009.11.08 2287
9 장비 Rei(레이)의 Paperdoll(비쥬얼 장비)스크립트 20 file 루시페르 2009.07.29 4467
8 장비 KGC장비종류 추가 스크립트. 36 file 루시페르 2009.03.28 4674
7 장비 KGC확장장비창 스크립트 15 file 티라엘 2009.03.27 3622
6 장비 Disposable Ammo(또 있는 곳을 잘 읽으셔야 합니다.) 2 Man... 2008.10.29 1696
5 장비 Equipment Set Bonus 6 Man... 2008.10.25 1849
4 장비 Expansion_Suite V2.1! 6 Man... 2008.10.25 1593
Board Pagination Prev 1 2 Next
/ 2