#============================================================================== # ■アクター個別管理専用編成システム Ver0.95-α for RGSS3 # □作成者 kure #=============================================================================== $kure_integrate_script = {} if $kure_integrate_script == nil $kure_integrate_script[:Actor_Organize] = 100 p "アクター個別管理編成" module KURE module Actor_Organize #初期設定(変更しない事)---------------------------------------------------- COMMAND_NAME = [] #動作設定------------------------------------------------------------------ #パーティーの最大メンバー数 MAX_PARTY_MEBER = 8 #PTM数0人プロテクト(0=OFF 1=ON) ZERO_PROTECT = 1 #表示設定------------------------------------------------------------------ #ゲームに使用する歩行グラフィックの高さと横幅 #RTPのサイズ32で調節しています。 CHARACTER_HEIGHT = 32 CHARACTER_WIDTH = 32 #コマンド名 COMMAND_NAME[0] = "アクター編成" #アクター編成 COMMAND_NAME[1] = "アクター離脱" #アクター離脱 COMMAND_NAME[2] = "アクター確認" #アクター確認 end end #============================================================================== # ■ RPG::Actor(追加定義) #============================================================================== class RPG::Actor < RPG::BaseItem #-------------------------------------------------------------------------- # ☆ 合成不可の定義(再定義) #-------------------------------------------------------------------------- def no_organize @note.include?("<編成固定>") end #-------------------------------------------------------------------------- # ☆ 削除補償の定義(再定義) #-------------------------------------------------------------------------- def delete_compensation result = Array.new cheak_note = @note while cheak_note do cheak_note.match(/<削除補償\s?(\d+)\s?,\s?(\d+)\s?,\s?(\d+)>/) result.push([$1.to_i, $2.to_i, $3.to_i]) if $1 && $2 && $3 cheak_note = $' end return result end end #============================================================================== # ■ Game_Party #============================================================================== class Game_Party < Game_Unit #-------------------------------------------------------------------------- # ● 指定位置のアクターを入れ替える(追加定義) #-------------------------------------------------------------------------- def set_add_actor(actor, index) @actors[index] = actor.id if actor && @actors[index] @actors.push(actor.id) if actor && !@actors[index] @actors.delete(@actors[index]) if !actor && @actors[index] $game_player.refresh end end #============================================================================== # ■ Scene_Actor_Organize #============================================================================== class Scene_Actor_Organize < Scene_MenuBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_help_window create_command_window create_ptm_window create_actor_select_window create_status_window create_popup_window window_setting end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window maxnum = KURE::Actor_Manage::MAX_MEMBER nownum = $game_actors.all_data.compact.size @help_window = Window_Help.new(1) @help_window.set_text("メニューを選択してください" + "        " + nownum.to_s + "/" + maxnum.to_s ) end #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_command_window wx = 0 wy = @help_window.height @cmd_window = Window_AO_Command_List.new(wx, wy) #ハンドラのセット @cmd_window.set_handler(:cancel, method(:cmd_cancel)) @cmd_window.set_handler(:ok, method(:cmd_ok)) end #-------------------------------------------------------------------------- # ● パーティーメンバーウィンドウの作成 #-------------------------------------------------------------------------- def create_ptm_window wx = 0 wy = @help_window.height wh = Graphics.height - @help_window.height @ptm_window = Window_AO_ALL_PartyMember_List.new(wx, wy, wh) #ハンドラのセット @ptm_window.set_handler(:cancel, method(:ptm_cancel)) @ptm_window.set_handler(:ok, method(:ptm_ok)) @ptm_window.deactivate @ptm_window.hide end #-------------------------------------------------------------------------- # ● アクター選択ウィンドウの作成 #-------------------------------------------------------------------------- def create_actor_select_window wx = @ptm_window.width wy = @help_window.height ww = Graphics.width - wx wh = 24 + (KURE::Actor_Organize::CHARACTER_HEIGHT + 4) * 4 @actor_selet_window = Window_AO_ALL_Actor_List.new(wx, wy, ww, wh) #ハンドラのセット @actor_selet_window.set_handler(:cancel, method(:as_cancel)) @actor_selet_window.set_handler(:ok, method(:as_ok)) @actor_selet_window.set_handler(:CTRL, method(:as_mode)) @actor_selet_window.deactivate @actor_selet_window.unselect end #-------------------------------------------------------------------------- # ● アクター選択ウィンドウの作成 #-------------------------------------------------------------------------- def create_status_window wx = @ptm_window.width wy = @help_window.height + @actor_selet_window.height ww = Graphics.width - wx wh = Graphics.height - wy @status_window = Window_AO_Status_Window.new(wx, wy, ww, wh) end #-------------------------------------------------------------------------- # ● ポップアップウィンドウの作成 #-------------------------------------------------------------------------- def create_popup_window wx = Graphics.width / 4 - 50 wy = (Graphics.height - (24 * 11)) / 2 @popup_window = Window_AO_Popup.new(wx, wy) @popup_window.z += 100 @popup_window.unselect @popup_window.deactivate @popup_window.back_opacity = 255 @popup_window.hide @popup_window.set_handler(:cancel, method(:pop_cancel)) @popup_window.set_handler(:ok, method(:pop_ok)) end #-------------------------------------------------------------------------- # ● ウィンドウのセット #-------------------------------------------------------------------------- def window_setting @process = 0 @ptm_window.set_actor_list @actor_selet_window.set_actor_list @ptm_window.status_window = @status_window @actor_selet_window.status_window = @status_window end #-------------------------------------------------------------------------- # ● コマンドウィンドウ[決定] #-------------------------------------------------------------------------- def cmd_ok @process = @cmd_window.current_ext case @process when 0 @cmd_window.deactivate @cmd_window.hide @ptm_window.show @ptm_window.activate @help_window.set_text("メンバーを選択してください") set_mode(1) @ptm_window.select(0) when 1,2 @cmd_window.deactivate @actor_selet_window.activate @actor_selet_window.select(0) @help_window.set_text("メンバーを選択してください") end end #-------------------------------------------------------------------------- # ● コマンドウィンドウ[キャンセル] #-------------------------------------------------------------------------- def cmd_cancel return_scene end #-------------------------------------------------------------------------- # ● パーティーウィンドウ[決定] #-------------------------------------------------------------------------- def ptm_ok @ptm_window.deactivate @actor_selet_window.activate @actor_selet_window.select(0) name = @ptm_window.actor ? @ptm_window.actor.name + "と" : "" @help_window.set_text(name + "交代するメンバーを選択してください") end #-------------------------------------------------------------------------- # ● パーティーウィンドウ[キャンセル] #-------------------------------------------------------------------------- def ptm_cancel @ptm_window.deactivate @ptm_window.hide @cmd_window.show @cmd_window.activate maxnum = KURE::Actor_Manage::MAX_MEMBER nownum = $game_actors.all_data.compact.size @help_window.set_text("メニューを選択してください" + "        " + nownum.to_s + "/" + maxnum.to_s ) set_mode(0) end #-------------------------------------------------------------------------- # ● アクター選択ウィンドウ[決定] #-------------------------------------------------------------------------- def as_ok case @process when 0 change_actor_process as_cancel when 1 if @actor_selet_window.actor.lock @actor_selet_window.activate else @actor_selet_window.deactivate pop_up_open end when 2 @actor_selet_window.actor.change_lock if @actor_selet_window.actor @actor_selet_window.refresh @status_window.refresh @actor_selet_window.activate end end #-------------------------------------------------------------------------- # ● アクター選択ウィンドウ[キャンセル] #-------------------------------------------------------------------------- def as_cancel @actor_selet_window.deactivate @actor_selet_window.unselect case @process when 0 @ptm_window.activate @help_window.set_text("メンバーを選択してください") when 1,2 @cmd_window.activate maxnum = KURE::Actor_Manage::MAX_MEMBER nownum = $game_actors.all_data.compact.size @help_window.set_text("メニューを選択してください" + "        " + nownum.to_s + "/" + maxnum.to_s ) end end #-------------------------------------------------------------------------- # ● アクター選択ウィンドウ[SHIFT] #-------------------------------------------------------------------------- def as_mode @actor_selet_window.change_sort end #-------------------------------------------------------------------------- # ● ポップアップ[決定] #-------------------------------------------------------------------------- def pop_ok case @popup_window.current_ext when 0 @popup_window.actor.actor.delete_compensation.each{|data| case data[0] when 1 ; $game_party.gain_gold(data[2]) when 2 ; $game_party.gain_item($data_items[data[1]] ,data[2]) when 3 ; $game_party.gain_item($data_weapons[data[1]],data[2]) when 4 ; $game_party.gain_item($data_armors[data[1]],data[2]) end } $game_party.delete_actor(@popup_window.actor.id) @actor_selet_window.set_actor_list @actor_selet_window.cursor_fix end pop_up_close @actor_selet_window.activate end #-------------------------------------------------------------------------- # ● ポップアップを表示[キャンセル] #-------------------------------------------------------------------------- def pop_cancel pop_up_close @actor_selet_window.activate end #-------------------------------------------------------------------------- # ● アクター入れ替え処理 #-------------------------------------------------------------------------- def change_actor_process $game_party.set_add_actor(@actor_selet_window.actor, @ptm_window.index) @ptm_window.set_actor_list @actor_selet_window.set_actor_list @ptm_window.index = @ptm_window.index end #-------------------------------------------------------------------------- # ● 画面描画の切り替え処理 #-------------------------------------------------------------------------- def set_mode(value) @actor_selet_window.mode = value @status_window.mode = value end #-------------------------------------------------------------------------- # ● ポップアップを表示 #-------------------------------------------------------------------------- def pop_up_open return unless @actor_selet_window.current_ext @popup_window.actor = @actor_selet_window.current_ext @popup_window.show @popup_window.activate @popup_window.select(1) end #-------------------------------------------------------------------------- # ● ポップアップを閉じる #-------------------------------------------------------------------------- def pop_up_close @popup_window.hide @popup_window.deactivate @popup_window.unselect end end #============================================================================== # ■ Window_AO_Command_List #============================================================================== class Window_AO_Command_List < Window_Command #-------------------------------------------------------------------------- # ● ウィンドウ幅と高さ、項目の高さの取得 #-------------------------------------------------------------------------- def window_width ; 200 ; end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list list = KURE::Actor_Organize::COMMAND_NAME add_command(list[0], :ok, enable?(0), 0) add_command(list[1], :ok, enable?(1), 1) add_command(list[2], :ok, enable?(2), 2) end #-------------------------------------------------------------------------- # ● コマンドの有効判定 #-------------------------------------------------------------------------- def enable?(actor) true end end #============================================================================== # ■ Window_AO_ALL_PartyMember_List #============================================================================== class Window_AO_ALL_PartyMember_List< Window_Command attr_accessor :actor attr_accessor :status_window #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, height) @window_height = height @max_page = 0 @page_index = 0 @last_index = 0 @actor_list = nil super(x,y) end #-------------------------------------------------------------------------- # ● アクターリストの設定 #-------------------------------------------------------------------------- def set_actor_list @actor_list = $game_party.all_members ; refresh end #-------------------------------------------------------------------------- # ● ウィンドウ幅と高さ、項目の高さの取得 #-------------------------------------------------------------------------- def window_width ; 200 ; end def window_height ; @window_height ; end def item_height ; KURE::Actor_Organize::CHARACTER_HEIGHT + 2 ; end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) change_color(normal_color, command_enabled?(index)) rect = item_rect(index) draw_text(rect, (index + 1).to_s , alignment) rect.x += 20 rect.x += KURE::Actor_Organize::CHARACTER_WIDTH / 2 actor = @list[index][:ext] draw_character(actor.character_name, actor.character_index , rect.x, rect.y + rect.height) if actor rect.x += (KURE::Actor_Organize::CHARACTER_WIDTH / 2) + 2 draw_text(rect, command_name(index), alignment) end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list return unless @actor_list KURE::Actor_Organize::MAX_PARTY_MEBER.times{|index| actor = @actor_list[index] if actor add_command(actor.name, :ok, enable?(actor), actor) else add_command("-empty-", :ok, enable_empty?(index), nil) end } end #-------------------------------------------------------------------------- # ● コマンドの有効判定 #-------------------------------------------------------------------------- def enable?(actor) return false if actor.actor.no_organize return true end #-------------------------------------------------------------------------- # ● コマンドの有効判定 #-------------------------------------------------------------------------- def enable_empty?(index) return true if @actor_list.size >= index return false end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor call_update_help @actor = current_ext @status_window.actor1 = current_ext if @status_window end end #============================================================================== # ■ Window_AO_ALL_Actor_List #============================================================================== class Window_AO_ALL_Actor_List< Window_Command attr_accessor :actor attr_accessor :status_window attr_accessor :mode #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) @window_height = height ; @window_width = width @max_page = 0 ; @page_index = 0 ; @last_index = 0 @mode = 0 @actor_list = nil @sort = 0 super(x,y) end #-------------------------------------------------------------------------- # ● 選択中のアクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor ; @actor = actor ; refresh end #-------------------------------------------------------------------------- # ● 表示モードの切り替え #-------------------------------------------------------------------------- def mode=(value) return if @mode == value ; @mode = value ; refresh end #-------------------------------------------------------------------------- # ● 決定やキャンセルなどのハンドリング処理(エイリアス) #-------------------------------------------------------------------------- alias k_before_process_handling process_handling unless $! def process_handling k_before_process_handling return process_ctrl if handle?(:CTRL) && Input.trigger?(:CTRL) end #-------------------------------------------------------------------------- # ● CTRL ボタン(CTRL)が押されたときの処理 #-------------------------------------------------------------------------- def process_ctrl Input.update call_handler(:CTRL) end #-------------------------------------------------------------------------- # ● 並べ替えモードの切り替え #-------------------------------------------------------------------------- def change_sort @sort += 1 @sort = 0 if @sort > 10 set_actor_list @actor = current_ext @status_window.actor2 = current_ext if @status_window end #-------------------------------------------------------------------------- # ● アクターリストの設定 #-------------------------------------------------------------------------- def set_actor_list @actor_list = $game_actors.all_data.select{|actor| include?(actor)} case @sort when 0 when 1 ; @actor_list = @actor_list.sort{ |a,b| a.level <=> b.level} when 2 ; @actor_list = @actor_list.sort{ |a,b| b.level <=> a.level} when 3 ; @actor_list = @actor_list.sort{ |a,b| b.mhp <=> a.mhp} when 4 ; @actor_list = @actor_list.sort{ |a,b| b.mmp <=> a.mmp} when 5 ; @actor_list = @actor_list.sort{ |a,b| b.atk <=> a.atk} when 6 ; @actor_list = @actor_list.sort{ |a,b| b.def <=> a.def} when 7 ; @actor_list = @actor_list.sort{ |a,b| b.mat <=> a.mat} when 8 ; @actor_list = @actor_list.sort{ |a,b| b.mdf <=> a.mdf} when 9 ; @actor_list = @actor_list.sort{ |a,b| b.agi <=> a.agi} when 10 ; @actor_list = @actor_list.sort{ |a,b| b.luk <=> a.luk} end refresh end #-------------------------------------------------------------------------- # ● コマンドの有効判定 #-------------------------------------------------------------------------- def include?(actor) if $kure_integrate_script[:Multi_Party] all_id = $game_party.call_all_save_actor.flatten return false if all_id.include?(actor.id) end return false if $game_party.actors.include?(actor.id) return true end #-------------------------------------------------------------------------- # ● ウィンドウ幅と高さ、項目の高さの取得 #-------------------------------------------------------------------------- def window_width ; @window_width ; end def window_height ; @window_height ; end def item_height ; KURE::Actor_Organize::CHARACTER_HEIGHT + 4 ; end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max ; return 4 ; end #-------------------------------------------------------------------------- # ● 横に項目が並ぶときの空白の幅を取得 #-------------------------------------------------------------------------- def spacing ; return 8 ; end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) change_color(normal_color, command_enabled?(index)) rect = item_rect(index) actor_x = (KURE::Actor_Organize::CHARACTER_WIDTH / 2) + 1 actor = @list[index][:ext] if actor draw_character(actor.character_name, actor.character_index , rect.x + actor_x, rect.y + rect.height - 2) last_size = contents.font.size contents.font.size = 18 change_color(system_color) case @sort when 0,1,2 ; txt = "Lv" ; txt2 = actor.level.to_s when 3 ; txt = "MHP" ; txt2 = actor.mhp.to_s when 4 ; txt = "MMP" ; txt2 = actor.mmp.to_s when 5 ; txt = "ATK" ; txt2 = actor.atk.to_s when 6 ; txt = "DEF" ; txt2 = actor.def.to_s when 7 ; txt = "MATK" ; txt2 = actor.mat.to_s when 8 ; txt = "MDEF" ; txt2 = actor.mdf.to_s when 9 ; txt = "AGI" ; txt2 = actor.agi.to_s when 10 ; txt = "LUK" ; txt2 = actor.luk.to_s end draw_text(rect.x + (actor_x * 2) - 2, rect.y, rect.width - (actor_x * 2), 18 , txt, 1) change_color(normal_color) draw_text(rect.x + (actor_x * 2) - 2, rect.y + 18, rect.width - (actor_x * 2), 18 , txt2, 1) contents.font.size = last_size else draw_text(rect, command_name(index), 1) end end #-------------------------------------------------------------------------- # ● カーソルを 1 ページ後ろに移動 #-------------------------------------------------------------------------- def cursor_pagedown @page_index += 1 ; cursor_fix end #-------------------------------------------------------------------------- # ● カーソルを 1 ページ前に移動 #-------------------------------------------------------------------------- def cursor_pageup @page_index -= 1 ; cursor_fix end #-------------------------------------------------------------------------- # ● カーソル位置修正 #-------------------------------------------------------------------------- def cursor_fix refresh @index = [@index,@last_index].min update_cursor call_update_help @actor = current_ext @status_window.actor2 = current_ext if @status_window end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list return unless @actor_list data = @actor_list @max_page = data.size.divmod(11)[0] - 1 @max_page += 1 if data.size.divmod(11)[1] != 0 @max_page += 1 if data.size == 0 @page_index = 0 if @page_index > @max_page @page_index = @max_page if @page_index < 0 first = @page_index * 11 last = [((@page_index + 1 ) * 11) - 1, data.size - 1].min @last_index = last - first + 1 data = data[first..last] add_command("外す", :ok, protect?, nil) if @mode == 1 data.each{|actor| add_command(actor.name, :ok, enable?(actor), actor)} end #-------------------------------------------------------------------------- # ● コマンドの有効判定 #-------------------------------------------------------------------------- def protect? return true if KURE::Actor_Organize::ZERO_PROTECT == 0 return true if KURE::Actor_Organize::ZERO_PROTECT == 1 && $game_party.all_members.size >= 2 return false end #-------------------------------------------------------------------------- # ● コマンドの有効判定 #-------------------------------------------------------------------------- def enable?(actor) return true end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor call_update_help @actor = current_ext @status_window.actor2 = current_ext if @status_window end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_guide last_size = contents.font.size contents.font.size = 20 change_color(normal_color) draw_text(0, contents.height - line_height, contents.width / 2 - 30, line_height, "LR:切替 " + "(" + (@page_index + 1).to_s + "/" + (@max_page + 1).to_s + ")", 1) case @sort when 0 ; txt = "ID順" when 1 ; txt = "Lv昇順" when 2 ; txt = "Lv降順" when 3 ; txt = "最大HP順" when 4 ; txt = "最大MP順" when 5 ; txt = "攻撃力順" when 6 ; txt = "防御力順" when 7 ; txt = "魔法攻撃力順" when 8 ; txt = "魔法防御順" when 9 ; txt = "敏捷性順" when 10 ; txt = "運順" end draw_text(contents.width / 2 - 30, contents.height - line_height, contents.width / 2 + 30, line_height, "CTRL:切替(" + txt + ")", 1) contents.font.size = last_size end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh super draw_guide end end #============================================================================== # ■ Window_AO_Status_Window #============================================================================== class Window_AO_Status_Window < Window_Base attr_accessor :actor1 attr_accessor :actor2 attr_accessor :mode #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) @mode = 0 super end #-------------------------------------------------------------------------- # ● 選択中のアクターの設定 #-------------------------------------------------------------------------- def actor1=(actor) return if @actor1 == actor ; @actor1 = actor ; refresh end #-------------------------------------------------------------------------- # ● 選択中のアクターの設定 #-------------------------------------------------------------------------- def actor2=(actor) return if @actor2 == actor ; @actor2 = actor ; refresh end #-------------------------------------------------------------------------- # ● 表示モードの切り替え #-------------------------------------------------------------------------- def mode=(value) return if @mode == value ; @mode = value ; refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh contents.clear case mode when 0 ; draw_mode_0 when 1 ; draw_mode_1 end end #-------------------------------------------------------------------------- # ● 描画(mode = 0) #-------------------------------------------------------------------------- def draw_mode_0 return unless @actor2 draw_actor_face(@actor2, 0, 12) draw_actor_name(@actor2, 108, 0) change_color(crisis_color) draw_text(225, 0, contents.width - 225, line_height, "Lock" ) if @actor2.lock change_color(normal_color) draw_actor_class(@actor2, 108, line_height * 1) draw_actor_level(@actor2, 225, line_height * 1) if $kure_integrate_script[:ActorConvert] draw_category(@actor2, 108, line_height * 2) draw_rank(@actor2, 225, line_height * 2) end draw_actor_hp(@actor2, 108, line_height * 3) draw_actor_mp(@actor2, 108, line_height * 4) 6.times{|index| param_id = index + 2 x = (contents.width / 3) * index.divmod(3)[1] y = line_height * (5 + index.divmod(3)[0]) change_color(system_color) draw_text(x, y, (contents.width / 3) - 45, line_height, Vocab::param(param_id)) change_color(normal_color) draw_text(x + (contents.width / 3) - 45, y, 40, line_height, @actor2.param(param_id), 2)} end #-------------------------------------------------------------------------- # ● 描画(mode = 1) #-------------------------------------------------------------------------- def draw_mode_1 if @actor1 draw_actor_face(@actor1, 20, 0) draw_actor_name(@actor1, 20, line_height * 4) draw_actor_class(@actor1, 20, line_height * 5) draw_actor_level(@actor1, 20, line_height * 6) end change_color(system_color) last_size = contents.font.size contents.font.size += 12 draw_text((contents.width - 45)/ 2, contents.height / 2 , 45, line_height + 12, "→", 1) contents.font.size = last_size change_color(normal_color) if @actor2 draw_actor_face(@actor2, contents.width - 130, 0) draw_actor_name(@actor2, contents.width - 130, line_height * 4) draw_actor_class(@actor2, contents.width - 130, line_height * 5) draw_actor_level(@actor2, contents.width - 130, line_height * 6) end end end #============================================================================== # ■ Window_AO_Popup #============================================================================== class Window_AO_Popup < Window_HorzCommand attr_accessor :actor #-------------------------------------------------------------------------- # ● 選択中のアクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor ; @actor = actor ; refresh end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width Graphics.width / 2 + 120 end #-------------------------------------------------------------------------- # ● 表示行数の取得 #-------------------------------------------------------------------------- def visible_line_number return 11 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 * 10 rect end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command("離脱させる", :ok, true, 0) add_command("メンバー選択に戻る", :ok, true, 1) end #-------------------------------------------------------------------------- # ● 描画処理 #-------------------------------------------------------------------------- def draw_contents draw_gauge(5 , 0, contents.width, 1, mp_gauge_color2,crisis_color) draw_text(5, 0, 300, line_height, "メンバー離脱確認") return unless @actor draw_actor_face(@actor, 0, line_height * 1) draw_actor_name(@actor, 108, line_height * 1) draw_actor_class(@actor, 108, line_height * 2) draw_actor_level(@actor, 225, line_height * 2) if $kure_integrate_script[:ActorConvert] draw_category(@actor, 108, line_height * 3) draw_rank(@actor, 225, line_height * 3) end if @actor.actor.delete_compensation != [] change_color(system_color) draw_text(0, line_height * 5, contents.width, line_height, "削除補償", 1) change_color(normal_color) @actor.actor.delete_compensation.each_with_index{|data, index| next if index > 2 pos_y = line_height * (6 + index) case data[0] when 1 draw_text(70, pos_y, contents.width / 2, line_height, data[2].to_s + " "+ Vocab.currency_unit, 1) when 2,3,4 case data[0] when 2 ; item = $data_items[data[1]] when 3 ; item = $data_weapons[data[1]] when 4 ; item = $data_armors[data[1]] end draw_item_name(item, 70, pos_y) draw_text(255, pos_y, contents.width / 2, line_height, data[2].to_s + "個") end } end change_color(crisis_color) draw_text(0, line_height * 9, contents.width, line_height, "※ 離脱したメンバーは元に戻せません", 1) change_color(normal_color) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh super draw_contents end end