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()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "BattleStatCalculator.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include "../../Library/Exceptions/NotImplementedException.hpp"
|
||||
#include "../Models/Creature.hpp"
|
||||
|
||||
using namespace CreatureLib;
|
||||
|
||||
@@ -40,7 +40,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (const CreatureException& e) {
|
||||
} catch (const ArbUt::Exception& e) {
|
||||
throw e;
|
||||
} catch (const std::exception& e) {
|
||||
THROW_CREATURE("Exception during choices set validation: '" << e.what() << "'.")
|
||||
@@ -81,7 +81,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
TriggerEventListener<TurnStartEvent>();
|
||||
try {
|
||||
TurnHandler::RunTurn(this->_currentTurnQueue);
|
||||
} catch (const CreatureException& e) {
|
||||
} catch (const ArbUt::Exception& e) {
|
||||
throw e;
|
||||
} catch (const std::exception& e) {
|
||||
THROW_CREATURE("Error during running a turn: '" << e.what() << "'.");
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define CREATURELIB_SCRIPTAGGREGATOR_HPP
|
||||
|
||||
#include <Arbutils/Collections/List.hpp>
|
||||
#include "../../Library/Exceptions/NotReachableException.hpp"
|
||||
#include "Script.hpp"
|
||||
#include "ScriptSet.hpp"
|
||||
#include "ScriptWrapper.hpp"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
THROW_CREATURE("Exception running script hook '" #hookName "': " << e.what()) \
|
||||
} \
|
||||
} \
|
||||
} catch (const CreatureException& e) { \
|
||||
} catch (const ArbUt::Exception& e) { \
|
||||
throw e; \
|
||||
} catch (const std::exception& e) { \
|
||||
THROW_CREATURE("Exception setting up script hook '" #hookName "': " << e.what()) \
|
||||
|
||||
Reference in New Issue
Block a user