Check if the user is usable when we set the choice
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
f13b78e297
commit
dcf6b20e65
|
@ -10,6 +10,9 @@ using namespace CreatureLib::Battling;
|
||||||
const ArbUt::BorrowedPtr<const BattleLibrary>& Battle::GetLibrary() const noexcept { return _library; }
|
const ArbUt::BorrowedPtr<const BattleLibrary>& Battle::GetLibrary() const noexcept { return _library; }
|
||||||
|
|
||||||
bool Battle::CanUse(const ArbUt::BorrowedPtr<BaseTurnChoice>& choice) {
|
bool Battle::CanUse(const ArbUt::BorrowedPtr<BaseTurnChoice>& choice) {
|
||||||
|
if (!choice->GetUser()->IsUsable()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (choice->GetKind() == TurnChoiceKind::Attack) {
|
if (choice->GetKind() == TurnChoiceKind::Attack) {
|
||||||
auto attack = choice.ForceAs<AttackTurnChoice>();
|
auto attack = choice.ForceAs<AttackTurnChoice>();
|
||||||
// HOOK: change number of uses needed.
|
// HOOK: change number of uses needed.
|
||||||
|
|
Loading…
Reference in New Issue