aspect of the monkey

This commit is contained in:
Yunfan Li
2023-12-18 23:30:07 +08:00
parent af15a691b6
commit c56b1558b6
6 changed files with 46 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ class DpsHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{ {
return new ActionNode ("aimed shot", return new ActionNode ("aimed shot",
/*P*/ nullptr, /*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("multi-shot", 10.0f), nullptr), /*A*/ NextAction::array(0, new NextAction("multi-shot"), nullptr),
/*C*/ nullptr); /*C*/ nullptr);
} }
}; };

View File

@@ -83,6 +83,12 @@ class CastAspectOfTheHawkAction : public CastBuffSpellAction
CastAspectOfTheHawkAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the hawk") { } CastAspectOfTheHawkAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the hawk") { }
}; };
class CastAspectOfTheMonkeyAction : public CastBuffSpellAction
{
public:
CastAspectOfTheMonkeyAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aspect of the monkey") { }
};
class CastAspectOfTheDragonhawkAction : public CastBuffSpellAction class CastAspectOfTheDragonhawkAction : public CastBuffSpellAction
{ {
public: public:

View File

@@ -68,6 +68,7 @@ class HunterTriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["aspect of the pack"] = &HunterTriggerFactoryInternal::aspect_of_the_pack; creators["aspect of the pack"] = &HunterTriggerFactoryInternal::aspect_of_the_pack;
creators["rapid fire"] = &HunterTriggerFactoryInternal::rapid_fire; creators["rapid fire"] = &HunterTriggerFactoryInternal::rapid_fire;
creators["aspect of the hawk"] = &HunterTriggerFactoryInternal::aspect_of_the_hawk; creators["aspect of the hawk"] = &HunterTriggerFactoryInternal::aspect_of_the_hawk;
creators["aspect of the monkey"] = &HunterTriggerFactoryInternal::aspect_of_the_monkey;
creators["aspect of the wild"] = &HunterTriggerFactoryInternal::aspect_of_the_wild; creators["aspect of the wild"] = &HunterTriggerFactoryInternal::aspect_of_the_wild;
creators["aspect of the viper"] = &HunterTriggerFactoryInternal::aspect_of_the_viper; creators["aspect of the viper"] = &HunterTriggerFactoryInternal::aspect_of_the_viper;
creators["trueshot aura"] = &HunterTriggerFactoryInternal::trueshot_aura; creators["trueshot aura"] = &HunterTriggerFactoryInternal::trueshot_aura;
@@ -101,6 +102,7 @@ class HunterTriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* aspect_of_the_pack(PlayerbotAI* botAI) { return new HunterAspectOfThePackTrigger(botAI); } static Trigger* aspect_of_the_pack(PlayerbotAI* botAI) { return new HunterAspectOfThePackTrigger(botAI); }
static Trigger* rapid_fire(PlayerbotAI* botAI) { return new RapidFireTrigger(botAI); } static Trigger* rapid_fire(PlayerbotAI* botAI) { return new RapidFireTrigger(botAI); }
static Trigger* aspect_of_the_hawk(PlayerbotAI* botAI) { return new HunterAspectOfTheHawkTrigger(botAI); } static Trigger* aspect_of_the_hawk(PlayerbotAI* botAI) { return new HunterAspectOfTheHawkTrigger(botAI); }
static Trigger* aspect_of_the_monkey(PlayerbotAI* botAI) { return new HunterAspectOfTheMonkeyTrigger(botAI); }
static Trigger* aspect_of_the_wild(PlayerbotAI* botAI) { return new HunterAspectOfTheWildTrigger(botAI); } static Trigger* aspect_of_the_wild(PlayerbotAI* botAI) { return new HunterAspectOfTheWildTrigger(botAI); }
static Trigger* low_ammo(PlayerbotAI* botAI) { return new HunterLowAmmoTrigger(botAI); } static Trigger* low_ammo(PlayerbotAI* botAI) { return new HunterLowAmmoTrigger(botAI); }
static Trigger* no_ammo(PlayerbotAI* botAI) { return new HunterNoAmmoTrigger(botAI); } static Trigger* no_ammo(PlayerbotAI* botAI) { return new HunterNoAmmoTrigger(botAI); }
@@ -140,6 +142,7 @@ class HunterAiObjectContextInternal : public NamedObjectContext<Action>
creators["boost"] = &HunterAiObjectContextInternal::rapid_fire; creators["boost"] = &HunterAiObjectContextInternal::rapid_fire;
creators["readiness"] = &HunterAiObjectContextInternal::readiness; creators["readiness"] = &HunterAiObjectContextInternal::readiness;
creators["aspect of the hawk"] = &HunterAiObjectContextInternal::aspect_of_the_hawk; creators["aspect of the hawk"] = &HunterAiObjectContextInternal::aspect_of_the_hawk;
creators["aspect of the monkey"] = &HunterAiObjectContextInternal::aspect_of_the_monkey;
creators["aspect of the wild"] = &HunterAiObjectContextInternal::aspect_of_the_wild; creators["aspect of the wild"] = &HunterAiObjectContextInternal::aspect_of_the_wild;
creators["aspect of the viper"] = &HunterAiObjectContextInternal::aspect_of_the_viper; creators["aspect of the viper"] = &HunterAiObjectContextInternal::aspect_of_the_viper;
creators["aspect of the pack"] = &HunterAiObjectContextInternal::aspect_of_the_pack; creators["aspect of the pack"] = &HunterAiObjectContextInternal::aspect_of_the_pack;
@@ -189,6 +192,7 @@ class HunterAiObjectContextInternal : public NamedObjectContext<Action>
static Action* rapid_fire(PlayerbotAI* botAI) { return new CastRapidFireAction(botAI); } static Action* rapid_fire(PlayerbotAI* botAI) { return new CastRapidFireAction(botAI); }
static Action* readiness(PlayerbotAI* botAI) { return new CastReadinessAction(botAI); } static Action* readiness(PlayerbotAI* botAI) { return new CastReadinessAction(botAI); }
static Action* aspect_of_the_hawk(PlayerbotAI* botAI) { return new CastAspectOfTheHawkAction(botAI); } static Action* aspect_of_the_hawk(PlayerbotAI* botAI) { return new CastAspectOfTheHawkAction(botAI); }
static Action* aspect_of_the_monkey(PlayerbotAI* botAI) { return new CastAspectOfTheMonkeyAction(botAI); }
static Action* aspect_of_the_wild(PlayerbotAI* botAI) { return new CastAspectOfTheWildAction(botAI); } static Action* aspect_of_the_wild(PlayerbotAI* botAI) { return new CastAspectOfTheWildAction(botAI); }
static Action* aspect_of_the_viper(PlayerbotAI* botAI) { return new CastAspectOfTheViperAction(botAI); } static Action* aspect_of_the_viper(PlayerbotAI* botAI) { return new CastAspectOfTheViperAction(botAI); }
static Action* aspect_of_the_pack(PlayerbotAI* botAI) { return new CastAspectOfThePackAction(botAI); } static Action* aspect_of_the_pack(PlayerbotAI* botAI) { return new CastAspectOfThePackAction(botAI); }

View File

@@ -5,24 +5,47 @@
#include "HunterBuffStrategies.h" #include "HunterBuffStrategies.h"
#include "Playerbots.h" #include "Playerbots.h"
class BuffHunterStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
BuffHunterStrategyActionNodeFactory()
{
creators["aspect of the hawk"] = &aspect_of_the_hawk;
}
private:
static ActionNode* aspect_of_the_hawk([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode ("aspect of the hawk",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("aspect of the monkey"), nullptr),
/*C*/ nullptr);
}
};
HunterBuffDpsStrategy::HunterBuffDpsStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
{
actionNodeFactories.Add(new BuffHunterStrategyActionNodeFactory());
}
void HunterBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void HunterBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
triggers.push_back(new TriggerNode("aspect of the hawk", NextAction::array(0, triggers.push_back(new TriggerNode("aspect of the hawk", NextAction::array(0,
new NextAction("aspect of the dragonhawk", 90.0f), new NextAction("aspect of the dragonhawk", 20.1f),
new NextAction("aspect of the hawk", 89.0f),nullptr))); new NextAction("aspect of the hawk", 20.0f),nullptr)));
} }
void HunterNatureResistanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void HunterNatureResistanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
triggers.push_back(new TriggerNode("aspect of the wild", NextAction::array(0, new NextAction("aspect of the wild", 90.0f), nullptr))); triggers.push_back(new TriggerNode("aspect of the wild", NextAction::array(0, new NextAction("aspect of the wild", 20.0f), nullptr)));
} }
void HunterBuffSpeedStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void HunterBuffSpeedStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
triggers.push_back(new TriggerNode("aspect of the pack", NextAction::array(0, new NextAction("aspect of the pack", 10.0f), nullptr))); triggers.push_back(new TriggerNode("aspect of the pack", NextAction::array(0, new NextAction("aspect of the pack", 20.0f), nullptr)));
} }
void HunterBuffManaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void HunterBuffManaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
triggers.push_back(new TriggerNode("aspect of the viper", NextAction::array(0, new NextAction("aspect of the viper", 10.0f), nullptr))); triggers.push_back(new TriggerNode("aspect of the viper", NextAction::array(0, new NextAction("aspect of the viper", 20.0f), nullptr)));
} }

View File

@@ -30,7 +30,7 @@ class HunterBuffManaStrategy : public NonCombatStrategy
class HunterBuffDpsStrategy : public NonCombatStrategy class HunterBuffDpsStrategy : public NonCombatStrategy
{ {
public: public:
HunterBuffDpsStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) { } HunterBuffDpsStrategy(PlayerbotAI* botAI);
std::string const getName() override { return "bdps"; } std::string const getName() override { return "bdps"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override; void InitTriggers(std::vector<TriggerNode*>& triggers) override;

View File

@@ -26,6 +26,12 @@ class AutoShotTrigger : public Trigger
bool IsActive() override; bool IsActive() override;
}; };
class HunterAspectOfTheMonkeyTrigger : public BuffTrigger
{
public:
HunterAspectOfTheMonkeyTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "aspect of the monkey") { }
};
class HunterAspectOfTheHawkTrigger : public BuffTrigger class HunterAspectOfTheHawkTrigger : public BuffTrigger
{ {
public: public: