아왜 주소복사가 안되는건데..........
XP스크립트-장비:검색 백호님의 7/20일자 장비추가스크립트
진짜급합니다...
장비창에
[0]
[장갑]
뻘짓해도 안되요... 도와주세요 ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆?備?張 - KGC_EquipExtension◆
#_/----------------------------------------------------------------------------
#_/ ?備?連の機能を?張します。
#_/============================================================================
#_/ ≪?備品設定詳細化[EquipDetailSetting]≫より上
#_/ ≪クラス設定詳細化[ClassDetailSetting]≫より上
#_/ ≪限界突破[LimitBreak]≫より上
#_/ ≪?備?面改造[EquipAlter]≫より下
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ if $game_special_elements == nil
$game_special_elements = {}
$data_system = load_data("Data/System.rxdata")
end #==============================================================================
# ★ カスタマイズ項目 ★
#============================================================================== module KGC
# ◆?張?備タイプ定義
# 配列の最初がタイプ 5 に相?。以降 6,7,8,... と?く。
EEX_EQUIP_TYPE_EXT = ["腕部", "脚部"] # ◆?備品のタイプ(1:盾 2:頭 3:身? 4:?飾品 5以降:↑で定義)
# ※どのように指定しても、必ず最初は武器になります。
EEX_EQUIP_TYPE = [1, 2, 3, 4, 4, 5, 6]
# ◆二刀流時の武器?
# 二刀流時は↑の先頭から (EEX_TS_NUMBER - 1) 個を武器に置き換える
EEX_TS_NUMBER = 2 # ◆?備欄の名前
# ?加した?備タイプの名?もここで指定。
EEX_EQUIP_NAME = [
$data_system.words.weapon, # 武器
$data_system.words.armor1, # タイプ 1(盾)
$data_system.words.armor2, # タイプ 2(頭)
$data_system.words.armor3, # タイプ 3(身?)
$data_system.words.armor4, # タイプ 4(?飾品)
EEX_EQUIP_TYPE_EXT[0], # タイプ 5
EEX_EQUIP_TYPE_EXT[1] # タイプ 6
] # ←この ] は消さないこと # ◆最??備から除外する?備タイプ
# 除外する?備タイプを格納。
# ≪?備?面改造≫と?用した場合はこちらを優先。
EEX_IGNORE_STRONGEST_TYPE = [4] # ◆?張?備?面に表示する?備欄開始番?
# 武器を 0 、最初の防具を 1 とした番?(インデックス)。
EEX_EQUIP_EX_INDEX = 0
# ◆?張?備?面背景透過
EEX_EQUIP_EX_BACK_TRANSPARENT = true # ◆?張?備?面「?備?更」名?
EEX_EQUIP_EX_COMMAND_EQUIP = "?備?更"
# ◆?張?備?面「最??備」名?
EEX_EQUIP_EX_COMMAND_STRONGEST_EQUIP = "最??備"
# ◆?張?備?面「全解除」名?
EEX_EQUIP_EX_COMMAND_ALL_RELEASE = "全解除" # ◆?張?備?面「?備?更」ヘルプ
EEX_EQUIP_EX_HELP_EQUIP = "?備を?更します。"
# ◆?張?備?面「最??備」ヘルプ
EEX_EQUIP_EX_HELP_STRONGEST_EQUIP = "最も?力な武具を?備します。"
# ◆?張?備?面「全解除」ヘルプ
EEX_EQUIP_EX_HELP_ALL_RELEASE = "全ての?備品を外します。" # ◆EP(Equip Point)制を使用する
EEX_USE_EP = true # ◆消費EP?定値
# 消費EPが指定されていない?備品で使用
EEX_EP_COST_DEFAULT = 1
# ◆EP上限値
EEX_EP_MAX = 15
# ◆EP下限値
EEX_EP_MIN = 1
# ◆最大EP算出式
# 【lv…レベル】
# 自動的に整??換されるので、結果が小?になってもOK。
EEX_EP_FORMULA = "lv * 0.6" # ◆「EP」の名?
EEX_EP_NAME = "EP"
# ◆?備?面のEP最大値描?
# 名前が?れたりする場合は false にしてください。
EEX_DRAW_EP_MAX = true
# ◆消費EP値の色(アイテム名の末尾に付く?値)
EEX_EP_COLOR = Color.new(128, 255, 255)
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ $imported = {} if $imported == nil
$imported["EquipExtension"] = true # ?手持ち?性
$game_special_elements["two_handed"] = $data_system.elements.index("?手持ち") if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for element in KGC::EEX_EQUIP_TYPE_EXT.compact
$game_special_elements["EEX_#{element}"] = $data_system.elements.index(element)
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #--------------------------------------------------------------------------
# ● ?張?備?面呼び出し
# actor_index : アクタ?INDEX
#--------------------------------------------------------------------------
def call_equip_extend(actor_index = 0)
# プレイヤ?の姿勢を矯正
$game_player.straighten
# ?張?備?面に切り替え
$scene = Scene_EquipExtend.new(actor_index)
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ RPG::Weapon
#============================================================================== class RPG::Weapon
#--------------------------------------------------------------------------
# ● 名前取得
#--------------------------------------------------------------------------
def name
return @name.gsub(/[.*]/) {""}
end
#--------------------------------------------------------------------------
# ● オリジナル名取得
#--------------------------------------------------------------------------
def original_name
return @name
end
#--------------------------------------------------------------------------
# ● 消費EP取得
#--------------------------------------------------------------------------
def ep_cost
return @name =~ /[EP[ ]*(d+)]/i ? $1.to_i : KGC::EEX_EP_COST_DEFAULT
end
#--------------------------------------------------------------------------
# ● ?備タイプ取得
#--------------------------------------------------------------------------
def equip_type
if @name =~ /[ET[ ]*([0-9,]+)]/i
type = $1.split(/[,]/).compact
for i in 0...type.size
type[i] = type[i].to_i
end
type.insert(0, 0) if type[0] != 0
return type
else
return nil
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ RPG::Armor
#============================================================================== class RPG::Armor
#--------------------------------------------------------------------------
# ● 名前取得
#--------------------------------------------------------------------------
def name
return @name.gsub(/[.*]/) {""}
end
#--------------------------------------------------------------------------
# ● オリジナル名取得
#--------------------------------------------------------------------------
def original_name
return @name
end
#--------------------------------------------------------------------------
# ● 消費EP取得
#--------------------------------------------------------------------------
def ep_cost
return @name =~ /[EP[ ]*(d+)]/i ? $1.to_i : KGC::EEX_EP_COST_DEFAULT
end
#--------------------------------------------------------------------------
# ● 種類取得
#--------------------------------------------------------------------------
def kind
if @guard_element_set.size > 0
@guard_element_set.compact.each { |element|
(0...KGC::EEX_EQUIP_TYPE_EXT.size).each { |i|
if element == $game_special_elements["EEX_#{KGC::EEX_EQUIP_TYPE_EXT[i]}"]
return i + 4
end
}
}
end
return @kind
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Game_Actor
#============================================================================== class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス??
#--------------------------------------------------------------------------
attr_accessor :weapon_fix # 武器固定
attr_accessor :armor_id # 防具 ID
attr_accessor :armor_fix # 防具固定
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクタ? ID
#--------------------------------------------------------------------------
alias setup_KGC_EquipExtension setup
def setup(actor_id)
actor = $data_actors[actor_id]
@weapons = [actor.weapon_id]
(1...KGC::EEX_TS_NUMBER).each { |i|
@weapons << 0
}
@armor1_id = @armor2_id = @armor3_id = @armor4_id = 0
@weapon_fix = [actor.weapon_fix]
(1...KGC::EEX_TS_NUMBER).each { |i|
@weapon_fix << false
}
# 防具固定?態を設定
@armor_fix = [false, false, false, false, false]
(1..4).each { |i|
if (index = KGC::EEX_EQUIP_TYPE.index(i)) != nil
@armor_fix[index] = eval("actor.armor#{i}_fix")
end
}
if self.equip_type.size > 5
(5...self.equip_type.size).each { |i|
@armor_fix[i] = false
}
end # 防具を設定
@armor_id = [0, 0, 0, 0, 0]
if (index = KGC::EEX_EQUIP_TYPE.index(1)) != nil &&
( @weapons[0] == 0 ||
!$data_weapons[@weapons[0]].element_set.include?(
$game_special_elements["two_handed"]) )
@armor_id[index] = actor.armor1_id
else
@armor_id[1] = 0
end
(2..4).each { |i|
if (index = KGC::EEX_EQUIP_TYPE.index(i)) != nil
@armor_id[index] = eval("actor.armor#{i}_id")
end
}
if self.equip_type.size > 5
(5...self.equip_type.size).each { |i|
@armor_id[i] = 0
}
end setup_KGC_EquipExtension(actor_id) @equip_type = nil
@equip_type_weapon = nil
@two_swords = false
@two_handed = false
@ts_number = nil
@attack_count = 0
if KGC::EEX_EQUIP_TYPE.size > 5
(5...KGC::EEX_EQUIP_TYPE.size).each { |i|
# 防具ID, 固定フラグを初期化
@armor_id[i] = 0
@armor_fix[i] = false
# オ?トステ?トを更新
update_auto_state(nil, $data_armors[self.armor_id[i]])
}
end
end
#--------------------------------------------------------------------------
# ● ?備タイプ取得
#--------------------------------------------------------------------------
def equip_type
type = (@equip_type_weapon != nil && @equip_type_weapon != []) ?
@equip_type_weapon : (@equip_type != nil && @equip_type != []) ?
@equip_type : KGC::EEX_EQUIP_TYPE
if type[0] != 0
type.insert(0, 0)
end
return type
end
#--------------------------------------------------------------------------
# ● ?備タイプ設定
#--------------------------------------------------------------------------
def equip_type=(type)
@equip_type = type
end
#--------------------------------------------------------------------------
# ● ?備品タイプ?更適用
#--------------------------------------------------------------------------
def equip_type_apply
last_equip_type = self.equip_type.dup
if self.weapon_id > 0
@equip_type_weapon = $data_weapons[self.weapon_id].equip_type
else
@equip_type_weapon = nil
end
# ?備不可能になったものは外す
for i in (self.two_swords? ? self.ts_number : 1)...last_equip_type.size
next if @armor_id[i] == nil
if (armor = $data_armors[@armor_id[i]]) != nil &&
self.equip_type[i] != armor.kind + 1
self.equip(i, 0)
end
end
@armor_id = @armor_id[0...self.equip_type.size]
end
#--------------------------------------------------------------------------
# ● 最大EP取得
#--------------------------------------------------------------------------
def max_ep
formula = KGC::EEX_EP_FORMULA.gsub(/lv/i) {"@level"}
return [[Integer(eval(formula)), KGC::EEX_EP_MIN].max, KGC::EEX_EP_MAX].min
end
#--------------------------------------------------------------------------
# ● EP取得
#--------------------------------------------------------------------------
def ep
if self.two_swords?
n = 0
self.ts_number.times { |i|
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.ep_cost : 0
}
else
n = (weapon = $data_weapons[self.weapon_id]) != nil ? weapon.ep_cost : 0
end
((self.two_swords? ? self.ts_number : 1)...self.equip_type.size).each { |i|
n += (armor = $data_armors[self.armor_id[i]]) != nil ? armor.ep_cost : 0
}
return self.max_ep - n
end
#--------------------------------------------------------------------------
# ● 二刀流?態取得
#--------------------------------------------------------------------------
def two_swords?
return @two_swords
end
#--------------------------------------------------------------------------
# ● 二刀流設定
#--------------------------------------------------------------------------
def two_swords=(value)
# 二刀流になった場合
if value && !@two_swords
# ?手持ちを解除
self.two_handed = false
# 二刀流で?備不可能になる防具を外す
for i in 1...self.ts_number
self.equip(i, 0)
end
# 二刀流が解除された場合
elsif !value && @two_swords
# 元?防具であった部分の武器を外す
for i in 1...self.ts_number
self.equip(i, 0)
@weapons[i] = 0
@weapon_fix[i] = false
end
end
@two_swords = value
end
#--------------------------------------------------------------------------
# ● 二刀流武器?取得
#--------------------------------------------------------------------------
def ts_number
return @ts_number != nil ? @ts_number : KGC::EEX_TS_NUMBER
end
#--------------------------------------------------------------------------
# ● 二刀流武器?設定
#--------------------------------------------------------------------------
def ts_number=(number)
@ts_number = number
end
#--------------------------------------------------------------------------
# ● ?手持ち?態取得
#--------------------------------------------------------------------------
def two_handed?
return @two_handed
end
#--------------------------------------------------------------------------
# ● ?手持ち設定
#--------------------------------------------------------------------------
def two_handed=(value)
# ?手持ちになった場合
if value && !@two_handed
# 二刀流を解除
self.two_swords = false
# 最初の防具を外す
self.equip(1, 0)
# 最初の防具を固定
@armor_fix[1] = true
# ?手持ちが解除された場合
elsif !value && @two_handed
# 最初の防具固定を解除
@armor_fix[1] = false
end
@two_handed = value
end
#--------------------------------------------------------------------------
# ● 攻?回?取得
#--------------------------------------------------------------------------
def attack_count
@attack_count = 0 if @attack_count == nil
return @attack_count
end
#--------------------------------------------------------------------------
# ● 攻?回?設定
#--------------------------------------------------------------------------
def attack_count=(value)
@attack_count = 0 if @attack_count == nil
@attack_count = value
end
#--------------------------------------------------------------------------
# ● 武器ID の取得
#--------------------------------------------------------------------------
def weapon_id(type = 0)
@weapons[type] = 0 if @weapons[type] == nil
return @weapons[type]
end
#--------------------------------------------------------------------------
# ● 武器ID の設定
#--------------------------------------------------------------------------
def weapon_id=(n)
@weapons[0] = n
end
#--------------------------------------------------------------------------
# ● 武器ID の設定(二刀流用)
#--------------------------------------------------------------------------
def set_weapon(type, n)
@weapons[type] = n
end
#--------------------------------------------------------------------------
# ● 武器リスト取得
#--------------------------------------------------------------------------
def equip_weapon_list
weapons = []
if self.two_swords?
(0...self.ts_number).each { |i|
weapons << $data_weapons[self.weapon_id(i)]
}
else
weapons << $data_weapons[self.weapon_id]
end
return weapons.compact
end
#--------------------------------------------------------------------------
# ● 防具リスト取得
#--------------------------------------------------------------------------
def equip_armor_list
armors = []
(1...self.equip_type.size).each { |i|
armors << $data_armors[self.armor_id[i]]
}
return armors.compact
end
#--------------------------------------------------------------------------
# ● 防具ID の取得
#--------------------------------------------------------------------------
def armor_id
type = self.equip_type.dup
for i in 1...type.size
if @armor_id[i] == nil
@armor_id[i] = 0
end
end
return @armor_id
end
#--------------------------------------------------------------------------
# ● 防具ID 1 の取得(互換用)
#--------------------------------------------------------------------------
def armor1_id
return self.armor_id[1]
end
#--------------------------------------------------------------------------
# ● 防具ID 1 の設定(互換用)
#--------------------------------------------------------------------------
def armor1_id=(id)
@armor_id[1] = id
end
#--------------------------------------------------------------------------
# ● 防具ID 2 の取得(互換用)
#--------------------------------------------------------------------------
def armor2_id
return self.armor_id[2]
end
#--------------------------------------------------------------------------
# ● 防具ID 2 の設定(互換用)
#--------------------------------------------------------------------------
def armor2_id=(id)
@armor_id[2] = id
end
#--------------------------------------------------------------------------
# ● 防具ID 3 の取得(互換用)
#--------------------------------------------------------------------------
def armor3_id
return self.armor_id[3]
end
#--------------------------------------------------------------------------
# ● 防具ID 3 の設定(互換用)
#--------------------------------------------------------------------------
def armor3_id=(id)
@armor_id[3] = id
end
#--------------------------------------------------------------------------
# ● 防具ID 4 の取得(互換用)
#--------------------------------------------------------------------------
def armor4_id
return self.armor_id[4]
end
#--------------------------------------------------------------------------
# ● 防具ID 4 の設定(互換用)
#--------------------------------------------------------------------------
def armor4_id=(id)
@armor_id[4] = id
end
#--------------------------------------------------------------------------
# ● 基本攻?力の取得
#--------------------------------------------------------------------------
def base_atk
if $game_temp.in_battle
if self.two_swords?
weapon = $data_weapons[self.weapon_id(@attack_count)]
n = weapon != nil ? weapon.atk : 0
else
weapon = $data_weapons[self.weapon_id]
n = weapon != nil ? weapon.atk : 0
n *= 1.5 if self.two_handed?
end
else
if self.two_swords?
n = 0
(0...self.ts_number).each { |i|
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.atk : 0
}
else
weapon = $data_weapons[self.weapon_id]
n = weapon != nil ? weapon.atk : 0
n *= 1.5 if self.two_handed?
end
end
return Integer(n)
end
#--------------------------------------------------------------------------
# ● ?性補正値の取得
# element_id : ?性 ID
#--------------------------------------------------------------------------
def element_rate(element_id)
# ?性有?度に??する?値を取得
table = [0,200,150,100,50,0,-100]
result = table[$data_classes[@class_id].element_ranks[element_id]]
# 防具でこの?性が防御されている場合は半減
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
val = self.armor_id[i]
next if val == nil
armor = $data_armors[val]
if armor != nil && armor.guard_element_set.include?(element_id)
result /= 2
end
end
# ステ?トでこの?性が防御されている場合は半減
for i in @states
if $data_states[i].guard_element_set.include?(element_id)
result /= 2
end
end
return result
end
#--------------------------------------------------------------------------
# ● ステ?ト防御判定
# state_id : ステ?ト ID
#--------------------------------------------------------------------------
def state_guard?(state_id)
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
val = self.armor_id[i]
next if val == nil
armor = $data_armors[val]
if armor != nil
if armor.guard_state_set.include?(state_id)
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ● 通常攻?の?性取得
#--------------------------------------------------------------------------
unless $imported["SetAttackElement"]
def element_set
weapons = equip_weapon_list
elements = []
weapons.each { |w|
elements |= w.element_set
}
return elements
end
end
#--------------------------------------------------------------------------
# ● 通常攻?のステ?ト?化 (+) 取得
#--------------------------------------------------------------------------
def plus_state_set
weapons = equip_weapon_list
state_set = []
weapons.each { |w|
state_set |= w.plus_state_set
}
return state_set
end
#--------------------------------------------------------------------------
# ● 通常攻?のステ?ト?化 (-) 取得
#--------------------------------------------------------------------------
def minus_state_set
weapons = equip_weapon_list
state_set = []
weapons.each { |w|
state_set |= w.minus_state_set
}
return state_set
end
#--------------------------------------------------------------------------
# ● ?備品の能力値修正の取得
#--------------------------------------------------------------------------
def equipment_parameter(type)
param = ["maxhp", "maxsp", "str", "dex", "agi", "int"]
n = 0
(equip_weapon_list + equip_armor_list).each { |e|
n += eval("e.#{param[type]}_plus")
}
return n
end
#--------------------------------------------------------------------------
# ● 基本腕力の取得
#--------------------------------------------------------------------------
def base_str
n = $data_actors[@actor_id].parameters[2, @level]
n += equipment_parameter(2)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本器用さの取得
#--------------------------------------------------------------------------
def base_dex
n = $data_actors[@actor_id].parameters[3, @level]
n += equipment_parameter(3)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本素早さの取得
#--------------------------------------------------------------------------
def base_agi
n = $data_actors[@actor_id].parameters[4, @level]
n += equipment_parameter(4)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本魔力の取得
#--------------------------------------------------------------------------
def base_int
n = $data_actors[@actor_id].parameters[5, @level]
n += equipment_parameter(5)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本物理防御の取得
#--------------------------------------------------------------------------
def base_pdef
n = 0
if self.two_swords?
for i in 0...self.ts_number
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.pdef : 0
end
else
weapon = $data_weapons[self.weapon_id]
n += weapon != nil ? weapon.pdef : 0
end
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
armor = $data_armors[self.armor_id[i]]
n += armor != nil ? armor.pdef : 0
end
return n
end
#--------------------------------------------------------------------------
# ● 基本魔法防御の取得
#--------------------------------------------------------------------------
def base_mdef
n = 0
if self.two_swords?
for i in 0...self.ts_number
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.mdef : 0
end
else
weapon = $data_weapons[self.weapon_id]
n += weapon != nil ? weapon.mdef : 0
end
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
armor = $data_armors[self.armor_id[i]]
n += armor != nil ? armor.mdef : 0
end
return n
end
#--------------------------------------------------------------------------
# ● 基本回避修正の取得
#--------------------------------------------------------------------------
def base_eva
n = 0
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
armor = $data_armors[self.armor_id[i]]
n += armor != nil ? armor.eva : 0
end
return n
end
#--------------------------------------------------------------------------
# ● ?備の?更
# equip_type : ?備タイプ
# id : 武器 or 防具 ID (0 なら?備解除)
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when (self.two_swords? ? 0...self.ts_number : 0) # 武器
if id == 0 || $game_party.weapon_number(id) > 0
# EP判定
if KGC::EEX_USE_EP && id > 0
# EP不足の場合は?る
if $data_weapons[id].ep_cost > self.ep
return
end
end
# 二刀流以外で?手持ち武器を?備する場合
if !self.two_swords? && id > 0 &&
$data_weapons[id].element_set.include?($game_special_elements["two_handed"])
# 最初の防具を外す
self.equip(1, 0)
end
$game_party.gain_weapon(self.weapon_id(equip_type), 1)
self.set_weapon(equip_type, id)
$game_party.lose_weapon(id, 1)
end
#when (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
else # 防具
# 二刀流以外で、?手持ち武器を?備しており、最初の防具を?更する場合は?る
if !self.two_swords? && equip_type == 1 && self.weapon_id > 0 &&
$data_weapons[self.weapon_id].element_set.include?($game_special_elements["two_handed"])
return
end
if id == 0 || $game_party.armor_number(id) > 0
# EP判定
if KGC::EEX_USE_EP && id > 0
# EP不足の場合は?る
if $data_armors[id].ep_cost > self.ep
return
end
end
update_auto_state(@armor_id[equip_type] != nil ?
$data_armors[@armor_id[equip_type]] : nil, $data_armors[id])
if @armor_id[equip_type] != nil && @armor_id[equip_type] > 0
$game_party.gain_armor(@armor_id[equip_type], 1)
end
@armor_id[equip_type] = id
$game_party.lose_armor(id, 1)
end
end
end
#--------------------------------------------------------------------------
# ● ?備固定判定
# equip_type : ?備タイプ
#--------------------------------------------------------------------------
def equip_fix?(equip_type)
case equip_type
when (self.two_swords? ? 0...self.ts_number : 0) # 武器
return @weapon_fix[equip_type]
#when (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
else # 防具
return @armor_fix[equip_type]
end
return false
end
#--------------------------------------------------------------------------
# ● 通常攻? 攻?側アニメ?ション ID の取得
#--------------------------------------------------------------------------
def animation1_id
if self.two_swords?
weapon = $data_weapons[self.weapon_id(self.attack_count)]
return weapon != nil ? weapon.animation1_id : 0
else
weapon = $data_weapons[self.weapon_id]
return weapon != nil ? weapon.animation1_id : 0
end
end
#--------------------------------------------------------------------------
# ● 通常攻? ?象側アニメ?ション ID の取得
#--------------------------------------------------------------------------
def animation2_id
if self.two_swords?
weapon = $data_weapons[self.weapon_id(self.attack_count)]
return weapon != nil ? weapon.animation2_id : 0
else
weapon = $data_weapons[self.weapon_id]
return weapon != nil ? weapon.animation2_id : 0
end
end
#--------------------------------------------------------------------------
# ● クラス ID の?更
# class_id : 新しいクラス ID
#--------------------------------------------------------------------------
def class_id=(class_id)
if $data_classes[class_id] != nil
@class_id = class_id
# ?備できなくなったアイテムを外す
if self.two_swords?
for i in 0...self.ts_number
equip(i, 0) unless equippable?($data_weapons[self.weapon_id(i)])
end
else
equip(0, 0) unless equippable?($data_weapons[self.weapon_id])
end
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
equip(i, 0) unless equippable?($data_armors[self.armor_id[i]])
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipLeft
#============================================================================== unless $imported["EquipAlter"]
class Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias refresh_KGC_EquipExtension refresh
def refresh
# 元の?理を?行
refresh_KGC_EquipExtension if KGC::EEX_USE_EP
if KGC::EEX_DRAW_EP_MAX
self.contents.font.color = system_color
self.contents.draw_text(140, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(172, 0, 24, 32, @actor.ep.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(196, 0, 16, 32, "/", 1)
self.contents.draw_text(212, 0, 24, 32, @actor.max_ep.to_s, 2)
else
self.contents.font.color = system_color
self.contents.draw_text(180, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(212, 0, 24, 32, @actor.ep.to_s, 2)
end
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipRight
#============================================================================== class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# ● タイプの取得
#--------------------------------------------------------------------------
def type
return @equip_type[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# ?備タイプを取得
@actor.equip_type_apply
@equip_type = @actor.equip_type.dup
if @actor.two_swords?
for i in 1...@actor.ts_number
@equip_type[i] = 0
end
end
if self.index >= @equip_type.size
self.index = @equip_type.size - 1
end
# ウィンドウ?容を作成
self.contents.dispose
self.contents = Bitmap.new(width - 32, @equip_type.size * 32)
@data = []
if @actor.two_swords?
for i in 0...@actor.ts_number
@data.push($data_weapons[@actor.weapon_id(i)])
end
for i in @actor.ts_number...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
else
@data.push($data_weapons[@actor.weapon_id])
for i in 1...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
end
@item_max = @data.size
self.contents.font.color = system_color
for i in 0...@equip_type.size
if @actor.two_swords? && i < @actor.ts_number
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[0])
else
next if KGC::EEX_EQUIP_NAME[@actor.equip_type[i]] == nil
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[@actor.equip_type[i]])
end
end
for i in 0...@data.size
self.contents.font.color = normal_color
draw_item_name(@data[i], 92, 32 * i)
if KGC::EEX_USE_EP && @data[i] != nil
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(92, 32 * i, 240, 32, @data[i].ep_cost.to_s, 2)
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipItem
#============================================================================== class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 項目の描?
# index : 項目番?
#--------------------------------------------------------------------------
alias draw_item_KGC_EquipExtension draw_item
def draw_item(index)
# 元の?理を?行
draw_item_KGC_EquipExtension(index) item = @data[index]
if KGC::EEX_USE_EP && item != nil
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(x + 216, y, 24, 32, item.ep_cost.to_s, 2)
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_Status
#============================================================================== class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if $imported["StatusAlter"]
draw_actor_graphic(@actor, 4, 48)
else
draw_actor_graphic(@actor, 40, 112)
end
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 96, 32)
draw_actor_state(@actor, 96, 64)
draw_actor_hp(@actor, 96, 112, 172)
draw_actor_sp(@actor, 96, 144, 172)
draw_actor_parameter(@actor, 96, 192, 0)
draw_actor_parameter(@actor, 96, 224, 1)
draw_actor_parameter(@actor, 96, 256, 2)
draw_actor_parameter(@actor, 96, 304, 3)
draw_actor_parameter(@actor, 96, 336, 4)
draw_actor_parameter(@actor, 96, 368, 5)
draw_actor_parameter(@actor, 96, 400, 6)
self.contents.font.color = system_color
self.contents.draw_text(320, 48, 80, 32, "EXP")
self.contents.draw_text(320, 80, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
if KGC::EEX_USE_EP
self.contents.font.color = system_color
self.contents.draw_text(468, 0, 48, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(516, 0, 32, 32, @actor.ep.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(548, 0, 24, 32, "/", 1)
self.contents.draw_text(572, 0, 32, 32, @actor.max_ep.to_s, 2)
end
self.contents.font.color = system_color
self.contents.draw_text(320, 160, 96, 32, "?備")
if @actor.two_swords?
for i in 0...@actor.ts_number
draw_item_name($data_weapons[@actor.weapon_id(i)], 320 + 16, 192 + 32 * i)
end
for i in @actor.ts_number...@actor.equip_type.size
draw_item_name($data_armors[ @actor.armor_id[i] ], 320 + 16, 192 + 32 * i)
end
else
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 192)
for i in 1...@actor.equip_type.size
draw_item_name($data_armors[ @actor.armor_id[i] ], 320 + 16, 192 + 32 * i)
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_ShopStatus
#============================================================================== class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
unless $imported["LargeParty"]
def refresh
self.contents.clear
if @item == nil
return
end
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
self.contents.font.size = 22
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "持っている?")
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
return if @item.is_a?(RPG::Item)
self.contents.font.size = 18 if $imported["HelpExtension"]
# ?備品追加情報
for i in 0...$game_party.actors.size
# アクタ?を取得
actor = $game_party.actors[i]
# ?備可能なら通常文字色に、不可能なら無?文字色に設定
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# アクタ?の名前を描?
if $imported["HelpExtension"]
self.contents.draw_text(4, 32 + 44 * i, 120, 32, actor.name)
else
self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
end
# 現在の?備品を取得
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
else
for j in 1...actor.equip_type.size
if actor.equip_type[j] == @item.kind + 1
item1 = $data_armors[actor.armor_id[j]]
break
end
end
end
# ?備可能な場合
if actor.equippable?(@item)
# 武器の場合
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
change = atk2 - atk1
end
# 防具の場合
if @item.is_a?(RPG::Armor)
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef2 = @item != nil ? @item.mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
end
# パラメ?タの?化値を描?
if $imported["HelpExtension"]
self.contents.draw_text(124, 32 + 44 * i, 112, 32,
sprintf("%+d", change), 2)
else
self.contents.draw_text(124, 64 + 64 * i, 112, 32,
sprintf("%+d", change), 2)
end
end
# アイテムを描?
if item1 != nil
x = 4
if $imported["HelpExtension"]
y = 32 + 44 * i + 22
else
y = 64 + 64 * i + 32
end
icon = RPG::Cache.icon(item1.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, icon, icon.rect, opacity)
self.contents.draw_text(x + 28, y, 212, 32, item1.name)
end
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendControl
#------------------------------------------------------------------------------
# ?備?面で、操作を選?するウィンドウです。
#============================================================================== class Window_EquipExtendControl < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = [KGC::EEX_EQUIP_EX_COMMAND_EQUIP, KGC::EEX_EQUIP_EX_COMMAND_STRONGEST_EQUIP, KGC::EEX_EQUIP_EX_COMMAND_ALL_RELEASE]
@item_max = @commands.size
@column_max = @commands.size
@item_width = (width - 32) / @commands.size
self.z = 1000
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
for i in 0...@commands.size
rect = Rect.new(@item_width * i, 0, @item_width, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = system_color
self.contents.draw_text(rect, @commands[i], 1)
end
end
#--------------------------------------------------------------------------
# ● カ?ソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if index != -1
self.cursor_rect.set(@item_width * index, 0, @item_width, 32)
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
case self.index
when 0
@help_window.set_text(KGC::EEX_EQUIP_EX_HELP_EQUIP)
when 1
@help_window.set_text(KGC::EEX_EQUIP_EX_HELP_STRONGEST_EQUIP)
when 2
@help_window.set_text(KGC::EEX_EQUIP_EX_HELP_ALL_RELEASE)
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendStatus
#------------------------------------------------------------------------------
# ?張?備?面で、アクタ?のパラメ?タ?化を表示するウィンドウです。
#============================================================================== class Window_EquipExtendStatus < Window_EquipLeft
#--------------------------------------------------------------------------
# ● 公開インスタンス??
#--------------------------------------------------------------------------
attr_accessor :new_equip # 選?中の?備品
attr_accessor :last_str # ?更前の腕力
attr_accessor :last_dex # ?更前の器用さ
attr_accessor :last_agi # ?更前の素早さ
attr_accessor :last_int # ?更前の魔力
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(actor)
super(actor)
self.back_opacity = 160 if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
self.x = 368
self.y = 288
self.z = 1000
# 初期能力値を保存
@new_equip = nil
@last_equip = nil
@last_str = @actor.str
@last_dex = @actor.dex
@last_agi = @actor.agi
@last_int = @actor.int
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
if KGC::EEX_USE_EP
if KGC::EEX_DRAW_EP_MAX
self.contents.font.color = system_color
self.contents.draw_text(140, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(172, 0, 24, 32, @actor.ep.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(196, 0, 16, 32, "/", 1)
self.contents.draw_text(212, 0, 24, 32, @actor.max_ep.to_s, 2)
else
self.contents.font.color = system_color
self.contents.draw_text(180, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(212, 0, 24, 32, @actor.ep.to_s, 2)
end
end
self.contents.font.color = system_color
self.contents.draw_text(4, 64, 72, 32, $data_system.words.atk)
self.contents.draw_text(4, 96, 72, 32, $data_system.words.pdef)
self.contents.draw_text(4, 128, 72, 32, $data_system.words.mdef)
self.contents.draw_text(120, 32, 72, 32, $data_system.words.str)
self.contents.draw_text(120, 64, 72, 32, $data_system.words.dex)
self.contents.draw_text(120, 96, 72, 32, $data_system.words.agi)
self.contents.draw_text(120, 128, 72, 32, $data_system.words.int) if @new_atk != nil
self.contents.font.color = @actor.atk > @new_atk ? text_color(2) :
@actor.atk < @new_atk ? text_color(3) : normal_color
self.contents.draw_text(80, 64, 36, 32, @new_atk.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(80, 64, 36, 32, @actor.atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = @actor.pdef > @new_pdef ? text_color(2) :
@actor.pdef < @new_pdef ? text_color(3) : normal_color
self.contents.draw_text(80, 96, 36, 32, @new_pdef.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(80, 96, 36, 32, @actor.pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = @actor.mdef > @new_mdef ? text_color(2) :
@actor.mdef < @new_mdef ? text_color(3) : normal_color
self.contents.draw_text(80, 128, 36, 32, @new_mdef.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(80, 128, 36, 32, @actor.mdef.to_s, 2)
end
if @new_str != nil
self.contents.font.color = @last_str > @new_str ? text_color(2) :
@last_str < @new_str ? text_color(3) : normal_color
self.contents.draw_text(200, 32, 36, 32, @new_str.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 32, 36, 32, @actor.str.to_s, 2)
end
if @new_dex != nil
self.contents.font.color = @last_dex > @new_dex ? text_color(2) :
@last_dex < @new_dex ? text_color(3) : normal_color
self.contents.draw_text(200, 64, 36, 32, @new_dex.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 64, 36, 32, @actor.dex.to_s, 2)
end
if @new_agi != nil
self.contents.font.color = @last_agi > @new_agi ? text_color(2) :
@last_agi < @new_agi ? text_color(3) : normal_color
self.contents.draw_text(200, 96, 36, 32, @new_agi.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 96, 36, 32, @actor.agi.to_s, 2)
end
if @new_int != nil
self.contents.font.color = @last_int > @new_int ? text_color(2) :
@last_int < @new_int ? text_color(3) : normal_color
self.contents.draw_text(200, 128, 36, 32, @new_int.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 128, 36, 32, @actor.int.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ● ?備?更後のパラメ?タ設定
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_st = [nil, nil, nil, nil])
if @new_atk != new_atk || @new_pdef != new_pdef || @new_mdef != new_mdef ||
@new_str != new_st[0] || @new_dex != new_st[1] ||
@new_agi != new_st[2] || @new_int != new_st[3]
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_st[0]
@new_dex = new_st[1]
@new_agi = new_st[2]
@new_int = new_st[3]
@last_equip = @new_equip
refresh
return
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendList
#------------------------------------------------------------------------------
# ?張?備?面で、アクタ?が現在?備しているアイテムを表示するウィンドウです。
#============================================================================== class Window_EquipExtendList < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクタ?
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 368, 416)
if $imported["HelpExtension"]
self.y = 128
self.height = 352
end
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160 if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
self.active = false
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● タイプの取得
#--------------------------------------------------------------------------
def type
return @equip_type[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# ?備タイプを取得
@actor.equip_type_apply
@equip_type = @actor.equip_type.dup
if @actor.two_swords?
for i in 1...@actor.ts_number
@equip_type[i] = 0
end
end
if self.index >= @equip_type.size
self.index = @equip_type.size - 1
end
# アイテムを追加
@data = []
if @actor.two_swords?
for i in 0...@actor.ts_number
@data.push($data_weapons[@actor.weapon_id(i)])
end
for i in @actor.ts_number...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
else
@data.push($data_weapons[@actor.weapon_id])
for i in 1...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
end
@equip_type = @equip_type[KGC::EEX_EQUIP_EX_INDEX...@equip_type.size]
@data = @data[KGC::EEX_EQUIP_EX_INDEX...@data.size]
@item_max = @data.size
# ウィンドウ?容を作成
self.contents.dispose
self.contents = Bitmap.new(width - 32, @equip_type.size * 32)
self.contents.font.color = system_color
for i in 0...@equip_type.size
if @equip_type[i] == 0 && @actor.two_swords? && i < @actor.ts_number
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[0])
else
next if KGC::EEX_EQUIP_NAME[@equip_type[i]] == nil
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[@equip_type[i]])
end
end
for i in 0...@data.size
self.contents.font.color = normal_color
draw_item_name(@data[i], 92, 32 * i)
if KGC::EEX_USE_EP && @data[i] != nil
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(92, 32 * i, 240, 32, @data[i].ep_cost.to_s, 2)
end
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendItem
#------------------------------------------------------------------------------
# ?張?備?面で、?備?更の候補となるアイテムの一?を表示するウィンドウです。
#============================================================================== class Window_EquipExtendItem < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクタ?
# equip_type : ?備部位 (0~3)
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(368, 64, 320, 416)
if $imported["HelpExtension"]
self.y = 128
self.height = 352
end
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
self.back_opacity = 160 if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# ?備可能な武器を追加
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 && weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
# ?備可能な防具を追加
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 && armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
# 空白を追加
@data.push(nil)
# ビットマップを作成し、全項目を描?
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
#--------------------------------------------------------------------------
# ● 項目の描?
# index : 項目番?
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
y = index * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
icon = RPG::Cache.icon(item.icon_name)
self.contents.blt(0, y + 4, icon, icon.rect)
self.contents.font.color = normal_color
self.contents.draw_text(32, y, 212, 32, item.name, 0)
self.contents.draw_text(244, y, 16, 32, ":", 1)
self.contents.draw_text(260, y, 24, 32, number.to_s, 2)
if KGC::EEX_USE_EP && item != nil
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(220, y, 24, 32, item.ep_cost.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Interpreter (分割定義 3)
#============================================================================== class Interpreter
#--------------------------------------------------------------------------
# ● ?件分岐
#--------------------------------------------------------------------------
def command_111
# ロ?カル?? result を初期化
result = false
# ?件判定
case @parameters[0]
when 0 # スイッチ
result = ($game_switches[@parameters[1]] == (@parameters[2] == 0))
when 1 # ??
value1 = $game_variables[@parameters[1]]
if @parameters[2] == 0
value2 = @parameters[3]
else
value2 = $game_variables[@parameters[3]]
end
case @parameters[4]
when 0 # と同値
result = (value1 == value2)
when 1 # 以上
result = (value1 >= value2)
when 2 # 以下
result = (value1 <= value2)
when 3 # 超
result = (value1 > value2)
when 4 # 未?
result = (value1 < value2)
when 5 # 以外
result = (value1 != value2)
end
when 2 # セルフスイッチ
if @event_id > 0
key = [$game_map.map_id, @event_id, @parameters[1]]
if @parameters[2] == 0
result = ($game_self_switches[key] == true)
else
result = ($game_self_switches[key] != true)
end
end
when 3 # タイマ?
if $game_system.timer_working
sec = $game_system.timer / Graphics.frame_rate
if @parameters[2] == 0
result = (sec >= @parameters[1])
else
result = (sec <= @parameters[1])
end
end
when 4 # アクタ?
actor = $game_actors[@parameters[1]]
if actor != nil
case @parameters[2]
when 0 # パ?ティにいる
result = ($game_party.actors.include?(actor))
when 1 # 名前
result = (actor.name == @parameters[3])
when 2 # スキル
result = (actor.skill_learn?(@parameters[3]))
when 3 # 武器
if actor.two_swords?
result = false
for i in 0...actor.ts_number
if actor.weapon_id(i) == @parameters[3]
result = true
break
end
end
else
result = (actor.weapon_id == @parameters[3])
end
when 4 # 防具
result = false
for i in 1...actor.equip_type.size
if actor.armor_id[i] == @parameters[3]
result = true
break
end
end
when 5 # ステ?ト
result = (actor.state?(@parameters[3]))
end
end
when 5 # エネミ?
enemy = $game_troop.enemies[@parameters[1]]
if enemy != nil
case @parameters[2]
when 0 # 出現している
result = (enemy.exist?)
when 1 # ステ?ト
result = (enemy.state?(@parameters[3]))
end
end
when 6 # キャラクタ?
character = get_character(@parameters[1])
if character != nil
result = (character.direction == @parameters[2])
end
when 7 # ゴ?ルド
if @parameters[2] == 0
result = ($game_party.gold >= @parameters[1])
else
result = ($game_party.gold <= @parameters[1])
end
when 8 # アイテム
result = ($game_party.item_number(@parameters[1]) > 0)
when 9 # 武器
result = ($game_party.weapon_number(@parameters[1]) > 0)
when 10 # 防具
result = ($game_party.armor_number(@parameters[1]) > 0)
when 11 # ボタン
result = (Input.press?(@parameters[1]))
when 12 # スクリプト
result = eval(@parameters[1])
end
# 判定結果をハッシュに格納
@branch[@list[@index].indent] = result
# 判定結果が?だった場合
if @branch[@list[@index].indent] == true
# 分岐デ?タを削除
@branch.delete(@list[@index].indent)
# ??
return true
end
# ?件に該?しない場合 : コマンドスキップ
return command_skip
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_Equip
#============================================================================== class Scene_Equip
#--------------------------------------------------------------------------
# ● メイン?理
#--------------------------------------------------------------------------
alias main_KGC_EquipExtension main
def main
# アクタ?を取得
@actor = $game_party.actors[@actor_index]
# アイテムウィンドウを作成
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6} = Window_EquipItem.new(@actor, i + 5)")
if $imported["MenuAlter"] && KGC::MA_MENU_TRANSPARENT
eval("@item_window#{i + 6}.back_opacity = 160")
end
end
end main_KGC_EquipExtension # アイテムウィンドウを解放
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.dispose if @item_window#{i + 6} != nil")
end
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# ヘルプウィンドウを設定
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.help_window = @help_window")
end
end
# アイテムウィンドウの可視?態設定
@item_window1.visible = (@right_window.type == 0)
@item_window2.visible = (@right_window.type == 1)
@item_window3.visible = (@right_window.type == 2)
@item_window4.visible = (@right_window.type == 3)
@item_window5.visible = (@right_window.type == 4)
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.visible = (@right_window.type == i + 5)")
end
end
# 現在?備中のアイテムを取得
item1 = @right_window.item
# 現在のアイテムウィンドウを @item_window に設定
eval("@item_window = @item_window#{@right_window.type + 1}")
# ライトウィンドウがアクティブの場合
if @right_window.active
# ?備?更後のパラメ?タを消去
@left_window.set_new_parameters(nil, nil, nil)
end
# アイテムウィンドウがアクティブの場合
if @item_window.active
# 現在選?中のアイテムを取得
item2 = @item_window.item
# ?備を?更
last_hp = @actor.hp
last_sp = @actor.sp
if @actor.two_swords?
case @right_window.index
when 0...@actor.ts_number # 武器
@actor.set_weapon(@right_window.index, item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item2 == nil ? 0 : item2.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
else
case @right_window.index
when 0 # 武器
@actor.weapon_id = (item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item2 == nil ? 0 : item2.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
end
# ?備?更後のパラメ?タを取得
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
if $imported["EquipAlter"]
new_st = [@actor.str, @actor.dex, @actor.agi, @actor.int]
end
# ?備を?す
if @actor.two_swords?
case @right_window.index
when 0...@actor.ts_number # 武器
@actor.set_weapon(@right_window.index, item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item1 == nil ? 0 : item1.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
else
case @right_window.index
when 0 # 武器
@actor.weapon_id = (item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item1 == nil ? 0 : item1.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
end
@actor.hp = last_hp
@actor.sp = last_sp
# レフトウィンドウに描?
if $imported["EquipAlter"]
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_st)
else
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (アイテムウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
unless $imported["EquipAlter"]
alias update_item_KGC_EquipExtension update_item
def update_item
# C ボタンが押された場合
if Input.trigger?(Input::C)
# アイテムウィンドウで現在選?されているデ?タを取得
item = @item_window.item
if KGC::EEX_USE_EP
# EP判定
if item != nil && item.ep_cost > @actor.ep
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
end
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備を?更
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
# オ?トステ?トを更新
if $imported["EquipDetailSetting"]
if @actor.two_swords?
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id(@right_window.index)], true)
else
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id], true)
end
end
for i in 1...@actor.equip_type.size
@actor.update_auto_state(nil, $data_armors[@actor.armor_id[i]])
end
# 初期能力を更新
if $imported["EquipAlter"]
@left_window.last_str = @actor.str
@left_window.last_dex = @actor.dex
@left_window.last_agi = @actor.agi
@left_window.last_int = @actor.int
end
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# レフトウィンドウを初期化
@left_window.new_equip = nil if $imported["EquipAlter"]
@left_window.set_new_parameters(nil, nil, nil)
# ライトウィンドウ、アイテムウィンドウの?容を再作成
@right_window.refresh
for i in 1..(KGC::EEX_EQUIP_TYPE_EXT.size + 5)
eval("@item_window#{i}.refresh")
end
return
end update_item_KGC_EquipExtension
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_Battle (分割定義 1)
#============================================================================== class Scene_Battle
#--------------------------------------------------------------------------
# ● メイン?理
#--------------------------------------------------------------------------
alias main_KGC_EquipExtension main
def main
# 攻?回?を初期化
for actor in $game_party.actors
actor.attack_count = 0
end main_KGC_EquipExtension
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_Battle (分割定義 4)
#============================================================================== class Scene_Battle
#--------------------------------------------------------------------------
# ● フレ?ム更新 (メインフェ?ズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_KGC_EquipExtension update_phase4_step6
def update_phase4_step6
update_phase4_step6_KGC_EquipExtension # 二刀流?通常攻?の場合
if @active_battler.is_a?(Game_Actor) && @active_battler.two_swords? &&
@active_battler.current_action.kind == 0 && @active_battler.current_action.basic == 0
# 攻?回?加算
loop {
@active_battler.attack_count += 1
if @active_battler.attack_count == @active_battler.ts_number ||
@active_battler.weapon_id(@active_battler.attack_count) > 0
break
end
}
# 規定回?行動した場合
if @active_battler.attack_count == @active_battler.ts_number
# 攻?回?を初期化
@active_battler.attack_count = 0
else
# ????の場合
unless judge
# 攻??象が死んでいる場合は再設定
if @target_battlers[0].dead?
if @active_battler.restriction == 3
@target_battlers[0] = $game_party.random_target_actor
else
@target_battlers[0] = $game_troop.random_target_enemy
end
end
if $imported["ActiveCountBattle"]
@action_battlers.insert(0, @active_battler)
else
# ステップ 2 に移行
@phase4_step = 2
end
end
end
else
if @active_battler.is_a?(Game_Actor)
# 攻?回?を初期化
@active_battler.attack_count = 0
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_EquipExtend
#------------------------------------------------------------------------------
# ?張?備?面の?理を行うクラスです。
#============================================================================== class Scene_EquipExtend
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_index : アクタ?インデックス
# equip_index : ?備インデックス
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0, call_menu = false)
@actor_index = actor_index
@equip_index = equip_index
@call_menu = call_menu
end
#--------------------------------------------------------------------------
# ● メイン?理
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
@spriteset = Spriteset_Map.new if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
# ウィンドウを作成
if $imported["HelpExtension"]
@help_window = Window_HelpExtension.new
else
@help_window = Window_Help.new
end
@control_window = Window_EquipExtendControl.new
@control_window.y = 64 if $imported["HelpExtension"]
@status_window = Window_EquipExtendStatus.new(@actor)
@list_window = Window_EquipExtendList.new(@actor)
@item_window1 = Window_EquipExtendItem.new(@actor, 0)
@item_window2 = Window_EquipExtendItem.new(@actor, 1)
@item_window3 = Window_EquipExtendItem.new(@actor, 2)
@item_window4 = Window_EquipExtendItem.new(@actor, 3)
@item_window5 = Window_EquipExtendItem.new(@actor, 4)
# ヘルプウィンドウを?連付け
@control_window.help_window = @help_window
@list_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
# ?張アイテムウィンドウを作成
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6} = Window_EquipExtendItem.new(@actor, i + 5)")
eval("@item_window#{i + 6}.help_window = @help_window")
if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
eval("@item_window#{i + 6}.back_opacity = 160")
end
end
end
if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
@help_window.back_opacity = 160
@control_window.back_opacity = 160
end
# カ?ソル位置を設定
@list_window.index = @equip_index
@effect_type = 0
refresh
# トランジション?行
Graphics.transition
# メインル?プ
loop {
Graphics.update
Input.update
update
if $scene != self
break
end
}
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@help_window.dispose
@control_window.dispose
@status_window.dispose
@list_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.dispose if @item_window#{i + 6} != nil")
end
end
@spriteset.dispose if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
end
#--------------------------------------------------------------------------
# ● フレ?ム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@status_window.update
@list_window.update
@item_window.update
@control_window.update
refresh
update_effect(@effect_type)
# 操作ウィンドウがアクティブの場合: update_control を呼ぶ
if @control_window.active
@effect_type = 0
update_control
return
end
# リストウィンドウがアクティブの場合: update_list を呼ぶ
if @list_window.active
@effect_type = 1
update_list
return
end
# アイテムウィンドウがアクティブの場合: update_item を呼ぶ
if @item_window.active
@effect_type = 2
update_item
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (エフェクト)
#--------------------------------------------------------------------------
def update_effect(type)
case type
when 1
@last_index = -1
@status_window.x = [@status_window.x + 48, 368].min
@status_window.y = [@status_window.y + 24, 288].min
@list_window.x = [@list_window.x + 8, 0].min
@item_window.x = [@item_window.x + 8, 368].min
when 2
if @last_index != @list_window.index
pos = @list_window.index - @list_window.top_row
center = (@list_window.height - 32) / 64
@status_y = pos >= center ? @list_window.y : 288
@last_index = @list_window.index
end
@status_window.x = [@status_window.x - 48, 0].max
if @status_y > @status_window.y
@status_window.y = [@status_window.y + 24, @status_y].min
elsif @status_y < @status_window.y
@status_window.y = [@status_window.y - 24, @status_y].max
end
@list_window.x = [@list_window.x - 8, -48].max
@item_window.x = [@item_window.x - 8, 320].max
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (操作ウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_control
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
if @call_menu
# メニュ??面に切り替え
if $imported["MenuAlter"]
index = KGC::MA_COMMANDS.index(2)
if index != nil
$scene = Scene_Menu.new(index)
else
$scene = Scene_Menu.new
end
else
$scene = Scene_Menu.new(3)
end
else
# マップ?面に切り替え
$scene = Scene_Map.new
end
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# カ?ソル位置で分岐
case @control_window.index
when 0 # ?備?更
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# リストウィンドウに切り替え
@list_window.active = true
@list_window.index = 0 if @list_window.index == -1
@control_window.active = false
@control_window.visible = false
when 1 # 最??備
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備最大?を取得
if $imported["EquipExtension"]
mx = @actor.equip_type.size
else
mx = 5
end
for i in KGC::EEX_EQUIP_EX_INDEX...mx
# ?備固定の場合は次へ
next if @actor.equip_fix?(i)
# ?備の種類で分岐
tw = $imported["EquipExtension"] && @actor.two_swords?
case i
when (tw ? 0...@actor.ts_number : 0) # 武器
# 最?武器?備
equip_strongest_weapon(i)
when (tw ? @actor.ts_number : 1)...mx # 防具
# 最?防具?備
equip_strongest_armor(@actor.equip_type[i], i)
end
end
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# レフトウィンドウを初期化
@status_window.set_new_parameters(nil, nil, nil)
# ウィンドウをリフレッシュ
refresh_window
when 2 # 全解除
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備最大?を取得
if $imported["EquipExtension"]
mx = @actor.equip_type.size
else
mx = 5
end
(KGC::EEX_EQUIP_EX_INDEX...mx).each { |i|
# ?備固定でない場合は解除
@actor.equip(i, 0) unless @actor.equip_fix?(i)
}
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# ステ?タスウィンドウを初期化
@status_window.set_new_parameters(nil, nil, nil)
# ウィンドウをリフレッシュ
refresh_window
end
return
end
# R ボタンが押された場合
if Input.trigger?(Input::R)
# カ?ソル SE を演奏
$game_system.se_play($data_system.cursor_se)
# 次のアクタ?へ
@actor_index += 1
@actor_index %= $game_party.actors.size
# 別の?備?面に切り替え
$scene = Scene_EquipExtend.new(@actor_index, 0, @call_menu)
return
end
# L ボタンが押された場合
if Input.trigger?(Input::L)
# カ?ソル SE を演奏
$game_system.se_play($data_system.cursor_se)
# 前のアクタ?へ
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# 別の?備?面に切り替え
$scene = Scene_EquipExtend.new(@actor_index, 0, @call_menu)
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (リストウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_list
# A ボタンが押された場合
if Input.trigger?(Input::A)
index = @list_window.index + KGC::EEX_EQUIP_EX_INDEX
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備を外す
@actor.equip(index, 0)
# ウィンドウリフレッシュ
refresh_window
return
end
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# 操作ウィンドウに切り替え
@list_window.active = false
@control_window.active = true
@control_window.visible = true
# リフレッシュ
refresh
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# ?備固定の場合
if @actor.equip_fix?(@list_window.index + KGC::EEX_EQUIP_EX_INDEX)
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# アイテムウィンドウをアクティブ化
@list_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (アイテムウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_item
# 選?中の?備品を更新
@status_window.new_equip = @item_window.item
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# ステ?タスウィンドウを初期化
@status_window.new_equip = nil
@status_window.set_new_parameters(nil, nil, nil)
# リストウィンドウをアクティブ化
@list_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# アイテムウィンドウで現在選?されているデ?タを取得
item = @item_window.item
index = @list_window.index + KGC::EEX_EQUIP_EX_INDEX
if $imported["EquipExtension"] && KGC::EEX_USE_EP
# EP判定
if item != nil && item.ep_cost > @actor.ep
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
end
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備を?更
@actor.equip(index, item == nil ? 0 : item.id)
# オ?トステ?トを更新
if $imported["EquipDetailSetting"]
if $imported["EquipExtension"] && @actor.two_swords?
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id(index)], true)
else
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id], true)
end
end
if $imported["EquipExtension"]
for i in (@actor.two_swords? ? @actor.ts_number : 1)...@actor.equip_type.size
@actor.update_auto_state(nil, $data_armors[@actor.armor_id[i]])
end
else
for i in 1..4
@actor.update_auto_state(nil, $data_armors[eval("@actor.armor#{i}_id")])
end
end
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# リストウィンドウをアクティブ化
@list_window.active = true
@item_window.active = false
@item_window.index = -1
# ステ?タスウィンドウを初期化
@status_window.new_equip = nil
@status_window.set_new_parameters(nil, nil, nil)
# ウィンドウの?容を再作成
refresh_window
return
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# アイテムウィンドウの可視?態設定
@item_window1.visible = (@list_window.type == 0)
@item_window2.visible = (@list_window.type == 1)
@item_window3.visible = (@list_window.type == 2)
@item_window4.visible = (@list_window.type == 3)
@item_window5.visible = (@list_window.type == 4)
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.visible = (@list_window.type == i + 5)")
end
end
# 現在?備中のアイテムを取得
item1 = @list_window.item
# 現在のアイテムウィンドウを @item_window に設定
eval("@item_window = @item_window#{@list_window.type + 1}")
# リストウィンドウがアクティブの場合
if @list_window.active
# ?備?更後のパラメ?タを消去
@status_window.set_new_parameters(nil, nil, nil)
end
# アイテムウィンドウがアクティブの場合
if @item_window.active
# 現在選?中のアイテムを取得
item2 = @item_window.item
index = @list_window.index + KGC::EEX_EQUIP_EX_INDEX
# ?備を?更
last_hp = @actor.hp
last_sp = @actor.sp
if @actor.two_swords?
case index
when 0...@actor.ts_number # 武器
@actor.set_weapon(index, item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item2 == nil ? 0 : item2.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
else
case index
when 0 # 武器
@actor.weapon_id = (item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item2 == nil ? 0 : item2.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
end
# ?備?更後のパラメ?タを取得
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
if $imported["EquipAlter"]
new_st = [@actor.str, @actor.dex, @actor.agi, @actor.int]
end
# ?備を?す
if @actor.two_swords?
case index
when 0...@actor.ts_number # 武器
@actor.set_weapon(index, item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item1 == nil ? 0 : item1.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
else
case index
when 0 # 武器
@actor.weapon_id = (item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item1 == nil ? 0 : item1.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
end
@actor.hp = last_hp
@actor.sp = last_sp
# ステ?タスウィンドウに描?
if $imported["EquipAlter"]
@status_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_st)
else
@status_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
end
#--------------------------------------------------------------------------
# ● ウィンドウをリフレッシュ
#--------------------------------------------------------------------------
def refresh_window
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# リフレッシュ
@status_window.refresh
@list_window.refresh
@item_window1.refresh
@item_window2.refresh
@item_window3.refresh
@item_window4.refresh
@item_window5.refresh
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.refresh")
end
end
end
#--------------------------------------------------------------------------
# ● 最?武器?備
#--------------------------------------------------------------------------
def equip_strongest_weapon(type)
# 武器リストを初期化
weapons = []
# ?備可能な武器を追加
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 && weapon_set.include?(i)
weapons.push($data_weapons[i])
end
end
# ?備可能な武器が無い場合は?る
return if weapons == []
# 武器リストを逆順(IDの大きい順)に?べ替え
weapons = weapons.reverse
# 最?武器を初期化
strongest_weapon = weapons[0]
# 最?武器を取得(攻?力で判定)
for weapon in weapons
strongest_weapon = weapon if strongest_weapon.atk < weapon.atk
end
# 現在の?備を取得
now_weapon = $data_weapons[
$imported["EquipExtension"] && @actor.two_swords? ?
@actor.weapon_id(type) : @actor.weapon_id]
# 何も?備していない場合
if now_weapon == nil
# ?備を?更
@actor.equip(type, strongest_weapon.id)
# 現在の?備より?い場合
elsif strongest_weapon.atk > now_weapon.atk
# ?備を?更
@actor.equip(type, strongest_weapon.id)
end
end
#--------------------------------------------------------------------------
# ● 最?防具?備
# type : 防具の種類
# index : ?備箇所
#--------------------------------------------------------------------------
def equip_strongest_armor(type, index)
# 除外?備の場合は?る
return if KGC::EEX_IGNORE_STRONGEST_TYPE.include?(type)
# 防具リストを初期化
armors = []
# ?備可能な防具を追加
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 && armor_set.include?(i)
if $data_armors[i].kind == type - 1
armors.push($data_armors[i])
end
end
end
# ?備可能な防具が無い場合は?る
return if armors == []
# 防具リストを逆順(IDの大きい順)に?べ替え
armors = armors.reverse
# 最?防具を初期化
strongest_armor = armors[0]
# 最?防具を取得(物理防御で判定)
for armor in armors
strongest_armor = armor if strongest_armor.pdef < armor.pdef
end
# 現在の?備を取得
now_armor = $data_armors[$imported["EquipExtension"] ?
@actor.armor_id[index] : eval("@actor.armor#{index}_id")]
# 何も?備していない場合
if now_armor == nil
# ?備を?更
@actor.equip(index, strongest_armor.id)
# 現在の?備より?い場合
elsif strongest_armor.pdef > now_armor.pdef
# ?備を?更
@actor.equip(index, strongest_armor.id)
end
end
end
#_/ ◆?備?張 - KGC_EquipExtension◆
#_/----------------------------------------------------------------------------
#_/ ?備?連の機能を?張します。
#_/============================================================================
#_/ ≪?備品設定詳細化[EquipDetailSetting]≫より上
#_/ ≪クラス設定詳細化[ClassDetailSetting]≫より上
#_/ ≪限界突破[LimitBreak]≫より上
#_/ ≪?備?面改造[EquipAlter]≫より下
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ if $game_special_elements == nil
$game_special_elements = {}
$data_system = load_data("Data/System.rxdata")
end #==============================================================================
# ★ カスタマイズ項目 ★
#============================================================================== module KGC
# ◆?張?備タイプ定義
# 配列の最初がタイプ 5 に相?。以降 6,7,8,... と?く。
EEX_EQUIP_TYPE_EXT = ["腕部", "脚部"] # ◆?備品のタイプ(1:盾 2:頭 3:身? 4:?飾品 5以降:↑で定義)
# ※どのように指定しても、必ず最初は武器になります。
EEX_EQUIP_TYPE = [1, 2, 3, 4, 4, 5, 6]
# ◆二刀流時の武器?
# 二刀流時は↑の先頭から (EEX_TS_NUMBER - 1) 個を武器に置き換える
EEX_TS_NUMBER = 2 # ◆?備欄の名前
# ?加した?備タイプの名?もここで指定。
EEX_EQUIP_NAME = [
$data_system.words.weapon, # 武器
$data_system.words.armor1, # タイプ 1(盾)
$data_system.words.armor2, # タイプ 2(頭)
$data_system.words.armor3, # タイプ 3(身?)
$data_system.words.armor4, # タイプ 4(?飾品)
EEX_EQUIP_TYPE_EXT[0], # タイプ 5
EEX_EQUIP_TYPE_EXT[1] # タイプ 6
] # ←この ] は消さないこと # ◆最??備から除外する?備タイプ
# 除外する?備タイプを格納。
# ≪?備?面改造≫と?用した場合はこちらを優先。
EEX_IGNORE_STRONGEST_TYPE = [4] # ◆?張?備?面に表示する?備欄開始番?
# 武器を 0 、最初の防具を 1 とした番?(インデックス)。
EEX_EQUIP_EX_INDEX = 0
# ◆?張?備?面背景透過
EEX_EQUIP_EX_BACK_TRANSPARENT = true # ◆?張?備?面「?備?更」名?
EEX_EQUIP_EX_COMMAND_EQUIP = "?備?更"
# ◆?張?備?面「最??備」名?
EEX_EQUIP_EX_COMMAND_STRONGEST_EQUIP = "最??備"
# ◆?張?備?面「全解除」名?
EEX_EQUIP_EX_COMMAND_ALL_RELEASE = "全解除" # ◆?張?備?面「?備?更」ヘルプ
EEX_EQUIP_EX_HELP_EQUIP = "?備を?更します。"
# ◆?張?備?面「最??備」ヘルプ
EEX_EQUIP_EX_HELP_STRONGEST_EQUIP = "最も?力な武具を?備します。"
# ◆?張?備?面「全解除」ヘルプ
EEX_EQUIP_EX_HELP_ALL_RELEASE = "全ての?備品を外します。" # ◆EP(Equip Point)制を使用する
EEX_USE_EP = true # ◆消費EP?定値
# 消費EPが指定されていない?備品で使用
EEX_EP_COST_DEFAULT = 1
# ◆EP上限値
EEX_EP_MAX = 15
# ◆EP下限値
EEX_EP_MIN = 1
# ◆最大EP算出式
# 【lv…レベル】
# 自動的に整??換されるので、結果が小?になってもOK。
EEX_EP_FORMULA = "lv * 0.6" # ◆「EP」の名?
EEX_EP_NAME = "EP"
# ◆?備?面のEP最大値描?
# 名前が?れたりする場合は false にしてください。
EEX_DRAW_EP_MAX = true
# ◆消費EP値の色(アイテム名の末尾に付く?値)
EEX_EP_COLOR = Color.new(128, 255, 255)
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ $imported = {} if $imported == nil
$imported["EquipExtension"] = true # ?手持ち?性
$game_special_elements["two_handed"] = $data_system.elements.index("?手持ち") if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for element in KGC::EEX_EQUIP_TYPE_EXT.compact
$game_special_elements["EEX_#{element}"] = $data_system.elements.index(element)
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #--------------------------------------------------------------------------
# ● ?張?備?面呼び出し
# actor_index : アクタ?INDEX
#--------------------------------------------------------------------------
def call_equip_extend(actor_index = 0)
# プレイヤ?の姿勢を矯正
$game_player.straighten
# ?張?備?面に切り替え
$scene = Scene_EquipExtend.new(actor_index)
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ RPG::Weapon
#============================================================================== class RPG::Weapon
#--------------------------------------------------------------------------
# ● 名前取得
#--------------------------------------------------------------------------
def name
return @name.gsub(/[.*]/) {""}
end
#--------------------------------------------------------------------------
# ● オリジナル名取得
#--------------------------------------------------------------------------
def original_name
return @name
end
#--------------------------------------------------------------------------
# ● 消費EP取得
#--------------------------------------------------------------------------
def ep_cost
return @name =~ /[EP[ ]*(d+)]/i ? $1.to_i : KGC::EEX_EP_COST_DEFAULT
end
#--------------------------------------------------------------------------
# ● ?備タイプ取得
#--------------------------------------------------------------------------
def equip_type
if @name =~ /[ET[ ]*([0-9,]+)]/i
type = $1.split(/[,]/).compact
for i in 0...type.size
type[i] = type[i].to_i
end
type.insert(0, 0) if type[0] != 0
return type
else
return nil
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ RPG::Armor
#============================================================================== class RPG::Armor
#--------------------------------------------------------------------------
# ● 名前取得
#--------------------------------------------------------------------------
def name
return @name.gsub(/[.*]/) {""}
end
#--------------------------------------------------------------------------
# ● オリジナル名取得
#--------------------------------------------------------------------------
def original_name
return @name
end
#--------------------------------------------------------------------------
# ● 消費EP取得
#--------------------------------------------------------------------------
def ep_cost
return @name =~ /[EP[ ]*(d+)]/i ? $1.to_i : KGC::EEX_EP_COST_DEFAULT
end
#--------------------------------------------------------------------------
# ● 種類取得
#--------------------------------------------------------------------------
def kind
if @guard_element_set.size > 0
@guard_element_set.compact.each { |element|
(0...KGC::EEX_EQUIP_TYPE_EXT.size).each { |i|
if element == $game_special_elements["EEX_#{KGC::EEX_EQUIP_TYPE_EXT[i]}"]
return i + 4
end
}
}
end
return @kind
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Game_Actor
#============================================================================== class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス??
#--------------------------------------------------------------------------
attr_accessor :weapon_fix # 武器固定
attr_accessor :armor_id # 防具 ID
attr_accessor :armor_fix # 防具固定
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクタ? ID
#--------------------------------------------------------------------------
alias setup_KGC_EquipExtension setup
def setup(actor_id)
actor = $data_actors[actor_id]
@weapons = [actor.weapon_id]
(1...KGC::EEX_TS_NUMBER).each { |i|
@weapons << 0
}
@armor1_id = @armor2_id = @armor3_id = @armor4_id = 0
@weapon_fix = [actor.weapon_fix]
(1...KGC::EEX_TS_NUMBER).each { |i|
@weapon_fix << false
}
# 防具固定?態を設定
@armor_fix = [false, false, false, false, false]
(1..4).each { |i|
if (index = KGC::EEX_EQUIP_TYPE.index(i)) != nil
@armor_fix[index] = eval("actor.armor#{i}_fix")
end
}
if self.equip_type.size > 5
(5...self.equip_type.size).each { |i|
@armor_fix[i] = false
}
end # 防具を設定
@armor_id = [0, 0, 0, 0, 0]
if (index = KGC::EEX_EQUIP_TYPE.index(1)) != nil &&
( @weapons[0] == 0 ||
!$data_weapons[@weapons[0]].element_set.include?(
$game_special_elements["two_handed"]) )
@armor_id[index] = actor.armor1_id
else
@armor_id[1] = 0
end
(2..4).each { |i|
if (index = KGC::EEX_EQUIP_TYPE.index(i)) != nil
@armor_id[index] = eval("actor.armor#{i}_id")
end
}
if self.equip_type.size > 5
(5...self.equip_type.size).each { |i|
@armor_id[i] = 0
}
end setup_KGC_EquipExtension(actor_id) @equip_type = nil
@equip_type_weapon = nil
@two_swords = false
@two_handed = false
@ts_number = nil
@attack_count = 0
if KGC::EEX_EQUIP_TYPE.size > 5
(5...KGC::EEX_EQUIP_TYPE.size).each { |i|
# 防具ID, 固定フラグを初期化
@armor_id[i] = 0
@armor_fix[i] = false
# オ?トステ?トを更新
update_auto_state(nil, $data_armors[self.armor_id[i]])
}
end
end
#--------------------------------------------------------------------------
# ● ?備タイプ取得
#--------------------------------------------------------------------------
def equip_type
type = (@equip_type_weapon != nil && @equip_type_weapon != []) ?
@equip_type_weapon : (@equip_type != nil && @equip_type != []) ?
@equip_type : KGC::EEX_EQUIP_TYPE
if type[0] != 0
type.insert(0, 0)
end
return type
end
#--------------------------------------------------------------------------
# ● ?備タイプ設定
#--------------------------------------------------------------------------
def equip_type=(type)
@equip_type = type
end
#--------------------------------------------------------------------------
# ● ?備品タイプ?更適用
#--------------------------------------------------------------------------
def equip_type_apply
last_equip_type = self.equip_type.dup
if self.weapon_id > 0
@equip_type_weapon = $data_weapons[self.weapon_id].equip_type
else
@equip_type_weapon = nil
end
# ?備不可能になったものは外す
for i in (self.two_swords? ? self.ts_number : 1)...last_equip_type.size
next if @armor_id[i] == nil
if (armor = $data_armors[@armor_id[i]]) != nil &&
self.equip_type[i] != armor.kind + 1
self.equip(i, 0)
end
end
@armor_id = @armor_id[0...self.equip_type.size]
end
#--------------------------------------------------------------------------
# ● 最大EP取得
#--------------------------------------------------------------------------
def max_ep
formula = KGC::EEX_EP_FORMULA.gsub(/lv/i) {"@level"}
return [[Integer(eval(formula)), KGC::EEX_EP_MIN].max, KGC::EEX_EP_MAX].min
end
#--------------------------------------------------------------------------
# ● EP取得
#--------------------------------------------------------------------------
def ep
if self.two_swords?
n = 0
self.ts_number.times { |i|
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.ep_cost : 0
}
else
n = (weapon = $data_weapons[self.weapon_id]) != nil ? weapon.ep_cost : 0
end
((self.two_swords? ? self.ts_number : 1)...self.equip_type.size).each { |i|
n += (armor = $data_armors[self.armor_id[i]]) != nil ? armor.ep_cost : 0
}
return self.max_ep - n
end
#--------------------------------------------------------------------------
# ● 二刀流?態取得
#--------------------------------------------------------------------------
def two_swords?
return @two_swords
end
#--------------------------------------------------------------------------
# ● 二刀流設定
#--------------------------------------------------------------------------
def two_swords=(value)
# 二刀流になった場合
if value && !@two_swords
# ?手持ちを解除
self.two_handed = false
# 二刀流で?備不可能になる防具を外す
for i in 1...self.ts_number
self.equip(i, 0)
end
# 二刀流が解除された場合
elsif !value && @two_swords
# 元?防具であった部分の武器を外す
for i in 1...self.ts_number
self.equip(i, 0)
@weapons[i] = 0
@weapon_fix[i] = false
end
end
@two_swords = value
end
#--------------------------------------------------------------------------
# ● 二刀流武器?取得
#--------------------------------------------------------------------------
def ts_number
return @ts_number != nil ? @ts_number : KGC::EEX_TS_NUMBER
end
#--------------------------------------------------------------------------
# ● 二刀流武器?設定
#--------------------------------------------------------------------------
def ts_number=(number)
@ts_number = number
end
#--------------------------------------------------------------------------
# ● ?手持ち?態取得
#--------------------------------------------------------------------------
def two_handed?
return @two_handed
end
#--------------------------------------------------------------------------
# ● ?手持ち設定
#--------------------------------------------------------------------------
def two_handed=(value)
# ?手持ちになった場合
if value && !@two_handed
# 二刀流を解除
self.two_swords = false
# 最初の防具を外す
self.equip(1, 0)
# 最初の防具を固定
@armor_fix[1] = true
# ?手持ちが解除された場合
elsif !value && @two_handed
# 最初の防具固定を解除
@armor_fix[1] = false
end
@two_handed = value
end
#--------------------------------------------------------------------------
# ● 攻?回?取得
#--------------------------------------------------------------------------
def attack_count
@attack_count = 0 if @attack_count == nil
return @attack_count
end
#--------------------------------------------------------------------------
# ● 攻?回?設定
#--------------------------------------------------------------------------
def attack_count=(value)
@attack_count = 0 if @attack_count == nil
@attack_count = value
end
#--------------------------------------------------------------------------
# ● 武器ID の取得
#--------------------------------------------------------------------------
def weapon_id(type = 0)
@weapons[type] = 0 if @weapons[type] == nil
return @weapons[type]
end
#--------------------------------------------------------------------------
# ● 武器ID の設定
#--------------------------------------------------------------------------
def weapon_id=(n)
@weapons[0] = n
end
#--------------------------------------------------------------------------
# ● 武器ID の設定(二刀流用)
#--------------------------------------------------------------------------
def set_weapon(type, n)
@weapons[type] = n
end
#--------------------------------------------------------------------------
# ● 武器リスト取得
#--------------------------------------------------------------------------
def equip_weapon_list
weapons = []
if self.two_swords?
(0...self.ts_number).each { |i|
weapons << $data_weapons[self.weapon_id(i)]
}
else
weapons << $data_weapons[self.weapon_id]
end
return weapons.compact
end
#--------------------------------------------------------------------------
# ● 防具リスト取得
#--------------------------------------------------------------------------
def equip_armor_list
armors = []
(1...self.equip_type.size).each { |i|
armors << $data_armors[self.armor_id[i]]
}
return armors.compact
end
#--------------------------------------------------------------------------
# ● 防具ID の取得
#--------------------------------------------------------------------------
def armor_id
type = self.equip_type.dup
for i in 1...type.size
if @armor_id[i] == nil
@armor_id[i] = 0
end
end
return @armor_id
end
#--------------------------------------------------------------------------
# ● 防具ID 1 の取得(互換用)
#--------------------------------------------------------------------------
def armor1_id
return self.armor_id[1]
end
#--------------------------------------------------------------------------
# ● 防具ID 1 の設定(互換用)
#--------------------------------------------------------------------------
def armor1_id=(id)
@armor_id[1] = id
end
#--------------------------------------------------------------------------
# ● 防具ID 2 の取得(互換用)
#--------------------------------------------------------------------------
def armor2_id
return self.armor_id[2]
end
#--------------------------------------------------------------------------
# ● 防具ID 2 の設定(互換用)
#--------------------------------------------------------------------------
def armor2_id=(id)
@armor_id[2] = id
end
#--------------------------------------------------------------------------
# ● 防具ID 3 の取得(互換用)
#--------------------------------------------------------------------------
def armor3_id
return self.armor_id[3]
end
#--------------------------------------------------------------------------
# ● 防具ID 3 の設定(互換用)
#--------------------------------------------------------------------------
def armor3_id=(id)
@armor_id[3] = id
end
#--------------------------------------------------------------------------
# ● 防具ID 4 の取得(互換用)
#--------------------------------------------------------------------------
def armor4_id
return self.armor_id[4]
end
#--------------------------------------------------------------------------
# ● 防具ID 4 の設定(互換用)
#--------------------------------------------------------------------------
def armor4_id=(id)
@armor_id[4] = id
end
#--------------------------------------------------------------------------
# ● 基本攻?力の取得
#--------------------------------------------------------------------------
def base_atk
if $game_temp.in_battle
if self.two_swords?
weapon = $data_weapons[self.weapon_id(@attack_count)]
n = weapon != nil ? weapon.atk : 0
else
weapon = $data_weapons[self.weapon_id]
n = weapon != nil ? weapon.atk : 0
n *= 1.5 if self.two_handed?
end
else
if self.two_swords?
n = 0
(0...self.ts_number).each { |i|
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.atk : 0
}
else
weapon = $data_weapons[self.weapon_id]
n = weapon != nil ? weapon.atk : 0
n *= 1.5 if self.two_handed?
end
end
return Integer(n)
end
#--------------------------------------------------------------------------
# ● ?性補正値の取得
# element_id : ?性 ID
#--------------------------------------------------------------------------
def element_rate(element_id)
# ?性有?度に??する?値を取得
table = [0,200,150,100,50,0,-100]
result = table[$data_classes[@class_id].element_ranks[element_id]]
# 防具でこの?性が防御されている場合は半減
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
val = self.armor_id[i]
next if val == nil
armor = $data_armors[val]
if armor != nil && armor.guard_element_set.include?(element_id)
result /= 2
end
end
# ステ?トでこの?性が防御されている場合は半減
for i in @states
if $data_states[i].guard_element_set.include?(element_id)
result /= 2
end
end
return result
end
#--------------------------------------------------------------------------
# ● ステ?ト防御判定
# state_id : ステ?ト ID
#--------------------------------------------------------------------------
def state_guard?(state_id)
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
val = self.armor_id[i]
next if val == nil
armor = $data_armors[val]
if armor != nil
if armor.guard_state_set.include?(state_id)
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ● 通常攻?の?性取得
#--------------------------------------------------------------------------
unless $imported["SetAttackElement"]
def element_set
weapons = equip_weapon_list
elements = []
weapons.each { |w|
elements |= w.element_set
}
return elements
end
end
#--------------------------------------------------------------------------
# ● 通常攻?のステ?ト?化 (+) 取得
#--------------------------------------------------------------------------
def plus_state_set
weapons = equip_weapon_list
state_set = []
weapons.each { |w|
state_set |= w.plus_state_set
}
return state_set
end
#--------------------------------------------------------------------------
# ● 通常攻?のステ?ト?化 (-) 取得
#--------------------------------------------------------------------------
def minus_state_set
weapons = equip_weapon_list
state_set = []
weapons.each { |w|
state_set |= w.minus_state_set
}
return state_set
end
#--------------------------------------------------------------------------
# ● ?備品の能力値修正の取得
#--------------------------------------------------------------------------
def equipment_parameter(type)
param = ["maxhp", "maxsp", "str", "dex", "agi", "int"]
n = 0
(equip_weapon_list + equip_armor_list).each { |e|
n += eval("e.#{param[type]}_plus")
}
return n
end
#--------------------------------------------------------------------------
# ● 基本腕力の取得
#--------------------------------------------------------------------------
def base_str
n = $data_actors[@actor_id].parameters[2, @level]
n += equipment_parameter(2)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本器用さの取得
#--------------------------------------------------------------------------
def base_dex
n = $data_actors[@actor_id].parameters[3, @level]
n += equipment_parameter(3)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本素早さの取得
#--------------------------------------------------------------------------
def base_agi
n = $data_actors[@actor_id].parameters[4, @level]
n += equipment_parameter(4)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本魔力の取得
#--------------------------------------------------------------------------
def base_int
n = $data_actors[@actor_id].parameters[5, @level]
n += equipment_parameter(5)
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本物理防御の取得
#--------------------------------------------------------------------------
def base_pdef
n = 0
if self.two_swords?
for i in 0...self.ts_number
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.pdef : 0
end
else
weapon = $data_weapons[self.weapon_id]
n += weapon != nil ? weapon.pdef : 0
end
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
armor = $data_armors[self.armor_id[i]]
n += armor != nil ? armor.pdef : 0
end
return n
end
#--------------------------------------------------------------------------
# ● 基本魔法防御の取得
#--------------------------------------------------------------------------
def base_mdef
n = 0
if self.two_swords?
for i in 0...self.ts_number
weapon = $data_weapons[self.weapon_id(i)]
n += weapon != nil ? weapon.mdef : 0
end
else
weapon = $data_weapons[self.weapon_id]
n += weapon != nil ? weapon.mdef : 0
end
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
armor = $data_armors[self.armor_id[i]]
n += armor != nil ? armor.mdef : 0
end
return n
end
#--------------------------------------------------------------------------
# ● 基本回避修正の取得
#--------------------------------------------------------------------------
def base_eva
n = 0
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
armor = $data_armors[self.armor_id[i]]
n += armor != nil ? armor.eva : 0
end
return n
end
#--------------------------------------------------------------------------
# ● ?備の?更
# equip_type : ?備タイプ
# id : 武器 or 防具 ID (0 なら?備解除)
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when (self.two_swords? ? 0...self.ts_number : 0) # 武器
if id == 0 || $game_party.weapon_number(id) > 0
# EP判定
if KGC::EEX_USE_EP && id > 0
# EP不足の場合は?る
if $data_weapons[id].ep_cost > self.ep
return
end
end
# 二刀流以外で?手持ち武器を?備する場合
if !self.two_swords? && id > 0 &&
$data_weapons[id].element_set.include?($game_special_elements["two_handed"])
# 最初の防具を外す
self.equip(1, 0)
end
$game_party.gain_weapon(self.weapon_id(equip_type), 1)
self.set_weapon(equip_type, id)
$game_party.lose_weapon(id, 1)
end
#when (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
else # 防具
# 二刀流以外で、?手持ち武器を?備しており、最初の防具を?更する場合は?る
if !self.two_swords? && equip_type == 1 && self.weapon_id > 0 &&
$data_weapons[self.weapon_id].element_set.include?($game_special_elements["two_handed"])
return
end
if id == 0 || $game_party.armor_number(id) > 0
# EP判定
if KGC::EEX_USE_EP && id > 0
# EP不足の場合は?る
if $data_armors[id].ep_cost > self.ep
return
end
end
update_auto_state(@armor_id[equip_type] != nil ?
$data_armors[@armor_id[equip_type]] : nil, $data_armors[id])
if @armor_id[equip_type] != nil && @armor_id[equip_type] > 0
$game_party.gain_armor(@armor_id[equip_type], 1)
end
@armor_id[equip_type] = id
$game_party.lose_armor(id, 1)
end
end
end
#--------------------------------------------------------------------------
# ● ?備固定判定
# equip_type : ?備タイプ
#--------------------------------------------------------------------------
def equip_fix?(equip_type)
case equip_type
when (self.two_swords? ? 0...self.ts_number : 0) # 武器
return @weapon_fix[equip_type]
#when (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
else # 防具
return @armor_fix[equip_type]
end
return false
end
#--------------------------------------------------------------------------
# ● 通常攻? 攻?側アニメ?ション ID の取得
#--------------------------------------------------------------------------
def animation1_id
if self.two_swords?
weapon = $data_weapons[self.weapon_id(self.attack_count)]
return weapon != nil ? weapon.animation1_id : 0
else
weapon = $data_weapons[self.weapon_id]
return weapon != nil ? weapon.animation1_id : 0
end
end
#--------------------------------------------------------------------------
# ● 通常攻? ?象側アニメ?ション ID の取得
#--------------------------------------------------------------------------
def animation2_id
if self.two_swords?
weapon = $data_weapons[self.weapon_id(self.attack_count)]
return weapon != nil ? weapon.animation2_id : 0
else
weapon = $data_weapons[self.weapon_id]
return weapon != nil ? weapon.animation2_id : 0
end
end
#--------------------------------------------------------------------------
# ● クラス ID の?更
# class_id : 新しいクラス ID
#--------------------------------------------------------------------------
def class_id=(class_id)
if $data_classes[class_id] != nil
@class_id = class_id
# ?備できなくなったアイテムを外す
if self.two_swords?
for i in 0...self.ts_number
equip(i, 0) unless equippable?($data_weapons[self.weapon_id(i)])
end
else
equip(0, 0) unless equippable?($data_weapons[self.weapon_id])
end
for i in (self.two_swords? ? self.ts_number : 1)...self.equip_type.size
equip(i, 0) unless equippable?($data_armors[self.armor_id[i]])
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipLeft
#============================================================================== unless $imported["EquipAlter"]
class Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias refresh_KGC_EquipExtension refresh
def refresh
# 元の?理を?行
refresh_KGC_EquipExtension if KGC::EEX_USE_EP
if KGC::EEX_DRAW_EP_MAX
self.contents.font.color = system_color
self.contents.draw_text(140, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(172, 0, 24, 32, @actor.ep.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(196, 0, 16, 32, "/", 1)
self.contents.draw_text(212, 0, 24, 32, @actor.max_ep.to_s, 2)
else
self.contents.font.color = system_color
self.contents.draw_text(180, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(212, 0, 24, 32, @actor.ep.to_s, 2)
end
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipRight
#============================================================================== class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# ● タイプの取得
#--------------------------------------------------------------------------
def type
return @equip_type[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# ?備タイプを取得
@actor.equip_type_apply
@equip_type = @actor.equip_type.dup
if @actor.two_swords?
for i in 1...@actor.ts_number
@equip_type[i] = 0
end
end
if self.index >= @equip_type.size
self.index = @equip_type.size - 1
end
# ウィンドウ?容を作成
self.contents.dispose
self.contents = Bitmap.new(width - 32, @equip_type.size * 32)
@data = []
if @actor.two_swords?
for i in 0...@actor.ts_number
@data.push($data_weapons[@actor.weapon_id(i)])
end
for i in @actor.ts_number...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
else
@data.push($data_weapons[@actor.weapon_id])
for i in 1...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
end
@item_max = @data.size
self.contents.font.color = system_color
for i in 0...@equip_type.size
if @actor.two_swords? && i < @actor.ts_number
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[0])
else
next if KGC::EEX_EQUIP_NAME[@actor.equip_type[i]] == nil
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[@actor.equip_type[i]])
end
end
for i in 0...@data.size
self.contents.font.color = normal_color
draw_item_name(@data[i], 92, 32 * i)
if KGC::EEX_USE_EP && @data[i] != nil
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(92, 32 * i, 240, 32, @data[i].ep_cost.to_s, 2)
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipItem
#============================================================================== class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 項目の描?
# index : 項目番?
#--------------------------------------------------------------------------
alias draw_item_KGC_EquipExtension draw_item
def draw_item(index)
# 元の?理を?行
draw_item_KGC_EquipExtension(index) item = @data[index]
if KGC::EEX_USE_EP && item != nil
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(x + 216, y, 24, 32, item.ep_cost.to_s, 2)
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_Status
#============================================================================== class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if $imported["StatusAlter"]
draw_actor_graphic(@actor, 4, 48)
else
draw_actor_graphic(@actor, 40, 112)
end
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 96, 32)
draw_actor_state(@actor, 96, 64)
draw_actor_hp(@actor, 96, 112, 172)
draw_actor_sp(@actor, 96, 144, 172)
draw_actor_parameter(@actor, 96, 192, 0)
draw_actor_parameter(@actor, 96, 224, 1)
draw_actor_parameter(@actor, 96, 256, 2)
draw_actor_parameter(@actor, 96, 304, 3)
draw_actor_parameter(@actor, 96, 336, 4)
draw_actor_parameter(@actor, 96, 368, 5)
draw_actor_parameter(@actor, 96, 400, 6)
self.contents.font.color = system_color
self.contents.draw_text(320, 48, 80, 32, "EXP")
self.contents.draw_text(320, 80, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
if KGC::EEX_USE_EP
self.contents.font.color = system_color
self.contents.draw_text(468, 0, 48, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(516, 0, 32, 32, @actor.ep.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(548, 0, 24, 32, "/", 1)
self.contents.draw_text(572, 0, 32, 32, @actor.max_ep.to_s, 2)
end
self.contents.font.color = system_color
self.contents.draw_text(320, 160, 96, 32, "?備")
if @actor.two_swords?
for i in 0...@actor.ts_number
draw_item_name($data_weapons[@actor.weapon_id(i)], 320 + 16, 192 + 32 * i)
end
for i in @actor.ts_number...@actor.equip_type.size
draw_item_name($data_armors[ @actor.armor_id[i] ], 320 + 16, 192 + 32 * i)
end
else
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 192)
for i in 1...@actor.equip_type.size
draw_item_name($data_armors[ @actor.armor_id[i] ], 320 + 16, 192 + 32 * i)
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_ShopStatus
#============================================================================== class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
unless $imported["LargeParty"]
def refresh
self.contents.clear
if @item == nil
return
end
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
self.contents.font.size = 22
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, "持っている?")
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
return if @item.is_a?(RPG::Item)
self.contents.font.size = 18 if $imported["HelpExtension"]
# ?備品追加情報
for i in 0...$game_party.actors.size
# アクタ?を取得
actor = $game_party.actors[i]
# ?備可能なら通常文字色に、不可能なら無?文字色に設定
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# アクタ?の名前を描?
if $imported["HelpExtension"]
self.contents.draw_text(4, 32 + 44 * i, 120, 32, actor.name)
else
self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
end
# 現在の?備品を取得
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
else
for j in 1...actor.equip_type.size
if actor.equip_type[j] == @item.kind + 1
item1 = $data_armors[actor.armor_id[j]]
break
end
end
end
# ?備可能な場合
if actor.equippable?(@item)
# 武器の場合
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
change = atk2 - atk1
end
# 防具の場合
if @item.is_a?(RPG::Armor)
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef2 = @item != nil ? @item.mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
end
# パラメ?タの?化値を描?
if $imported["HelpExtension"]
self.contents.draw_text(124, 32 + 44 * i, 112, 32,
sprintf("%+d", change), 2)
else
self.contents.draw_text(124, 64 + 64 * i, 112, 32,
sprintf("%+d", change), 2)
end
end
# アイテムを描?
if item1 != nil
x = 4
if $imported["HelpExtension"]
y = 32 + 44 * i + 22
else
y = 64 + 64 * i + 32
end
icon = RPG::Cache.icon(item1.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, icon, icon.rect, opacity)
self.contents.draw_text(x + 28, y, 212, 32, item1.name)
end
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendControl
#------------------------------------------------------------------------------
# ?備?面で、操作を選?するウィンドウです。
#============================================================================== class Window_EquipExtendControl < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = [KGC::EEX_EQUIP_EX_COMMAND_EQUIP, KGC::EEX_EQUIP_EX_COMMAND_STRONGEST_EQUIP, KGC::EEX_EQUIP_EX_COMMAND_ALL_RELEASE]
@item_max = @commands.size
@column_max = @commands.size
@item_width = (width - 32) / @commands.size
self.z = 1000
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
for i in 0...@commands.size
rect = Rect.new(@item_width * i, 0, @item_width, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = system_color
self.contents.draw_text(rect, @commands[i], 1)
end
end
#--------------------------------------------------------------------------
# ● カ?ソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if index != -1
self.cursor_rect.set(@item_width * index, 0, @item_width, 32)
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
case self.index
when 0
@help_window.set_text(KGC::EEX_EQUIP_EX_HELP_EQUIP)
when 1
@help_window.set_text(KGC::EEX_EQUIP_EX_HELP_STRONGEST_EQUIP)
when 2
@help_window.set_text(KGC::EEX_EQUIP_EX_HELP_ALL_RELEASE)
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendStatus
#------------------------------------------------------------------------------
# ?張?備?面で、アクタ?のパラメ?タ?化を表示するウィンドウです。
#============================================================================== class Window_EquipExtendStatus < Window_EquipLeft
#--------------------------------------------------------------------------
# ● 公開インスタンス??
#--------------------------------------------------------------------------
attr_accessor :new_equip # 選?中の?備品
attr_accessor :last_str # ?更前の腕力
attr_accessor :last_dex # ?更前の器用さ
attr_accessor :last_agi # ?更前の素早さ
attr_accessor :last_int # ?更前の魔力
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(actor)
super(actor)
self.back_opacity = 160 if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
self.x = 368
self.y = 288
self.z = 1000
# 初期能力値を保存
@new_equip = nil
@last_equip = nil
@last_str = @actor.str
@last_dex = @actor.dex
@last_agi = @actor.agi
@last_int = @actor.int
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
if KGC::EEX_USE_EP
if KGC::EEX_DRAW_EP_MAX
self.contents.font.color = system_color
self.contents.draw_text(140, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(172, 0, 24, 32, @actor.ep.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(196, 0, 16, 32, "/", 1)
self.contents.draw_text(212, 0, 24, 32, @actor.max_ep.to_s, 2)
else
self.contents.font.color = system_color
self.contents.draw_text(180, 0, 32, 32, KGC::EEX_EP_NAME)
self.contents.font.color = @actor.ep == 0 ? knockout_color : normal_color
self.contents.draw_text(212, 0, 24, 32, @actor.ep.to_s, 2)
end
end
self.contents.font.color = system_color
self.contents.draw_text(4, 64, 72, 32, $data_system.words.atk)
self.contents.draw_text(4, 96, 72, 32, $data_system.words.pdef)
self.contents.draw_text(4, 128, 72, 32, $data_system.words.mdef)
self.contents.draw_text(120, 32, 72, 32, $data_system.words.str)
self.contents.draw_text(120, 64, 72, 32, $data_system.words.dex)
self.contents.draw_text(120, 96, 72, 32, $data_system.words.agi)
self.contents.draw_text(120, 128, 72, 32, $data_system.words.int) if @new_atk != nil
self.contents.font.color = @actor.atk > @new_atk ? text_color(2) :
@actor.atk < @new_atk ? text_color(3) : normal_color
self.contents.draw_text(80, 64, 36, 32, @new_atk.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(80, 64, 36, 32, @actor.atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = @actor.pdef > @new_pdef ? text_color(2) :
@actor.pdef < @new_pdef ? text_color(3) : normal_color
self.contents.draw_text(80, 96, 36, 32, @new_pdef.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(80, 96, 36, 32, @actor.pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = @actor.mdef > @new_mdef ? text_color(2) :
@actor.mdef < @new_mdef ? text_color(3) : normal_color
self.contents.draw_text(80, 128, 36, 32, @new_mdef.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(80, 128, 36, 32, @actor.mdef.to_s, 2)
end
if @new_str != nil
self.contents.font.color = @last_str > @new_str ? text_color(2) :
@last_str < @new_str ? text_color(3) : normal_color
self.contents.draw_text(200, 32, 36, 32, @new_str.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 32, 36, 32, @actor.str.to_s, 2)
end
if @new_dex != nil
self.contents.font.color = @last_dex > @new_dex ? text_color(2) :
@last_dex < @new_dex ? text_color(3) : normal_color
self.contents.draw_text(200, 64, 36, 32, @new_dex.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 64, 36, 32, @actor.dex.to_s, 2)
end
if @new_agi != nil
self.contents.font.color = @last_agi > @new_agi ? text_color(2) :
@last_agi < @new_agi ? text_color(3) : normal_color
self.contents.draw_text(200, 96, 36, 32, @new_agi.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 96, 36, 32, @actor.agi.to_s, 2)
end
if @new_int != nil
self.contents.font.color = @last_int > @new_int ? text_color(2) :
@last_int < @new_int ? text_color(3) : normal_color
self.contents.draw_text(200, 128, 36, 32, @new_int.to_s, 2)
else
self.contents.font.color = normal_color
self.contents.draw_text(200, 128, 36, 32, @actor.int.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ● ?備?更後のパラメ?タ設定
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_st = [nil, nil, nil, nil])
if @new_atk != new_atk || @new_pdef != new_pdef || @new_mdef != new_mdef ||
@new_str != new_st[0] || @new_dex != new_st[1] ||
@new_agi != new_st[2] || @new_int != new_st[3]
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_st[0]
@new_dex = new_st[1]
@new_agi = new_st[2]
@new_int = new_st[3]
@last_equip = @new_equip
refresh
return
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendList
#------------------------------------------------------------------------------
# ?張?備?面で、アクタ?が現在?備しているアイテムを表示するウィンドウです。
#============================================================================== class Window_EquipExtendList < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクタ?
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 368, 416)
if $imported["HelpExtension"]
self.y = 128
self.height = 352
end
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160 if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
self.active = false
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● タイプの取得
#--------------------------------------------------------------------------
def type
return @equip_type[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# ?備タイプを取得
@actor.equip_type_apply
@equip_type = @actor.equip_type.dup
if @actor.two_swords?
for i in 1...@actor.ts_number
@equip_type[i] = 0
end
end
if self.index >= @equip_type.size
self.index = @equip_type.size - 1
end
# アイテムを追加
@data = []
if @actor.two_swords?
for i in 0...@actor.ts_number
@data.push($data_weapons[@actor.weapon_id(i)])
end
for i in @actor.ts_number...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
else
@data.push($data_weapons[@actor.weapon_id])
for i in 1...@equip_type.size
@data.push($data_armors[@actor.armor_id[i]])
end
end
@equip_type = @equip_type[KGC::EEX_EQUIP_EX_INDEX...@equip_type.size]
@data = @data[KGC::EEX_EQUIP_EX_INDEX...@data.size]
@item_max = @data.size
# ウィンドウ?容を作成
self.contents.dispose
self.contents = Bitmap.new(width - 32, @equip_type.size * 32)
self.contents.font.color = system_color
for i in 0...@equip_type.size
if @equip_type[i] == 0 && @actor.two_swords? && i < @actor.ts_number
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[0])
else
next if KGC::EEX_EQUIP_NAME[@equip_type[i]] == nil
self.contents.draw_text(4, 32 * i, 92, 32, KGC::EEX_EQUIP_NAME[@equip_type[i]])
end
end
for i in 0...@data.size
self.contents.font.color = normal_color
draw_item_name(@data[i], 92, 32 * i)
if KGC::EEX_USE_EP && @data[i] != nil
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(92, 32 * i, 240, 32, @data[i].ep_cost.to_s, 2)
end
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Window_EquipExtendItem
#------------------------------------------------------------------------------
# ?張?備?面で、?備?更の候補となるアイテムの一?を表示するウィンドウです。
#============================================================================== class Window_EquipExtendItem < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクタ?
# equip_type : ?備部位 (0~3)
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(368, 64, 320, 416)
if $imported["HelpExtension"]
self.y = 128
self.height = 352
end
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
self.back_opacity = 160 if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
end
#--------------------------------------------------------------------------
# ● アイテムの取得
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# ?備可能な武器を追加
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 && weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
# ?備可能な防具を追加
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 && armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
# 空白を追加
@data.push(nil)
# ビットマップを作成し、全項目を描?
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
#--------------------------------------------------------------------------
# ● 項目の描?
# index : 項目番?
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
y = index * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
icon = RPG::Cache.icon(item.icon_name)
self.contents.blt(0, y + 4, icon, icon.rect)
self.contents.font.color = normal_color
self.contents.draw_text(32, y, 212, 32, item.name, 0)
self.contents.draw_text(244, y, 16, 32, ":", 1)
self.contents.draw_text(260, y, 24, 32, number.to_s, 2)
if KGC::EEX_USE_EP && item != nil
self.contents.font.color = KGC::EEX_EP_COLOR
self.contents.draw_text(220, y, 24, 32, item.ep_cost.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Interpreter (分割定義 3)
#============================================================================== class Interpreter
#--------------------------------------------------------------------------
# ● ?件分岐
#--------------------------------------------------------------------------
def command_111
# ロ?カル?? result を初期化
result = false
# ?件判定
case @parameters[0]
when 0 # スイッチ
result = ($game_switches[@parameters[1]] == (@parameters[2] == 0))
when 1 # ??
value1 = $game_variables[@parameters[1]]
if @parameters[2] == 0
value2 = @parameters[3]
else
value2 = $game_variables[@parameters[3]]
end
case @parameters[4]
when 0 # と同値
result = (value1 == value2)
when 1 # 以上
result = (value1 >= value2)
when 2 # 以下
result = (value1 <= value2)
when 3 # 超
result = (value1 > value2)
when 4 # 未?
result = (value1 < value2)
when 5 # 以外
result = (value1 != value2)
end
when 2 # セルフスイッチ
if @event_id > 0
key = [$game_map.map_id, @event_id, @parameters[1]]
if @parameters[2] == 0
result = ($game_self_switches[key] == true)
else
result = ($game_self_switches[key] != true)
end
end
when 3 # タイマ?
if $game_system.timer_working
sec = $game_system.timer / Graphics.frame_rate
if @parameters[2] == 0
result = (sec >= @parameters[1])
else
result = (sec <= @parameters[1])
end
end
when 4 # アクタ?
actor = $game_actors[@parameters[1]]
if actor != nil
case @parameters[2]
when 0 # パ?ティにいる
result = ($game_party.actors.include?(actor))
when 1 # 名前
result = (actor.name == @parameters[3])
when 2 # スキル
result = (actor.skill_learn?(@parameters[3]))
when 3 # 武器
if actor.two_swords?
result = false
for i in 0...actor.ts_number
if actor.weapon_id(i) == @parameters[3]
result = true
break
end
end
else
result = (actor.weapon_id == @parameters[3])
end
when 4 # 防具
result = false
for i in 1...actor.equip_type.size
if actor.armor_id[i] == @parameters[3]
result = true
break
end
end
when 5 # ステ?ト
result = (actor.state?(@parameters[3]))
end
end
when 5 # エネミ?
enemy = $game_troop.enemies[@parameters[1]]
if enemy != nil
case @parameters[2]
when 0 # 出現している
result = (enemy.exist?)
when 1 # ステ?ト
result = (enemy.state?(@parameters[3]))
end
end
when 6 # キャラクタ?
character = get_character(@parameters[1])
if character != nil
result = (character.direction == @parameters[2])
end
when 7 # ゴ?ルド
if @parameters[2] == 0
result = ($game_party.gold >= @parameters[1])
else
result = ($game_party.gold <= @parameters[1])
end
when 8 # アイテム
result = ($game_party.item_number(@parameters[1]) > 0)
when 9 # 武器
result = ($game_party.weapon_number(@parameters[1]) > 0)
when 10 # 防具
result = ($game_party.armor_number(@parameters[1]) > 0)
when 11 # ボタン
result = (Input.press?(@parameters[1]))
when 12 # スクリプト
result = eval(@parameters[1])
end
# 判定結果をハッシュに格納
@branch[@list[@index].indent] = result
# 判定結果が?だった場合
if @branch[@list[@index].indent] == true
# 分岐デ?タを削除
@branch.delete(@list[@index].indent)
# ??
return true
end
# ?件に該?しない場合 : コマンドスキップ
return command_skip
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_Equip
#============================================================================== class Scene_Equip
#--------------------------------------------------------------------------
# ● メイン?理
#--------------------------------------------------------------------------
alias main_KGC_EquipExtension main
def main
# アクタ?を取得
@actor = $game_party.actors[@actor_index]
# アイテムウィンドウを作成
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6} = Window_EquipItem.new(@actor, i + 5)")
if $imported["MenuAlter"] && KGC::MA_MENU_TRANSPARENT
eval("@item_window#{i + 6}.back_opacity = 160")
end
end
end main_KGC_EquipExtension # アイテムウィンドウを解放
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.dispose if @item_window#{i + 6} != nil")
end
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# ヘルプウィンドウを設定
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.help_window = @help_window")
end
end
# アイテムウィンドウの可視?態設定
@item_window1.visible = (@right_window.type == 0)
@item_window2.visible = (@right_window.type == 1)
@item_window3.visible = (@right_window.type == 2)
@item_window4.visible = (@right_window.type == 3)
@item_window5.visible = (@right_window.type == 4)
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.visible = (@right_window.type == i + 5)")
end
end
# 現在?備中のアイテムを取得
item1 = @right_window.item
# 現在のアイテムウィンドウを @item_window に設定
eval("@item_window = @item_window#{@right_window.type + 1}")
# ライトウィンドウがアクティブの場合
if @right_window.active
# ?備?更後のパラメ?タを消去
@left_window.set_new_parameters(nil, nil, nil)
end
# アイテムウィンドウがアクティブの場合
if @item_window.active
# 現在選?中のアイテムを取得
item2 = @item_window.item
# ?備を?更
last_hp = @actor.hp
last_sp = @actor.sp
if @actor.two_swords?
case @right_window.index
when 0...@actor.ts_number # 武器
@actor.set_weapon(@right_window.index, item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item2 == nil ? 0 : item2.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
else
case @right_window.index
when 0 # 武器
@actor.weapon_id = (item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item2 == nil ? 0 : item2.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
end
# ?備?更後のパラメ?タを取得
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
if $imported["EquipAlter"]
new_st = [@actor.str, @actor.dex, @actor.agi, @actor.int]
end
# ?備を?す
if @actor.two_swords?
case @right_window.index
when 0...@actor.ts_number # 武器
@actor.set_weapon(@right_window.index, item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item1 == nil ? 0 : item1.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
else
case @right_window.index
when 0 # 武器
@actor.weapon_id = (item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[@right_window.index] = (item1 == nil ? 0 : item1.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
end
@actor.hp = last_hp
@actor.sp = last_sp
# レフトウィンドウに描?
if $imported["EquipAlter"]
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_st)
else
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (アイテムウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
unless $imported["EquipAlter"]
alias update_item_KGC_EquipExtension update_item
def update_item
# C ボタンが押された場合
if Input.trigger?(Input::C)
# アイテムウィンドウで現在選?されているデ?タを取得
item = @item_window.item
if KGC::EEX_USE_EP
# EP判定
if item != nil && item.ep_cost > @actor.ep
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
end
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備を?更
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
# オ?トステ?トを更新
if $imported["EquipDetailSetting"]
if @actor.two_swords?
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id(@right_window.index)], true)
else
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id], true)
end
end
for i in 1...@actor.equip_type.size
@actor.update_auto_state(nil, $data_armors[@actor.armor_id[i]])
end
# 初期能力を更新
if $imported["EquipAlter"]
@left_window.last_str = @actor.str
@left_window.last_dex = @actor.dex
@left_window.last_agi = @actor.agi
@left_window.last_int = @actor.int
end
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# レフトウィンドウを初期化
@left_window.new_equip = nil if $imported["EquipAlter"]
@left_window.set_new_parameters(nil, nil, nil)
# ライトウィンドウ、アイテムウィンドウの?容を再作成
@right_window.refresh
for i in 1..(KGC::EEX_EQUIP_TYPE_EXT.size + 5)
eval("@item_window#{i}.refresh")
end
return
end update_item_KGC_EquipExtension
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_Battle (分割定義 1)
#============================================================================== class Scene_Battle
#--------------------------------------------------------------------------
# ● メイン?理
#--------------------------------------------------------------------------
alias main_KGC_EquipExtension main
def main
# 攻?回?を初期化
for actor in $game_party.actors
actor.attack_count = 0
end main_KGC_EquipExtension
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_Battle (分割定義 4)
#============================================================================== class Scene_Battle
#--------------------------------------------------------------------------
# ● フレ?ム更新 (メインフェ?ズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_KGC_EquipExtension update_phase4_step6
def update_phase4_step6
update_phase4_step6_KGC_EquipExtension # 二刀流?通常攻?の場合
if @active_battler.is_a?(Game_Actor) && @active_battler.two_swords? &&
@active_battler.current_action.kind == 0 && @active_battler.current_action.basic == 0
# 攻?回?加算
loop {
@active_battler.attack_count += 1
if @active_battler.attack_count == @active_battler.ts_number ||
@active_battler.weapon_id(@active_battler.attack_count) > 0
break
end
}
# 規定回?行動した場合
if @active_battler.attack_count == @active_battler.ts_number
# 攻?回?を初期化
@active_battler.attack_count = 0
else
# ????の場合
unless judge
# 攻??象が死んでいる場合は再設定
if @target_battlers[0].dead?
if @active_battler.restriction == 3
@target_battlers[0] = $game_party.random_target_actor
else
@target_battlers[0] = $game_troop.random_target_enemy
end
end
if $imported["ActiveCountBattle"]
@action_battlers.insert(0, @active_battler)
else
# ステップ 2 に移行
@phase4_step = 2
end
end
end
else
if @active_battler.is_a?(Game_Actor)
# 攻?回?を初期化
@active_battler.attack_count = 0
end
end
end
end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #==============================================================================
# ■ Scene_EquipExtend
#------------------------------------------------------------------------------
# ?張?備?面の?理を行うクラスです。
#============================================================================== class Scene_EquipExtend
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_index : アクタ?インデックス
# equip_index : ?備インデックス
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0, call_menu = false)
@actor_index = actor_index
@equip_index = equip_index
@call_menu = call_menu
end
#--------------------------------------------------------------------------
# ● メイン?理
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
@spriteset = Spriteset_Map.new if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
# ウィンドウを作成
if $imported["HelpExtension"]
@help_window = Window_HelpExtension.new
else
@help_window = Window_Help.new
end
@control_window = Window_EquipExtendControl.new
@control_window.y = 64 if $imported["HelpExtension"]
@status_window = Window_EquipExtendStatus.new(@actor)
@list_window = Window_EquipExtendList.new(@actor)
@item_window1 = Window_EquipExtendItem.new(@actor, 0)
@item_window2 = Window_EquipExtendItem.new(@actor, 1)
@item_window3 = Window_EquipExtendItem.new(@actor, 2)
@item_window4 = Window_EquipExtendItem.new(@actor, 3)
@item_window5 = Window_EquipExtendItem.new(@actor, 4)
# ヘルプウィンドウを?連付け
@control_window.help_window = @help_window
@list_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
# ?張アイテムウィンドウを作成
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6} = Window_EquipExtendItem.new(@actor, i + 5)")
eval("@item_window#{i + 6}.help_window = @help_window")
if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
eval("@item_window#{i + 6}.back_opacity = 160")
end
end
end
if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
@help_window.back_opacity = 160
@control_window.back_opacity = 160
end
# カ?ソル位置を設定
@list_window.index = @equip_index
@effect_type = 0
refresh
# トランジション?行
Graphics.transition
# メインル?プ
loop {
Graphics.update
Input.update
update
if $scene != self
break
end
}
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@help_window.dispose
@control_window.dispose
@status_window.dispose
@list_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.dispose if @item_window#{i + 6} != nil")
end
end
@spriteset.dispose if KGC::EEX_EQUIP_EX_BACK_TRANSPARENT
end
#--------------------------------------------------------------------------
# ● フレ?ム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@status_window.update
@list_window.update
@item_window.update
@control_window.update
refresh
update_effect(@effect_type)
# 操作ウィンドウがアクティブの場合: update_control を呼ぶ
if @control_window.active
@effect_type = 0
update_control
return
end
# リストウィンドウがアクティブの場合: update_list を呼ぶ
if @list_window.active
@effect_type = 1
update_list
return
end
# アイテムウィンドウがアクティブの場合: update_item を呼ぶ
if @item_window.active
@effect_type = 2
update_item
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (エフェクト)
#--------------------------------------------------------------------------
def update_effect(type)
case type
when 1
@last_index = -1
@status_window.x = [@status_window.x + 48, 368].min
@status_window.y = [@status_window.y + 24, 288].min
@list_window.x = [@list_window.x + 8, 0].min
@item_window.x = [@item_window.x + 8, 368].min
when 2
if @last_index != @list_window.index
pos = @list_window.index - @list_window.top_row
center = (@list_window.height - 32) / 64
@status_y = pos >= center ? @list_window.y : 288
@last_index = @list_window.index
end
@status_window.x = [@status_window.x - 48, 0].max
if @status_y > @status_window.y
@status_window.y = [@status_window.y + 24, @status_y].min
elsif @status_y < @status_window.y
@status_window.y = [@status_window.y - 24, @status_y].max
end
@list_window.x = [@list_window.x - 8, -48].max
@item_window.x = [@item_window.x - 8, 320].max
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (操作ウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_control
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
if @call_menu
# メニュ??面に切り替え
if $imported["MenuAlter"]
index = KGC::MA_COMMANDS.index(2)
if index != nil
$scene = Scene_Menu.new(index)
else
$scene = Scene_Menu.new
end
else
$scene = Scene_Menu.new(3)
end
else
# マップ?面に切り替え
$scene = Scene_Map.new
end
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# カ?ソル位置で分岐
case @control_window.index
when 0 # ?備?更
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# リストウィンドウに切り替え
@list_window.active = true
@list_window.index = 0 if @list_window.index == -1
@control_window.active = false
@control_window.visible = false
when 1 # 最??備
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備最大?を取得
if $imported["EquipExtension"]
mx = @actor.equip_type.size
else
mx = 5
end
for i in KGC::EEX_EQUIP_EX_INDEX...mx
# ?備固定の場合は次へ
next if @actor.equip_fix?(i)
# ?備の種類で分岐
tw = $imported["EquipExtension"] && @actor.two_swords?
case i
when (tw ? 0...@actor.ts_number : 0) # 武器
# 最?武器?備
equip_strongest_weapon(i)
when (tw ? @actor.ts_number : 1)...mx # 防具
# 最?防具?備
equip_strongest_armor(@actor.equip_type[i], i)
end
end
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# レフトウィンドウを初期化
@status_window.set_new_parameters(nil, nil, nil)
# ウィンドウをリフレッシュ
refresh_window
when 2 # 全解除
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備最大?を取得
if $imported["EquipExtension"]
mx = @actor.equip_type.size
else
mx = 5
end
(KGC::EEX_EQUIP_EX_INDEX...mx).each { |i|
# ?備固定でない場合は解除
@actor.equip(i, 0) unless @actor.equip_fix?(i)
}
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# ステ?タスウィンドウを初期化
@status_window.set_new_parameters(nil, nil, nil)
# ウィンドウをリフレッシュ
refresh_window
end
return
end
# R ボタンが押された場合
if Input.trigger?(Input::R)
# カ?ソル SE を演奏
$game_system.se_play($data_system.cursor_se)
# 次のアクタ?へ
@actor_index += 1
@actor_index %= $game_party.actors.size
# 別の?備?面に切り替え
$scene = Scene_EquipExtend.new(@actor_index, 0, @call_menu)
return
end
# L ボタンが押された場合
if Input.trigger?(Input::L)
# カ?ソル SE を演奏
$game_system.se_play($data_system.cursor_se)
# 前のアクタ?へ
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# 別の?備?面に切り替え
$scene = Scene_EquipExtend.new(@actor_index, 0, @call_menu)
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (リストウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_list
# A ボタンが押された場合
if Input.trigger?(Input::A)
index = @list_window.index + KGC::EEX_EQUIP_EX_INDEX
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備を外す
@actor.equip(index, 0)
# ウィンドウリフレッシュ
refresh_window
return
end
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# 操作ウィンドウに切り替え
@list_window.active = false
@control_window.active = true
@control_window.visible = true
# リフレッシュ
refresh
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# ?備固定の場合
if @actor.equip_fix?(@list_window.index + KGC::EEX_EQUIP_EX_INDEX)
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# アイテムウィンドウをアクティブ化
@list_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (アイテムウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_item
# 選?中の?備品を更新
@status_window.new_equip = @item_window.item
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# ステ?タスウィンドウを初期化
@status_window.new_equip = nil
@status_window.set_new_parameters(nil, nil, nil)
# リストウィンドウをアクティブ化
@list_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# アイテムウィンドウで現在選?されているデ?タを取得
item = @item_window.item
index = @list_window.index + KGC::EEX_EQUIP_EX_INDEX
if $imported["EquipExtension"] && KGC::EEX_USE_EP
# EP判定
if item != nil && item.ep_cost > @actor.ep
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
end
# ?備 SE を演奏
$game_system.se_play($data_system.equip_se)
# ?備を?更
@actor.equip(index, item == nil ? 0 : item.id)
# オ?トステ?トを更新
if $imported["EquipDetailSetting"]
if $imported["EquipExtension"] && @actor.two_swords?
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id(index)], true)
else
@actor.update_auto_state(nil, $data_weapons[@actor.weapon_id], true)
end
end
if $imported["EquipExtension"]
for i in (@actor.two_swords? ? @actor.ts_number : 1)...@actor.equip_type.size
@actor.update_auto_state(nil, $data_armors[@actor.armor_id[i]])
end
else
for i in 1..4
@actor.update_auto_state(nil, $data_armors[eval("@actor.armor#{i}_id")])
end
end
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# リストウィンドウをアクティブ化
@list_window.active = true
@item_window.active = false
@item_window.index = -1
# ステ?タスウィンドウを初期化
@status_window.new_equip = nil
@status_window.set_new_parameters(nil, nil, nil)
# ウィンドウの?容を再作成
refresh_window
return
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# アイテムウィンドウの可視?態設定
@item_window1.visible = (@list_window.type == 0)
@item_window2.visible = (@list_window.type == 1)
@item_window3.visible = (@list_window.type == 2)
@item_window4.visible = (@list_window.type == 3)
@item_window5.visible = (@list_window.type == 4)
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.visible = (@list_window.type == i + 5)")
end
end
# 現在?備中のアイテムを取得
item1 = @list_window.item
# 現在のアイテムウィンドウを @item_window に設定
eval("@item_window = @item_window#{@list_window.type + 1}")
# リストウィンドウがアクティブの場合
if @list_window.active
# ?備?更後のパラメ?タを消去
@status_window.set_new_parameters(nil, nil, nil)
end
# アイテムウィンドウがアクティブの場合
if @item_window.active
# 現在選?中のアイテムを取得
item2 = @item_window.item
index = @list_window.index + KGC::EEX_EQUIP_EX_INDEX
# ?備を?更
last_hp = @actor.hp
last_sp = @actor.sp
if @actor.two_swords?
case index
when 0...@actor.ts_number # 武器
@actor.set_weapon(index, item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item2 == nil ? 0 : item2.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
else
case index
when 0 # 武器
@actor.weapon_id = (item2 == nil ? 0 : item2.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item1, item2, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item2 == nil ? 0 : item2.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item1, item2)
end
end
end
# ?備?更後のパラメ?タを取得
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
if $imported["EquipAlter"]
new_st = [@actor.str, @actor.dex, @actor.agi, @actor.int]
end
# ?備を?す
if @actor.two_swords?
case index
when 0...@actor.ts_number # 武器
@actor.set_weapon(index, item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when @actor.ts_number...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item1 == nil ? 0 : item1.id)
for i in @actor.ts_number...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
else
case index
when 0 # 武器
@actor.weapon_id = (item1 == nil ? 0 : item1.id)
if $imported["EquipDetailSetting"]
@actor.update_auto_state(item2, item1, true)
end
when 1...@actor.equip_type.size # 防具
@actor.armor_id[index] = (item1 == nil ? 0 : item1.id)
for i in 1...@actor.equip_type.size
@actor.update_auto_state(item2, item1)
end
end
end
@actor.hp = last_hp
@actor.sp = last_sp
# ステ?タスウィンドウに描?
if $imported["EquipAlter"]
@status_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_st)
else
@status_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
end
#--------------------------------------------------------------------------
# ● ウィンドウをリフレッシュ
#--------------------------------------------------------------------------
def refresh_window
# 初期能力を更新
@status_window.last_str = @actor.str
@status_window.last_dex = @actor.dex
@status_window.last_agi = @actor.agi
@status_window.last_int = @actor.int
# リフレッシュ
@status_window.refresh
@list_window.refresh
@item_window1.refresh
@item_window2.refresh
@item_window3.refresh
@item_window4.refresh
@item_window5.refresh
if KGC::EEX_EQUIP_TYPE_EXT.size > 0
for i in 0...KGC::EEX_EQUIP_TYPE_EXT.size
eval("@item_window#{i + 6}.refresh")
end
end
end
#--------------------------------------------------------------------------
# ● 最?武器?備
#--------------------------------------------------------------------------
def equip_strongest_weapon(type)
# 武器リストを初期化
weapons = []
# ?備可能な武器を追加
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 && weapon_set.include?(i)
weapons.push($data_weapons[i])
end
end
# ?備可能な武器が無い場合は?る
return if weapons == []
# 武器リストを逆順(IDの大きい順)に?べ替え
weapons = weapons.reverse
# 最?武器を初期化
strongest_weapon = weapons[0]
# 最?武器を取得(攻?力で判定)
for weapon in weapons
strongest_weapon = weapon if strongest_weapon.atk < weapon.atk
end
# 現在の?備を取得
now_weapon = $data_weapons[
$imported["EquipExtension"] && @actor.two_swords? ?
@actor.weapon_id(type) : @actor.weapon_id]
# 何も?備していない場合
if now_weapon == nil
# ?備を?更
@actor.equip(type, strongest_weapon.id)
# 現在の?備より?い場合
elsif strongest_weapon.atk > now_weapon.atk
# ?備を?更
@actor.equip(type, strongest_weapon.id)
end
end
#--------------------------------------------------------------------------
# ● 最?防具?備
# type : 防具の種類
# index : ?備箇所
#--------------------------------------------------------------------------
def equip_strongest_armor(type, index)
# 除外?備の場合は?る
return if KGC::EEX_IGNORE_STRONGEST_TYPE.include?(type)
# 防具リストを初期化
armors = []
# ?備可能な防具を追加
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 && armor_set.include?(i)
if $data_armors[i].kind == type - 1
armors.push($data_armors[i])
end
end
end
# ?備可能な防具が無い場合は?る
return if armors == []
# 防具リストを逆順(IDの大きい順)に?べ替え
armors = armors.reverse
# 最?防具を初期化
strongest_armor = armors[0]
# 最?防具を取得(物理防御で判定)
for armor in armors
strongest_armor = armor if strongest_armor.pdef < armor.pdef
end
# 現在の?備を取得
now_armor = $data_armors[$imported["EquipExtension"] ?
@actor.armor_id[index] : eval("@actor.armor#{index}_id")]
# 何も?備していない場合
if now_armor == nil
# ?備を?更
@actor.equip(index, strongest_armor.id)
# 現在の?備より?い場合
elsif strongest_armor.pdef > now_armor.pdef
# ?備を?更
@actor.equip(index, strongest_armor.id)
end
end
end