fan of knives for rogue

This commit is contained in:
Yunfan Li
2023-08-29 21:35:01 +08:00
parent 8f20e721af
commit 19191d64f3
3 changed files with 13 additions and 0 deletions

View File

@@ -207,6 +207,7 @@ void StealthedRogueStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
/*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", ACTION_EMERGENCY + 1), nullptr)));*/ /*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", ACTION_EMERGENCY + 1), nullptr)));*/
triggers.push_back(new TriggerNode("no stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr))); triggers.push_back(new TriggerNode("no stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr)));
triggers.push_back(new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr))); triggers.push_back(new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr)));
} }
void StealthStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void StealthStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
@@ -217,6 +218,9 @@ void StealthStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
void RogueAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void RogueAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH), nullptr))); triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode(
"medium aoe",
NextAction::array(0, new NextAction("fan of knives", ACTION_NORMAL + 5), NULL)));
} }
void RogueBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void RogueBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -142,4 +142,11 @@ class UseInstantPoisonAction : public UseItemAction
virtual bool Execute(Event event) override; virtual bool Execute(Event event) override;
virtual bool isPossible() override; virtual bool isPossible() override;
}; };
class FanOfKnivesAction : public CastMeleeSpellAction
{
public:
FanOfKnivesAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "fan of knives") {}
};
#endif #endif

View File

@@ -127,6 +127,7 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
creators["tricks of the trade on main tank"] = &RogueAiObjectContextInternal::tricks_of_the_trade_on_main_tank; creators["tricks of the trade on main tank"] = &RogueAiObjectContextInternal::tricks_of_the_trade_on_main_tank;
creators["use instant poison on main hand"] = &RogueAiObjectContextInternal::use_instant_poison; creators["use instant poison on main hand"] = &RogueAiObjectContextInternal::use_instant_poison;
creators["use deadly poison on off hand"] = &RogueAiObjectContextInternal::use_deadly_poison; creators["use deadly poison on off hand"] = &RogueAiObjectContextInternal::use_deadly_poison;
creators["fan of knives"] = &RogueAiObjectContextInternal::fan_of_knives;
} }
private: private:
@@ -160,6 +161,7 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
static Action* tricks_of_the_trade_on_main_tank(PlayerbotAI* ai) { return new CastTricksOfTheTradeOnMainTankAction(ai); } static Action* tricks_of_the_trade_on_main_tank(PlayerbotAI* ai) { return new CastTricksOfTheTradeOnMainTankAction(ai); }
static Action* use_instant_poison(PlayerbotAI* ai) { return new UseInstantPoisonAction(ai); } static Action* use_instant_poison(PlayerbotAI* ai) { return new UseInstantPoisonAction(ai); }
static Action* use_deadly_poison(PlayerbotAI* ai) { return new UseDeadlyPoisonAction(ai); } static Action* use_deadly_poison(PlayerbotAI* ai) { return new UseDeadlyPoisonAction(ai); }
static Action* fan_of_knives(PlayerbotAI* ai) { return new FanOfKnivesAction(ai); }
}; };
RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)