Module cores

Source
Expand description

Pure arithmetic and state machines for the twin cores, laws and bridges (OVT-2517, laws v0.2). No events, no IO — everything here is a function of CoresState + GameConfig, so every acceptance criterion in the plan is unit-testable without a fight or a database.

Layering:

  • core_multiplier / law_slots_for_level / max_bridges — part A plus the structural limits. Refitted for the artifact right column: one slot per core level and a cap of 5, so min(level) − 1 is always exactly one short of what the slots allow and the bridge limit binds at every level again (post-merge plan §8).
  • laws_unlocked_by_core_level / grant_unlocked_laws — the deterministic law schedule: a core level hands out its side’s batch outright, so random copy drops fund LEVELLING only and never the unlock itself.
  • build_law_bridge_charges / law_power_multiplier — the per-fight bridge charge machinery that replaced LawRhythms.
  • active_law_attribute_deltas — the passive half of the active side’s laws, amplified by whatever their bridge delivered at the last flip.

Enums§

BridgeError
Why a bridge could not be created.

Constants§

ARM_BASIC
Damage bonus armed for the owner’s next BASIC attack, permyriad.
ARM_SKILL
Damage bonus armed for the owner’s next original SKILL, permyriad. See ARM_BASIC.
ARM_THIS
Damage bonus armed for the strike being resolved RIGHT NOW, permyriad (RL-01 “every 5th Basic Attack: THIS strike deals +100%”).
MAX_BRIDGES_PER_LAW
Maximum number of bridges one law may sit in.

Functions§

active_law_attribute_deltas
Attribute deltas contributed by the laws that are actually doing something: slotted, on the side that is currently up, at their current level, scaled by whatever their bridge delivered at the last flip.
bridge_capacity_hundredths
Capacity of one bridge direction for this build, in hundredths — the configured whole-unit capacity, moved by the Bridge Law socket, scaled to the accumulator’s own unit.
build_law_bridge_charges
Builds the live bridge charges from the character’s bridges. A bridge is live only when BOTH of its laws are slotted — an unslotted law is not on a core, so it can neither fill a charge nor receive one.
core_multiplier
The PER-STAT multiplier for the product of the two core levels — BAL-010’s M_stat = (1 + min(P/5, sqrt(P) − 0.2))^(1/2.75) (configs::cores::core_stat_multiplier owns the arithmetic).
grant_unlocked_laws
Grants every law side’s core has earned at its CURRENT level, and reports how many were new.
law_arm_key
Which of the two arms a cast of kind spends.
law_effect_number
The number an effect (or a passive modifier) actually lands with: the authored value, grown by the law’s upgrade level, then multiplied by the bridge amplification.
law_power_multiplier
Law Power multiplier currently enjoyed by law_id: 1.0 for an unbridged law, a law whose partner banked nothing, and every law at the very start of a fight.
law_slots_for_level
slots = min(ceil(level / core_levels_per_slot), max_slots_per_core). Level 0 (no core) has no slots.
law_template
law_value_at_level
A law’s own upgrade scaling, before any bridge amplification.
laws_unlocked_by_core_level
Every law of side the deterministic schedule hands out at core level and below.
max_bridges
bridges = min(real_level, fantasy_level, max_slot_level) - 1 + extra, floored at 0. With one core still at level 1 and no artifact, no bridge is allowed at all.
prune_bridges_over_budget
Drops the bridges that no longer fit max_bridges, and reports how many went.
validate_new_bridge
Validates a would-be bridge and returns it side-normalized.