self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::EquipExtension::Regexp::BaseItem::EP_COST
# 消費 EP
@__ep_cost = $1.to_i
when KGC::EquipExtension::Regexp::BaseItem::EQUIP_TYPE
# 装備タイプ
@__equip_type = []
$1.scan(/\d+/) { |num|
@__equip_type << num.to_i
}
end
}
# EP 制を使用しない場合は消費 EP = 0
@__ep_cost = 0 unless KGC::EquipExtension::USE_EP_SYSTEM
end
#--------------------------------------------------------------------------
# ○ 消費 EP
#--------------------------------------------------------------------------
def ep_cost
create_equip_extension_cache if @__ep_cost == nil
return @__ep_cost
end
#--------------------------------------------------------------------------
# ○ 装備タイプ
#--------------------------------------------------------------------------
def equip_type
create_equip_extension_cache if @__equip_type == nil
return @__equip_type
end
end
class RPG::Armor < RPG::BaseItem
#--------------------------------------------------------------------------
# ○ 装備拡張のキャッシュを作成
#--------------------------------------------------------------------------
def create_equip_extension_cache
super
@__kind = -1
self.note.split(/[\r\n]+/).each { |line|
if line =~ KGC::EquipExtension::Regexp::Armor::EQUIP_KIND
# 装備タイプ
e_index = KGC::EquipExtension::EXTRA_EQUIP_KIND.index($1)
next if e_index == nil
@__kind = e_index + 4
end
}
end
unless $@
#--------------------------------------------------------------------------
# ○ 種別
#--------------------------------------------------------------------------
alias kind_KGC_EquipExtension kind
def kind
create_equip_extension_cache if @__kind == nil
return (@__kind == -1 ? kind_KGC_EquipExtension : @__kind)
end
end
# 拡張防具欄を検索
extra_armor_number.times { |i|
if extra_armor_id == item.id
@extra_armor_id = 0
break
end
}
restore_battle_skill if $imported["SkillCPSystem"]
restore_passive_rev if $imported["PassiveSkill"]
end
#--------------------------------------------------------------------------
# ● 職業 ID の変更
# class_id : 新しい職業 ID
#--------------------------------------------------------------------------
alias class_id_equal_KGC_EquipExtension class_id=
def class_id=(class_id)
class_id_equal_KGC_EquipExtension(class_id)
return if extra_armor_number == 0 # 拡張防具欄がない
# 装備できない拡張防具を外す
for i in 5..armor_number
change_equip(i, nil) unless equippable?(equips)
end
end
#--------------------------------------------------------------------------
# ○ EP 条件クリア判定
# equip_type : 装備部位
# item : 武器 or 防具
#--------------------------------------------------------------------------
def ep_condition_clear?(equip_type, item)
return true if item == nil # nil は解除なので OK
if KGC::EquipExtension::SHOW_STATUS_EP
#--------------------------------------------------------------------------
# ● 基本情報の描画
# x : 描画先 X 座標
# y : 描画先 Y 座標
#--------------------------------------------------------------------------
alias draw_basic_info_KGC_EquipExtension draw_basic_info
def draw_basic_info(x, y)
draw_basic_info_KGC_EquipExtension(x, y)
draw_actor_ep(@actor, x + 160, y + WLH * 4)
end
end
#--------------------------------------------------------------------------
# ● 装備品の描画
# x : 描画先 X 座標
# y : 描画先 Y 座標
#--------------------------------------------------------------------------
def draw_equipments(x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
item_number = [@actor.equips.size, @actor.armor_number + 1].min
item_number.times { |i|
draw_item_name(@actor.equips, x + 16, y + WLH * (i + 1))
}
end
end