SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
dbc_proc_callback_t Struct Reference

DBC-driven proc callback. More...

#include <dbc_proc_callback.hpp>

Inheritance diagram for dbc_proc_callback_t:
action_callback_t noncopyable bfa_darkmoon_deck_cb_t< T > covenant::covenant_ability_cast_cb_t unique_gear::shadowlands::items::chains_of_domination_cb_t warlock::actions::demonic_synergy_callback_t

Public Types

enum  trigger_fn_type { trigger_fn_type::NONE, trigger_fn_type::CONDITION, trigger_fn_type::TRIGGER }
 
using execute_fn_t = std::function< void(const dbc_proc_callback_t *, action_t *, action_state_t *)>
 
using trigger_fn_t = std::function< bool(const dbc_proc_callback_t *, action_t *, action_state_t *)>
 

Public Member Functions

 dbc_proc_callback_t (const item_t &i, const special_effect_t &e)
 
 dbc_proc_callback_t (const item_t *i, const special_effect_t &e)
 
 dbc_proc_callback_t (player_t *p, const special_effect_t &e)
 
void initialize () override
 Initialize the proc callback. More...
 
cooldown_tget_cooldown (player_t *target)
 
void trigger (action_t *a, action_state_t *state) override
 
virtual player_ttarget (const action_state_t *state) const
 
rng::rng_trng () const
 
- Public Member Functions inherited from action_callback_t
 action_callback_t (player_t *l, bool ap=false, bool asp=false)
 
virtual void reset ()
 
virtual void activate ()
 
virtual void deactivate ()
 

Public Attributes

const item_titem
 
const special_effect_teffect
 
cooldown_tcooldown
 
target_specific_cooldown_ttarget_specific_cooldown
 
real_ppm_trppm
 
double proc_chance
 
double ppm
 
buff_tproc_buff
 
action_tproc_action
 
weapon_tweapon
 
bool expire_on_max_stack
 Expires proc_buff on max stack, automatically set if proc_buff max_stack > 1.
 
trigger_fn_type trigger_type
 Trigger condition override type.
 
const trigger_fn_t * trigger_fn
 Override proc trigger condition with a separate callback function.
 
execute_fn_t * execute_fn
 Override execution behavior with a separate callback function.
 
bool can_only_proc_from_class_abilites
 
bool can_proc_from_procs
 
- Public Attributes inherited from action_callback_t
player_tlistener
 
bool active
 
bool allow_self_procs
 
bool allow_procs
 

Static Public Attributes

static const item_t default_item_ = item_t()
 

Protected Member Functions

virtual void execute (action_t *, action_state_t *state)
 Base rules for proc execution. More...
 

Friends

struct proc_event_t
 

Additional Inherited Members

- Static Public Member Functions inherited from action_callback_t
static void trigger (const std::vector< action_callback_t *> &v, action_t *a, action_state_t *state)
 
static void reset (const std::vector< action_callback_t *> &v)
 

Detailed Description

DBC-driven proc callback.

Extensively leans on the concept of "driver" spells that blizzard uses to trigger actual proc spells in most cases. Uses spell data as much as possible (through interaction with special_effect_t). Intentionally vastly simplified compared to our other (older) callback systems. The "complex" logic is offloaded either into special_effect_t (creation of buffs/actions), special effect_t initialization (what kind of special effect to create from DBC data or user given options, or when and why to proc things (new DBC based proc system).

The actual triggering logic is also vastly simplified (see execute()), as the majority of procs in WoW are very simple. Custom procs can always be derived off of this struct.

Member Enumeration Documentation

◆ trigger_fn_type

Enumerator
NONE 

Trigger uses normal processing.

CONDITION 

Custom callback enforces an additional trigger check on the proc, but uses normal proc chance and proc-related semantics.

TRIGGER 

Custom callback trigger completely overrides the trigger attempt logic of the callback.

This includes all aspects of the trigger attempt, including e.g., (internal) cooldown checks.

Proc chance (and probability distribution) is still driven by the characteristics of proc itself.

Note, the proc flags still control if the proc is even attempted to trigger.

Member Function Documentation

◆ execute()

void dbc_proc_callback_t::execute ( action_t action,
action_state_t state 
)
protectedvirtual

Base rules for proc execution.

1) If we proc a buff, trigger it 2a) If the buff triggered and is at max stack, and we have an action, execute the action on the target of the action that triggered this proc. 2b) If we have no buff, trigger the action on the target of the action that triggered this proc.

TODO: Ticking buffs, though that'd be better served by fusing tick_buff_t into buff_t. TODO: Proc delay TODO: Buff cooldown hackery for expressions. Is this really needed or can we do it in a smarter way (better expression support?)

Reimplemented in unique_gear::shadowlands::items::chains_of_domination_cb_t, warlock::actions::demonic_synergy_callback_t, and bfa_darkmoon_deck_cb_t< T >.

◆ initialize()

void dbc_proc_callback_t::initialize ( )
overridevirtual

Initialize the proc callback.

This method is called by each actor through player_t::register_callbacks(), which is invoked as the last thing in the actor initialization process.

Reimplemented from action_callback_t.

Reimplemented in covenant::covenant_ability_cast_cb_t.