Rogue spell cast optimize

This commit is contained in:
Yunfan Li
2024-02-09 23:51:03 +08:00
parent a7e33a6fad
commit c40a1bed67
6 changed files with 26 additions and 2 deletions

View File

@@ -35,6 +35,8 @@ AssassinationRogueStrategy::AssassinationRogueStrategy(PlayerbotAI* ai) : MeleeC
NextAction** AssassinationRogueStrategy::getDefaultActions()
{
return NextAction::array(0,
new NextAction("garrote", ACTION_DEFAULT + 0.2f),
new NextAction("ambush", ACTION_DEFAULT + 0.1f),
new NextAction("melee", ACTION_DEFAULT),
NULL);
}
@@ -47,6 +49,10 @@ void AssassinationRogueStrategy::InitTriggers(std::vector<TriggerNode*> &trigger
"high energy available",
NextAction::array(0, new NextAction("mutilate", ACTION_NORMAL + 3), NULL)));
triggers.push_back(new TriggerNode(
"hunder for blood",
NextAction::array(0, new NextAction("hunder for blood", ACTION_HIGH + 6), NULL)));
triggers.push_back(new TriggerNode(
"slice and dice",
NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 5), NULL)));

View File

@@ -80,6 +80,8 @@ DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(bot
NextAction** DpsRogueStrategy::getDefaultActions()
{
return NextAction::array(0,
new NextAction("garrote", ACTION_DEFAULT + 0.3f),
new NextAction("ambush", ACTION_DEFAULT + 0.2f),
new NextAction("killing spree", ACTION_DEFAULT + 0.1f),
new NextAction("melee", ACTION_DEFAULT), NULL);
}

View File

@@ -16,6 +16,12 @@ class CastEvasionAction : public CastBuffSpellAction
CastEvasionAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "evasion") { }
};
class CastHungerForBloodAction : public CastBuffSpellAction
{
public:
CastHungerForBloodAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "hunger for blood") { }
};
class CastSprintAction : public CastBuffSpellAction
{
public:

View File

@@ -61,6 +61,7 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["kick"] = &RogueTriggerFactoryInternal::kick;
creators["rupture"] = &RogueTriggerFactoryInternal::rupture;
creators["slice and dice"] = &RogueTriggerFactoryInternal::slice_and_dice;
creators["hunger for blood"] = &RogueTriggerFactoryInternal::hunger_for_blood;
creators["expose armor"] = &RogueTriggerFactoryInternal::expose_armor;
creators["kick on enemy healer"] = &RogueTriggerFactoryInternal::kick_on_enemy_healer;
creators["unstealth"] = &RogueTriggerFactoryInternal::unstealth;
@@ -81,6 +82,7 @@ class RogueTriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* kick(PlayerbotAI* botAI) { return new KickInterruptSpellTrigger(botAI); }
static Trigger* rupture(PlayerbotAI* botAI) { return new RuptureTrigger(botAI); }
static Trigger* slice_and_dice(PlayerbotAI* botAI) { return new SliceAndDiceTrigger(botAI); }
static Trigger* hunger_for_blood(PlayerbotAI* botAI) { return new HungerForBloodTrigger(botAI); }
static Trigger* expose_armor(PlayerbotAI* botAI) { return new ExposeArmorTrigger(botAI); }
static Trigger* kick_on_enemy_healer(PlayerbotAI* botAI) { return new KickInterruptEnemyHealerSpellTrigger(botAI); }
static Trigger* unstealth(PlayerbotAI* botAI) { return new UnstealthTrigger(botAI); }
@@ -107,6 +109,7 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
creators["kidney shot"] = &RogueAiObjectContextInternal::kidney_shot;
creators["rupture"] = &RogueAiObjectContextInternal::rupture;
creators["slice and dice"] = &RogueAiObjectContextInternal::slice_and_dice;
creators["hunger for blood"] = &RogueAiObjectContextInternal::hunger_for_blood;
creators["eviscerate"] = &RogueAiObjectContextInternal::eviscerate;
creators["vanish"] = &RogueAiObjectContextInternal::vanish;
creators["evasion"] = &RogueAiObjectContextInternal::evasion;
@@ -144,6 +147,7 @@ class RogueAiObjectContextInternal : public NamedObjectContext<Action>
static Action* kidney_shot(PlayerbotAI* botAI) { return new CastKidneyShotAction(botAI); }
static Action* rupture(PlayerbotAI* botAI) { return new CastRuptureAction(botAI); }
static Action* slice_and_dice(PlayerbotAI* botAI) { return new CastSliceAndDiceAction(botAI); }
static Action* hunger_for_blood(PlayerbotAI* botAI) { return new CastHungerForBloodAction(botAI); }
static Action* eviscerate(PlayerbotAI* botAI) { return new CastEviscerateAction(botAI); }
static Action* vanish(PlayerbotAI* botAI) { return new CastVanishAction(botAI); }
static Action* evasion(PlayerbotAI* botAI) { return new CastEvasionAction(botAI); }

View File

@@ -19,10 +19,10 @@ class CastSapAction : public CastMeleeSpellAction
bool isUseful() override { return true; }
};
class CastGarroteAction : public CastMeleeSpellAction
class CastGarroteAction : public CastDebuffSpellAction
{
public:
CastGarroteAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "garrote") { }
CastGarroteAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "garrote", true, 8.0f) { }
};
class CastCheapShotAction : public CastMeleeSpellAction

View File

@@ -21,6 +21,12 @@ class SliceAndDiceTrigger : public BuffTrigger
SliceAndDiceTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "slice and dice") { }
};
class HungerForBloodTrigger : public BuffTrigger
{
public:
HungerForBloodTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "hunger for blood") { }
};
class AdrenalineRushTrigger : public BoostTrigger
{
public: