#============================================================================== # ■ ラピッドボーナス #------------------------------------------------------------------------------ # 1ターンキル等をするとボーナスをもらえるスクリプトです # 経験値を獲得したというメッセージの後ラピッドボーナスのメッセージを表示し # それからレベルアップ計算をします # # *月の下の宿 # URL:http://gekkasou.shiteyattari.com/ #============================================================================== module An #ボーナスメッセージ Rapid_Bonus = "Rapid Bonus!!" #%sの箇所に経験値が入る Rapid_Exp = "ボーナス経験値%s獲得!" #ボーナス経験値レート。1000で普通の経験値。初期値は500(50%) Rapid_Rate = 500 #ボーナス経験値分散度。初期値は10(約10%前後にぶれる) Rapid_Variance = 10 #ボーナス経験値最低値。少なくともこれだけボーナスが入るよってこと Rapid_Minimum = 10 end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base alias rapid_display_level_up display_level_up def display_level_up rexp = $game_troop.exp_total r = false $game_troop.exexp = 0 if $game_troop.turn_count <= 1 r = true rexp /= 1000.0 rexp *= An::Rapid_Rate rexp = [rexp, An::Rapid_Minimum].max if rexp != 0 amp = [rexp.abs * An::Rapid_Variance / 100, 0].max rexp += rand(amp+1) + rand(amp+1) - amp end rexp = rexp.round $game_message.texts.push(An::Rapid_Bonus) $game_message.texts.push(sprintf(An::Rapid_Exp, rexp)) $game_troop.exexp = rexp end rapid_display_level_up end end #============================================================================== # ■ An_Rapid #============================================================================== class An_Rapid attr_reader :exp def initialize(exexp) @exp = exexp end end #============================================================================== # ■ Game_Troop #============================================================================== class Game_Troop < Game_Unit attr_accessor :exexp # エキストラEXP(ボーナスEXP) alias original_rapid_bonus_exp_total exp_total #-------------------------------------------------------------------------- # ● 経験値の合計計算 #-------------------------------------------------------------------------- def exp_total dead_members << An_Rapid.new(@exexp) original_rapid_bonus_exp_total end end