#============================================================================== # ■スタイルチェンジスクリプト for RGSS3 Ver0.30-α # □作成者 kure # # 呼び出し方法  SceneManager.call(Scene_SetStyle) # #============================================================================== $kure_integrate_script = {} if $kure_integrate_script == nil $kure_integrate_script[:StyleChange] = 1 p "スタイルチェンジ" #-------------------------------------------------------------------------- # ★ 設定項目(各設定の値を変更してください) #-------------------------------------------------------------------------- module KURE #ウェポンラックモジュール module WeaponRack #動作に関する項目------------------------------------------------------------- #ラックの表示名 RACK_NAME = "ラック" #ラックの基本個数 BASE_RACK_NUM = 5 end #スタイルチェンジモジュール module StyleChange #スタイルの表示名 STYLE_NAME = "スタイル" end end #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● 指定IDのアクターの指定IDのラックへ現在の装備を登録(追加定義) #-------------------------------------------------------------------------- def regist_rack(actor_id, id) actor = $game_actors[actor_id] data = [id, actor.equips] actor.regist_weapon_rack(data) end #-------------------------------------------------------------------------- # ● 指定IDのアクターに指定IDのステートを登録(追加定義) #-------------------------------------------------------------------------- def regist_style(actor_id, state_id) actor = $game_actors[actor_id] actor.regist_style_state(state_id) end #-------------------------------------------------------------------------- # ● 指定IDのアクターの指定IDのステートを登録解除(追加定義) #-------------------------------------------------------------------------- def remove_style(actor_id, state_id) actor = $game_actors[actor_id] actor.remove_style_state(state_id) end end #============================================================================== # ■ RPG::Actor(追加定義) #============================================================================== class RPG::Actor < RPG::BaseItem #-------------------------------------------------------------------------- # ★ ラック数の定義(追加定義) #-------------------------------------------------------------------------- def rack_num @note.match(/<ラック数\s?(\d+)\s?>/) return $1 ? $1.to_i : KURE::WeaponRack::BASE_RACK_NUM end end #============================================================================== # ■ Game_Actor(追加定義) #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 全てのウェポンラックを呼び出す #-------------------------------------------------------------------------- def all_weapon_rack @weapon_rack ||= [] actor.rack_num.times{|id| @weapon_rack[id] ||= []} return @weapon_rack end #-------------------------------------------------------------------------- # ● 指定IDのウェポンラックを呼び出す #-------------------------------------------------------------------------- def weapon_rack(id) @weapon_rack ||= [] @weapon_rack[id] ||= [] return @weapon_rack[id] end #-------------------------------------------------------------------------- # ● 指定IDのウェポンラックへデータを登録 #-------------------------------------------------------------------------- def regist_weapon_rack(data) @weapon_rack ||= [] @weapon_rack[data[0]] = data[1] end #-------------------------------------------------------------------------- # ● 指定IDのウェポンラックへ装備を換装 #-------------------------------------------------------------------------- def set_weapon_rack(id) clear_equipments @weapon_rack[id] ||= [] @weapon_rack[id].each_with_index{|item, index| next unless item change_equip(index, item)} release_unequippable_items end #-------------------------------------------------------------------------- # ● 現在のスタイルステートを呼び出す #-------------------------------------------------------------------------- def now_style return @style_state_now end #-------------------------------------------------------------------------- # ● 全てのスタイルステートを呼び出す #-------------------------------------------------------------------------- def all_style_state @style_state ||= [] return @style_state end #-------------------------------------------------------------------------- # ● スタイルステートの登録 #-------------------------------------------------------------------------- def regist_style_state(state_id) @style_state ||= [] @style_state.push(state_id) end #-------------------------------------------------------------------------- # ● スタイルステートの削除 #-------------------------------------------------------------------------- def remove_style_state(state_id) @style_state ||= [] @style_state.delete(state_id) end #-------------------------------------------------------------------------- # ● 指定IDのスタイルステートを発動 #-------------------------------------------------------------------------- def set_style_state(state_id) @style_state ||= [] return unless @style_state.include?(state_id) @style_state.each{|id| ; next if id == state_id ; erase_state(id)} add_state(state_id) if state_id @style_state_now = state_id end #-------------------------------------------------------------------------- # ◎ ステート情報をクリア(エイリアス再定義) #-------------------------------------------------------------------------- alias k_style_before_clear_states clear_states unless $! def clear_states k_style_before_clear_states add_state(@style_state_now) if @style_state_now end end #============================================================================== # ■ Scene_SetStyle #============================================================================== class Scene_SetStyle < Scene_MenuBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_help_window create_small_status_window create_command_window create_select_window create_info_window create_task_window @actor = $game_party.members[0] $game_party.menu_actor = @actor set_window_task end #-------------------------------------------------------------------------- # ● ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_small_status_window wx = 0 ; wy = @help_window.height ww = 305 ; wh = 24 * 5 @status_window = Window_SetStyle_Small_Status.new(wx,wy,ww,wh) end #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_command_window wx = 0 wy = @help_window.height + @status_window.height ww = @status_window.width @command_window = Window_SetStyle_Command.new(wx,wy,ww) @command_window.help_window = @help_window @command_window.set_handler(:rack, method(:command_rack)) @command_window.set_handler(:style, method(:command_style)) @command_window.set_handler(:cancel, method(:command_cancel)) @command_window.set_handler(:pagedown, method(:next_actor)) @command_window.set_handler(:pageup, method(:prev_actor)) @command_window.activate end #-------------------------------------------------------------------------- # ● セレクトウィンドウの作成 #-------------------------------------------------------------------------- def create_select_window wx = 0 ; wy = @command_window.height + @help_window.height + @status_window.height ww = 305 ; wh = Graphics.height - wy @select_window = Window_SetStyle_Selection.new(wx, wy, ww, wh) @select_window.help_window = @help_window @select_window.set_handler(:ok, method(:on_select_ok)) @select_window.set_handler(:cancel, method(:on_select_cancel)) @select_window.set_handler(:pagedown, method(:next_actor)) @select_window.set_handler(:pageup, method(:prev_actor)) @select_window.deactivate @select_window.unselect end #-------------------------------------------------------------------------- # ● インフォメーションウィンドウの作成 #-------------------------------------------------------------------------- def create_info_window @info_window = Window_Scene_SetStyle_Info.new(@select_window.width, @help_window.height,Graphics.width - @select_window.width,Graphics.height - @help_window.height) end #-------------------------------------------------------------------------- # ● タスクウィンドウの作成 #-------------------------------------------------------------------------- def create_task_window wx = (Graphics.width - 180)/2 wy = (Graphics.height - 180)/2 @task_window = Window_k_WeaponRack_Task_Command.new(wx, wy) @task_window.unselect @task_window.deactivate @task_window.z += 10 @task_window.hide #ハンドラのセット @task_window.set_handler(:cancel, method(:close_task)) @task_window.set_handler(:ok, method(:task_ok)) end #-------------------------------------------------------------------------- # ● ウィンドウのセッティング処理 #-------------------------------------------------------------------------- def set_window_task @command_window.select_window = @select_window @select_window.info_window = @info_window @task_window.help_window = @help_window @status_window.actor = @actor @select_window.actor = @actor @info_window.actor = @actor @command_window.select(0) @help_window.set_text("項目を選択してください LR:アクター切り替え") end #-------------------------------------------------------------------------- # ● コマンド[ラック] #-------------------------------------------------------------------------- def command_rack @select_window.process = 0 @info_window.draw_index = 0 cmd_to_select @help_window.set_text(KURE::WeaponRack::RACK_NAME + "を選択してください LR:アクター切り替え") end #-------------------------------------------------------------------------- # ● コマンド[スタイル] #-------------------------------------------------------------------------- def command_style @select_window.process = 1 @info_window.draw_index = 1 cmd_to_select @help_window.set_text(KURE::StyleChange::STYLE_NAME + "を選択してください LR:アクター切り替え") end #-------------------------------------------------------------------------- # ● コマンド[キャンセル] #-------------------------------------------------------------------------- def command_cancel return_scene end #-------------------------------------------------------------------------- # ● セレクトウィンドウ[決定] #-------------------------------------------------------------------------- def on_select_ok case @select_window.process when 0 call_task when 1 @actor.set_style_state(@select_window.current_ext) @status_window.refresh @info_window.refresh @select_window.activate end end #-------------------------------------------------------------------------- # ● セレクトウィンドウ[キャンセル] #-------------------------------------------------------------------------- def on_select_cancel @select_window.deactivate @select_window.unselect @info_window.draw_object = nil @command_window.activate @help_window.set_text("項目を選択してください LR:アクター切り替え") end #-------------------------------------------------------------------------- # ● タスクウィンドウ呼び出し #-------------------------------------------------------------------------- def call_task @select_window.deactivate @task_window.show @task_window.activate @task_window.select(0) end #-------------------------------------------------------------------------- # ● タスクウィンドウ #-------------------------------------------------------------------------- def close_task @task_window.hide @task_window.deactivate @select_window.activate @help_window.set_text(KURE::WeaponRack::RACK_NAME + "を選択してください LR:アクター切り替え") end #-------------------------------------------------------------------------- # ● タスクウィンドウ[決定] #-------------------------------------------------------------------------- def task_ok case @task_window.index when 0 close_task @actor.set_weapon_rack(@select_window.current_ext[0]) when 1 close_task data = [@select_window.index, @actor.equips] @actor.regist_weapon_rack(data) @info_window.draw_object = data @select_window.refresh @info_window.refresh when 2 close_task end end #-------------------------------------------------------------------------- # ● コマンド→セレクト #-------------------------------------------------------------------------- def cmd_to_select @select_window.activate @select_window.select(0) @command_window.deactivate end #-------------------------------------------------------------------------- # ● 次のアクターに切り替え #-------------------------------------------------------------------------- def next_actor set_passive @actor = $game_party.menu_actor_next on_actor_change end #-------------------------------------------------------------------------- # ● 前のアクターに切り替え #-------------------------------------------------------------------------- def prev_actor set_passive @actor = $game_party.menu_actor_prev on_actor_change end #-------------------------------------------------------------------------- # ● アクターの切り替え #-------------------------------------------------------------------------- def on_actor_change set_window_task on_select_cancel @command_window.select(0) @command_window.activate end #-------------------------------------------------------------------------- # ● パッシブスキル更新 #-------------------------------------------------------------------------- def set_passive @actor.fix_memorys if $kure_integrate_script[:Memorize] @actor.set_passive_object if $kure_integrate_script[:integrate] @actor.release_unequippable_items end end #============================================================================== # ■ Window_SetStyle_Small_Status #============================================================================== class Window_SetStyle_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_face(@actor, 0, line_height * 0) draw_actor_name(@actor, 108, line_height * 0) draw_actor_icons(@actor, 108, line_height * 1) draw_actor_hp(@actor, 108, line_height * 2) draw_actor_mp(@actor, 108, line_height * 3) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear draw_status end end #============================================================================== # ■ Window_SetStyle_Command #============================================================================== class Window_SetStyle_Command < Window_HorzCommand attr_accessor :select_window # セレクトウィンドウ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width) @window_width = width ; super(x, y) end #-------------------------------------------------------------------------- # ● 各種設定 #-------------------------------------------------------------------------- def window_width ; @window_width ; end def col_max ; 2 ; end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor return if @index < 0 @select_window.process = current_ext if @select_window end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command(KURE::WeaponRack::RACK_NAME, :rack, true, 0) add_command(KURE::StyleChange::STYLE_NAME, :style, true, 1) end end #============================================================================== # ■ Window_SetStyle_Selection #============================================================================== class Window_SetStyle_Selection < Window_Command #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :process # プロセス attr_accessor :info_window # インフォメーションウィンドウ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) @width = width ; @height = height super(x, y) @actor = nil @process = 0 refresh end #-------------------------------------------------------------------------- # ● ウィンドウ高さと幅の取得 #-------------------------------------------------------------------------- def window_height ; return @height ; end def window_width ; return @width ; end #-------------------------------------------------------------------------- # ● アクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end #-------------------------------------------------------------------------- # ● プロセスの設定 #-------------------------------------------------------------------------- def process=(process) return if @process == process @process = process refresh end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor return if @index < 0 @info_window.draw_object = current_ext if @info_window end #-------------------------------------------------------------------------- # ● →キー入力時動作 #-------------------------------------------------------------------------- def cursor_right(wrap = false) end #-------------------------------------------------------------------------- # ● ←キー入力時操作 #-------------------------------------------------------------------------- def cursor_left(wrap = false) end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list return unless @actor case @process when 0 @actor.all_weapon_rack.each_with_index{|data, index| add_command("ラック" + index.to_s , :ok ,true, [index, data])} when 1 @actor.all_style_state.each{|id| add_command($data_states[id].name , :ok ,true, id)} end end end #============================================================================== # ■ Window_Scene_SetStyle_Info #============================================================================== class Window_Scene_SetStyle_Info < Window_EquipStatus attr_accessor :draw_index attr_accessor :draw_object attr_accessor :actor #-------------------------------------------------------------------------- # ◎ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y,width,height) @draw_index = 0 ; @draw_object = nil ; @actor = nil @width = width ; @height = height super(x, y) end #-------------------------------------------------------------------------- # ◎ 描画INDEXの設定 #-------------------------------------------------------------------------- def draw_index=(index) return if @draw_index == index ; @draw_index = index ; refresh end #-------------------------------------------------------------------------- # ◎ アクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor ; @actor = actor ; refresh end #-------------------------------------------------------------------------- # ◎ 描画オブジェクトを設定 #-------------------------------------------------------------------------- def draw_object=(item) return if @draw_object == item ; @draw_object = item ; refresh end #-------------------------------------------------------------------------- # ◎ ウィンドウの設定 #-------------------------------------------------------------------------- def window_width ; return @width ; end def window_height ; return @height; end #-------------------------------------------------------------------------- # ◎ リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear #タイトルゲージを描画 draw_gauge(0,0, contents.width, 1, mp_gauge_color2,crisis_color) change_color(normal_color) case @draw_index when 0 ; draw_index_zero when 1 ; draw_index_one end end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 0) #-------------------------------------------------------------------------- def draw_index_zero return unless @draw_object draw_text(0, 0, 180, contents.font.size, "ラック" + @draw_object[0].to_s) @draw_object[1].each_with_index{|item, index| pos_y = line_height * (index + 1) draw_item_name(item, 10, pos_y)} end #-------------------------------------------------------------------------- # ◎ 操作説明(draw_index = 100,101) #-------------------------------------------------------------------------- def draw_index_one return unless @draw_object draw_text(0, 0, 180, contents.font.size, "スタイルステート") return unless @actor change_color(system_color) draw_text(0, line_height * 1, 50, contents.font.size, "現在") draw_text(30, line_height * 2, contents.width, 20, "→") change_color(normal_color) if @actor.now_style name = $data_states[@actor.now_style].name index = $data_states[@actor.now_style].icon_index else name = "無し" ; index = 0 end draw_icon(index, 55, line_height * 1) draw_text(85, line_height * 1, contents.width - 85, contents.font.size, name) draw_icon($data_states[@draw_object].icon_index, 65, line_height * 2) draw_text(105, line_height * 2, contents.width - 105, contents.font.size, $data_states[@draw_object].name) draw_features(0,line_height * 3, $data_states[@draw_object]) end #-------------------------------------------------------------------------- # ◎ 特徴の描画(draw_index = 200..299) #-------------------------------------------------------------------------- def draw_features(x,y,item) return unless item draw_list = KURE.basic_actor_add_feature_txt(item) unless $kure_integrate_script[:integrate] draw_list = KURE.call_add_feature_txt(item) if $kure_integrate_script[:integrate] contents.font.size = 20 draw_list[0..10].each_with_index{|text, index| pos_y = y + contents.font.size * index draw_text(x, pos_y, contents.width, contents.font.size, text) } contents.font.size = 24 end end #============================================================================== # ■ Window_k_WeaponRack_Task_Command #============================================================================== class Window_k_WeaponRack_Task_Command < Window_Command attr_accessor :help_window #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y) end #-------------------------------------------------------------------------- # ● ウィンドウ幅と高さの取得 #-------------------------------------------------------------------------- def window_width ; return 180 ; end def window_height; fitting_height(visible_line_number) ; end #-------------------------------------------------------------------------- # ● ヘルプの設定 #-------------------------------------------------------------------------- def call_update_help return unless @help_window case current_ext when 1 ; @help_window.set_text("指定のラックの装備に変更します。") when 2 ; @help_window.set_text("指定のラックに装備を登録します。") when 3 ; @help_window.set_text("ラックの選択に戻ります。") end end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command("装備変更", :ok, true, 1) add_command("装備登録", :ok, true, 2) add_command("キャンセル", :ok, true, 3) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh clear_command_list make_command_list create_contents self.height = window_height select(0) super end end #------------------------------------------------------------------------------ #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ◎ 全ウィンドウの作成(エイリアス再定義) #-------------------------------------------------------------------------- alias k_before_wepanrack_create_all_windows create_all_windows def create_all_windows k_before_wepanrack_create_all_windows create_weaponrck_window end #-------------------------------------------------------------------------- # ◎ アクターコマンドウィンドウの作成(エイリアス再定義) #-------------------------------------------------------------------------- alias k_before_wepanrack_create_actor_command_window create_actor_command_window def create_actor_command_window k_before_wepanrack_create_actor_command_window @actor_command_window.set_handler(:rack, method(:command_rack)) end #-------------------------------------------------------------------------- # ★ ウェポンラックウィンドウの作成(追加定義) #-------------------------------------------------------------------------- def create_weaponrck_window @rack_window = Window_WeaponRack.new(@help_window, @info_viewport) @rack_window.set_handler(:ok, method(:on_rack_ok)) @rack_window.set_handler(:cancel, method(:on_rack_cancel)) end #-------------------------------------------------------------------------- # ● コマンド[ウェポンラック] #-------------------------------------------------------------------------- def command_rack @rack_window.actor = BattleManager.actor @rack_window.refresh @rack_window.show.activate @rack_window.select(0) @help_window.set_text("ラックを選択してください。") end #-------------------------------------------------------------------------- # ★ ウェポンラック[決定](追加定義) #-------------------------------------------------------------------------- def on_rack_ok @rack_window.actor.set_weapon_rack(@rack_window.index) @rack_window.hide @actor_command_window.activate end #-------------------------------------------------------------------------- # ★ ウェポンラック[キャンセル](追加定義) #-------------------------------------------------------------------------- def on_rack_cancel @rack_window.hide @actor_command_window.activate end end #============================================================================== # ■ Window_WeaponRack #============================================================================== class Window_WeaponRack < Window_Selectable attr_accessor :actor #-------------------------------------------------------------------------- # ● オブジェクト初期化 # info_viewport : 情報表示用ビューポート #-------------------------------------------------------------------------- def initialize(help_window, info_viewport) y = help_window.height super(0, y, Graphics.width, info_viewport.rect.y - y) self.visible = false @help_window = help_window @info_viewport = info_viewport end #-------------------------------------------------------------------------- # ● アクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh self.oy = 0 end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max @data ? @data.size : 1 end #-------------------------------------------------------------------------- # ● スキルリストの作成 #-------------------------------------------------------------------------- def make_item_list @data = @actor ? @actor.all_weapon_rack : [] end #-------------------------------------------------------------------------- # ● 項目を描画する矩形の取得 #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new rect.width = item_width / 2 rect.height = item_height rect.x = index % col_max * (item_width + spacing) rect.y = index / col_max * item_height rect end #-------------------------------------------------------------------------- # ● 全項目の描画 #-------------------------------------------------------------------------- def draw_all_items item_max.times {|i| draw_item(i) } draw_rack_data end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) rect.width -= 4 draw_text(rect, "ラック" + index.to_s) end #-------------------------------------------------------------------------- # ● ラックの描画 #-------------------------------------------------------------------------- def draw_rack_data contents.clear_rect((contents.width / 2) + 10, 0, (contents.width / 2) - 10, contents.height) return unless @data[@index] @data[@index].each_with_index{|item, index| pos_y = line_height * index draw_item_name(item, (contents.width / 2) + 10, pos_y)} end #-------------------------------------------------------------------------- # ◎ カーソルの移動処理(エイリアス) #-------------------------------------------------------------------------- alias k_before_wepanrack_process_cursor_move process_cursor_move def process_cursor_move last_index = @index k_before_wepanrack_process_cursor_move draw_rack_data if @index != last_index end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh make_item_list create_contents draw_all_items end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help end #-------------------------------------------------------------------------- # ● ウィンドウの表示 #-------------------------------------------------------------------------- def show @help_window.show ; super end #-------------------------------------------------------------------------- # ● ウィンドウの非表示 #-------------------------------------------------------------------------- def hide @help_window.hide ; super end end #============================================================================== # ■ Window_ActorCommand #============================================================================== class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- alias k_before_wepanrack_make_command_list make_command_list def make_command_list k_before_wepanrack_make_command_list add_rack_command end #-------------------------------------------------------------------------- # ● アイテムコマンドをリストに追加 #-------------------------------------------------------------------------- def add_rack_command add_command("ラック", :rack) 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