Skip to main content

wowlab_engine_content/
lib.rs

1//! Generated specialization and item bindings plus handwritten combat hooks.
2
3#![expect(
4    clippy::multiple_crate_versions,
5    reason = "the engine dependency graph currently resolves multiple versions of transitive crates"
6)]
7
8/// Crate version.
9pub const VERSION: &str = env!("CARGO_PKG_VERSION");
10
11mod catalog;
12mod composition;
13mod expansion_traits;
14#[rustfmt::skip]
15mod generated;
16pub(crate) mod hooks;
17pub(crate) mod items;
18mod racials;
19mod raid_buffs;
20#[cfg(test)]
21pub(crate) mod test_support;
22mod weapon_enchants;
23
24pub use catalog::force_link_generated_specs;
25/// Generated item metadata.
26pub use generated::items::REGISTERED_ITEMS;
27
28/// Resolve the registered on-use spell for an item, when its mechanic is implemented.
29#[must_use]
30pub fn registered_item_use_spell(item_id: u32) -> Option<u32> {
31    generated::items::ITEM_USE_SPELLS
32        .iter()
33        .find_map(|&(registered_item_id, spell_id)| {
34            (registered_item_id == item_id).then_some(spell_id)
35        })
36}
37
38#[cfg(test)]
39pub(crate) fn test_combat_builder(
40    stats: wowlab_engine_ports::CombatStats,
41) -> wowlab_engine_combat::CombatSystemBuilder {
42    let encounter = wowlab_engine_ports::test_support::introspection_fixture(300.0)
43        .expect("engine-content's unit-test encounter must resolve");
44
45    wowlab_engine_combat::BuiltCombatSystem::builder(stats).encounter(encounter)
46}