#============================================================================== # ■装備拡張セカンド for RGSS3 Ver1.01-β # □作成者 kure # # 呼び出し方法  SceneManager.call(Scene_Equip) # # 更新用覚書 # プロセスによる表示内容 # 1 通常装備選択 # 2 アイテムグループ表示(装備品個別管理専用) # 3 装備候補リスト # 4 装備候補リスト(装備品個別管理専用) # 5 スロット用装備選択(装備品個別管理専用) # 6 選択した装備のスロットリスト(装備品個別管理専用) # 7 スロット用アイテムグループ表示(装備品個別管理専用) # 8 スロット用装備候補リスト(装備品個別管理専用) #============================================================================== $kure_integrate_script = {} if $kure_integrate_script == nil $kure_integrate_script[:ExEquip] = 3017 p "装備拡張" #-------------------------------------------------------------------------- # ★ 設定項目(各設定の値を変更してください) #-------------------------------------------------------------------------- module KURE module ExEquip #初期設定(変更しないこと)----------------------------------------------------- EQUIP_SLOT_NAME = [] ; Vocab_Ex1 = [] #戦闘中挙動------------------------------------------------------------------- #戦闘中の装備変更許可を設定(0=常時不可 1=条件付き可能 2=常時可能) BATTLE_PERMIT = 2 #戦闘中装備変更許可スイッチ(スイッチ番号を指定、0を入れない事) BATTLE_PERMIT_SWITH = 1 #画面の表示設定----------------------------------------------------------- #AP情報ウィンドウ(0=表示しない 1=表示する) AP_VIEWER = 1 #用語の表示名 Vocab_ClearEquip = "装備解除" #装備解除 #使用しない場合空白に設定の事 Vocab_EquipType = "装備タイプ" #装備タイプ Vocab_Weight = "重量 / 補正" #重量 / 補正 Vocab_EquipExp = "装備Exp" #装備経験値 Vocab_Durable = "耐久値" #耐久値 Vocab_Slot = "スロット" #スロット名(装備品個別管理) Vocab_SlotList = "装備スロットリスト" #装備スロットリスト Vocab_Symbollist = "装備シンボルリスト" #装備シンボルリスト Vocab_level_err = "要求Lv未達成" #要求Lv未達成 Vocab_weight_err = "重量超過" #重量超過 Vocab_memorize_err = "メモライズ超過" #メモライズ超過 Vocab_param_err = "要求パラメータ不足" #要求パラメータ不足 Vocab_cond_err = "装備条件未達成" #装備条件未達成 Vocab_clear_err = "装備解除不可" #装備解除不可 Vocab_count_err = "同時装備数超過" #同時装備数超過 #装備スロットの設定---------------------------------------------------- #装備スロットを設定 EQUIP_SLOT = [0,1,2,2,2,2] #通常のスロット EQUIP_SLOT_DUAL = [0,0,2,2,2,2] #二刀流のスロット #空スロット禁止スロット FILL_SLOT = [] #装備スロット表示名を設定(EQUIP_SLOT_NAME[ID] = "表示名" #スロットID 0〜4はシステムより予約されています EQUIP_SLOT_NAME[5] = "スロット5" EQUIP_SLOT_NAME[6] = "スロット6" #ステータス欄の表示設定------------------------------------------------------- #基本パラメータの表示 VIEW_PARAM = [0,1,2,3,4,5,6,7] #ステータスの表示名 Vocab_Ex1[0] = "命中率" #命中率 Vocab_Ex1[1] = "回避率" #回避率 Vocab_Ex1[2] = "会心率" #会心率 #システム関連設定------------------------------------------------------------- #装備重量システムを利用する(0=利用しない 1=利用する) USE_WEIGHT_SYSTEM = 1 #基礎最大重量(全てのアクターが最低限もてる重量を設定します) MAX_WEIGHT_BASE = 100 #レベル補正(レベルが上がるごとに増える最大重量を設定します) MAX_WEIGHT_Lv = 20 #装備重量の名称 WEIGHT_NAME = "WT" #重量0のアイテムの重量表示(0=表示する 1=表示しない) WEIGHT_0_ITEM = 0 #装備レベルシステムを利用する(0=利用しない 1=利用する) USE_EQUIPLV_SYSTEM = 1 #装備ステータスシステムを利用する(0=利用しない 1=利用する) USE_EQUIPSTATUS_SYSTEM = 1 #装備要求変数システムを利用する(0=利用しない 1=利用する) USE_EQUIPVAL_SYSTEM = 1 #同時装備数判定を利用する(0=利用しない 1=利用する) USE_EQUIP_NUM_CHEAK = 1 end end #メモ欄の取得に関するスクリプト処理群------------------------------------------- module KURE #-------------------------------------------------------------------------- # ☆ 数値配列に畳む(追加定義) #-------------------------------------------------------------------------- def self.arr_num_slice(arr) result_arr = Array.new unless arr == [] and arr.empty? arr.flatten! arr.each{|value| value.scan(/\d+/).each { |num| result_arr.push(num.to_i)}} end return result_arr end #-------------------------------------------------------------------------- # ★ メモ欄取得操作の定義(1式単純加算処理を返す)(追加定義) #-------------------------------------------------------------------------- def self.memo_1_15_id_command(base, cheak_note, word) result = base while cheak_note do cheak_note.match(/<#{word}\s?([-]?\d+)\s?>/) result += $1.to_i if $1 cheak_note = $' end return result end end #============================================================================== # ●■ RPG::BaseItem(追加定義集積) #============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # ● 通常装備スロットの定義(追加定義) #-------------------------------------------------------------------------- def o_equip_slot KURE.arr_num_slice(@note.scan(/<通常装備スロット\s?(\d+(?:\s?*,\s?*\d+)*)>/)) end #-------------------------------------------------------------------------- # ● 二刀流装備スロットの定義(追加定義) #-------------------------------------------------------------------------- def o_equip_slot_d KURE.arr_num_slice(@note.scan(/<二刀流装備スロット\s?(\d+(?:\s?*,\s?*\d+)*)>/)) end #-------------------------------------------------------------------------- # ● 装備封印の定義(追加定義) #-------------------------------------------------------------------------- def seal_equip_type KURE.arr_num_slice(@note.scan(/<装備封印\s?(\d+(?:\s?*,\s?*\d+)*)>/)) end #-------------------------------------------------------------------------- # ● 装備固定の定義(追加定義) #-------------------------------------------------------------------------- def rock_equip_type KURE.arr_num_slice(@note.scan(/<装備固定\s?(\d+(?:\s?*,\s?*\d+)*)>/)) end #-------------------------------------------------------------------------- # ● 装備重量の定義(追加定義) #-------------------------------------------------------------------------- def weight KURE.memo_1_15_id_command(0, @note, "装備重量") end #-------------------------------------------------------------------------- # ● 最大重量補正の定義(追加定義) #-------------------------------------------------------------------------- def weight_revise KURE.memo_1_15_id_command(0, @note, "最大重量補正") end #-------------------------------------------------------------------------- # ● 装備重量増加の定義(追加定義) #-------------------------------------------------------------------------- def gain_weight KURE.memo_1_15_id_command(0, @note, "最大重量増加") end #-------------------------------------------------------------------------- # ● 装備レベルの定義(追加定義)(職業ID, 必要, 上限) #-------------------------------------------------------------------------- def need_equip_level result = [] ; cheak_note = @note while cheak_note do cheak_note.match(/<装備要求レベル\s?([-]?\d+)\s?,\s?([-]?\d+)\s?,\s?([-]?\d+)\s?>/) result.push([$1.to_i, $2.to_i, $3.to_i]) if $1 && $2 && $3 cheak_note = $' end return result end #-------------------------------------------------------------------------- # ●▲ 装備要求変数の定義(追加定義) #-------------------------------------------------------------------------- def need_equip_val request_val = [0, 0] @note.match(/<装備要求変数\s?([-]?\d+)\s?,\s?([-]?\d+)\s?>/) request_val = [$1.to_i, $2.to_i] if $1 && $2 return request_val end #-------------------------------------------------------------------------- # ● 装備要求パラメータの定義(追加定義) #-------------------------------------------------------------------------- def need_equip_status result = [] ; cheak_note = @note while cheak_note do cheak_note.match(/<装備要求パラメータ\s?([-]?\d+)\s?,\s?([-]?\d+)\s?>/) result.push([$1.to_i, $2.to_i]) if $1 && $2 cheak_note = $' end return result end end #============================================================================== # ■ RPG::EquipItem(再定義) #============================================================================== class RPG::EquipItem < RPG::BaseItem #-------------------------------------------------------------------------- # ● 装備タイプの定義(再定義) #-------------------------------------------------------------------------- def etype_id @note.match(/<装備タイプ\s?(\d+)\s?>/) return $1 ? $1.to_i : @etype_id end #-------------------------------------------------------------------------- # ● 拡張装備タイプの定義(追加定義) #-------------------------------------------------------------------------- def add_etype_id KURE.arr_num_slice(@note.scan(/<拡張装備タイプ\s?(\d+(?:\s?*,\s?*\d+)*)>/)) end #-------------------------------------------------------------------------- # ● 装備可能アクターの定義(追加定義) #-------------------------------------------------------------------------- def actor_equip_limit KURE.arr_num_slice(@note.scan(/<装備可能アクター\s?(\d+(?:\s?*,\s?*\d+)*)>/)) end #-------------------------------------------------------------------------- # ● 装備タイプの定義(再定義) #-------------------------------------------------------------------------- def equip_max_number @note.match(/<最大同時装備数\s?(\d+)\s?>/) return $1 ? $1.to_i : nil end #-------------------------------------------------------------------------- # ● 装備タイプの定義(再定義) #-------------------------------------------------------------------------- def etype_id=(etype_id) @etype_id = etype_id end end #============================================================================== # ■ Game_Interpreter(追加定義) #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● 指定アクターの装備を変更(追加定義) #-------------------------------------------------------------------------- def change_exslot_equip(actor_id, slot_id, item_id) return if $game_actors[actor_id].equip_slots[slot_id] == 0 $game_actors[actor_id].change_equip_by_id(slot_id, item_id) end end #============================================================================== # ■ Game_BaseItem #============================================================================== class Game_BaseItem #-------------------------------------------------------------------------- # ● 封印リスト呼び出し #-------------------------------------------------------------------------- def seal_equip_type return object ? object.seal_equip_type : [] end #-------------------------------------------------------------------------- # ● 固定リストの呼び出し #-------------------------------------------------------------------------- def rock_equip_type return object ? object.rock_equip_type : [] end end #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 装備変更の可能判定(再定義) # slot_id : 装備スロット ID #-------------------------------------------------------------------------- def equip_change_ok?(slot_id) return false if equip_type_fixed?(equip_slots[slot_id]) return false if equip_type_sealed?(equip_slots[slot_id]) return false if equip_type_sealed_ex?(equip_slots[slot_id],slot_id) return true end #-------------------------------------------------------------------------- # ● 装備封印、固定の判定 # etype_id : 装備タイプ ID slot_id : 装備スロットID #-------------------------------------------------------------------------- def equip_type_sealed_ex?(etype_id,slot_id) #封印リスト equips_seal_list = @equips.select{|obj| obj != nil}.collect{|obj| obj.seal_equip_type} state_seal_list = self.states.select{|obj| obj != nil}.collect{|obj| obj.seal_equip_type} job_list = $data_classes[@class_id].seal_equip_type all_seal_list = equips_seal_list + state_seal_list + job_list all_seal_list.uniq!.flatten!.compact! #固定リスト equips_rock_list = @equips.select{|obj| obj != nil}.collect{|obj| obj.rock_equip_type} state_rock_list = self.states.collect{|obj| obj.rock_equip_type} job_list = $data_classes[@class_id].rock_equip_type all_rock_list = equips_rock_list + state_rock_list + job_list all_rock_list.uniq!.flatten!.compact! #封印判定 if all_seal_list.include?(etype_id) change_equip(slot_id, nil) return true end #固定判定 if all_rock_list.include?(etype_id) return true end return false end #-------------------------------------------------------------------------- # ● 装備の変更(再定義) # slot_id : 装備スロット ID # item : 武器/防具(nil なら装備解除) #-------------------------------------------------------------------------- def change_equip(slot_id, item) #装備制限 item_object = @equips[slot_id].object return if equip_condition?(slot_id, item) != [0,0,0,0,0,0,0] #拡張装備スロット if item && equip_slots[slot_id] != item.etype_id return unless item.add_etype_id.include?(equip_slots[slot_id]) end #アクター装備制限 if item && item.actor_equip_limit != [] return unless item.actor_equip_limit.include?(@actor_id) end return unless trade_item_with_party(item, equips[slot_id]) @equips[slot_id].object = item refresh unless $kure_integrate_script[:integrate] #追加装備のスキル削除処理 if $kure_integrate_script[:integrate] set_passive_object fix_memorize if $kure_integrate_script[:Memorize3] refresh end end #-------------------------------------------------------------------------- # ● アイテム変更許可を判定(追加定義) #-------------------------------------------------------------------------- def equip_condition?(slot_id, new_item, temp_actor = nil) unless temp_actor temp_actor = Marshal.load(Marshal.dump(self)) temp_actor.name = "tester" temp_actor.force_change_equip(slot_id, new_item) end save_condition = [0,0,0,0,0,0,0] save_condition[0] = 1 unless equip_lv?(temp_actor, new_item) #重量システムを利用時だけ判定を行う if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 save_condition[1] = 1 unless equip_weight?(temp_actor) end #スキルメモライズ利用時判定(廃止) #if $kure_integrate_script[:integrate] && $kure_integrate_script[:Memorize] #end #装備ステータス利用時だけ判定を行う if KURE::ExEquip::USE_EQUIPSTATUS_SYSTEM == 1 save_condition[3] = 1 unless equip_status?(new_item) end #装備変数利用時だけ判定を行う if KURE::ExEquip::USE_EQUIPVAL_SYSTEM== 1 save_condition[4] = 1 unless equip_val?(new_item) end #空スロット禁止判定 if slot_id && KURE::ExEquip::FILL_SLOT.include?(slot_id) save_condition[5] = 1 unless new_item end #同時装備数 if KURE::ExEquip::USE_EQUIP_NUM_CHEAK == 1 save_condition[6] = 1 unless equip_number?(temp_actor, new_item) end return save_condition end #-------------------------------------------------------------------------- # ● 装備レベル判定(追加定義) #-------------------------------------------------------------------------- def equip_lv?(temp_actor, new_item) return true if KURE::ExEquip::USE_EQUIPLV_SYSTEM == 0 return true unless new_item return true if new_item.need_equip_level == [] class_list = Array.new class_list[0] = [temp_actor.class_id, @level] class_list += temp_actor.adv_class_id if $kure_integrate_script[:multiclass] class_list.compact! new_item.need_equip_level.each{|block| class_list.each{|data| next if block[0] != 0 && block[0] != data[0] next if block[1] != 0 && block[1] > data[1] next if block[2] != 0 && block[2] < data[1] return true } } return false end #-------------------------------------------------------------------------- # ● 重量判定(追加定義) #-------------------------------------------------------------------------- def equip_weight?(temp_actor) return true if temp_actor.max_weight >= temp_actor.all_weight return false end #-------------------------------------------------------------------------- # ● メモライズ容量判定(追加定義) #-------------------------------------------------------------------------- def enough_memorize? return true unless $kure_integrate_script[:Memorize] @memory_skills.each_with_index{|block, type| next unless block return false if !memorize_cond_ok?(type) } return true end #-------------------------------------------------------------------------- # ● 装備ステータス判定(追加定義) #-------------------------------------------------------------------------- def equip_status?(new_item) return true unless new_item new_item.need_equip_status.each{|block| return false if $game_actors[@actor_id].param_base(block[0]) < block[1] } return true end #-------------------------------------------------------------------------- # ● 装備変数判定(追加定義) #-------------------------------------------------------------------------- def equip_val?(new_item) return true unless new_item var = new_item.need_equip_val[0] value = new_item.need_equip_val[1] return true if var == 0 return false if !$game_variables[var] or $game_variables[var] < value return true end #-------------------------------------------------------------------------- # ● 同時装備数判定(追加定義) #-------------------------------------------------------------------------- def equip_number?(temp_actor, new_item) return true unless new_item return true unless new_item.equip_max_number unless $kure_integrate_script[:SortOut] return true if new_item.equip_max_number >= temp_actor.equips.count(new_item) return false else id_list = temp_actor.equips.select{|obj| obj}.collect{|equip| equip.database_id} return true if new_item.equip_max_number >= id_list.count(new_item.database_id) return false end return true end #-------------------------------------------------------------------------- # ● 装備スロットの配列を取得(再定義) #-------------------------------------------------------------------------- def equip_slots slot = Array.new if dual_wield? slot = KURE::ExEquip::EQUIP_SLOT_DUAL slot = self.class.o_equip_slot_d if self.class.o_equip_slot_d != [] slot = actor.o_equip_slot_d if actor.o_equip_slot_d != [] else slot = KURE::ExEquip::EQUIP_SLOT # 通常 slot = self.class.o_equip_slot if self.class.o_equip_slot != [] slot = actor.o_equip_slot if actor.o_equip_slot != [] end while slot.size > @equips.size do @equips.push(Game_BaseItem.new) end return slot end #-------------------------------------------------------------------------- # ● 装備総重量(追加定義) #-------------------------------------------------------------------------- def all_weight equips.select{|obj| obj}.inject(0){|r, obj| r += obj.weight} end #-------------------------------------------------------------------------- # ● 重量増加量(追加定義) #-------------------------------------------------------------------------- def all_gain_weight equips.select{|obj| obj}.inject(0){|r, obj| r += obj.gain_weight} end #-------------------------------------------------------------------------- # ● 重量最大量(追加定義) #-------------------------------------------------------------------------- def max_weight value = all_gain_weight #追加重量 value += KURE::ExEquip::MAX_WEIGHT_BASE #基礎値 value += KURE::ExEquip::MAX_WEIGHT_Lv * @level #レベル補正 value += actor.weight_revise #アクター補正 value += self.class.weight_revise #職業補正 skills.each{|skill| value += skill.weight_revise} #スキル補正を加算 return value end #-------------------------------------------------------------------------- # ● 装備できない装備品を外す(再定義) # item_gain : 外した装備品をパーティに戻す #-------------------------------------------------------------------------- def release_unequippable_items(item_gain = true) loop do last_equips = equips.dup @equips.each_with_index{|item, i| if !equippable?(item.object) || item.object.etype_id != equip_slots[i] #拡張装備タイプ判定 if !item.object or !item.object.add_etype_id.include?(equip_slots[i]) trade_item_with_party(nil, item.object) if item_gain item.object = nil end end } return if equips == last_equips end end end #============================================================================== # ■ Scene_Equip(再定義) #============================================================================== class Scene_Equip < Scene_MenuBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super if $kure_integrate_script[:integrate] && $kure_integrate_script[:SortOut] $game_party.refresh_equip_name_list_both @actor.release_unequippable_items if KURE::SortOut::USE_DURABLE == 1 end create_help_window create_small_status_window create_command_window create_slot_window create_status_window create_pop_window set_window_task end #-------------------------------------------------------------------------- # ● ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_small_status_window wx = 0 ; wy = @help_window.height ww = 305 ; wh = 48 @small_status_window = Window_Equip_Small_Status.new(wx,wy,ww,wh) end #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_command_window wx = 0 wy = @help_window.height + @small_status_window.height ww = @small_status_window.width @command_window = Window_Ex_EquipCommand.new(wx,wy,ww) @command_window.help_window = @help_window @command_window.set_handler(:equip, method(:command_equip)) @command_window.set_handler(:slot, method(:command_slot)) @command_window.set_handler(:optimize, method(:command_optimize)) @command_window.set_handler(:clear, method(:command_clear)) @command_window.set_handler(:cancel, method(:command_cancel)) @command_window.set_handler(:pagedown, method(:next_actor_cm)) @command_window.set_handler(:pageup, method(:prev_actor_cm)) @command_window.activate end #-------------------------------------------------------------------------- # ● スロットウィンドウの作成 #-------------------------------------------------------------------------- def create_slot_window wx = 0 ; wy = @command_window.height + @help_window.height + @small_status_window.height ww = 305 ; wh = Graphics.height - wy @slot_window = Window_Ex_Multi_Equip.new(wx, wy, ww, wh) @slot_window.help_window = @help_window @slot_window.set_handler(:ok, method(:on_slot_ok)) @slot_window.set_handler(:cancel, method(:on_slot_cancel)) @slot_window.set_handler(:pagedown, method(:next_actor_sl)) @slot_window.set_handler(:pageup, method(:prev_actor_sl)) @slot_window.deactivate @slot_window.unselect end #-------------------------------------------------------------------------- # ● ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_status_window @status_window = Window_Ex_EquipStatus.new(@slot_window.width, @help_window.height,Graphics.width - @slot_window.width,Graphics.height - @help_window.height) end #-------------------------------------------------------------------------- # ● ポップアップウィンドウの作成 #-------------------------------------------------------------------------- def create_pop_window @popup_window = Window_Ex_Equip_Popup.new(Graphics.width / 4 - 50,Graphics.height / 4 ) @popup_window.z += 100 @popup_window.unselect @popup_window.deactivate @popup_window.back_opacity = 255 @popup_window.hide #呼び出しのハンドラをセット @popup_window.set_handler(:ok,method(:pop_ok)) @popup_window.set_handler(:cancel,method(:pop_cancel)) end #-------------------------------------------------------------------------- # ● ウィンドウのセッティング処理 #-------------------------------------------------------------------------- def set_window_task @small_status_window.actor = @actor @slot_window.actor = @actor @status_window.actor = @actor @slot_window.status_window = @status_window #プロセスを初期化 @process = 0 @slot_window.process = 0 @need_reset_name = false @keep_index = 0 @keep_slot_index = 0 @keep_slot_item = nil @last_index = [0,0] @last_call = nil end #-------------------------------------------------------------------------- # ● ポップアップウィンドウ[決定] #-------------------------------------------------------------------------- def pop_ok case @popup_window.index when 0 @actor.clear_memorize case @last_call when 0 ; return_scene ; return when 1,2 ; next_actor when 3,4 ; prev_actor end pop_close(@last_call) when 1 pop_close(@last_call) end end #-------------------------------------------------------------------------- # ● ポップアップウィンドウ[キャンセル] #-------------------------------------------------------------------------- def pop_cancel pop_close(@last_call) end #-------------------------------------------------------------------------- # ● ポップアップウィンドウ[開く] #-------------------------------------------------------------------------- def pop_open(call) @popup_window.show @popup_window.select(1) @popup_window.activate case call when 0,1,3 ; @command_window.deactivate when 2,4 ; @slot_window.deactivate end end #-------------------------------------------------------------------------- # ● ポップアップウィンドウ[閉じる] #-------------------------------------------------------------------------- def pop_close(call) @popup_window.hide @popup_window.unselect @popup_window.deactivate case call when 0,1,3 ; @command_window.activate when 2,4 ; @slot_window.activate end end #-------------------------------------------------------------------------- # ● コマンド[装備変更] #-------------------------------------------------------------------------- def command_equip @process = 1 @status_window.draw_index = 100 command_to_slot end #-------------------------------------------------------------------------- # ● コマンド[スロット] #-------------------------------------------------------------------------- def command_slot @process = 5 @status_window.draw_index = 100 command_to_slot end #-------------------------------------------------------------------------- # ● コマンド[最強装備] #-------------------------------------------------------------------------- def command_optimize Sound.play_equip @actor.optimize_equipments @slot_window.refresh @command_window.activate @need_reset_name = true cheak_master_refresh end #-------------------------------------------------------------------------- # ● コマンド[全て外す] #-------------------------------------------------------------------------- def command_clear Sound.play_equip @actor.clear_equipments @slot_window.refresh @command_window.activate @small_status_window.refresh if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 @need_reset_name = true cheak_master_refresh end #-------------------------------------------------------------------------- # ● コマンド[キャンセル] #-------------------------------------------------------------------------- def command_cancel if @actor.enough_memorize? return_scene ; return end @last_call = 0 pop_open(@last_call) end #-------------------------------------------------------------------------- # ● 呼び出し元のシーンへ戻る #-------------------------------------------------------------------------- def return_scene set_passive SceneManager.return end #-------------------------------------------------------------------------- # ● スロット[決定] #-------------------------------------------------------------------------- def on_slot_ok #プロセスにより処理を変更する case @process when 1 keep_basic_item if $kure_integrate_script[:integrate] && $kure_integrate_script[:SortOut] #装備品個別管理使用時はプロセス2へ cheak_master_refresh set_process(2, 2, 600) else #それ以外はプロセス3へ set_process(3, 3, 700) end command_to_slot when 2 #装備品個別管理使用時はグル―プリストを作成 if @slot_window.current_ext @last_index = [@slot_window.page_index,@slot_window.index].clone @slot_window.selecter = @slot_window.current_ext set_process(4, 4, 700) command_to_slot else #装備解除処理 change_equip_process end when 3,4 #装備変更(個別管理、通常共通処理) change_equip_process when 5 #スロットを選択した場合はスロット画面へ cheak_master_refresh keep_slot_item set_process(6, 6, 100) command_to_slot when 6 #スロットリストを選択した時の処理 cheak_master_refresh @keep_slot_item = @slot_window.current_ext @keep_slot_index = @slot_window.index set_process(7, 7, 600) command_to_slot when 7 if @slot_window.current_ext @slot_window.selecter = @slot_window.current_ext @process = 8 @slot_window.process = 8 @slot_window.select(0) @slot_window.activate @status_window.draw_index = 100 else change_slot_equip_process end when 8 change_slot_equip_process end end #-------------------------------------------------------------------------- # ● スロット[キャンセル] #-------------------------------------------------------------------------- def on_slot_cancel #プロセスにより処理を変更する case @process #装備選択 when 1,5 slot_to_command when 2,3 @process = 1 @slot_window.process = 0 @slot_window.select(@keep_index) @slot_window.activate @status_window.draw_index = 100 when 4 cheak_master_refresh @slot_window.page_index = @last_index[0] set_process(2, 2, 600) command_to_slot @slot_window.select(@last_index[1]) @slot_window.cursor_fix when 6 cheak_master_refresh set_process(5, 0, 100) command_to_slot @slot_window.select(@keep_index) when 7 cheak_master_refresh @process = 6 @slot_window.process = 6 @slot_window.select(@keep_slot_index) @slot_window.activate @status_window.draw_index = 100 when 8 cheak_master_refresh set_process(7, 7, 600) command_to_slot end end #-------------------------------------------------------------------------- # ● スロット → コマンド #-------------------------------------------------------------------------- def command_to_slot @command_window.deactivate @slot_window.select(0) @slot_window.activate end #-------------------------------------------------------------------------- # ● スロット → コマンド #-------------------------------------------------------------------------- def slot_to_command @command_window.activate #画面のプロセス初期化 @slot_window.process = 0 @status_window.draw_index = 0 @slot_window.unselect @slot_window.deactivate end #-------------------------------------------------------------------------- # ● アクターの切り替え #-------------------------------------------------------------------------- def on_actor_change set_window_task @command_window.select(0) slot_to_command @slot_window.tmp_item = nil @slot_window.status_window_refresh end #-------------------------------------------------------------------------- # ● 次のアクターに切り替え #-------------------------------------------------------------------------- def next_actor_cm if @actor.enough_memorize? next_actor ; return end @last_call = 1 pop_open(@last_call) end #-------------------------------------------------------------------------- # ● 次のアクターに切り替え #-------------------------------------------------------------------------- def next_actor_sl if @actor.enough_memorize? next_actor ; return end @last_call = 2 pop_open(@last_call) end #-------------------------------------------------------------------------- # ● 前のアクターに切り替え #-------------------------------------------------------------------------- def prev_actor_cm if @actor.enough_memorize? prev_actor ; return end @last_call = 3 pop_open(@last_call) end #-------------------------------------------------------------------------- # ● 前のアクターに切り替え #-------------------------------------------------------------------------- def prev_actor_sl if @actor.enough_memorize? prev_actor ; return end @last_call = 4 pop_open(@last_call) end #-------------------------------------------------------------------------- # ● 次のアクターに切り替え #-------------------------------------------------------------------------- def next_actor case @process when 0,1,5 set_passive @actor = $game_party.menu_actor_next on_actor_change when 2,3,4,6,7,8 @slot_window.next_page @slot_window.activate end end #-------------------------------------------------------------------------- # ● 前のアクターに切り替え #-------------------------------------------------------------------------- def prev_actor case @process when 0,1,5 set_passive @actor = $game_party.menu_actor_prev on_actor_change when 2,3,4,6,7,8 @slot_window.prev_page @slot_window.activate end end #-------------------------------------------------------------------------- # ● 装備変更処理 #-------------------------------------------------------------------------- def change_equip_process if @status_window.can_equip != [0,0,0,0,0,0,0] Sound.play_buzzer @slot_window.activate return end Sound.play_equip @actor.change_equip(@keep_index, @slot_window.current_ext) #二刀流両手剣問題対応 if @actor.dual_wield? && @slot_window.current_ext case @keep_index when 0 @actor.change_equip(1, nil) if @actor.features_set(54).include?(1) when 1 @actor.change_equip(0, nil) if @actor.features_set(54).include?(1) end end @process = 1 @slot_window.process = 0 @slot_window.select(@keep_index) @slot_window.activate @status_window.draw_index = 100 @need_reset_name = true @small_status_window.refresh if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 set_passive end #-------------------------------------------------------------------------- # ● スロット装備変更処理 #-------------------------------------------------------------------------- def change_slot_equip_process return unless @actor.trade_item_with_party(@slot_window.current_ext , @keep_slot_item) @slot_window.slot_master.set_slot_value(@keep_slot_index, @slot_window.current_ext) @actor.claer_equip_cache @process = 6 @slot_window.process = 6 @slot_window.select(@keep_slot_index) @slot_window.activate @status_window.draw_index = 100 @need_reset_name = true @small_status_window.refresh if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 set_passive end #-------------------------------------------------------------------------- # ● プロセスのセット(メイン、スロット、ステータス) #-------------------------------------------------------------------------- def set_process(main, slot, draw) @process = main @slot_window.process = slot @status_window.draw_index = draw @slot_window.temp_actor = nil @slot_window.tmp_item = nil @slot_window.equip_data = nil end #-------------------------------------------------------------------------- # ● 選択したアイテム情報をスロットとステータスウィンドウへ渡す #-------------------------------------------------------------------------- def keep_basic_item @status_window.basic_item = @slot_window.current_ext @slot_window.etype_id = @actor.equip_slots[@slot_window.index] #INDEXを保存 @slot_window.slot_index = @slot_window.index @keep_index = @slot_window.index end #-------------------------------------------------------------------------- # ● 選択したアイテム情報をスロットとステータスウィンドウへ渡す #-------------------------------------------------------------------------- def keep_slot_item @slot_window.slot_master = @slot_window.current_ext #INDEXを保存 @slot_window.slot_index = @slot_window.index @keep_index = @slot_window.index end #-------------------------------------------------------------------------- # ● 装備リストの更新確認 #-------------------------------------------------------------------------- def cheak_master_refresh return unless $kure_integrate_script[:integrate] return unless $kure_integrate_script[:SortOut] if @need_reset_name $game_party.refresh_equip_name_list_both @need_reset_name = nil end end #-------------------------------------------------------------------------- # ● パッシブスキル更新 #-------------------------------------------------------------------------- def set_passive @actor.fix_memorys if $kure_integrate_script[:Memorize] @actor.set_passive_object if $kure_integrate_script[:integrate] end end #============================================================================== # ■ Window_Small_Status #============================================================================== class Window_Equip_Small_Status < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y,width,height) super(x, y, width, height) refresh end #-------------------------------------------------------------------------- # ● アクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_status return unless @actor draw_actor_name(@actor, 0, line_height * 0) draw_actor_weight(@actor, 160, line_height * 0) if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1 end #-------------------------------------------------------------------------- # ● 装備重量の描画 #-------------------------------------------------------------------------- def draw_actor_weight(actor, x, y, width = 124) weight = actor.all_weight max_weight = actor.max_weight weight_rate = 1 weight_rate = weight.to_f / max_weight if max_weight != 0 draw_gauge(x, y, width, weight_rate, tp_gauge_color1, tp_gauge_color2) change_color(system_color) draw_text(x, y, 35, line_height, KURE::ExEquip::WEIGHT_NAME) draw_current_and_max_values(x, y, width, weight, max_weight, mp_color(actor), normal_color) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear draw_status end end #============================================================================== # ■ Window_Ex_EquipCommand #------------------------------------------------------------------------------ #  スキル画面で、コマンド(装備変更、最強装備など)を選択するウィンドウです。 #============================================================================== class Window_Ex_EquipCommand < Window_HorzCommand #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width) @window_width = width super(x, y) end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width @window_width end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max col_max = 2 if $kure_integrate_script[:integrate] && $kure_integrate_script[:SortOut] col_max += 1 if KURE::SortOut::USE_SLOT_EQUIP == 1 end col_max += 1 if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0 return col_max end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command(Vocab::equip2, :equip) if $kure_integrate_script[:integrate] && $kure_integrate_script[:SortOut] add_command(KURE::ExEquip::Vocab_Slot, :slot) if KURE::SortOut::USE_SLOT_EQUIP == 1 end add_command(Vocab::optimize, :optimize) if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0 add_command(Vocab::clear, :clear) end end #============================================================================== # ■ Window_Ex_Multi_Equip #============================================================================== class Window_Ex_Multi_Equip < Window_Command #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :status_window # ステータスウィンドウ attr_accessor :process # プロセス attr_accessor :etype_id # 装備タイプ attr_accessor :slot_index # 選択中スロット attr_accessor :selecter # 装備中装備ID attr_accessor :slot_master # スロットマスターアイテム attr_accessor :temp_actor # キャッシュアクター attr_accessor :tmp_item # キャッシュアイテム attr_accessor :equip_data # キャッシュアクター(装備オブジェクト) attr_accessor :page_index # ページ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) @width = width ; @height = height super(x, y) @actor = nil @process = 0 @set_item = nil @slot_master = nil @temp_actor = nil @equip_data = nil @page_index = 0 @max_page = 0 @tmp_item = nil @last_index = 0 @pages = [] refresh end #-------------------------------------------------------------------------- # ● ウィンドウ高さと幅の取得 #-------------------------------------------------------------------------- def window_height ; return @height ; end def window_width ; return @width ; end #-------------------------------------------------------------------------- # ● 1ページに表示する行数の指定(グループ設定用) #-------------------------------------------------------------------------- def draw_line_number case @process when 2,7,3 ; return ((window_height - padding - padding_bottom) / item_height) - 2 when 4,8 ; return ((window_height - padding - padding_bottom) / item_height) - 1 end end #-------------------------------------------------------------------------- # ● アクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end #-------------------------------------------------------------------------- # ● プロセスの設定 #-------------------------------------------------------------------------- def process=(process) return if @process == process @process = process refresh end #-------------------------------------------------------------------------- # ● スロットマスターの設定 #-------------------------------------------------------------------------- def slot_master=(slot_master) return if @slot_master == slot_master @slot_master = slot_master end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor call_update_help return if @index < 0 status_window_refresh end #-------------------------------------------------------------------------- # ● 1ページ進める #-------------------------------------------------------------------------- def next_page @page_index += 1 refresh cursor_fix end #-------------------------------------------------------------------------- # ● 1ページ戻る #-------------------------------------------------------------------------- def prev_page @page_index -= 1 refresh cursor_fix end #-------------------------------------------------------------------------- # ● カーソル位置修正 #-------------------------------------------------------------------------- def cursor_fix return unless [2,3,4,7,8].include?(@process) @index = [@index,@last_index].min update_cursor call_update_help status_window_refresh end #-------------------------------------------------------------------------- # ● カーソル位置修正 #-------------------------------------------------------------------------- def status_window_refresh return unless @status_window @status_window.set_item(current_ext) case @process when 0,1,3,4,5,8 @pages[0] = call_add_feature_size(current_ext) @pages[1] = call_ap_list_size(current_ext) @pages[2] = call_sortout_size(0, current_ext) @pages[3] = call_sortout_size(1, current_ext) end case @process when 2,3,4,8 @temp_actor = nil if @tmp_item && @tmp_item.features.select {|ft| ft.code == 54 } != [] unless @temp_actor @temp_actor = Marshal.load(Marshal.dump(@actor)) end if @tmp_item != current_ext or !@tmp_item @temp_actor.force_change_equip(@slot_index, current_ext) @status_window.can_equip = @actor.equip_condition?(@slot_index, current_ext, @temp_actor) @status_window.set_temp_actor(@temp_actor) @tmp_item = current_ext end end @status_window.page_fix @status_window.refresh end #-------------------------------------------------------------------------- # ● 特徴ページ数 #-------------------------------------------------------------------------- def call_add_feature_size(item) return 0 unless item if $kure_integrate_script[:integrate] basic = KURE.call_add_feature_txt(item).size else basic = KURE.basic_actor_add_feature_txt(item).size end result = basic.div(11) + 1 result -= 1 if basic.modulo(11) == 0 return [result, 1].max end #-------------------------------------------------------------------------- # ● APリスト数 #-------------------------------------------------------------------------- def call_ap_list_size(item) return 0 unless item return 0 unless $kure_integrate_script[:integrate] basic = KURE.call_add_feature(83, item.note).size result = basic.div(5) + 1 result -= 1 if basic.modulo(5) == 0 return [result, 1].max end #-------------------------------------------------------------------------- # ● スロット数やシンボル数などページ数の取得 #-------------------------------------------------------------------------- def call_sortout_size(type, item) return 0 unless item return 0 unless $kure_integrate_script[:SortOut] case type when 0 result = item.max_slot_number.div(10) + 1 result -= 1 if item.max_slot_number.modulo(10) == 0 when 1 result = item.max_symbol_number.div(10) + 1 result -= 1 if item.max_symbol_number.modulo(10) == 0 end return [result, 1].max end #-------------------------------------------------------------------------- # ● →キー入力時動作 #-------------------------------------------------------------------------- def cursor_right(wrap = false) first_page = Array.new case @process when 0,6,8 ; first_page = use_101? ? [100, 101] : [100] when 3,4 ; first_page = [700] end @pages[0] ||= 1 ; @pages[1] ||= 1 ; @pages[2] ||= 1 ; @pages[3] ||= 1 ; page_list = first_page @pages[0].times{|index| page_list.push(200 + index)} case @process when 0,3,4 if $kure_integrate_script[:integrate] @pages[1].times{|index| page_list.push(300 + index)} if KURE::ExEquip::AP_VIEWER == 1 @pages[2].times{|index| page_list.push(400 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SLOT_EQUIP == 1 @pages[3].times{|index| page_list.push(500 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SYMBOL == 1 end page_list += first_page when 6,8 if $kure_integrate_script[:integrate] @pages[1].times{|index| page_list.push(300 + index)} if KURE::ExEquip::AP_VIEWER == 1 @pages[3].times{|index| page_list.push(500 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SYMBOL == 1 end page_list += first_page end case @process when 0,3,4,6,8 page_list.each_with_index{|id, index| if id == @status_window.draw_index @status_window.draw_index = page_list[index + 1] break end } end end #-------------------------------------------------------------------------- # ● ←キー入力時操作 #-------------------------------------------------------------------------- def cursor_left(wrap = false) first_page = Array.new case @process when 0,6,8 ; first_page = use_101? ? [100, 101] : [100] when 3,4 ; first_page = [700] end @pages[0] ||= 1 ; @pages[1] ||= 1 ; @pages[2] ||= 1 ; @pages[3] ||= 1 page_list = first_page @pages[0].times{|index| page_list.push(200 + index)} case @process when 0,3,4 if $kure_integrate_script[:integrate] @pages[1].times{|index| page_list.push(300 + index)} if KURE::ExEquip::AP_VIEWER == 1 @pages[2].times{|index| page_list.push(400 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SLOT_EQUIP == 1 @pages[3].times{|index| page_list.push(500 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SYMBOL == 1 end page_list.unshift(page_list[page_list.size - 1]) when 6,8 if $kure_integrate_script[:integrate] @pages[1].times{|index| page_list.push(300 + index)} if KURE::ExEquip::AP_VIEWER == 1 @pages[3].times{|index| page_list.push(500 + index)} if $kure_integrate_script[:SortOut] && KURE::SortOut::USE_SYMBOL == 1 end page_list.unshift(page_list[page_list.size - 1]) end case @process when 0,3,4,6,8 for page in 1..page_list.size - 1 if page_list[page] == @status_window.draw_index @status_window.draw_index = page_list[page - 1] break end end end end #-------------------------------------------------------------------------- # ● 装備条件ページが必要かどうか #-------------------------------------------------------------------------- def use_101? return true if KURE::ExEquip::USE_EQUIPLV_SYSTEM == 1 return true if KURE::ExEquip::USE_EQUIPSTATUS_SYSTEM == 1 return true if KURE::ExEquip::USE_EQUIPVAL_SYSTEM == 1 return false end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list return unless @actor #プロセス23478 case @process when 2,7 equip_list = $game_party.weapons_name_list + $game_party.armors_name_list add_list = equip_list.select{|item| item && include?(item)} when 3 add_list = $game_party.equip_items.select {|item| item && include?(item)} when 4,8 equip_list = $game_party.weapons_block(@selecter.id) if @selecter.is_a?(RPG::Weapon) equip_list = $game_party.armors_block(@selecter.id) if @selecter.is_a?(RPG::Armor) add_list = equip_list.select{|item| item && include?(item)} end case @process when 2,3,7,4,8 @max_page = add_list.size.divmod(draw_line_number)[0] - 1 @max_page += 1 if add_list.size.divmod(draw_line_number)[1] != 0 @max_page += 1 if add_list.size == 0 @page_index = 0 if @page_index > @max_page @page_index = @max_page if @page_index < 0 first = @page_index * draw_line_number last = [((@page_index + 1 ) * draw_line_number) - 1, add_list.size - 1].min add_list = add_list[first..last] @last_index = last - first end #プロセスにより描画内容を変化させる case @process when 0 #装備スロットの描画 for index in 0..@actor.equip_slots.size - 1 if @actor.equips[index] add_command(@actor.equips[index].name , :ok ,enable?(index) , @actor.equips[index]) else add_command("" , :ok ,enable?(index),nil) end end when 2,3,7 #グループリスト add_list.each{|item| add_command(item.name, :ok, true, item)} add_command(" " + KURE::ExEquip::Vocab_ClearEquip , :ok ,true ,nil) when 4,8 #グループリスト add_list.each{|item| add_command(item.name, :ok, true, item)} when 6 return unless @slot_master slot_list = @slot_master.slot_list max_number = @slot_master.max_slot_number for slot in 0..max_number - 1 if slot_list[slot] add_command(slot_list[slot].name , :ok ,true , slot_list[slot]) else add_command("" , :ok ,true) end end end end #-------------------------------------------------------------------------- # ● アイテムをリストに含めるかどうか #-------------------------------------------------------------------------- def include?(item) return true if item == nil return false unless item.is_a?(RPG::EquipItem) case @process when 2,3,4 return false if @etype_id < 0 #拡張装備タイプ判定 if item.etype_id != @etype_id return false unless item.add_etype_id.include?(@etype_id) end #アクター装備制限の判定 if item.actor_equip_limit != [] return false unless item.actor_equip_limit.include?(@actor.id) end return @actor.equippable?(item) when 7,8 return true if @slot_master.adopt_slot_type.include?(item.etype_id) item.add_etype_id.each do |id| return true if @slot_master.adopt_slot_type.include?(id) end return false end return true end #-------------------------------------------------------------------------- # ● 全項目の描画 #-------------------------------------------------------------------------- def draw_all_items item_max.times {|i| draw_item(i) } draw_gide end #-------------------------------------------------------------------------- # ● ガイドの描画 #-------------------------------------------------------------------------- def draw_gide last = contents.font.size contents.font.size = 20 case @process when 2,3,7,4,8 now = @page_index + 1 max = @max_page + 1 change_color(normal_color) draw_text(0, contents.height - (contents.font.size + 3) , contents.width, contents.font.size, "LR:ページ切り替え " + now.to_s + "/" + max.to_s ,1) end contents.font.size = last end #-------------------------------------------------------------------------- # ● 装備スロットを許可状態で表示するかどうか #-------------------------------------------------------------------------- def enable?(index) @actor ? @actor.equip_change_ok?(index) : false end #-------------------------------------------------------------------------- # ● 装備スロットの名前を取得(Process1) #-------------------------------------------------------------------------- def slot_name(index) return "" unless @actor return Vocab::etype(@actor.equip_slots[index]) if @actor.equip_slots[index] <= 4 return KURE::ExEquip::EQUIP_SLOT_NAME[@actor.equip_slots[index]] end #-------------------------------------------------------------------------- # ● 番号の描画 #-------------------------------------------------------------------------- def draw_number(index) return unless @slot_master change_color(system_color) draw_text(0, contents.font.size * index, 24, contents.font.size, index + 1) change_color(normal_color) end #-------------------------------------------------------------------------- # ● 項目を描画 #-------------------------------------------------------------------------- def draw_item(index) return unless @actor change_color(normal_color, command_enabled?(index)) item = @list[index][:ext] rect = item_rect(index) case @process when 0 draw_text(rect.x, rect.y, 87, line_height, slot_name(index)) draw_item_name(item, rect.x + 87, rect.y, command_enabled?(index)) draw_weight(rect, index, item) when 2,3,7 if item draw_item_name(item, rect.x, rect.y, command_enabled?(index)) draw_text(item_rect_for_text(index), sprintf(":%2d", $game_party.item_number(item)), 2) else draw_text(item_rect_for_text(index), command_name(index)) end when 4,8 draw_item_name(item, rect.x, rect.y, command_enabled?(index)) draw_weight(rect, index, item) when 6 draw_number(index) draw_item_name(item, rect.x + 24, rect.y, command_enabled?(index)) end end #-------------------------------------------------------------------------- # ● 重量を描画 #-------------------------------------------------------------------------- def draw_weight(rect, index, item) #重量システムを利用時は重量を表示する return unless item return if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0 weight = item.weight - item.gain_weight if weight < 0 change_color(power_up_color) draw_text(rect.x, rect.y, rect.width, line_height, weight.to_s,2) end if weight > 0 change_color(power_down_color) draw_text(rect.x, rect.y, rect.width, line_height, weight.to_s,2) end if weight == 0 && KURE::ExEquip::WEIGHT_0_ITEM == 0 change_color(power_down_color) draw_text(rect.x, rect.y, rect.width, line_height, weight.to_s,2) end end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help @help_window.clear @help_window.set_item(current_ext) if @help_window end end #============================================================================== # ■ Window_Ex_EquipStatus #------------------------------------------------------------------------------ #  装備画面で、アクターの能力値変化を表示するウィンドウです。 #============================================================================== class Window_Ex_EquipStatus < Window_EquipStatus attr_accessor :draw_index attr_accessor :basic_item attr_accessor :can_equip #-------------------------------------------------------------------------- # ◎ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y,width,height) @can_equip = [0,0,0,0,0,0,0] @draw_index = 0 @width = width @height = height @draw_item = nil @basic_item = nil super(x, y) end #-------------------------------------------------------------------------- # ◎ 描画INDEXの設定 #-------------------------------------------------------------------------- def draw_index=(index) @draw_index = index refresh end #-------------------------------------------------------------------------- # ◎ ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width return @width end #-------------------------------------------------------------------------- # ◎ ウィンドウ高さの取得 #-------------------------------------------------------------------------- def window_height return @height end #-------------------------------------------------------------------------- # ◎ 装備アイテム描画を設定 #-------------------------------------------------------------------------- def set_item(item) return if @draw_item == item @draw_item = item end #-------------------------------------------------------------------------- # ◎ 描画ページの修正を設定 #-------------------------------------------------------------------------- def page_fix case @draw_index when 100..199 ; @draw_index = 100 when 200..299 ; @draw_index = 200 when 300..399 ; @draw_index = 300 when 400..499 ; @draw_index = 400 when 500..599 ; @draw_index = 500 when 600..699 ; @draw_index = 600 when 700..799 ; @draw_index = 700 end end #-------------------------------------------------------------------------- # ◎ リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear #フォントの設定 last_font = contents.font.size contents.font.size = 20 #タイトルゲージを描画 draw_gauge(0,0, contents.width, 1, mp_gauge_color2,crisis_color) change_color(normal_color) draw_text(0, contents.height - contents.font.size, contents.width, contents.font.size, "← →:表示切り替え",1) if @draw_index != 0 case @draw_index when 0 ; draw_index_zero when 100..199 ; draw_index_one when 200..299 ; draw_index_two when 300..399 ; draw_index_three when 400..499 ; draw_index_four when 500..599 ; draw_index_five when 600..699 ; draw_index_six when 700..799 ; draw_index_seven end end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 0) #-------------------------------------------------------------------------- def draw_index_zero draw_text(0, 0, 180, contents.font.size, "操作説明") draw_text(5, contents.font.size * 2, contents.width, contents.font.size, "LR :アクター切り替え") draw_text(5, contents.font.size * 3, contents.width, contents.font.size, "←→:項目選択") end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 100,101) #-------------------------------------------------------------------------- def draw_index_one case @draw_index when 100 ; draw_text(0, 0, 180, contents.font.size, "装備品能力") when 101 ; draw_text(0, 0, 180, contents.font.size, "装備条件") end return unless @draw_item draw_item_name(@draw_item, 5,line_height * 1) case @draw_index when 100 8.times {|i| draw_item_index1_1(0, line_height * 2, i, @draw_item) } draw_equip_type(0,line_height * 1 + contents.font.size * 6, @draw_item) when 101 draw_equip_condition(0, line_height * 1, @draw_item) end end #-------------------------------------------------------------------------- # ◎ 項目の描画(draw_index = 100) #-------------------------------------------------------------------------- def draw_item_index1_1(x, y, param_id, item) return unless KURE::ExEquip::VIEW_PARAM[param_id] draw_id = KURE::ExEquip::VIEW_PARAM[param_id] left = "" ; left2 = "" pos_x = x + (contents.width / 2) * param_id.modulo(2) pos_y = y + contents.font.size * param_id.div(2) draw_param_name(pos_x, pos_y, draw_id) if item change_color(param_change_color(item.params[draw_id])) left =" " if item.params[draw_id].abs < 100 left =" " if item.params[draw_id].abs < 10 left2 = "+" if item.params[draw_id] > 0 left2 = " " if item.params[draw_id] == 0 end draw_text(pos_x, pos_y, contents.width / 2 - 5, contents.font.size, left + left2 + (item.params[draw_id].abs).to_s, 2) end #-------------------------------------------------------------------------- # ◎ 要求条件の描画(draw_index = 100) #-------------------------------------------------------------------------- def draw_equip_type(x,y,item) 5.times{|index| case index when 1 ; next if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0 when 2,3,4 ; next unless $kure_integrate_script[:SortOut] end pos_y = y + contents.font.size * index case index when 0 ; system_name = KURE::ExEquip::Vocab_EquipType when 1 ; system_name = KURE::ExEquip::Vocab_Weight when 2 ; system_name = KURE::ExEquip::Vocab_EquipExp when 3 ; system_name = KURE::ExEquip::Vocab_Durable when 4 ; system_name = KURE::ExEquip::Vocab_Slot + "(装備/最大)" end next if system_name == "" change_color(system_color) draw_text(x, pos_y, 130, contents.font.size, system_name) case index when 0 if item.is_a?(RPG::Weapon) ; str = $data_system.weapon_types[item.wtype_id] elsif item.is_a?(RPG::Armor) ; str = $data_system.armor_types[item.atype_id] else ; str = "" end when 1 weight = item.weight.to_s revise = item.gain_weight > 0 ? "+" + item.gain_weight.to_s : item.gain_weight.to_s str = weight + " / " + revise when 2 str = item.equip_exp.to_s when 3 str = item.broken? ? "破損中" : item.durable_value when 4 slot_max = item.max_slot_number slot_num = item.slot_list.compact.size str = "(" + slot_num.to_s + " / " + slot_max.to_s + ")" end change_color(normal_color) draw_text(x, pos_y, contents.width - 10, contents.font.size, str, 2) } end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 101) #-------------------------------------------------------------------------- def draw_equip_condition(x, y, item) #装備レベル利用時は要求レベルを描画 line = 1 3.times{|index| case index when 0 ; list = item.need_equip_level ; next if list == [] when 1 ; list = item.need_equip_status ; next if list == [] when 2 ; list = [item.need_equip_val] ; next if list == [[0, 0]] end case index when 0 next if KURE::ExEquip::USE_EQUIPLV_SYSTEM == 0 name = "装備可能レベル" when 1 next if KURE::ExEquip::USE_EQUIPSTATUS_SYSTEM == 0 name = "装備要求ステータス" when 2 next if KURE::ExEquip::USE_EQUIPVAL_SYSTEM == 0 name = "装備要求条件" end change_color(system_color) draw_text(x, y + contents.font.size * line, 150, contents.font.size, name) line += 1 change_color(normal_color) list.each{|block| case index when 0 name = $data_classes[block[0]].name + " " need = block[1] != 0 ? block[1].to_s + "以上 " : "" limit = block[2] != 0 ? block[2].to_s + "以下" : "" str = name + need + limit when 1 name = Vocab::param(block[0]) + " " need = block[1].to_s + "以上" str = name + need when 2 name = $data_system.variables[block[0]] ? $data_system.variables[block[0]] + " " : "特殊条件" need = block[1].to_s + "以上" str = name + need end draw_text(x + 10, y + contents.font.size * line, contents.width - 15, contents.font.size, str) line += 1 } } end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 2) #-------------------------------------------------------------------------- def draw_index_two draw_text(0, 0, 180, contents.font.size, "装備品特徴" + "(" + (@draw_index - 199).to_s + ")" ) draw_item_name(@draw_item, 5,line_height * 1) if @draw_item draw_features(0,line_height * 2,@draw_item) end #-------------------------------------------------------------------------- # ◎ 特徴の描画(draw_index = 200..299) #-------------------------------------------------------------------------- def draw_features(x,y,item) return unless item if $kure_integrate_script[:integrate] draw_list = KURE.call_add_feature_txt(item) else draw_list = KURE.basic_actor_add_feature_txt(item) end first = 0 + 11 * (@draw_index - 200) last = [10 + 11 * (@draw_index - 200), draw_list.size].min draw_list[first..last].each_with_index{|text, index| pos_y = y + contents.font.size * index draw_text(x, pos_y, contents.width, contents.font.size, text) } end #-------------------------------------------------------------------------- # ◎ 習得スキルリスト(draw_index = 3) #-------------------------------------------------------------------------- def draw_index_three draw_text(0, 0, 180, contents.font.size, "習得スキルリスト" + "(" + (@draw_index - 299).to_s + ")" ) draw_item_name(@draw_item, 5,line_height * 1) if @draw_item draw_aplist(0,line_height * 2,@draw_item) end #-------------------------------------------------------------------------- # ◎ APのリストを描画(draw_index = 300..399) #-------------------------------------------------------------------------- def draw_aplist(x,y,item) return unless item draw_list = KURE.call_add_feature(83, item.note) first = 0 + 5 * (@draw_index - 300) last = [4 + 5 * (@draw_index - 300), draw_list.size].min draw_list[first..last].each_with_index{|data, index| pos_y = y + line_height * index * 2 pos_y2 = y + line_height * ((index * 2) + 1) skill = $data_skills[data[0]] value = @actor.call_ability_point(data[0]) text1 = skill.name + "(" + "x" + data[1].to_s + ")" text2 = value.to_s + "/" + "1000" draw_icon(skill.icon_index, x, pos_y) draw_text(x + 30, pos_y + (line_height - contents.font.size) / 2, contents.width, contents.font.size, text1) draw_text(x, pos_y2, contents.width, contents.font.size, text2, 2) } end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 4) #-------------------------------------------------------------------------- def draw_index_four draw_text(0, 0, 180, contents.font.size, KURE::ExEquip::Vocab_SlotList + "(" + (@draw_index - 399).to_s + ")" ) draw_item_name(@draw_item, 5,line_height * 1) if @draw_item draw_ss_list(0, line_height * 2, @draw_item, 0) end #-------------------------------------------------------------------------- # ◎ 装備シンボルリスト(draw_index = 5) #-------------------------------------------------------------------------- def draw_index_five draw_text(0, 0, 180, contents.font.size, KURE::ExEquip::Vocab_Symbollist + "(" + (@draw_index - 499).to_s + ")" ) draw_item_name(@draw_item, 5,line_height * 1) if @draw_item draw_ss_list(0, line_height * 2, @draw_item, 1) end #-------------------------------------------------------------------------- # ◎ スロット、シンボル内容を描画 #-------------------------------------------------------------------------- def draw_ss_list(x, y, item, mode) return unless item case mode when 0 slot_list = item.slot_list slot_max_size = item.max_slot_number base = 400 when 1 slot_list = item.symbol_list.collect{|obj| obj[0] } slot_max_size = item.max_symbol_number base = 500 end first = 0 + 10 * (@draw_index - base) last = [10 + 10 * (@draw_index - base), slot_max_size].min (last - first).times{|index| pos_y = y + (line_height * index) + 2 id = index + first draw_text(5, pos_y, 25, line_height, id + 1) draw_item_name(slot_list[id], 30, pos_y) if slot_list[id] } end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 6) #-------------------------------------------------------------------------- def draw_index_six draw_text(0, 0, 180, contents.font.size, "操作説明") draw_text(5, contents.font.size * 2, contents.width, contents.font.size, "LR :ページ切り替え") end #-------------------------------------------------------------------------- # ◎ 装備変更(draw_index = 7) #-------------------------------------------------------------------------- def draw_index_seven draw_text(0, 0, 180, contents.font.size, "ステータス変化") draw_equip_before(0,line_height * 1) draw_right_arrow(0, line_height * 2) draw_equip_after(20,line_height * 2) 11.times {|i| draw_item(0, line_height * 2 + contents.font.size * (1 + i), i) } if @can_equip == [0,0,0,0,0,0,0] draw_need_equip_condition(0, line_height * 2 + contents.font.size * 1) if @can_equip != [0,0,0,0,0,0,0] end #-------------------------------------------------------------------------- # ◎ 装備変更のアイテム表示(draw_index = 7) #-------------------------------------------------------------------------- def draw_equip_before(x,y) return unless @actor draw_item_name(basic_item, x, y) if basic_item end #-------------------------------------------------------------------------- # ◎ 装備変更のアイテム表示(draw_index = 7) #-------------------------------------------------------------------------- def draw_equip_after(x,y) return unless @actor draw_item_name(@draw_item, x, y) if @draw_item end #-------------------------------------------------------------------------- # ◎ 項目の描画(draw_index = 7) #-------------------------------------------------------------------------- def draw_item(x, y, param_id) value = 0 value2 = 0 case param_id when 0,1,2,3,4,5,6,7 return unless KURE::ExEquip::VIEW_PARAM[param_id] draw_id = KURE::ExEquip::VIEW_PARAM[param_id] value = @actor.param(draw_id).to_i if @actor value2 = @temp_actor.param(draw_id).to_i if @temp_actor draw_param_name(x, y, draw_id) draw_current_param(x + 80, y, draw_id) if @actor draw_right_arrow(x + 112, y) draw_new_param(x + 136, y, draw_id) if @temp_actor when 8,9,10 value = (@actor.xparam(param_id - 8) * 100).to_i if @actor value2 = (@temp_actor.xparam(param_id - 8) * 100).to_i if @temp_actor change_color(system_color) draw_text(x, y, 80, line_height, KURE::ExEquip::Vocab_Ex1[param_id - 8]) change_color(normal_color) draw_text(x + 80, y, 32, line_height, value, 2) if @actor draw_right_arrow(x + 112, y) change_color(param_change_color(value2 - value)) if @temp_actor draw_text(x + 136, y, 32, line_height, value2, 2) if @temp_actor end if @draw_item left = "(" left = "( " if (value2 - value).abs < 100 left = "( " if (value2 - value).abs < 10 left2 = "-" left2 = "+" if (value2 - value) > 0 left2 = " " if (value2 - value) == 0 change_color(param_change_color(value2 - value)) draw_text(x + 168, y, 50, line_height, left + left2 + ((value2 - value).abs).to_s + ")", 2) end end #-------------------------------------------------------------------------- # ◎ 要求条件の描画(draw_index = 7) #-------------------------------------------------------------------------- def draw_need_equip_condition(x,y) change_color(normal_color) draw_text(x + 5, y, contents.width, contents.font.size, "装備条件を満たしていません") change_color(power_down_color) line = 1 @can_equip.each_with_index{|value, index| pos_y = y + contents.font.size * line next if value == 0 case index when 0 ; txt = KURE::ExEquip::Vocab_level_err when 1 ; txt = KURE::ExEquip::Vocab_weight_err when 2 ; txt = KURE::ExEquip::Vocab_memorize_err when 3 ; txt = KURE::ExEquip::Vocab_param_err when 4 ; txt = KURE::ExEquip::Vocab_cond_err when 5 ; txt = KURE::ExEquip::VVocab_clear_err when 6 ; txt = KURE::ExEquip::Vocab_count_err end draw_text(x + 5, pos_y, contents.width, contents.font.size, txt) } end end #============================================================================== # ■ Window_Ex_Equip_Popup #============================================================================== class Window_Ex_Equip_Popup < Window_HorzCommand #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width Graphics.width / 2 + 120 end #-------------------------------------------------------------------------- # ● 表示行数の取得 #-------------------------------------------------------------------------- def visible_line_number return 5 end #-------------------------------------------------------------------------- # ● ウィンドウ内容の高さを計算 #-------------------------------------------------------------------------- def contents_height line_height * visible_line_number end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max return 2 end #-------------------------------------------------------------------------- # ● 項目を描画する矩形の取得 #-------------------------------------------------------------------------- def item_rect(index) rect = super rect.x = index * (item_width + spacing) rect.y = line_height * 4 rect end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command("装備を反映する", :ok) add_command("装備選択に戻る", :ok) end #-------------------------------------------------------------------------- # ● 描画処理 #-------------------------------------------------------------------------- def draw_contents draw_gauge(5 , 0, contents.width, 1, mp_gauge_color2,crisis_color) draw_text(5, 0, 126, line_height, "装備変更確認") draw_text(5, line_height * 1, contents.width, line_height, "メモライズ数または容量がオーバーしています。") draw_text(5, line_height * 2, contents.width, line_height, "メモライズを初期化して装備を反映しますか?") end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh super draw_contents end end #メモ欄の取得に関するスクリプト処理群------------------------------------------- module KURE #-------------------------------------------------------------------------- # ◎ 特徴の文字配列の呼び出し(基本)(共通呼び出し項目) #-------------------------------------------------------------------------- def self.basic_actor_add_feature_txt(item) return [] unless item draw_txt = Array.new #コードのID配列を取得 object = item.is_a?(Game_Actor) ? item.all_features : item.features code_list = object.collect{|ft| case ft.code when 11,12,13,21,23,22,32,62,64 [ft.code, ft.data_id] when 14,31,41,42,43,44,53,54,55,33,34,61 [ft.code, 0] end } code_list.compact! code_list.uniq! #書きだし code_list.each{|block| case block[0] when 14,31,41,42,43,44,53,54,55,62,64 data = features_set_data(item, block[0]) case block[0] when 31 ; data.each{|id| draw_txt.push($data_system.elements[id] + "属性 ")} when 14 ; data.each{|id| draw_txt.push($data_states[id].name + "無効 ")} when 41 ; data.each{|id| draw_txt.push($data_system.skill_types[id] + "使用可 ")} when 42 ; data.each{|id| draw_txt.push($data_system.skill_types[id] + "使用不可 ")} when 43 ; data.each{|id| draw_txt.push($data_skills[id].name + "使用可 ")} when 44 ; data.each{|id| draw_txt.push($data_skills[id].name + "使用不可 ")} when 53 ; data.each{|id| draw_txt.push($data_system.terms.etypes[id] + "固定 ")} when 54 ; data.each{|id| draw_txt.push($data_system.terms.etypes[id] + "封印 ")} when 55 ; draw_txt.push("二刀流 ") if data.max == 1 when 62 case block[1] when 0 ; draw_txt.push("自動戦闘 ") when 1 ; draw_txt.push("自動防御 ") when 2 ; draw_txt.push("自動献身 ") when 3 ; draw_txt.push("TP持越 ") end when 64 case block[1] when 0 ; draw_txt.push("敵出現率↓ ") when 1 ; draw_txt.push("敵出現率0 ") when 2 ; draw_txt.push("被先制無効 ") when 3 ; draw_txt.push("先制率上昇 ") when 4 ; draw_txt.push("獲得金額2倍 ") when 5 ; draw_txt.push("Drop率2倍 ") end end when 11,12,13,21,23 data = (features_pi_data(item, block[0], block[1]) * 100).to_i case block[0] when 11 ; draw_txt.push($data_system.elements[block[1]] + "有効度" + data.to_s + "% ") when 12 ; draw_txt.push(Vocab::param(block[1]) + "弱体有効度" + data.to_s + "% ") when 13 ; draw_txt.push($data_states[block[1]].name + "有効度" + data.to_s + "% ") when 21 data2 = data > 100 ? "+" + (data - 100).to_s : (data - 100).to_s draw_txt.push(Vocab::param(block[1]) + data2 + "% ") when 23 next if data == 100 case block[1] when 0 ; draw_str = "狙われ率" when 1 ; draw_str = "防御効果" when 2 ; draw_str = "回復効果" when 3 ; draw_str = "薬知識" when 4 ; draw_str = "MP消費率" when 5 ; draw_str = "TP上昇率" when 6 ; draw_str = "被物理Dmg" when 7 ; draw_str = "被魔法Dmg" when 8 ; draw_str = "床Dmg" when 9 ; draw_str = "経験値" end data2 = data > 100 ? "+" + (data - 100).to_s : (data - 100).to_s draw_txt.push(draw_str + data2 + "% ") end when 22,32 data = (features_sum_data(item, block[0], block[1]) * 100).to_i case block[0] when 22 case block[1] when 0 ; draw_str = "命中率" when 1 ; draw_str = "回避率" when 2 ; draw_str = "会心率" when 3 ; draw_str = "会心回避" when 4 ; draw_str = "魔法回避" when 5 ; draw_str = "魔法反射" when 6 ; draw_str = "反撃率" when 7 ; draw_str = "毎ターンHP回復" when 8 ; draw_str = "毎ターンMP回復" when 9 ; draw_str = "毎ターンTP回復" end data2 = data > 0 ? "+" + data.to_s : data.to_s draw_txt.push(draw_str + data2 + "% ") when 32 draw_txt.push($data_states[block[1]].name + "付与" + data.to_s + "% ") end when 33,34 data = features_sum_all_data(item, block[0]) case block[0] when 33 next if data == 0 draw_txt.push("攻撃速度増加") if data > 0 draw_txt.push("攻撃速度減少") if data < 0 when 34 next if data == 0 draw_txt.push("攻撃追加" + data.to_s + "回 ") if data > 0 draw_txt.push("攻撃減少" + data.to_s + "回 ") if data < 0 end when 61 data = features_data(item, 61).collect{|ft| (ft.value * 100).to_i} data.each{|id| draw_txt.push("追加行動" + id.to_s + "% ")} end } return draw_txt end #-------------------------------------------------------------------------- # ★ 特徴オブジェクトの配列取得(特徴コードを限定)(追加定義) #-------------------------------------------------------------------------- def self.features_data(item, code) object = item.is_a?(Game_Actor) ? item.all_features : item.features object.select {|ft| ft.code == code } end #-------------------------------------------------------------------------- # ★ 特徴オブジェクトの配列取得(特徴コードとデータ ID を限定)(追加定義) #-------------------------------------------------------------------------- def self.features_with_id_data(item, code, id) object = item.is_a?(Game_Actor) ? item.all_features : item.features object.select {|ft| ft.code == code && ft.data_id == id } end #-------------------------------------------------------------------------- # ★ 特徴値の総乗計算(追加定義) #-------------------------------------------------------------------------- def self.features_pi_data(item, code, id) features_with_id_data(item, code, id).inject(1.0) {|r, ft| r *= ft.value } end #-------------------------------------------------------------------------- # ★ 特徴値の総和計算(データ ID を指定)(追加定義) #-------------------------------------------------------------------------- def self.features_sum_data(item, code, id) features_with_id_data(item, code, id).inject(0.0) {|r, ft| r += ft.value } end #-------------------------------------------------------------------------- # ★ 特徴値の総和計算(データ ID は非指定)(追加定義) #-------------------------------------------------------------------------- def self.features_sum_all_data(item, code) features_data(item, code).inject(0.0) {|r, ft| r += ft.value } end #-------------------------------------------------------------------------- # ★ 特徴の集合和計算(追加定義) #-------------------------------------------------------------------------- def self.features_set_data(item, code) features_data(item, code).inject([]) {|r, ft| r |= [ft.data_id] } end end