Expand description
The name-addressed registry of native behavior functions — every config script slot dispatches to a function registered here.
§Model
Every script slot in the game config is one BehaviorKind. A category
fixes the typed input scope and return type the slot expects. A config field
referencing a script names a function of the matching category; the
config-validator step asserts the name exists and the category matches
(see validate::validate_game_config_refs).
Only config-dispatched behaviors live here. Behaviors whose name is hardcoded in Rust (character/item power, fast-equip, opponent generation, item price, …) are plain functions on their modules, called directly.
Modules§
- arena
- Arena rating-change behaviors (code-dispatched by the matchmaking / fight-result paths).
- combat
- Combat behaviors: ability/projectile casts, fight start, and effect ticks.
- fast_
equip - Native functions for the
ability_idscategory (run_abilities_ids_script)fast_equip_abilities_scriptdoes (copyAbilities, sort bybalance::ability_damagedescending with afloored comparator, take the topSlots) and then call the already-nativecrate::mechanics::balance::ability_damage_from_idfor the core damage formula, so this fn only handles the copy/sort/take marshalling. - fixtures
- Test-fixture behaviors quarantine.
- items
- Native functions for the per-attribute item value calculation slots —
cases.rs::try_finalize_itemviarun_expression::<i64>with scopeItem/Random/AttributesQuantity). - opponents
- Native port of the
opponent_generationcategory — the singlebots_settings.bots_generation_scriptrun via [crate::BehaviorRegistry::generate_opponent] to build a PvP bot from an expected arena rating. - power
- Native functions for the power categories (
character_power,item_power, …). These handle the loadout marshalling and then call thecrate::mechanics::balancelogic for the core power formula. - quests
- Quest behaviors: progress rules, loop-task pacing, and offer triggers.
- rewards
- Reward behaviors for bundle currency steps. Fixed reward lists live in the
config (
BundleRawStep::currencies,CurrencyBranchStep,QuestsProgressionPointSettings::reward); the only computed reward is the AFK accrual. - ui_
values - Native function for the
description_valuescategory — computes the values for an ability’sdescription_values_script. - validate
- Deploy-time validation of every script-ref field in the game config.
- vassals
- Vassal behaviors: task/link reward stubs, task loyalty, and link loyalty decay.
Structs§
- Behavior
Catalog - Exported catalog shape (
behavior_catalog.json). Snapshot-tested in CI. - Behavior
Meta - Catalog metadata for one registered native script function. This is what the
admin renders as a dropdown option for a
script_reffield, and what the validator checks config references against. - Behavior
Registry - The name-addressed registry of config-dispatched native fns, keyed
by
(category, name). Built once viabuild_registry.
Enums§
- Behavior
Kind - One config-dispatched script slot. A category fixes the slot’s typed input/output contract.
Functions§
- build_
registry - Build the full registry: every config-dispatched category submodule registers its functions.