#============================================================================== # ■ RGSS3 敵グループ勝利時追加報酬 Ver1.01 by 星潟 #------------------------------------------------------------------------------ # 敵グループに勝利した際、戦闘不能にした敵に本来含まれていない # EXP・お金・ドロップアイテムを得られるようにします。 # この設定は、戦闘毎にリセットされます。 # # 使用例(全てバトルイベントにてイベントコマンドのスクリプトを使用します) # # 敵グループのEXPを10000増加させたい時 # # $game_troop.ex_plus_exp = 10000 # # 敵グループのお金を10000増加させたい時 # # $game_troop.ex_plus_gold = 10000 # # 敵グループにアイテムID1をドロップさせたい場合 # # $game_troop.ex_plus_item.push($data_items[1]) # # 敵グループにアイテムID2・武器ID4・防具ID5・アイテムID6をドロップさせたい場合 # # $game_troop.ex_plus_item.push($data_items[2]) # $game_troop.ex_plus_item.push($data_weapons[4]) # $game_troop.ex_plus_item.push($data_armors[5]) # $game_troop.ex_plus_item.push($data_items[6]) #------------------------------------------------------------------------------ # Ver1.01 効果が戦闘毎にリセットされない不具合を修正しました。 #============================================================================== #============================================================================== # ■ Game_Troop #------------------------------------------------------------------------------ #  敵グループおよび戦闘に関するデータを扱うクラスです。バトルイベントの処理も # 行います。このクラスのインスタンスは $game_troop で参照されます。 #============================================================================== class Game_Troop < Game_Unit attr_accessor :ex_plus_exp attr_accessor :ex_plus_gold attr_accessor :ex_plus_item #-------------------------------------------------------------------------- # オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_ex_ex_g_i initialize def initialize #本来の処理を実行。 initialize_ex_ex_g_i #敵グループ勝利時追加報酬のリセットを実行。 ex_ex_g_i_reset end #-------------------------------------------------------------------------- # セットアップ #-------------------------------------------------------------------------- alias setup_ex_ex_g_i setup def setup(troop_id) #本来の処理を実行。 setup_ex_ex_g_i(troop_id) #敵グループ勝利時追加報酬のリセットを実行。 ex_ex_g_i_reset end #-------------------------------------------------------------------------- # 経験値の合計計算 #-------------------------------------------------------------------------- alias exp_total_ex_ex_g_i exp_total def exp_total #本来の処理に追加報酬分の経験値を加える。 exp_total_ex_ex_g_i + @ex_plus_exp end #-------------------------------------------------------------------------- # お金の合計計算 #-------------------------------------------------------------------------- alias gold_total_ex_ex_g_i gold_total def gold_total #本来の処理に追加報酬のお金を加える。 gold_total_ex_ex_g_i + @ex_plus_gold end #-------------------------------------------------------------------------- # ドロップアイテムの配列作成 #-------------------------------------------------------------------------- alias make_drop_items_ex_ex_g_i make_drop_items def make_drop_items #本来の処理に追加報酬分のアイテムを加える。 data = make_drop_items_ex_ex_g_i + @ex_plus_item #エラー対策にnilを消去し、配列を返す。 data.delete(nil);data end #-------------------------------------------------------------------------- # 敵グループ勝利時追加報酬のリセット #-------------------------------------------------------------------------- def ex_ex_g_i_reset #3つのデータを全て初期化する。 @ex_plus_exp = 0 @ex_plus_gold = 0 @ex_plus_item = [] end end