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, somin(level) − 1is 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 replacedLawRhythms.active_law_attribute_deltas— the passive half of the active side’s laws, amplified by whatever their bridge delivered at the last flip.
Enums§
- Bridge
Error - 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_multiplierowns 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
kindspends. - 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.0for 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
sidethe deterministic schedule hands out at coreleveland 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.