From 71bb45ec7c14dc0da0a68e797c959efe7441e129 Mon Sep 17 00:00:00 2001 From: Bobblybook Date: Tue, 23 Jul 2024 18:09:55 +1000 Subject: [PATCH] Cone of Cold isUseful check --- src/strategy/mage/MageActions.cpp | 7 +++++++ src/strategy/mage/MageActions.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/strategy/mage/MageActions.cpp b/src/strategy/mage/MageActions.cpp index fcbc5b83..455bad57 100644 --- a/src/strategy/mage/MageActions.cpp +++ b/src/strategy/mage/MageActions.cpp @@ -15,3 +15,10 @@ bool CastFrostNovaAction::isUseful() { return sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", GetTargetName()), 10.f); } + +bool CastConeOfColdAction::isUseful() +{ + bool facingTarget = AI_VALUE2(bool, "facing", "current target"); + bool targetClose = sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", GetTargetName()), 10.f); + return facingTarget && targetClose; +} diff --git a/src/strategy/mage/MageActions.h b/src/strategy/mage/MageActions.h index 3b159db0..a9ae6ff9 100644 --- a/src/strategy/mage/MageActions.h +++ b/src/strategy/mage/MageActions.h @@ -106,7 +106,7 @@ class CastConeOfColdAction : public CastSpellAction public: CastConeOfColdAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "cone of cold") { } ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } - // bool isUseful() override; + bool isUseful() override; }; class CastArcaneIntellectAction : public CastBuffSpellAction