# ▼▲▼ XSE_A2 AP獲得・撃破 ▼▲▼ # # #============================================================================== # AP計算式 #============================================================================== class Game_Enemy < Game_Battler def ap # とりあえずEXPをAPとして設定 return self.exp end end #============================================================================== # AP の獲得 #============================================================================== class Scene_Battle alias xse_a2_start_phase5 start_phase5 def start_phase5 # 呼び戻す xse_a2_start_phase5 # ループ ap = 0 for enemy in $game_troop.enemies # エネミーが隠れ状態でない場合 unless enemy.hidden # 獲得APを追加 ap += enemy.ap end end # 頭数で割る ap = (1.0 * ap / $game_party.actors.size).ceil # APの獲得 for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false actor.ap += ap end end # 再設定 @result_window.set_ap(ap) end end #============================================================================== # ■ Window_BattleResult #============================================================================== class Window_BattleResult < Window_Base #-------------------------------------------------------------------------- # ● リフレッシュ [再定義] #-------------------------------------------------------------------------- def set_ap(ap) @ap = ap refresh end def refresh self.contents.clear x = 4 self.contents.font.color = normal_color cx = contents.text_size(@exp.to_s).width self.contents.draw_text(x, 0, cx, 32, @exp.to_s) x += cx + 4 self.contents.font.color = system_color cx = contents.text_size("EXP").width self.contents.draw_text(x, 0, 64, 32, "EXP") x += cx + 16 if @ap != nil self.contents.font.color = normal_color cx = contents.text_size(@ap.to_s).width self.contents.draw_text(x, 0, cx, 32, @ap.to_s) x += cx + 4 self.contents.font.color = system_color cx = contents.text_size(XSE::AP_S).width self.contents.draw_text(x, 0, 64, 32, XSE::AP_S) x += cx + 16 end self.contents.font.color = normal_color cx = contents.text_size(@gold.to_s).width self.contents.draw_text(x, 0, cx, 32, @gold.to_s) x += cx + 4 self.contents.font.color = system_color self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold) y = 32 for item in @treasures draw_item_name(item, 4, y) y += 32 end end end