Skip to content

Commit

Permalink
Add cc strategy to shaman bots
Browse files Browse the repository at this point in the history
  • Loading branch information
davidonete committed Sep 23, 2023
1 parent f6af931 commit 739f864
Show file tree
Hide file tree
Showing 11 changed files with 827 additions and 54 deletions.
12 changes: 6 additions & 6 deletions playerbot/AiFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
{
if (tab == 0)
{
combatEngine->addStrategies("elemental", "aoe", "bmana", "threat", "flee", "ranged", NULL);
combatEngine->addStrategies("elemental", "aoe", "cc", "bmana", "threat", "flee", "ranged", NULL);
}
else if (tab == 2)
{
combatEngine->addStrategies("restoration", "bmana", "flee", "ranged", NULL);
}
else
{
combatEngine->addStrategies("enhancement", "aoe", "bdps", "threat", "close", NULL);
combatEngine->addStrategies("enhancement", "aoe", "cc", "bdps", "threat", "close", NULL);
}

combatEngine->addStrategies("dps assist", "cure", "totems", "buff", "boost", NULL);
Expand Down Expand Up @@ -511,7 +511,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa

if (player->getClass() == CLASS_SHAMAN && tab == 2)
{
combatEngine->addStrategies("elemental", "aoe", NULL);
combatEngine->addStrategies("elemental", "aoe", "cc", NULL);
}

if (player->getClass() == CLASS_PALADIN && tab == 0)
Expand Down Expand Up @@ -587,7 +587,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa

if (player->getClass() == CLASS_SHAMAN && tab == 2)
{
combatEngine->addStrategies("elemental", "aoe", NULL);
combatEngine->addStrategies("elemental", "aoe", "cc", NULL);
}

if (player->getClass() == CLASS_DRUID && tab == 2)
Expand Down Expand Up @@ -654,15 +654,15 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const
{
if (tab == 0)
{
nonCombatEngine->addStrategies("elemental", "bmana", "aoe", NULL);
nonCombatEngine->addStrategies("elemental", "bmana", "aoe", "cc", NULL);
}
else if (tab == 2)
{
nonCombatEngine->addStrategies("restoration", "bmana", NULL);
}
else
{
nonCombatEngine->addStrategies("enhancement", "bdps", NULL);
nonCombatEngine->addStrategies("enhancement", "bdps", "aoe", "cc", NULL);
}

nonCombatEngine->addStrategies("dps assist", "cure", "totems", "buff", "boost", NULL);
Expand Down
162 changes: 150 additions & 12 deletions playerbot/strategy/shaman/ElementalShamanStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ void ElementalShamanStrategy::InitCombatTriggers(std::list<TriggerNode*>& trigge
{
ShamanStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"frost shock snare",
NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL)));

triggers.push_back(new TriggerNode(
"shock",
NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL)));
Expand Down Expand Up @@ -191,6 +187,56 @@ void ElementalShamanAoeRaidStrategy::InitNonCombatTriggers(std::list<TriggerNode
ShamanAoeRaidStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCcStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"frost shock snare",
NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL)));
}

void ElementalShamanCcStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCcStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcPveStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcPveStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcPveStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcPveStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcPvpStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcPvpStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcPvpStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcPvpStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcRaidStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcRaidStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcRaidStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcRaidStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCureStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCureStrategy::InitCombatTriggers(triggers);
Expand Down Expand Up @@ -423,10 +469,6 @@ void ElementalShamanStrategy::InitCombatTriggers(std::list<TriggerNode*>& trigge
{
ShamanStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"frost shock snare",
NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL)));

triggers.push_back(new TriggerNode(
"shock",
NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL)));
Expand Down Expand Up @@ -569,6 +611,56 @@ void ElementalShamanAoeRaidStrategy::InitNonCombatTriggers(std::list<TriggerNode
ShamanAoeRaidStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCcStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"frost shock snare",
NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL)));
}

void ElementalShamanCcStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCcStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcPveStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcPveStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcPveStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcPveStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcPvpStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcPvpStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcPvpStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcPvpStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcRaidStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcRaidStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcRaidStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcRaidStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCureStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCureStrategy::InitCombatTriggers(triggers);
Expand Down Expand Up @@ -801,10 +893,6 @@ void ElementalShamanStrategy::InitCombatTriggers(std::list<TriggerNode*>& trigge
{
ShamanStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"frost shock snare",
NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL)));

triggers.push_back(new TriggerNode(
"shock",
NextAction::array(0, new NextAction("earth shock", ACTION_NORMAL), NULL)));
Expand Down Expand Up @@ -947,6 +1035,56 @@ void ElementalShamanAoeRaidStrategy::InitNonCombatTriggers(std::list<TriggerNode
ShamanAoeRaidStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCcStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"frost shock snare",
NextAction::array(0, new NextAction("frost shock", ACTION_HIGH), NULL)));
}

void ElementalShamanCcStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCcStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcPveStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcPveStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcPveStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcPveStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcPvpStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcPvpStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcPvpStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcPvpStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCcRaidStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitCombatTriggers(triggers);
ShamanCcRaidStrategy::InitCombatTriggers(triggers);
}

void ElementalShamanCcRaidStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
{
ElementalShamanCcStrategy::InitNonCombatTriggers(triggers);
ShamanCcRaidStrategy::InitNonCombatTriggers(triggers);
}

void ElementalShamanCureStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
{
ShamanCureStrategy::InitCombatTriggers(triggers);
Expand Down
43 changes: 43 additions & 0 deletions playerbot/strategy/shaman/ElementalShamanStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,49 @@ namespace ai
void InitNonCombatTriggers(std::list<TriggerNode*>& triggers) override;
};

class ElementalShamanCcStrategy : public ShamanCcStrategy
{
public:
ElementalShamanCcStrategy(PlayerbotAI* ai) : ShamanCcStrategy(ai) {}

protected:
virtual void InitCombatTriggers(std::list<TriggerNode*>& triggers) override;
virtual void InitNonCombatTriggers(std::list<TriggerNode*>& triggers) override;
};

class ElementalShamanCcPveStrategy : public ElementalShamanCcStrategy
{
public:
ElementalShamanCcPveStrategy(PlayerbotAI* ai) : ElementalShamanCcStrategy(ai) {}
string getName() override { return "cc elemental pve"; }

private:
void InitCombatTriggers(std::list<TriggerNode*>& triggers) override;
void InitNonCombatTriggers(std::list<TriggerNode*>& triggers) override;
};

class ElementalShamanCcPvpStrategy : public ElementalShamanCcStrategy
{
public:
ElementalShamanCcPvpStrategy(PlayerbotAI* ai) : ElementalShamanCcStrategy(ai) {}
string getName() override { return "cc elemental pvp"; }

private:
void InitCombatTriggers(std::list<TriggerNode*>& triggers) override;
void InitNonCombatTriggers(std::list<TriggerNode*>& triggers) override;
};

class ElementalShamanCcRaidStrategy : public ElementalShamanCcStrategy
{
public:
ElementalShamanCcRaidStrategy(PlayerbotAI* ai) : ElementalShamanCcStrategy(ai) {}
string getName() override { return "cc elemental raid"; }

private:
void InitCombatTriggers(std::list<TriggerNode*>& triggers) override;
void InitNonCombatTriggers(std::list<TriggerNode*>& triggers) override;
};

class ElementalShamanCureStrategy : public ShamanCureStrategy
{
public:
Expand Down
Loading

0 comments on commit 739f864

Please sign in to comment.