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    ) -> Self {
19        let mut built = parts.into_built();
20
21        register_retribution(&mut built, params);
22        register_highlords_judgment(&mut built, params);
23
24        Self {
25            inner: CombatHandler::from_built(built),
26        }
27    }
28}
29
30crate::hooks::define_spec_handler! {
31impl RetributionHandler(self, inner) {
32    fn on_sim_start(&mut self, ctx: &mut SimContext) {
33        self.inner.on_sim_start(ctx);
34    }
35
36}
37delegate {
38            fn on_player_ready(&mut self, ctx: &mut SimContext) -> Option<SpecAction>;
39            fn on_cast_complete(&mut self, event: wowlab_engine_ports::Event, ctx: &mut SimContext);
40            fn on_spell_impact(&mut self, impact_id: u32, ctx: &mut SimContext);
41            fn on_aura_tick(&mut self, event: wowlab_engine_ports::AuraEventRef, ctx: &mut SimContext);
42            fn on_aura_expire(&mut self, event: wowlab_engine_ports::AuraEventRef, ctx: &mut SimContext);
43            fn on_auto_attack(&mut self, source: wowlab_types::sim::ActorId, target: wowlab_types::sim::EnemyIdx, ctx: &mut SimContext);
44            fn on_cooldown_ready(&mut self, cooldown_key: wowlab_types::sim::SpellIdx, ctx: &mut SimContext);
45            fn flush_scheduled(&mut self, push: &mut dyn FnMut(wowlab_engine_ports::Event));
46            fn reset(&mut self);
47            fn total_damage(&self) -> f64;
48            fn cast_time_ms(&self, spell_id: wowlab_types::sim::SpellIdx, empower_rank: u8) -> u32;
49            fn introspect(&self) -> wowlab_types::game::SpecIntrospection;
50            fn paperdoll(&self) -> Option<wowlab_engine_ports::Paperdoll>;
51            fn attach_decision_trace(
52                &mut self,
53                sink: std::sync::Arc<dyn wowlab_engine_ports::DecisionTraceSink>,
54            );
55}
56}