Skip to main content

wowlab_engine_content/hooks/retribution_paladin/
handler.rs

1use wowlab_engine_combat::CombatHandler;
2use wowlab_engine_ports::{HandlerParams, SimContext, SpecAction};
3
4
5use super::config::{register_highlords_judgment, register_retribution};
6
7/// Retribution Paladin combat handler.
8#[derive(Debug)]
9pub(crate) struct RetributionHandler {
10    inner: CombatHandler,
11}
12
13impl RetributionHandler {
14    /// Finishes the specialization handler from the shared-content composition stage.
15    pub(crate) fn new(
16        parts: crate::composition::ContentHandlerParts,
17        params: &HandlerParams<'_>,
18    ) -> Result<Self, wowlab_engine_ports::EngineError> {
19        let mut parts = parts;
20        let built = parts.draft_mut();
21
22        register_retribution(built, params)?;
23        register_highlords_judgment(built, params);
24
25        let built = parts.finalize()?;
26
27        Ok(Self {
28            inner: CombatHandler::from_built(built),
29        })
30    }
31}
32
33crate::hooks::define_spec_handler! {
34impl RetributionHandler(self, inner) {
35    fn on_sim_start(&mut self, ctx: &mut SimContext) {
36        self.inner.on_sim_start(ctx);
37    }
38
39}
40delegate {
41            fn on_player_ready(&mut self, ctx: &mut SimContext) -> Option<SpecAction>;
42            fn on_cast_complete(&mut self, event: wowlab_engine_ports::Event, ctx: &mut SimContext);
43            fn on_spell_impact(&mut self, impact_id: wowlab_engine_ports::PendingImpactBinding, ctx: &mut SimContext);
44            fn on_aura_tick(&mut self, event: wowlab_engine_ports::AuraEventRef, ctx: &mut SimContext);
45            fn on_aura_expire(&mut self, event: wowlab_engine_ports::AuraEventRef, ctx: &mut SimContext);
46            fn on_auto_attack(&mut self, source: wowlab_types::sim::ActorId, target: wowlab_types::sim::EnemyIdx, ctx: &mut SimContext);
47            fn on_cooldown_ready(&mut self, spell: wowlab_engine_ports::ScheduledSpellBinding, ctx: &mut SimContext);
48            fn flush_scheduled(&mut self, push: &mut dyn FnMut(wowlab_engine_ports::Event));
49            fn reset(&mut self);
50            fn total_damage(&self) -> f64;
51            fn cast_time_ms(&self, spell: wowlab_engine_ports::ScheduledSpellBinding, empower_rank: u8) -> u32;
52            fn introspect(&self) -> wowlab_types::game::SpecIntrospection;
53            fn paperdoll(&self) -> Option<wowlab_engine_ports::Paperdoll>;
54            fn attach_decision_trace(
55                &mut self,
56                sink: std::sync::Arc<dyn wowlab_engine_ports::DecisionTraceSink>,
57            );
58}
59}