#============================================================================== # # リザルトウィンドウv1.6 # # # ○KGC様の多人数パーティと併用できるようにしてありますが # パーティメンバー数があまりにも多い場合、ウィンドウが画面に収まりきりません # その場合、VIEW_STAND_BY_MEMBERSをfalseにすれば # 待機メンバーの情報は表示されません。 # # v1.6の追加項目 # RESULT_MESSAGE # バトル終了後、リザルト画面に移行する前に # リザルトメッセージを表示することができます # #============================================================================== module BBL #============================================================================== # ■ カスタマイズ #============================================================================== # リザルト画面の早送りを禁止するなら false にしてください SKIP_PM = true # リザルト画面の早送りボタンです SKIP_KEY = Input::C # 早送り時のカウント増加数です # ※この数値を増やすと早送り速度が上がります # (WAIT_TIMEと同値にすると、スキップ機能になります) SKIP_COUNT = 1 # リザルト画面でのウェイト時間(というかループ回数です) WAIT_TIME = 100 #--------------------------------------------------------------------------- # リザルト画面配置設定 # ※リザルト画面のメンバーリスト部分の配置やサイズを設定できます # ここでの数値にあわせて、その他のウィンドウサイズも変更されます # ※リザルトウィンドウとスキルウィンドウの横幅を画面二等分する場合の # 数値の例を記載しておきます # WINDOW_WIDTH = 272 # WINDOW_ACTOR_X = 0 # WINDOW_ACTOR_LEVEL = 48 # WINDOW_EXP_GAUGE_X = 112 # WINDOW_EXP_X = 112 #--------------------------------------------------------------------------- # リザルト画面の横幅です WINDOW_WIDTH = 304 # リザルト画面に表示するアクター画像の位置です WINDOW_ACTOR_X = 8 # リザルト画面に表示するアクターレベルの位置です WINDOW_ACTOR_LEVEL = 64 # リザルト画面に表示する経験値ゲージの位置です WINDOW_EXP_GAUGE_X = 136 # リザルト画面に表示するNext経験値の位置です WINDOW_EXP_X = 136 # アクターひとり分の縦幅です ACTOR_HEIGHT = 40 # EXPバーのグラデーションカラーです # ※EXP_COLOR1(左側)からEXP_COLOR2(右側)にバーのグラデーションが流れます EXP_COLOR1 = Color.new(150, 0, 255) EXP_COLOR2 = Color.new(150, 135, 255) # レベルアップ時のLV数値描画の色です LVUP_COLOR = Color.new(255, 220, 0) # リザルト画面でアクターの歩行グラフィックを表示する場合は 0 # 名前を表示する場合は 1 # ※アクターの名前が6文字以上だとLV表示と重なっちゃいます VIEW_ACTOR = 0 # EXPウィンドウに表示する経験値の用語です VIEW_EXP = "EXP" # EXPウィンドウに表示するお金の用語です VIEW_GOLD = "GOLD" # アイテム獲得時のアイテムウィンドウに表示する用語です VIEW_ITEM = "ITEM" # スキル習得時に表示する用語です VIEW_SKILL = "NEW SKILL" # リザルト画面更新中に音を鳴らさないなら false にしてください EXP_SOUND = true # レベルアップ時に音を鳴らさないなら false にしてください LVUP_SOUND = true # アイテム獲得時に音を鳴らさないなら false にしてください ITEM_SOUND = true # リザルト画面更新中に音を鳴らす場合のSEファイル名です # ("ファイル名", ボリューム, ピッチ) EXP_SOUND_FILE = RPG::SE.new("Decision1", 80, 110) # リザルト画面更新中に音を鳴らす場合の間隔です # ※(WAIT_TIME ÷ EXP_SOUND_COUNT)回だけ音が連続で鳴ります EXP_SOUND_COUNT = 3 # レベルアップ時に音を鳴らす場合のSEファイル名です # ("ファイル名", ボリューム, ピッチ) LVUP_SOUND_FILE = RPG::SE.new("Item2", 80, 100) # アイテム獲得時に音を鳴らす場合のSEファイル名です # ("ファイル名", ボリューム, ピッチ) ITEM_SOUND_FILE = RPG::SE.new("Chime2", 80, 100) # KGCさんの装備スキルでAP獲得を導入している場合のみ設定してください # スキルマスター時に表示する用語です VIEW_SKILL_MASTER = "MASTER SKILL" # 多人数パーティも導入してる場合は待機メンバーにAPを獲得させるか # 設定してください STAND_BY_GAIN_AP = true # 待機メンバーのAP獲得率を設定できます # 数値の意味は多人数パーティのSTAND_BY_EXP_RATEと同じです STAND_BY_AP_RATE = 500 # スキルマスター時に音を鳴らさないなら false にしてください SKILL_MASTER_SOUND = true # スキルマスター時に音を鳴らす場合のSEファイル名です # ("ファイル名", ボリューム, ピッチ) SKILL_MASTER_SOUND_FILE = RPG::SE.new("Up", 80, 100) #---------------------------------------------------------------------------- # 習得スキルウィンドウのアクター画像位置微調整 # ※アクターの歩行サイズ(32x32)を変更している方用です # 通常は、編集する必要はありません #---------------------------------------------------------------------------- # 習得スキルウィンドウ1行分の縦幅です SKILL_ACTOR_HEIGHT = 24 # 習得スキルウィンドウに描画するアクター画像の横幅です # ※この値によって、後に表示するスキル名のX座標も変更されます SKILL_ACTOR_WIDTH = 40 # 習得スキルウィンドウに描画するアクター画像のX座標です SKILL_ACTOR_X = 20 # 習得スキルウィンドウに描画するアクター画像のY座標です SKILL_ACTOR_Y = 32 # アクター画像で表示させたくない部分のY座標です # ※足元の座標を0として、CLEAR_ACTOR_Yより下の画像が消えます CLEAR_ACTOR_Y = 10 # KGCさんの多人数パーティを導入している際 # リザルト画面に待機メンバーを表示させない場合はfalseにしてください VIEW_STAND_BY_MEMBERS = true #---------------------------------------------------------------------------- # バトル終了後のリザルトメッセージ #---------------------------------------------------------------------------- # リザルトメッセージを表示する場合はtrueにしてください RESULT_MESSAGE = true # リザルトメッセージを表示する時間です MESSAGE_WAIT = 60 # リザルトメッセージに表示するデフォルトの内容です # ※1つ目の%sに先頭のアクター名が代入され # 2つ目の%sに敵グループの1番目のエネミー名が代入されます # アクター名やモンスター名を表示したくない場合は、%sを削除してください DEFAULT_TEXT = "%sは%sとの戦いに勝利した!" # DEFAULT_TEXT = "%sは戦いに勝利した!" # ←モンスター名は表示されない # エネミーが複数いた場合に複数形の呼び方にします # ※同名エネミーの場合は省略されます ENEMIES_TEXT = "たち" # "スライムたちは"と表示される # 敵グループIDごとにメッセージを変更することができます # MESSAGE_GROUP[敵グループID] = "メッセージ" # ※ここで指定しなかった敵グループは、すべてDEFAULT_TEXTが適応されます MESSAGE_GROUP = [] # ←この行は削除・編集しないこと # MESSAGE_GROUP[10] = "%sは強敵との戦いに勝利した!" # バトルにかかったターン数に応じて、メッセージを変更することができます # ※trueにした場合、上記MESSAGE_GROUPは適応されません # また、%sに代入される順番等もDEFAULT_TEXTと一緒です TURN_MESSAGE = false # TURN_MESSAGE[ターン数] = "メッセージ" TURN_MESSAGE_TEXT = [] #←この行は削除しないこと # 例)上から、1ターンで倒せた場合、2ターン以上かかった場合 # 5ターン以上かかった場合のメッセージ TURN_MESSAGE_TEXT[1] = "%sは%sを瞬殺した!" TURN_MESSAGE_TEXT[2] = "%sは%sとの戦いに勝利した!" TURN_MESSAGE_TEXT[5] = "%sは%sとの激戦に見事勝利した!" #============================================================================== # ☆ ここからおまけ # # ターンボーナス #  指定ターン以内にバトルに勝利するとEXPとGOLDにボーナスが適応されます # # ノーダメージボーナス # 敵からダメージを受けないで勝利するとEXPとGOLDにボーナスが適応されます # #============================================================================== # ターンボーナスを有効にする場合は true にしてください TURN_BONUS = false # ターンボーナスの無効ターンです # ※TURN_BONUS_LIMIT = 2 の場合 # 2ターン経過する前に勝利した場合ボーナスが適応されます TURN_BONUS_LIMIT = 1 # リザルト画面でターンボーナスの条件を満たした際に表示する用語です TURN_BONUS_WORD = "ターンボーナス" # ターンボーナスの用語を表示する際の色です TURN_BONUS_COLOR = Color.new(255, 255, 150) # ノーダメージボーナスを有効にする場合は true にしてください # ※敵からダメージを受けないで勝利した場合、EXPとGOLDにボーナスを適応します NO_DAMAGE_BONUS = false # リザルト画面でノーダメージボーナスの条件を満たした際に表示する用語です NO_DAMAGE_WORD = "ノーダメージボーナス" # ノーダメージボーナスの用語を表示する際の色です NO_DAMAGE_COLOR = Color.new(255, 255, 150) # ボーナスが有効な場合のEXP増加レートです # (EXP_BONUS_RATE = 150 でEXPを通常の150%獲得します) EXP_BONUS_RATE = 150 # ボーナスが有効な場合のGOLD増加レートです # (GOLD_BONUS_RATE = 150 でGOLDを通常の150%獲得します) GOLD_BONUS_RATE = 150 # ※TURN_BONUSとNO_DAMAGE_BONUSを両方有効にした上でバトル中両条件を満たした場合 # それぞれのBONUS_RATEが倍になります #============================================================================== # ■ カスタマイズ終了 #============================================================================== end #============================================================================== # ■ KGC多人数パーティ用 #============================================================================== $imported = {} if $imported == nil #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :level_up_flug # レベルアップフラグ attr_accessor :new_skills # 新しく覚えたスキルの配列 #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor_id : アクター ID #-------------------------------------------------------------------------- alias initialize_BBL initialize def initialize(actor_id) initialize_BBL(actor_id) @new_skills = [] end #-------------------------------------------------------------------------- # ● 次のレベルまでの経験値の取得 #-------------------------------------------------------------------------- def next_rest_exp return @exp_list[@level+1] > 0 ? (@exp_list[@level+1] - @exp) : 0 end #-------------------------------------------------------------------------- # ● 次のレベルまでの経験値の最大値の取得 #-------------------------------------------------------------------------- def next_max_exp return @exp_list[@level+1] - @exp_list[@level] end end #============================================================================== # ■ Game_Troop #============================================================================== class Game_Troop < Game_Unit #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :troop_id # グループID end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- alias start_bbl start def start start_bbl @enemy_name = $game_troop.enemy_names[0] if $game_troop.enemy_names.size >= 2 @enemy_name += BBL::ENEMIES_TEXT end end #-------------------------------------------------------------------------- # ● 勝利の処理(再定義) #-------------------------------------------------------------------------- def process_victory # 再定義 @info_viewport.visible = false @message_window.visible = false RPG::BGM.stop $game_system.battle_end_me.play unless $BTEST $game_temp.map_bgm.play $game_temp.map_bgs.play end display_result battle_end(0) end #-------------------------------------------------------------------------- # ○ リザルト画面表示 #-------------------------------------------------------------------------- def display_result members = $game_party.all_members if $imported["LargeParty"] members = $game_party.members unless $imported["LargeParty"] # レベルアップフラグ初期化 for actor in members actor.level_up_flug = false end drop_items = $game_troop.make_drop_items for item in drop_items $game_party.gain_item(item, 1) end exp = $game_troop.exp_total gold = $game_troop.gold_total if $imported["EquipLearnSkill"] ap = $game_troop.ap_total else ap = 0 end # リザルトメッセージ表示 result_message if BBL::RESULT_MESSAGE # 各ウィンドウ作成 @resultitem_window = Window_ResultItem.new(drop_items) if drop_items != [] @result_window = Window_Result.new @resultexp_window = Window_ResultNextExp.new(exp) @expview_window = Window_ResultExp.new(exp, gold, ap) @result_skill_window = Window_ResultSkill.new @result_skill_window.visible = false # RESULT_WINDOWのY座標 @result_window.y = 208 - ((@result_window.height - @expview_window.height) / 2) @resultexp_window.y = @result_window.y # ドロップアイテムがあった場合 if drop_items != [] BBL::ITEM_SOUND_FILE.play if BBL::ITEM_SOUND == true # ITEM_WINDOWとRESULT_WINDOWの縦幅が画面の下枠を超える場合、全体の位置を上に調整 if @result_window.height + @resultitem_window.height > 416 - @result_window.y @result_window.y = 416 - (@result_window.height + @resultitem_window.height) @resultexp_window.y = @result_window.y end # RESULT_WINDOWのY座標がEXP_WINDOWの縦幅よりも少ない場合、全体の位置を下に調整 if @result_window.y < @expview_window.height @result_window.y = @expview_window.height @resultexp_window.y = @result_window.y end # アイテムウィンドウのY座標 @resultitem_window.y = @result_window.y + @result_window.height if @resultitem_window != nil # 各ウィンドウのHEIGHTの合計が画面の枠を超える場合、全体のウィンドウ位置を調整と # ITEM_WINDOWの横幅を調整 if @result_window.height + @resultitem_window.height + @expview_window.height > 416 @result_window.x = @resultexp_window.x = @expview_window.x = 0 @result_window.y = 208 - ((@result_window.height - @expview_window.height) / 2) @resultexp_window.y = @result_window.y @resultitem_window.x = @result_window.width @resultitem_window.y = (@result_window.y + @result_window.height) - @resultitem_window.height @resultitem_window.width = 544 - @result_window.width else # ITEM_WINDOWのX座標と横幅をRESULT_WINDOWにあわせる @resultitem_window.width = @result_window.width @resultitem_window.x = @result_window.x end end # EXPウィンドウのY座標 @expview_window.y = @result_window.y - @expview_window.height # スキルウィンドウのY座標 @result_skill_window.y = @expview_window.y #--------------------------------------------------------------------------- # KGC 装備スキル用 #--------------------------------------------------------------------------- if $imported["EquipLearnSkill"] @result_skillkgc_window = Window_ResultSkill_KGC.new @result_skillkgc_window.visible = false skills = [] members.each { |actor| last_full_ap_skills = actor.full_ap_skills unless actor.dead? member = actor.battle_member? if $imported["LargeParty"] member = actor.exist? unless $imported["LargeParty"] if member actor.gain_ap(ap, false) else if BBL::STAND_BY_GAIN_AP stand_by_ap = ap stand_by_ap = ap * (BBL::STAND_BY_AP_RATE / 1000.0) actor.gain_ap(stand_by_ap.round, false) end end end if actor.full_ap_skills != last_full_ap_skills new_full_ap_skills = actor.full_ap_skills - last_full_ap_skills unless new_full_ap_skills.empty? for i in 0...new_full_ap_skills.size skills.push([new_full_ap_skills[i].name, actor.id]) end @result_skillkgc_window.visible = true @result_skillkgc_window.refresh(skills) @result_skillkgc_window.y = @expview_window.y @result_skill_window.y = @result_skillkgc_window.y + @result_skillkgc_window.height BBL::SKILL_MASTER_SOUND_FILE.play if BBL::SKILL_MASTER_SOUND end end } end #--------------------------------------------------------------------------- # リザルト画面更新 @count = 0 @se_count = 0 skills = [] loop do if BBL::SKIP_PM == true @count += BBL::SKIP_COUNT if Input.press?(BBL::SKIP_KEY) end if BBL::EXP_SOUND == true BBL::EXP_SOUND_FILE.play if @se_count == 0 and exp != 0 @se_count += 1 @se_count = 0 if @se_count == BBL::EXP_SOUND_COUNT end @count += 1 @count = BBL::WAIT_TIME if @count > BBL::WAIT_TIME @resultexp_window.update(exp, @count) for actor in members unless actor.new_skills.empty? for i in 0...actor.new_skills.size skills.push([actor.new_skills[i].name, actor.id]) end @result_skill_window.visible = true @result_skill_window.refresh(skills) actor.new_skills = [] end end break if @count == BBL::WAIT_TIME update_basic end @resultexp_window.update(exp, @count) # 補助 wait(30) if @result_skill_window.visible # EXP獲得 $game_party.members.each { |actor| actor.gain_exp(exp, false) if actor.exist? } if $imported["LargeParty"] exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000 $game_party.stand_by_members.each { |actor| actor.gain_exp(exp, false) if actor.exist? } end # ゴールド獲得 $game_party.gain_gold(gold) loop do update_basic break if Input.trigger?(Input::C) end # 各ウィンドウの解放 @result_window.dispose @expview_window.dispose @resultexp_window.dispose @result_skill_window.dispose @resultitem_window.dispose if @resultitem_window != nil @result_skillkgc_window.dispose if $imported["EquipLearnSkill"] end #-------------------------------------------------------------------------- # ● リザルトメッセージ表示 #-------------------------------------------------------------------------- def result_message @help_window = Window_Help.new @help_window.y = (416 / 2) - (@help_window.height / 2) if BBL::TURN_MESSAGE for i in 1..BBL::TURN_MESSAGE_TEXT.size if BBL::TURN_MESSAGE_TEXT[i] != nil text = sprintf(BBL::TURN_MESSAGE_TEXT[i], $game_party.name, @enemy_name) end break if i == $game_troop.turn_count end else text = BBL::MESSAGE_GROUP[$game_troop.troop_id] end if text == nil text = sprintf(BBL::DEFAULT_TEXT, $game_party.name, @enemy_name) end text_width = @help_window.contents.text_size(text).width @help_window.width = text_width + 32 @help_window.width = 544 if @help_window.width > 544 @help_window.x = (544 - @help_window.width) / 2 @help_window.create_contents @help_window.z = 1000 @help_window.set_text(text, 1) wait(BBL::MESSAGE_WAIT) loop do if Input.trigger?(Input::C) @help_window.dispose break end update_basic end end end #============================================================================== # ■ Window_ResultExp # リザルト画面で獲得EXPを表示するウィンドウです #============================================================================== class Window_ResultExp < Window_Base WIDTH = BBL::WINDOW_WIDTH # ウィンドウの横幅 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(exp, gold, ap) i = 2 if BBL::NO_DAMAGE_BONUS i += 1 unless $game_temp.damage_flug end if BBL::TURN_BONUS i += 1 if $game_temp.turn_bonus end if $imported["EquipLearnSkill"] i += 1 if ap > 0 end super(0, 0, WIDTH, WLH * i + 32) self.contents = Bitmap.new(width - 32, height - 32) refresh(exp, gold, ap) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(exp, gold, ap) self.contents.clear i = 0 if BBL::TURN_BONUS if $game_temp.turn_bonus self.contents.font.color = BBL::TURN_BONUS_COLOR self.contents.draw_text(4, WLH * i, 272, WLH, BBL::TURN_BONUS_WORD) i += 1 end end if BBL::NO_DAMAGE_BONUS unless $game_temp.damage_flug self.contents.font.color = BBL::NO_DAMAGE_COLOR self.contents.draw_text(4, WLH * i, 272, WLH, BBL::NO_DAMAGE_WORD) i += 1 end end self.contents.font.color = system_color exp_width = contents.text_size(BBL::VIEW_EXP).width gold_width = contents.text_size(BBL::VIEW_GOLD).width self.contents.draw_text(4, WLH * i, exp_width, WLH, BBL::VIEW_EXP) self.contents.draw_text(4, WLH * i + WLH, gold_width, WLH, BBL::VIEW_GOLD) self.contents.font.color = normal_color x = [exp_width, gold_width].max if BBL::TURN_BONUS || BBL::NO_DAMAGE_BONUS exp_rate = 100 gold_rate = 100 if $game_temp.damage_flug == false && BBL::NO_DAMAGE_BONUS exp_rate += BBL::EXP_BONUS_RATE - 100 gold_rate += BBL::GOLD_BONUS_RATE - 100 end if $game_temp.turn_bonus && BBL::TURN_BONUS exp_rate += BBL::EXP_BONUS_RATE - 100 gold_rate += BBL::GOLD_BONUS_RATE - 100 end if $game_temp.damage_flug == false || $game_temp.turn_bonus exp1 = (exp / (exp_rate / 100.0)).round exp2 = exp - exp1 total_exp = exp1, " + ", exp2 total_exp = exp if exp == 0 gold1 = (gold / (gold_rate / 100.0)).round gold2 = gold - gold1 total_gold = gold1, " + ", gold2 total_gold = gold if gold == 0 self.contents.draw_text(x + 32, WLH * i, 304 - 32, 24, total_exp) self.contents.draw_text(x + 32, WLH * i + WLH, 304 - 32, 24, total_gold) else self.contents.draw_text(x + 32, WLH * i, 304 - 32, 24, exp) self.contents.draw_text(x + 32, WLH * i + WLH, 304 - 32, 24, gold) end else self.contents.draw_text(x + 32, WLH * i, 304 - 32, 24, exp) self.contents.draw_text(x + 32, WLH * i + WLH, 304 - 32, 24, gold) end if ap > 0 i += 1 self.contents.draw_text(x + 32, WLH * i + WLH, 304 - 32, 24, ap) self.contents.font.color = system_color self.contents.draw_text(4, WLH * i + WLH, gold_width, WLH, KGC::EquipLearnSkill::VOCAB_AP) end end end #============================================================================== # ■ Window_ResultItem # リザルト画面で獲得アイテムを表示するウィンドウです #============================================================================== class Window_ResultItem < Window_Base WIDTH = 544 - BBL::WINDOW_WIDTH #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(drop_items) x = BBL::WINDOW_WIDTH super(x, 0, WIDTH, (drop_items.size * WLH) + WLH + 32) refresh(drop_items) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(drop_items) self.contents.clear x = 4 item_width = contents.text_size(BBL::VIEW_ITEM).width self.contents.font.color = system_color self.contents.draw_text(x, 0, item_width, WLH, BBL::VIEW_ITEM) y = WLH for item in drop_items draw_item_name(item, 4, y) y += WLH end end #-------------------------------------------------------------------------- # ● アイテム名の描画 # item : アイテム (スキル、武器、防具でも可) # x : 描画先 X 座標 # y : 描画先 Y 座標 # enabled : 有効フラグ。false のとき半透明で描画 #-------------------------------------------------------------------------- def draw_item_name(item, x, y, enabled = true) if item != nil draw_icon(item.icon_index, x, y, enabled) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(x + 24, y, WIDTH - 56, WLH, item.name) end end end #============================================================================== # ■ Window_Result # リザルト画面でアクターの情報を表示するウィンドウです #============================================================================== class Window_Result < Window_Base HEIGHT = BBL::ACTOR_HEIGHT # アクター1人分の高さ WIDTH = BBL::WINDOW_WIDTH # ウィンドウの横幅 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @members = $game_party.members if $imported["LargeParty"] && BBL::VIEW_STAND_BY_MEMBERS @members = $game_party.all_members end super(0, 0, WIDTH, (@members.size * HEIGHT) + 32) self.contents = Bitmap.new(width - 32, height - 32) self.y = 208 - (height / 2) refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear name_width = [] actor_x = BBL::WINDOW_ACTOR_X level_x = BBL::WINDOW_ACTOR_LEVEL gauge_x = BBL::WINDOW_EXP_GAUGE_X lv_width = contents.text_size(Vocab::level_a).width for actor in @members x = 4 y = actor.index * HEIGHT unless $imported["LargeParty"] y = actor.party_index * HEIGHT if $imported["LargeParty"] sy = (HEIGHT / 2) - 16 case BBL::VIEW_ACTOR when 0;draw_actor_graphic(actor, actor_x + 16, y + HEIGHT - sy) when 1;draw_actor_name(actor, actor_x, y + HEIGHT - 20 - sy) end self.contents.font.size = 20 self.contents.font.color = system_color self.contents.draw_text(level_x, y + HEIGHT - 20 - sy, lv_width, WLH, Vocab::level_a) self.contents.draw_text(gauge_x, y + HEIGHT - 28 - sy, 64, WLH, "Next") end end end #============================================================================== # ■ Window_ResultSkill # リザルト画面で習得したスキルを表示するウィンドウです #============================================================================== HEIGHT = BBL::SKILL_ACTOR_HEIGHT WIDTH = 544 - BBL::WINDOW_WIDTH GWIDTH = BBL::SKILL_ACTOR_WIDTH class Window_ResultSkill < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize x = BBL::WINDOW_WIDTH super(x, 0, WIDTH, WLH + 32) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(skills) self.contents.clear text_width = contents.text_size(BBL::VIEW_SKILL).width self.height = skills.size * HEIGHT + WLH + 32 self.contents = Bitmap.new(width - 32, height - 32) x = 0 self.contents.font.color = system_color self.contents.draw_text(x, 0, text_width, WLH, BBL::VIEW_SKILL) last_id = 9999 text_x = x + GWIDTH sy = BBL::SKILL_ACTOR_Y sx = BBL::SKILL_ACTOR_X for i in 0...skills.size actor = $data_actors[skills[i][1]] unless last_id == skills[i][1] draw_actor_graphic(actor, x + sx, sy + WLH + HEIGHT * i) end self.contents.font.color = normal_color self.contents.draw_text(text_x, WLH + HEIGHT * i, WIDTH - (32 + text_x), WLH, skills[i][0]) last_id = skills[i][1] end end #-------------------------------------------------------------------------- # ○ 歩行グラフィックの描画 (再定義) # character_name : 歩行グラフィック ファイル名 # character_index : 歩行グラフィック インデックス # x : 描画先 X 座標 # y : 描画先 Y 座標 # opacity : 不透明度 #-------------------------------------------------------------------------- def draw_character(character_name, character_index, x, y, opacity = 255) return if character_name == nil bitmap = Cache.character(character_name) sign = character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity) gheight = BBL::CLEAR_ACTOR_Y self.contents.clear_rect(x - cw / 2, y - gheight, GWIDTH, gheight) end end #============================================================================== # ■ Window_ResultNextExp # リザルト画面で動的な情報を表示するウィンドウです #============================================================================== class Window_ResultNextExp < Window_Base HEIGHT = BBL::ACTOR_HEIGHT # アクター1人分の高さ WIDTH = BBL::WINDOW_WIDTH # ウィンドウの横幅 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(exp) @members = $game_party.all_members if $imported["LargeParty"] @members = $game_party.members unless $imported["LargeParty"] super(0, 0, WIDTH, (@members.size * HEIGHT) + 32) self.contents = Bitmap.new(width - 32, height - 32) self.y = 208 - (height / 2) self.opacity = 0 end #-------------------------------------------------------------------------- # ● EXP表示更新 #-------------------------------------------------------------------------- def update(exp_s, count) self.contents.clear level_x = BBL::WINDOW_ACTOR_LEVEL gauge_x = BBL::WINDOW_EXP_GAUGE_X exp_x = BBL::WINDOW_EXP_X for actor in @members # 装備の経験値2倍を適応 exp = exp_s exp = exp_s * 2 if actor.double_exp_gain # KGC経験値&ゴールド変化適応 exp = exp_s * actor.exp_gain_rate / 100 if $imported["VariableExpGold"] x = 56 y = actor.index * HEIGHT unless $imported["LargeParty"] y = actor.party_index * HEIGHT if $imported["LargeParty"] sy = (HEIGHT / 2) - 16 update_actor_level(actor, level_x, y + HEIGHT - 20 - sy) if view_member?(actor) update_actor_nextexp(actor, exp_x, y + HEIGHT - 28 - sy, exp, count) update_actor_exp_gauge(actor, gauge_x, y + HEIGHT - 22 - sy, exp, count) if view_member?(actor) end end #-------------------------------------------------------------------------- # ○ レベル描画の更新 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def update_actor_level(actor, x, y) self.contents.font.color = BBL::LVUP_COLOR if actor.level_up_flug == true self.contents.draw_text(x + 32, y, 24, WLH, actor.level) end #-------------------------------------------------------------------------- # ○ NEXTEXP表示更新 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 幅 #-------------------------------------------------------------------------- def update_actor_nextexp(actor, x, y, exp, count, width = 120) if actor.level == 99 self.contents.draw_text(x, y, width, WLH, "MAX", 2) return end exp = 0 if actor.dead? if $imported["LargeParty"] unless actor.battle_member? exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000 end end gwc = exp * count / BBL::WAIT_TIME self.contents.font.color = normal_color if actor.next_rest_exp_s - gwc <= 0 last_skills = actor.skills # KGCスキルCP制適応 last_skills = actor.all_skills if $imported["SkillCPSystem"] actor.level_up actor.level_up_flug = true BBL::LVUP_SOUND_FILE.play if BBL::LVUP_SOUND == true actor.new_skills = actor.skills - last_skills # KGCスキルCP制適応 actor.new_skills = actor.all_skills - last_skills if $imported["SkillCPSystem"] end if actor.next_max_exp > 0 self.contents.draw_text(x, y, width, WLH, actor.next_rest_exp_s - gwc, 2) if view_member?(actor) else xr = x + width end end #-------------------------------------------------------------------------- # ☆ EXP ゲージの描画(リザルト) # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 # width : 幅 #-------------------------------------------------------------------------- def update_actor_exp_gauge(actor, x, y, exp, count, width = 120) color1 = BBL::EXP_COLOR1 color2 = BBL::EXP_COLOR2 if actor.level == 99 self.contents.gradient_fill_rect(x, y + WLH - 8, width, 6, color1, color2) return end exp = 0 if actor.dead? if $imported["LargeParty"] unless actor.battle_member? exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000 end end max = actor.next_max_exp gw = width * (max - actor.next_rest_exp) / max exp = width * exp / max gwc = exp * count / BBL::WAIT_TIME + gw color1 = BBL::EXP_COLOR1 color2 = BBL::EXP_COLOR2 self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gwc, 6, color1, color2) end #-------------------------------------------------------------------------- # ☆ 描画判定 # KGC多人数パーティ導入時、待機メンバーの情報を描画するか判定 #-------------------------------------------------------------------------- def view_member?(actor) if $imported["LargeParty"] unless BBL::VIEW_STAND_BY_MEMBERS return false unless actor.battle_member? end end return true end end if $imported["EquipLearnSkill"] #============================================================================== # ■ Window_ResultSkill_KGC # マスターしたスキルを表示するウィンドウです # KGC 装備スキル導入時 #============================================================================== HEIGHT = BBL::SKILL_ACTOR_HEIGHT WIDTH = 544 - BBL::WINDOW_WIDTH GWIDTH = BBL::SKILL_ACTOR_WIDTH class Window_ResultSkill_KGC < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize x = BBL::WINDOW_WIDTH super(x, 0, WIDTH, WLH + 32) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(skills) self.contents.clear text_width = contents.text_size(BBL::VIEW_SKILL_MASTER).width self.height = skills.size * HEIGHT + WLH + 32 self.contents = Bitmap.new(width - 32, height - 32) x = 0 self.contents.font.color = system_color self.contents.draw_text(x, 0, text_width, WLH, BBL::VIEW_SKILL_MASTER) last_id = 9999 text_x = x + GWIDTH sy = BBL::SKILL_ACTOR_Y sx = BBL::SKILL_ACTOR_X for i in 0...skills.size actor = $data_actors[skills[i][1]] unless last_id == skills[i][1] draw_actor_graphic(actor, x + sx, sy + WLH + HEIGHT * i) end self.contents.font.color = normal_color self.contents.draw_text(text_x, WLH + HEIGHT * i, WIDTH - (32 + text_x), WLH, skills[i][0]) last_id = skills[i][1] end end #-------------------------------------------------------------------------- # ○ 歩行グラフィックの描画 (再定義) # character_name : 歩行グラフィック ファイル名 # character_index : 歩行グラフィック インデックス # x : 描画先 X 座標 # y : 描画先 Y 座標 # opacity : 不透明度 #-------------------------------------------------------------------------- def draw_character(character_name, character_index, x, y, opacity = 255) return if character_name == nil bitmap = Cache.character(character_name) sign = character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity) gheight = BBL::CLEAR_ACTOR_Y self.contents.clear_rect(x - cw / 2, y - gheight, GWIDTH, gheight) end end end if BBL::TURN_BONUS || BBL::NO_DAMAGE_BONUS #============================================================================== # ここからおまけ #============================================================================== # ■ Game_Temp #============================================================================== class Game_Temp #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :damage_flug # 被ダメージフラグ attr_accessor :turn_bonus # ターンボーナスフラグ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_BBL initialize def initialize initialize_BBL @damage_flug = false @turn_bonus = true end end #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● 通常攻撃によるダメージ計算(追加定義) #-------------------------------------------------------------------------- alias make_attack_damage_value_BBL make_attack_damage_value def make_attack_damage_value(attacker) # 元の処理 make_attack_damage_value_BBL(attacker) # ダメージフラグ if $game_temp.damage_flug == false if @hp_damage > 0 $game_temp.damage_flug = true unless attacker.actor? end end end #-------------------------------------------------------------------------- # ● スキルまたはアイテムによるダメージ計算(追加定義) #-------------------------------------------------------------------------- alias make_obj_damage_value_BBL make_obj_damage_value def make_obj_damage_value(user, obj) # 追加定義 # 元の処理 make_obj_damage_value_BBL(user, obj) # ダメージフラグ if $game_temp.damage_flug == false if @hp_damage > 0 $game_temp.damage_flug = true unless user.actor? end end end end #============================================================================== # ■ Game_Troop #============================================================================== class Game_Troop < Game_Unit #-------------------------------------------------------------------------- # ● 経験値の合計計算(追加定義) #-------------------------------------------------------------------------- alias exp_total_BBL exp_total def exp_total # 追加定義 exp = exp_total_BBL rate = 100 if BBL::NO_DAMAGE_BONUS if $game_temp.damage_flug == false rate += BBL::EXP_BONUS_RATE - 100 end end if BBL::TURN_BONUS if $game_temp.turn_bonus rate += BBL::EXP_BONUS_RATE - 100 end end exp = ((exp * rate) / 100).round return exp end #-------------------------------------------------------------------------- # ● お金の合計計算(追加定義) #-------------------------------------------------------------------------- alias gold_total_BBL gold_total def gold_total # 追加定義 gold = gold_total_BBL rate = 100 if BBL::NO_DAMAGE_BONUS if $game_temp.damage_flug == false rate += BBL::GOLD_BONUS_RATE - 100 end end if BBL::TURN_BONUS if $game_temp.turn_bonus rate += BBL::GOLD_BONUS_RATE - 100 end end gold = ((gold * rate) / 100).round return gold end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 戦闘終了(追加定義) #-------------------------------------------------------------------------- alias battle_end_BBL battle_end def battle_end(result) # 追加定義 $game_temp.damage_flug = false # ダメージフラグ初期化 $game_temp.turn_bonus = true # ターンボーナス初期化 # 元の処理 battle_end_BBL(result) end #-------------------------------------------------------------------------- # ● ターン終了(追加定義) #-------------------------------------------------------------------------- alias turn_end_BBL turn_end def turn_end # 追加定義 if $game_troop.turn_count == BBL::TURN_BONUS_LIMIT $game_temp.turn_bonus = false end # 元の処理 turn_end_BBL end end end