Initial support for handling multi target attacks.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-06-05 15:32:05 +02:00
parent f463ba8496
commit 66379bfa65
4 changed files with 116 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
#include <Arbutils/Assert.hpp>
#include "../../Library/Exceptions/NotImplementedException.hpp"
#include "../ScriptHandling/ScriptMacros.hpp"
#include "ResolveTarget.hpp"
using namespace CreatureLib::Battling;
@@ -57,9 +58,9 @@ void TurnHandler::ExecuteAttackChoice(ArbUt::BorrowedPtr<AttackTurnChoice> choic
// TODO: Change attack
}
// FIXME: Resolve all targets
auto target = choice->GetUser()->GetBattle()->GetCreature(choice->GetTarget());
ArbUt::List<ArbUt::BorrowedPtr<Creature>> targets = {target};
ArbUt::List<ArbUt::BorrowedPtr<Creature>> targets = TargetResolver::ResolveTargets(
choice->GetTarget(), choice->GetAttack()->GetAttack()->GetTarget(), choice->GetUser()->GetBattle());
auto attack = ExecutingAttack(targets, 1, choice->GetUser(), choice->GetAttack(), choice->GetAttackScript());
bool prevented = false;