# ▽△▽ XRXSv30. MeLT_Status. 成長システムコレクション ▽△▽ # [伸縮対応] # # publish 2010/ 3/26 # update - 12/22a # #============================================================================== # カスタマイズポイント #============================================================================== module XRXSV30 # # 用語 # TEXP_S = "合計EXP." NEXP_S = "次のLvまであと" LARN_S = "????" CHNG_S = "!装備が変更されました。" # # 用語(単体専用):以下の二つは「クラス別EXP」と連動する場合使用されません。 # NXKL_S = "次の習得スキル" NONX_S = "習得するスキルはもうありません。" # # クラスリストの背景に使用するウィンドウスキン(Graphics/System) # ClassSkin = "Window" # # EXPメータースキン(Graphics/System) # (ファイルが存在しない場合VXのメーター描画機能が使用されます) # EXPMeterSkin = "Menu_ExpMeter" # # クラスラーニングリストを表示する? # LearningsOpen = true # # ラーニングリスト表示で、スキルを判明させるレベル加算範囲 # LearningShowLimit = 5 # # 文字 # Captions = [] Captions[0] = "現在のステータス" end #============================================================================== # 設定 #============================================================================== class Game_System attr_accessor :wide_screen end module XRXSV30 CommandIDs = [0] end #============================================================================== # ステータスコマンド #============================================================================== class Window_SlideCommand < Window_Command end class Window_StatusCommand < Window_SlideCommand def initialize @clear_style = ((XRXSV10::BG_NAME rescue "").size >= 1) @command_ids = XRXSV30::CommandIDs commands = [] for command_id in @command_ids commands.push(XRXSV30::Captions[command_id].to_s) end super(236, commands) self.x = Graphics.width - self.width + 12 self.y = (@clear_style ? 72 : 56) end def command_id return @command_ids[self.index] end def slidein! super(-8, 4, 4) end end #============================================================================== # ピクチャへの対応 #============================================================================== class Scene_Base def create_picture end def dispose_picture end end #============================================================================== # ナンバー描画への対応 #============================================================================== module XRXSVForDNX def draw_number(x, y, width, height, number, align, skin, opacity = 224) self.draw_text(x, y, width, height, number, align) end def draw_number_l(x, y, width, height, number, align = 0) skin = Cache.system(XRXSVDsIn::NumberL) rescue nil self.draw_number(x, y, width, height, number, align, skin) end def draw_number_s(x, y, width, height, number, align = 0) skin = Cache.system(XRXSVDsIn::NumberS) rescue nil self.draw_number(x, y, width, height, number, align, skin) end end class Bitmap include XRXSVForDNX end #============================================================================== # ステータス画面 #============================================================================== class Scene_Status < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background y = Graphics.height - 24 * 5 - 32 - 56 @actor = $game_party.members[@actor_index] @actorstatus_window = Window_SkillStatus.new(0, 0, @actor) @equipstatus_window = Window_SetStatus.new(0, y, @actor) @equipstatus_window.width = 320 if @equipstatus_window.width == 208 @class_window = Window_Classes.new(0, 56, @actor) @class_window.active = false @command_window = Window_StatusCommand.new @command_window.active = true @learnings_window = Window_ClassLearnings.new(@actor) @help_window = Window_Help.new @help_window.y = Graphics.height - @help_window.height @help_window.visible = false @last_equips = @actor.equips.dup @last_command_index = -1 @last_class_index = -1 create_picture end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @actorstatus_window.dispose @class_window.dispose @equipstatus_window.dispose dispose_picture @learnings_window.dispose @command_window.dispose @help_window.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super update_menu_background @command_window.update @learnings_window.update @help_window.update if @class_window.active update_class update_status_window elsif @command_window.active update_command end end #-------------------------------------------------------------------------- # フレーム更新 - コマンド #-------------------------------------------------------------------------- def update_command if @last_command_index != @command_window.index @last_command_index = @command_window.index @class_window.set(@command_window.command_id) end if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::A) Sound.play_cursor go_equip_scene elsif Input.trigger?(Input::R) Sound.play_cursor next_actor elsif Input.trigger?(Input::L) Sound.play_cursor prev_actor elsif Input.trigger?(Input::C) Sound.play_decision start_class_selection end end #-------------------------------------------------------------------------- # クラス選択の開始と終了 #-------------------------------------------------------------------------- def start_class_selection @command_window.decide! rescue nil @command_window.active = false @class_window.index = 0 @class_window.active = true if XRXSV30::LearningsOpen and @class_window.type <= 1 @learnings_window.open @command_window.visible = false end @last_class_index = -1 end def end_class_selection @class_window.index = 0 @class_window.index = -1 @class_window.active = false @command_window.cancel! rescue nil @command_window.active = true if XRXSV30::LearningsOpen and @class_window.type <= 1 @learnings_window.close @command_window.visible = true end end #-------------------------------------------------------------------------- # フレーム更新 - クラス #-------------------------------------------------------------------------- def update_class if XRXSV30::LearningsOpen if @last_class_index != @class_window.index @last_class_index = @class_window.index @learnings_window.set(@class_window.class_id) end end if Input.trigger?(Input::R) Sound.play_cursor @learnings_window.scroll(1) return elsif Input.trigger?(Input::L) Sound.play_cursor @learnings_window.scroll(-1) return end @class_window.update if Input.trigger?(Input::B) Sound.play_cancel end_class_selection elsif Input.trigger?(Input::A) Sound.play_cursor go_equip_scene elsif Input.trigger?(Input::C) class_decision end end def class_decision end #-------------------------------------------------------------------------- # 装備画面へ #-------------------------------------------------------------------------- def go_equip_scene $scene = Scene_Equip.new(@actor_index, 0) end #-------------------------------------------------------------------------- # ステータスウィンドウの更新 #-------------------------------------------------------------------------- def update_status_window if @command_window.active @equipstatus_window.set_new_parameters(nil, nil, nil, nil) elsif @class_window.active @equipstatus_window.set_new_actor(*@class_window.new_parameter_actor) end @equipstatus_window.update end end #============================================================================== # EXPの取得 #============================================================================== class Game_Actor < Game_Battler attr_accessor :exp_list end #============================================================================== # クラスリストウィンドウ #============================================================================== class Window_Classes < Window_Selectable #-------------------------------------------------------------------------- # オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, actor) @clear_style = ((XRXSV10::BG_NAME rescue "").size >= 1) super(x, y, 320, 152) @actor = actor @data = [] @for_one_mode = false @backskin = Cache.system(XRXSV30::ClassSkin) set(0) if @clear_style self.opacity = 0 self.x = -16 end end def type return @set_type end #-------------------------------------------------------------------------- # セット #-------------------------------------------------------------------------- def set(index) @set_type = index case @set_type when 0 @for_one_mode = true @item_max = 1 @data = [@actor.class_id] refresh draw_item_for_one end end #-------------------------------------------------------------------------- # 表示するパラメータ変化 #-------------------------------------------------------------------------- def new_parameter_actor return nil if @set_type == 0 end #-------------------------------------------------------------------------- # リフレッシュ #-------------------------------------------------------------------------- def refresh create_contents if @clear_style draw_rect = Rect.new(0, 0, self.contents.width, self.contents.height) skin_rect = Rect.new(0, 16, 64, 32) self.contents.stretch_blt(draw_rect, @backskin, skin_rect, 96) skin_rect = Rect.new(0, 64, 64, 64) self.contents.stretch_blt(draw_rect, @backskin, skin_rect, 160) end for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # クラスIDの取得 #-------------------------------------------------------------------------- def class_id return @data[self.index] end #-------------------------------------------------------------------------- # 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) x = 0 y = rect.y class_id = @data[index] class_data = $data_classes[class_id] n = class_data.weapon_set.size if n >= 1 weapon = $data_weapons[class_data.weapon_set[n - 1]] draw_icon(weapon.icon_index, 0, y) end indent = (self.contents.width - 184) name_width = indent - 24 self.contents.font.size = 18 self.contents.font.color = normal_color self.contents.font.color.alpha = (class_id == @actor.class_id ? 255 : 128) self.contents.draw_text(24, y, name_width, WLH, class_data.name) begin if @for_one_mode level = @actor.level now_exp = @actor.exp else level = @actor.class_level(class_id) now_exp = @actor.class_exp[class_id] end rescue level = -1 end if level >= 1 self.contents.font.size = 16 self.contents.font.color = system_color self.contents.draw_text(indent, y, 16, WLH, Vocab::level_a) self.contents.font.color = normal_color self.contents.draw_number_l(indent + 24, y, 24, WLH, level, 2) exp_now_level = @actor.exp_list[level] exp_next_level = @actor.exp_list[level+1] gx = indent + 54 gy = y + WLH - 10 gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 if exp_next_level.to_i >= 1 exp_current = now_exp - exp_now_level exp_current_max = exp_next_level - exp_now_level exp_next_to = exp_current_max - exp_current gw1 = 128 gw2 = gw1 * exp_current / exp_current_max else gw1 = 128 gw2 = 0 end begin skin = Cache.system(XRXSV30::EXPMeterSkin) skin_rect = Rect.new(0, 0, skin.width, 4) self.contents.blt(gx, gy, skin, skin_rect) skin_rect = Rect.new(0, 8, gw2, 4) self.contents.blt(gx, gy, skin, skin_rect) rescue self.contents.fill_rect(gx, gy, gw1, 4, gauge_back_color) self.contents.gradient_fill_rect(gx, gy, gw2, 4, gc1, gc2) end if exp_next_level.to_i >= 1 self.contents.font.color = normal_color self.contents.draw_number_s(indent + 64, y, 50, WLH, exp_current, 2) self.contents.draw_number_s(indent + 128, y, 50, WLH, exp_current_max, 2) self.contents.font.size = 14 self.contents.font.color = normal_color self.contents.draw_text(indent + 116, y, 12, WLH, "/") end else next_learning = nil for learning in class_data.learnings if learning.level > @actor.level next_learning = learning break end end self.contents.font.size = 16 self.contents.font.color = system_color if next_learning skill = $data_skills[next_learning.skill_id] self.contents.draw_text(indent, y, 80, WLH, XRXSV30::NXKL_S) self.contents.font.color = normal_color self.contents.draw_text(indent + 80, y, 96, WLH, skill.name) else self.contents.draw_text(indent, y, 176, WLH, XRXSV30::NONX_S) end end end #-------------------------------------------------------------------------- # 「現在のステータス」用の描画 #-------------------------------------------------------------------------- def draw_item_for_one indent = (self.contents.width - 184) self.contents.font.color = system_color self.contents.draw_text(indent, WLH, 90, WLH, XRXSV30::TEXP_S) self.contents.font.color = normal_color self.contents.draw_number_s(indent + 98, WLH, 80, WLH, @actor.exp, 2) next_need_exp = @actor.exp_list[@actor.level+1] if next_need_exp > 0 self.contents.font.color = system_color self.contents.draw_text(indent, WLH*2, 90, WLH, XRXSV30::NEXP_S) n = next_need_exp - @actor.exp self.contents.font.color = normal_color self.contents.draw_number_s(indent + 98, WLH*2, 80, WLH, n, 2) end end end #============================================================================== # クラスラーニングリストウィンドウ #============================================================================== class Window_ClassLearnings < Window_Selectable def initialize(actor) @class_data = nil @actor = actor @data = [] @enables = [] @levels = [] w = ($game_system.wide_screen ? 190 : 224) x = 544 - w super(x, 56, w, 304) @column_max = 1 self.index = -1 self.active = false self.openness = 0 self.z += 5 end def set(class_id) return if class_id == nil @class_data = $data_classes[class_id] refresh end def scroll(n) view_size = self.height - 32 max = self.contents.height - view_size self.oy = [[self.oy + n * view_size / 2, 0].max, max].min end def refresh return if @class_data == nil self.oy = 0 @offset_wait_count = 60 begin actor_level = @actor.class_level(@class_data.id) rescue actor_level = @actor.level end limit_level = actor_level + XRXSV30::LearningShowLimit @data.clear @enables.clear @levels.clear for learning in @class_data.learnings if learning.level <= limit_level @data.push($data_skills[learning.skill_id]) @enables.push(learning.level <= actor_level) @levels.push(learning.level) else @data.push(nil) @enables.push(false) @levels.push(nil) end end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end def draw_item(index) rect = item_rect(index) skill = @data[index] enabled = @enables[index] level = @levels[index] if skill != nil self.contents.font.color = system_color self.contents.draw_text(rect.x, rect.y, 16, WLH, Vocab.level_a) self.contents.font.color = normal_color self.contents.draw_text(rect.x + 16, rect.y, 16, WLH, level, 2) draw_icon(skill.icon_index, rect.x + 32, rect.y, enabled) self.contents.font.color.alpha = enabled ? 255 : 128 draw_skillname(rect.x + 56, rect.y, skill.name) else self.contents.font.color = normal_color self.contents.font.color.alpha = 128 draw_skillname(rect.x + 56, rect.y, XRXSV30::LARN_S) end end def draw_skillname(x, y, name) text_width = [self.contents.text_size(name).width + 2, 136].min text_width = (text_width * ($game_system.wide_screen ? 3 : 4) / 4.0).ceil self.contents.draw_text(x, y, text_width, WLH, name) end def skill return @data[self.index] end def update_help @help_window.set_text(skill == nil ? "" : skill.description) end end #============================================================================== # 基本イクイップステータスの拡張 #============================================================================== class Window_EquipStatus < Window_Base def set_new_actor(actor) if actor set_new_parameters(actor.atk, actor.def, actor.spi, actor.agi) else set_new_parameters(nil, nil, nil, nil) end end end #============================================================================== # ステータスセットウィンドウ #============================================================================== class Window_SetStatus < Window_EquipStatus end