shaman, rogue strategy port, use item action.

This commit is contained in:
Yunfan Li
2023-06-08 10:37:13 +08:00
parent 231b0b51e4
commit 89d24b646c
34 changed files with 664 additions and 109 deletions

View File

@@ -10,101 +10,116 @@ class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
public:
DpsRogueStrategyActionNodeFactory()
{
creators["riposte"] = &riposte;
creators["mutilate"] = &mutilate;
creators["sinister strike"] = &sinister_strike;
creators["kick"] = &kick;
creators["kidney shot"] = &kidney_shot;
creators["slice and dice"] = &slice_and_dice;
creators["rupture"] = &rupture;
creators["backstab"] = &backstab;
creators["melee"] = &melee;
}
private:
static ActionNode* riposte([[maybe_unused]] PlayerbotAI* botAI)
static ActionNode* melee(PlayerbotAI* botAI)
{
return new ActionNode ("riposte",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr),
/*C*/ nullptr);
return new ActionNode ("melee",
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("mutilate"), NULL),
/*C*/ NULL);
}
static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI)
static ActionNode* mutilate(PlayerbotAI* botAI)
{
return new ActionNode ("mutilate",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr),
/*C*/ nullptr);
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("sinister strike"), NULL),
/*C*/ NULL);
}
static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI)
static ActionNode* sinister_strike(PlayerbotAI* botAI)
{
return new ActionNode ("sinister strike",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("melee"), nullptr),
/*C*/ nullptr);
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("melee"), NULL),
/*C*/ NULL);
}
static ActionNode* kick([[maybe_unused]] PlayerbotAI* botAI)
static ActionNode* kick(PlayerbotAI* botAI)
{
return new ActionNode ("kick",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("kidney shot"), nullptr),
/*C*/ nullptr);
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("kidney shot"), NULL),
/*C*/ NULL);
}
static ActionNode* kidney_shot([[maybe_unused]] PlayerbotAI* botAI)
static ActionNode* kidney_shot(PlayerbotAI* botAI)
{
return new ActionNode ("kidney shot",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
/*P*/ NULL,
/*A*/ NULL,
/*C*/ NULL);
}
static ActionNode* rupture([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode ("rupture",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr),
/*C*/ nullptr);
}
ACTION_NODE_A(slice_and_dice, "slice and dice", "rupture");
static ActionNode* backstab([[maybe_unused]] PlayerbotAI* botAI)
static ActionNode* backstab(PlayerbotAI* botAI)
{
return new ActionNode ("backstab",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
/*P*/ NULL,
/*A*/ NextAction::array(0, new NextAction("mutilate"), NULL),
/*C*/ NULL);
}
};
DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(botAI)
{
actionNodeFactories.Add(new DpsRogueStrategyActionNodeFactory());
}
NextAction** DpsRogueStrategy::getDefaultActions()
{
return NextAction::array(0, new NextAction("riposte", ACTION_NORMAL), nullptr);
return NextAction::array(0, new NextAction("melee", ACTION_NORMAL), NULL);
}
void DpsRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
CombatStrategy::InitTriggers(triggers);
MeleeCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("combo points available", NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), nullptr)));
triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("feint", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("evasion", ACTION_EMERGENCY), new NextAction("feint", ACTION_EMERGENCY), nullptr)));
triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("blind", ACTION_EMERGENCY), new NextAction("vanish", ACTION_EMERGENCY), nullptr)));
triggers.push_back(new TriggerNode("kick", NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), nullptr)));
triggers.push_back(new TriggerNode("kick on enemy healer", NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), nullptr)));
triggers.push_back(new TriggerNode("behind target", NextAction::array(0, new NextAction("backstab", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 2), nullptr)));
triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr)));
triggers.push_back(new TriggerNode("in stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr)));
triggers.push_back(new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", ACTION_NORMAL), nullptr)));
triggers.push_back(new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode(
"high energy available",
NextAction::array(0, new NextAction("sinister strike", ACTION_NORMAL + 3), NULL)));
triggers.push_back(new TriggerNode(
"slice and dice",
NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), NULL)));
triggers.push_back(new TriggerNode(
"combo points available",
NextAction::array(0, new NextAction("rupture", ACTION_HIGH + 1), NULL)));
triggers.push_back(new TriggerNode(
"medium threat",
NextAction::array(0, new NextAction("vanish", ACTION_HIGH), NULL)));
triggers.push_back(new TriggerNode(
"low health",
NextAction::array(0, new NextAction("evasion", ACTION_EMERGENCY), new NextAction("feint", ACTION_EMERGENCY), NULL)));
triggers.push_back(new TriggerNode(
"kick",
NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), NULL)));
triggers.push_back(new TriggerNode(
"kick on enemy healer",
NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), NULL)));
triggers.push_back(new TriggerNode(
"behind target",
NextAction::array(0, new NextAction("backstab", ACTION_NORMAL), NULL)));
triggers.push_back(new TriggerNode(
"light aoe",
NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH + 3), NULL)));
triggers.push_back(new TriggerNode(
"enemy out of melee",
NextAction::array(0, new NextAction("stealth", ACTION_NORMAL + 9), new NextAction("reach melee", ACTION_NORMAL + 8), NULL)));
triggers.push_back(new TriggerNode(
"expose armor",
NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), NULL)));
}
class StealthedRogueStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>