Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include "TurnHandler.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <unordered_set>
|
||||
#include "../../Library/Exceptions/NotImplementedException.hpp"
|
||||
#include "../EventHooks/EventDataClasses.hpp"
|
||||
#include "../History/HistoryElements/AttackUseHistory.hpp"
|
||||
#include "../ScriptHandling/ScriptMacros.hpp"
|
||||
@@ -58,14 +57,14 @@ void TurnHandler::ExecuteChoice(ArbUt::BorrowedPtr<BaseTurnChoice> choice) {
|
||||
}
|
||||
|
||||
switch (choiceKind) {
|
||||
case TurnChoiceKind::Pass: throw NotReachableException();
|
||||
case TurnChoiceKind::Pass: return;
|
||||
case TurnChoiceKind::Attack:
|
||||
try_creature(return ExecuteAttackChoice(choice.ForceAs<AttackTurnChoice>()),
|
||||
"Encountered exception during attack choice execution");
|
||||
case TurnChoiceKind::Switch: return ExecuteSwitchChoice(choice.ForceAs<SwitchTurnChoice>());
|
||||
case TurnChoiceKind::Flee: return ExecuteFleeChoice(choice.ForceAs<FleeTurnChoice>());
|
||||
|
||||
case TurnChoiceKind::Item: throw NotImplementedException();
|
||||
case TurnChoiceKind::Item: NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +200,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
|
||||
if (hasSecondaryEffect) {
|
||||
HOOK(OnSecondaryEffect, user, attack, target.GetRaw(), hitIndex);
|
||||
}
|
||||
} catch (const CreatureException& e) {
|
||||
} catch (const ArbUt::Exception& e) {
|
||||
throw e;
|
||||
} catch (const std::exception& e) {
|
||||
THROW_CREATURE("Exception during status attack effect handling: " << e.what() << ".");
|
||||
@@ -233,7 +232,7 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
|
||||
if (hasSecondaryEffect) {
|
||||
HOOK(OnSecondaryEffect, user, attack, target.GetRaw(), hitIndex);
|
||||
}
|
||||
} catch (const CreatureException& e) {
|
||||
} catch (const ArbUt::Exception& e) {
|
||||
throw e;
|
||||
} catch (const std::exception& e) {
|
||||
THROW_CREATURE("Exception during offensive attack secondary effect handling: " << e.what()
|
||||
|
||||
Reference in New Issue
Block a user