mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-31 09:23:47 +00:00
# Pull Request
- Applies the clean and corrected singletons, Meyer pattern. (cherry
picked from @SmashingQuasar )
Testing by just playing the game in various ways. Been tested by myself
@Celandriel and @SmashingQuasar
---
## Complexity & Impact
- Does this change add new decision branches?
- [x] No
- [ ] Yes (**explain below**)
- Does this change increase per-bot or per-tick processing?
- [x] No
- [ ] Yes (**describe and justify impact**)
- Could this logic scale poorly under load?
- [x] No
- [ ] Yes (**explain why**)
---
## Defaults & Configuration
- Does this change modify default bot behavior?
- [x] No
- [ ] Yes (**explain why**)
---
## AI Assistance
- Was AI assistance (e.g. ChatGPT or similar tools) used while working
on this change?
- [x] No
- [ ] Yes (**explain below**)
---
## Final Checklist
- [x] Stability is not compromised
- [x] Performance impact is understood, tested, and acceptable
- [x] Added logic complexity is justified and explained
- [x] Documentation updated if needed
---
## Notes for Reviewers
Anything that significantly improves realism at the cost of stability or
performance should be carefully discussed
before merging.
---------
Co-authored-by: Nicolas Lebacq <nicolas.cordier@outlook.com>
Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
73 lines
1.7 KiB
C++
73 lines
1.7 KiB
C++
/*
|
|
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
|
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
|
*/
|
|
|
|
#ifndef _PLAYERBOT_REACHTARGETACTIONS_H
|
|
#define _PLAYERBOT_REACHTARGETACTIONS_H
|
|
|
|
#include "GenericSpellActions.h"
|
|
#include "MovementActions.h"
|
|
|
|
class PlayerbotAI;
|
|
|
|
class ReachTargetAction : public MovementAction
|
|
{
|
|
public:
|
|
ReachTargetAction(PlayerbotAI* botAI, std::string const name, float distance)
|
|
: MovementAction(botAI, name), distance(distance)
|
|
{
|
|
}
|
|
|
|
bool Execute(Event event) override;
|
|
bool isUseful() override;
|
|
std::string const GetTargetName() override;
|
|
|
|
protected:
|
|
float distance;
|
|
};
|
|
|
|
class CastReachTargetSpellAction : public CastSpellAction
|
|
{
|
|
public:
|
|
CastReachTargetSpellAction(PlayerbotAI* botAI, std::string const spell, float distance)
|
|
: CastSpellAction(botAI, spell), distance(distance)
|
|
{
|
|
}
|
|
|
|
bool isUseful() override;
|
|
|
|
protected:
|
|
float distance;
|
|
};
|
|
|
|
class ReachMeleeAction : public ReachTargetAction
|
|
{
|
|
public:
|
|
ReachMeleeAction(PlayerbotAI* botAI) : ReachTargetAction(botAI, "reach melee", sPlayerbotAIConfig.meleeDistance) {}
|
|
};
|
|
|
|
class ReachSpellAction : public ReachTargetAction
|
|
{
|
|
public:
|
|
ReachSpellAction(PlayerbotAI* botAI);
|
|
};
|
|
|
|
class ReachPartyMemberToHealAction : public ReachTargetAction
|
|
{
|
|
public:
|
|
ReachPartyMemberToHealAction(PlayerbotAI* botAI);
|
|
|
|
std::string const GetTargetName() override;
|
|
};
|
|
|
|
class ReachPartyMemberToResurrectAction : public ReachTargetAction
|
|
{
|
|
public:
|
|
ReachPartyMemberToResurrectAction(PlayerbotAI* botAI);
|
|
|
|
std::string const GetTargetName() override;
|
|
};
|
|
|
|
#endif
|