Module mechanics

Source
Expand description

modules).

longer an engine to register modules against: the native script functions live in crate::behaviors and are exposed through the crate::BehaviorRegistry registry, while the content_lookups they read are built at BehaviorRegistry::new. This module therefore only declares the native sub-modules that the behaviors ports (and each other) depend on.

Modules§

balance
Functions and constants here mirror the original balance.yaml script, which contained the project’s fundamental combat and economic balance formulas. Content-dependent lookups (item rarity quality, ability rarity effectiveness, fixed-power items) are sourced from ContentLookups, which is populated at engine init time by reading the content_raw module’s data maps.
content
Native content script-module dispatchers plus the per-ability ability_info(level) composition for the content_raw-style ability map.
content_lookups
engine init. Holds fields that the Rust schemas don’t carry (q, eff, fixed_power, is_boss, is_dungeon, is_bossfight, attribute base_value, effect on_apply/on_change callbacks, …).
content_raw_extract
Builds ContentLookups from the typed GameConfig.
effect_cb
script ports (behaviors::cast_ability / cast_projectile).
fight
Native Rust fight logic.
fight_context
Native Rust fight_context module — now a no-op placeholder.
loop_tasks
Native Rust implementation of the loop-task pacing logic.
util
(build_module / register_array_extensions) is gone — there is no engine to register into. What remains here are the pure, typed versions of the random helpers the util module used to expose to scripts: rand_round, get_random_element, rand_weight, and drain_random.