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

Method ActionSelectedCallback

src/scene_battle.cpp:570–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570void Scene_Battle::ActionSelectedCallback(Game_Battler* for_battler) {
571 assert(for_battler->GetBattleAlgorithm() != nullptr);
572
573 auto single_target = for_battler->GetBattleAlgorithm()->GetOriginalSingleTarget();
574 auto group_targets = for_battler->GetBattleAlgorithm()->GetOriginalPartyTarget();
575 // Target: 0 None, 1 Single Enemy, 2 All Enemies, 3 Single Ally, 4 All Allies
576 Game_Battle::ManiacBattleHook(
577 Game_Interpreter_Battle::ManiacBattleHookType::Targetting,
578 for_battler->GetType() == Game_Battler::Type_Enemy,
579 for_battler->GetPartyIndex(),
580 for_battler->GetBattleAlgorithm()->GetActionType(),
581 for_battler->GetBattleAlgorithm()->GetActionId(),
582 single_target
583 ? (single_target->GetType() != Game_Battler::Type_Enemy ? 1 : 3)
584 : (group_targets->GetRandomActiveBattler()->GetType() != Game_Battler::Type_Enemy ? 2 : 4),
585 single_target ? single_target->GetPartyIndex() : 0
586 );
587
588 if (for_battler->GetBattleAlgorithm() == nullptr) {
589 Output::Warning("ActionSelectedCallback: Invalid action for battler {} ({})",
590 for_battler->GetId(), for_battler->GetName());
591 Output::Warning("Please report a bug!");
592 }
593
594 battle_actions.push_back(for_battler);
595}
596
597bool Scene_Battle::CallDebug() {
598 if (Player::debug_flag) {

Callers

nothing calls this directly

Calls 10

GetBattleAlgorithmMethod · 0.80
GetPartyIndexMethod · 0.80
GetActionTypeMethod · 0.80
GetActionIdMethod · 0.80
GetTypeMethod · 0.45
GetIdMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected