sarana Protecteur de la Lumière
Nombre de messages : 160 Localisation : Thailande Date d'inscription : 09/06/2006
| Sujet: Rapport de montée de niveau Sam 10 Juin - 8:39 | |
| Ce script vous affiche un rapport avec combien de PV max vous avez en tout, etc. quand vous montez de niveau : 1. Le codeÀ insérer au-dessus de Main : - Code:
-
# ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ ver.2 ▼▲▼ built 033116 # by 桜雅 在土
#============================================================================== # □ カスタマイズポイント #============================================================================== module XRXS_BP10 # # 「位置揃え」(0:左寄せ 1:中央 2:右寄せ) # ALIGN = 0 # # 確保するサイズ[単位:~人分] # MAX = 4 end class Scene_Battle # # レベルアップSE。""で無し。 # LEVEL_UP_SE = "" # # レベルアップME # LEVEL_UP_ME = "Audio/ME/007-Fanfare01" # # 「敵全滅→ウィンドウ表示」までのウェイト時間[単位:F] # PHASE5_WAIT_COUNT = 100 end class Window_SkillLearning < Window_Base # # スキル習得SE。 # SKILLLEARN_SE = "Audio/SE/106-Heal02" end
#============================================================================== # --- XRXS. パラメータフリーズ機構 --- #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ○ パラメータフリーズ #-------------------------------------------------------------------------- def parameter_freeze @freezed_maxhp = self.base_maxhp @freezed_maxsp = self.base_maxsp @parameter_freeze = true end #-------------------------------------------------------------------------- # ○ パラメータフリーズ解除 #-------------------------------------------------------------------------- def parameter_freeze_cancel @parameter_freeze = nil @freezed_maxhp = nil @freezed_maxsp = nil end #-------------------------------------------------------------------------- # ● 基本 MaxHP の取得 #-------------------------------------------------------------------------- alias xrxs_bp10_base_maxhp base_maxhp def base_maxhp return (@parameter_freeze.nil? ? xrxs_bp10_base_maxhp : @freezed_maxhp) end #-------------------------------------------------------------------------- # ● 基本 MaxSP の取得 #-------------------------------------------------------------------------- alias xrxs_bp10_base_maxsp base_maxsp def base_maxsp return (@parameter_freeze.nil? ? xrxs_bp10_base_maxsp : @freezed_maxsp) end end
#============================================================================== # ■ Window_LevelUpWindow #------------------------------------------------------------------------------ # バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。 #============================================================================== class Window_LevelUpWindow < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(x, y, actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int) super(x, y, 160, 192) self.contents = Bitmap.new(width - 32, height - 32) self.visible = false self.back_opacity = 160 refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int) self.contents.clear self.contents.font.color = system_color self.contents.font.size = 14 self.contents.draw_text( 0, 0, 160, 24, "LEVEL UP!!") self.contents.font.size = 18 self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp) self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp) self.contents.font.size = 14 self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str) self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex) self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi) self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int) self.contents.draw_text(92, 0, 128, 24, "→") self.contents.draw_text(76, 28, 128, 24, "=") self.contents.draw_text(76, 50, 128, 24, "=") self.contents.draw_text(76, 72, 128, 24, "=") self.contents.draw_text(76, 94, 128, 24, "=") self.contents.draw_text(76, 116, 128, 24, "=") self.contents.draw_text(76, 138, 128, 24, "=") self.contents.font.color = normal_color self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2) self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2) self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2) self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2) self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2) self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2) self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2) self.contents.font.size = 20 self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2) self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2) self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2) self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2) self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2) self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2) self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2) end end #============================================================================== # ■ Window_SkillLearning #------------------------------------------------------------------------------ # レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。 #============================================================================== class Window_SkillLearning < Window_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :learned # スキルを習得したかどうか #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor, already_learned, last_lv) super(160, 64, 320, 64) self.contents = Bitmap.new(width - 32, height - 28) # わざと▽を表示 self.visible = false self.back_opacity = 160 @learned = false refresh(actor, already_learned, last_lv) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(actor, already_learned, last_lv) class_id = actor.class_id now_lv = actor.level for i in 0...$data_classes[class_id].learnings.size learn_lv = $data_classes[class_id].learnings[i].level # 今回のレベルアップ範囲で習得するスキルの場合 if learn_lv > last_lv and learn_lv <= now_lv # 既に何らかの方法で習得している場合は飛ばす skill_id = $data_classes[class_id].learnings[i].skill_id if already_learned.include?(skill_id) next end @learned = true # SEの再生 if SKILLLEARN_SE != "" Audio.se_play(SKILLLEARN_SE) end # 各描写 skill_name = $data_skills[skill_id].name self.contents.clear self.contents.draw_text(0,0,448,32, skill_name + "を習得!!") self.visible = true # メインループ loop do #
| |
|
sarana Protecteur de la Lumière
Nombre de messages : 160 Localisation : Thailande Date d'inscription : 09/06/2006
| Sujet: Re: Rapport de montée de niveau Sam 10 Juin - 8:39 | |
| À mettre en-dessous sans interruption : - Code:
-
ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # フレーム更新 update # 画面が切り替わったらループを中断 break unless @learned end # メインループここまで end end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update # C ボタンが押された場合 if Input.trigger?(Input::C) @learned = false self.visible = false end end end #============================================================================== # ■ Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :level_up_flags # LEVEL UP!表示 end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ● アフターバトルフェーズ開始 #-------------------------------------------------------------------------- alias xrxs_bp10_start_phase5 start_phase5 def start_phase5 # パラメータ群の記憶とパラメータフリーズ @parameters = [] for actor in $game_party.actors @parameters.push([actor.level, actor.skills.dup, nil, actor.str, actor.dex, actor.agi, actor.int]) actor.parameter_freeze unless actor.cant_get_exp? end # 呼び戻す xrxs_bp10_start_phase5 # 設定 @exp_gain_actor = -1 # ウェイトカウントを設定 @phase5_wait_count = PHASE5_WAIT_COUNT # 初期化 @phase5_levelup_step_start = false end #-------------------------------------------------------------------------- # ● フレーム更新 (アフターバトルフェーズ) #-------------------------------------------------------------------------- alias xrxs_bp10_update_phase5 update_phase5 def update_phase5 # ウェイトカウントが 0 より大きい場合 unless @phase5_levelup_step_start if @phase5_wait_count > 0 # 呼び戻す xrxs_bp10_update_phase5 return else @phase5_levelup_step_start = true end end @level_up_phase_done = false if @level_up_phase_done != true # C ボタンが押された場合 if Input.trigger?(Input::C) # ウィンドウを閉じて次のアクターへ @levelup_window.visible = false if @levelup_window != nil @status_window.level_up_flags[@exp_gain_actor] = false if @levelup_window != nil @levelup_window.dispose @levelup_window = nil end @level_up_phase_done = phase5_next_levelup end if @level_up_phase_done if @phase5_wait_count < 2 # リザルトウィンドウをvisible=trueでも不可視に @result_window.opacity = 0 @result_window.back_opacity = 0 @result_window.contents_opacity = 0 end # バトル終了 battle_end(0) end end #-------------------------------------------------------------------------- # ● 次のアクターのレベルアップ表示へ #-------------------------------------------------------------------------- def phase5_next_levelup begin # 次のアクターへ @exp_gain_actor += 1 # 最後のアクターの場合 if @exp_gain_actor >= $game_party.actors.size # アフターバトルフェーズ開始 return true end actor = $game_party.actors[@exp_gain_actor] unless actor.cant_get_exp? # 現在の能力値を保持 last_level = @parameters[actor.index][0] last_maxhp = actor.maxhp last_maxsp = actor.maxsp last_str = @parameters[actor.index][3] last_dex = @parameters[actor.index][4] last_agi = @parameters[actor.index][5] last_int = @parameters[actor.index][6] # パラメータフリーズ解除 actor.parameter_freeze_cancel # 判定 if actor.level > last_level # レベルアップした場合 @status_window.level_up(@exp_gain_actor) # リザルトウィンドウを消す @result_window.visible = false # SEの再生 if LEVEL_UP_SE != "" Audio.se_play(LEVEL_UP_SE) end # MEの再生 if LEVEL_UP_ME != "" Audio.me_stop Audio.me_play(LEVEL_UP_ME) end # LEVEL-UPウィンドウの設定 space = @status_window.width / XRXS_BP10::MAX i = @exp_gain_actor case XRXS_BP10::ALIGN when 0 cx = i * space + 4 when 1 cx = (space * ((XRXS_BP10::MAX - $game_party.actors.size)/2.0 + i)).floor when 2 cx = (i + XRXS_BP10::MAX - $game_party.actors.size) * space + 4 end cx += space/2 cx += @status_window.x w = 80 #(レベルアップウィンドウの幅/2) x = [[cx, w].max, 640-w].min - w y = 128 # 作成実行 @levelup_window = Window_LevelUpWindow.new(x, y, actor, last_level, actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str, actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int) @levelup_window.visible = true # ステータスウィンドウをリフレッシュ @status_window.refresh # スキル習得ウィンドウの設定 @skilllearning_window = Window_SkillLearning.new(actor, @parameters[actor.index][1], last_level) # ウェイトカウントを設定 @phase5_wait_count = 40 return false end end end until false end end
2. Screenieshttp://xms.rdy.jp/x/img/XRXS_BP_View10.jpg(Note : ce screenie montre plusieurs scripts, ne vous intéressez qu'à la fenêtre au milieu) 3. CréditsEncore trouvé sur un site japonais dont voici l'adresse : http://xms.rdy.jp/x/XRXS_BP10.htm[/code] | |
|