mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 01:19:08 +00:00
Run clang-format
This commit is contained in:
@@ -1,57 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "ReachTargetActions.h"
|
||||
|
||||
#include "Event.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
|
||||
bool ReachTargetAction::Execute(Event event)
|
||||
{
|
||||
return ReachCombatTo(AI_VALUE(Unit*, GetTargetName()), distance);
|
||||
}
|
||||
bool ReachTargetAction::Execute(Event event) { return ReachCombatTo(AI_VALUE(Unit*, GetTargetName()), distance); }
|
||||
|
||||
bool ReachTargetAction::isUseful()
|
||||
{
|
||||
// do not move while casting
|
||||
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) {
|
||||
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Unit* target = GetTarget();
|
||||
// float dis = distance + CONTACT_DISTANCE;
|
||||
return target && !bot->IsWithinCombatRange(target, distance); // sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", GetTargetName()), distance);
|
||||
return target &&
|
||||
!bot->IsWithinCombatRange(target, distance); // sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float,
|
||||
// "distance", GetTargetName()), distance);
|
||||
}
|
||||
|
||||
std::string const ReachTargetAction::GetTargetName()
|
||||
{
|
||||
return "current target";
|
||||
}
|
||||
std::string const ReachTargetAction::GetTargetName() { return "current target"; }
|
||||
|
||||
bool CastReachTargetSpellAction::isUseful()
|
||||
{
|
||||
return sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "current target"), (distance + sPlayerbotAIConfig->contactDistance));
|
||||
return sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "current target"),
|
||||
(distance + sPlayerbotAIConfig->contactDistance));
|
||||
}
|
||||
|
||||
ReachSpellAction::ReachSpellAction(PlayerbotAI* botAI) : ReachTargetAction(botAI, "reach spell", botAI->GetRange("spell"))
|
||||
ReachSpellAction::ReachSpellAction(PlayerbotAI* botAI)
|
||||
: ReachTargetAction(botAI, "reach spell", botAI->GetRange("spell"))
|
||||
{
|
||||
}
|
||||
|
||||
ReachPartyMemberToHealAction::ReachPartyMemberToHealAction(PlayerbotAI* botAI) : ReachTargetAction(botAI, "reach party member to heal", botAI->GetRange("heal"))
|
||||
ReachPartyMemberToHealAction::ReachPartyMemberToHealAction(PlayerbotAI* botAI)
|
||||
: ReachTargetAction(botAI, "reach party member to heal", botAI->GetRange("heal"))
|
||||
{
|
||||
}
|
||||
|
||||
std::string const ReachPartyMemberToHealAction::GetTargetName()
|
||||
{
|
||||
return "party member to heal";
|
||||
}
|
||||
std::string const ReachPartyMemberToHealAction::GetTargetName() { return "party member to heal"; }
|
||||
|
||||
ReachPartyMemberToResurrectAction::ReachPartyMemberToResurrectAction(PlayerbotAI* botAI) : ReachTargetAction(botAI, "reach party member to resurrect", botAI->GetRange("spell"))
|
||||
ReachPartyMemberToResurrectAction::ReachPartyMemberToResurrectAction(PlayerbotAI* botAI)
|
||||
: ReachTargetAction(botAI, "reach party member to resurrect", botAI->GetRange("spell"))
|
||||
{
|
||||
}
|
||||
|
||||
std::string const ReachPartyMemberToResurrectAction::GetTargetName()
|
||||
{
|
||||
return "party member to resurrect";
|
||||
}
|
||||
std::string const ReachPartyMemberToResurrectAction::GetTargetName() { return "party member to resurrect"; }
|
||||
|
||||
Reference in New Issue
Block a user