MCPcopy Create free account
hub / github.com/EasyRPG/Player / CalcNormalAttackAutoBattleRank

Function CalcNormalAttackAutoBattleRank

src/autobattle.cpp:258–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258double CalcNormalAttackAutoBattleRank(const Game_Actor& source, Game_Battler::Weapon weapon, const lcf::rpg::System::BattleCondition cond, bool apply_variance, bool emulate_bugs) {
259 double rank = 0.0;
260 std::vector<Game_Battler*> targets;
261 Main_Data::game_enemyparty->GetBattlers(targets);
262
263 if (!emulate_bugs && source.HasAttackAll(weapon)) {
264 for (auto* target: targets) {
265 auto target_rank = CalcNormalAttackAutoBattleTargetRank(source, *target, weapon, cond, apply_variance, emulate_bugs);
266 rank += target_rank;
267 DebugLog("AUTOBATTLE: Actor {} Check Attack Party Enemy {} Rank : {} -> {}", source.GetName(), target->GetName(), rank, target_rank);
268 }
269 } else {
270 for (auto* target: targets) {
271 auto target_rank = CalcNormalAttackAutoBattleTargetRank(source, *target, weapon, cond, apply_variance, emulate_bugs);
272 rank = std::max(rank, target_rank);
273 DebugLog("AUTOBATTLE: Actor {} Check Attack Single Enemy {} Rank : {} -> {}", source.GetName(), target->GetName(), rank, target_rank);
274 }
275 }
276 return rank;
277}
278
279void SelectAutoBattleAction(Game_Actor& source,
280 Game_Battler::Weapon weapon,

Callers 1

SelectAutoBattleActionFunction · 0.85

Calls 6

maxFunction · 0.85
GetBattlersMethod · 0.80
DebugLogFunction · 0.70
HasAttackAllMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected