#============================================================================== # ■接頭語能力図鑑 for RGSS3 Ver1.02 # □作成者 kure # # 呼び出し方法  SceneManager.call(Scene_NV_Dictionary) # #============================================================================== #============================================================================== # ■ Scene_NV_Dictionary #============================================================================== class Scene_NV_Dictionary < Scene_MenuBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_namevalue_list_window create_status_window set_window_task end #-------------------------------------------------------------------------- # ● 接頭語リストウィンドウの作成 #-------------------------------------------------------------------------- def create_namevalue_list_window @namevalue_list_window = Window_k_NVList_Command.new(0, 0) @namevalue_list_window.height = Graphics.height #呼び出しのハンドラをセット @namevalue_list_window.set_handler(:ok,method(:namevalue_list_command)) @namevalue_list_window.set_handler(:cancel,method(:on_namevalue_list_cancel)) end #-------------------------------------------------------------------------- # ● ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_status_window wx = @namevalue_list_window.width ww = Graphics.width - wx wh = Graphics.height @status_window = Window_k_NVList_Status.new(wx,0,ww,wh) @status_window.deactivate end #-------------------------------------------------------------------------- # ● ウィンドウのセッティング処理 #-------------------------------------------------------------------------- def set_window_task @namevalue_list_window.status_window = @status_window @namevalue_list_window.activate @namevalue_list_window.select(0) end #-------------------------------------------------------------------------- # ● 装備タイプ選択ウィンドウ[決定] #-------------------------------------------------------------------------- def namevalue_list_command @namevalue_list_window.activate end #-------------------------------------------------------------------------- # ● 装備タイプ選択ウィンドウ[キャンセル] #-------------------------------------------------------------------------- def on_namevalue_list_cancel return_scene end end #============================================================================== # ■ Window_k_NVList_Command #============================================================================== class Window_k_NVList_Command < Window_Command attr_accessor :status_window #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_commands end #-------------------------------------------------------------------------- # ● カーソル位置の設定 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor call_update_help return if index < 0 @status_window.item = current_ext if @status_window end #-------------------------------------------------------------------------- # ● 装備をリストに追加 #-------------------------------------------------------------------------- def add_commands master_name_value_list = KURE::SortOut::NAME_VALUE_LIST name_value_list = $game_party.know_name_value_list #全接頭語配列を検索 if name_value_list == [] add_command("", :ok, true, nil) return else for list in 0..name_value_list.size - 1 if name_value_list[list] && name_value_list[list] != [] for value in 0..name_value_list[list].size - 1 if name_value_list[list][value] case name_value_list[list][value] when 1 item = $data_weapons[master_name_value_list[list][value][1]] when 2 item = $data_armors[master_name_value_list[list][value][1]] when 3 item = $data_classes[master_name_value_list[list][value][1]] when 4 item = $data_states[master_name_value_list[list][value][1]] end add_command(item.name, :ok, true, item) end end end end end end end #============================================================================== # ■ Window_k_NVList_Status #============================================================================== class Window_k_NVList_Status < Window_Base attr_accessor :item #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, width, height) super @item = nil refresh end #-------------------------------------------------------------------------- # ● 描画するアイテムの設定 #-------------------------------------------------------------------------- def item=(item) return if @item == item @item = item refresh end #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def refresh contents.clear return unless @item #接頭語名称 draw_gauge(0,0, contents.width, 1, mp_gauge_color2,crisis_color) change_color(normal_color) draw_text(0,0, 200, line_height, "接頭語名称") change_color(normal_color) draw_text(0, line_height * 1, 200, line_height, @item.name) #ステータス描画 draw_gauge(0,line_height * 3, contents.width, 1, mp_gauge_color2,crisis_color) change_color(normal_color) draw_text(0,line_height * 3, 200, line_height, "基本能力付与") draw_add_status(0, line_height * 4) #特殊能力値描画 draw_gauge(0,line_height * 9, contents.width, 1, mp_gauge_color2,crisis_color) change_color(normal_color) draw_text(0,line_height * 9, 200, line_height, "追加能力付与") draw_add_feature(0, line_height * 10) end #-------------------------------------------------------------------------- # ● ステータス描画 #-------------------------------------------------------------------------- def draw_add_status(x, y) #ステータス名描画 change_color(system_color) for param in 0..7 case param when 0,2,4,6 draw_text(0, y + line_height * (param / 2), 80, line_height, Vocab::param(param)) when 1,3,5,7 draw_text(contents.width / 2, y + line_height * ((param - 1) / 2), 80, line_height, Vocab::param(param)) end end #ステータス描画 status = [0,0,0,0,0,0,0,0] if @item.class == RPG::Weapon or @item.class == RPG::Armor status = @item.params end for param in 0..7 change_color(normal_color) case param when 0,2,4,6 if status[param] > 0 change_color(power_up_color) draw_text(90, y + line_height * (param / 2), (contents.width / 2) -120, line_height, "+" + status[param].to_s, 2) elsif status[param] == 0 draw_text(90, y + line_height * (param / 2), (contents.width / 2) -120, line_height, status[param], 2) else change_color(power_down_color) draw_text(90, y + line_height * (param / 2), (contents.width / 2) -120, line_height, status[param], 2) end when 1,3,5,7 if status[param] > 0 change_color(power_up_color) draw_text((contents.width / 2) + 90, y + line_height * ((param - 1) / 2), (contents.width / 2) - 120, line_height, "+" + status[param].to_s, 2) elsif status[param] == 0 draw_text((contents.width / 2) + 90, y + line_height * ((param - 1) / 2), (contents.width / 2) - 120, line_height, status[param], 2) else change_color(power_down_color) draw_text((contents.width / 2) + 90, y + line_height * ((param - 1) / 2), (contents.width / 2) - 120, line_height, status[param], 2) end end end end #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def draw_add_feature(x,y) return unless @item features_max = @item.features.size - 1 draw_list = call_add_feature_txt(@item) #実際の描画処理 line_cheacker_x = 0 line_cheacker_y = 0 for j in 0..draw_list.size - 1 line_cheacker_y += 1 if line_cheacker_x == 3 line_cheacker_x = 0 if line_cheacker_x == 3 change_color(normal_color) draw_text(x + ((contents.width - x)/3) * line_cheacker_x, y + line_height * line_cheacker_y , ((contents.width - x)/3) - 5, line_height, draw_list[j]) line_cheacker_x += 1 end end end