Function law_attribute_snapshot

Source
pub fn law_attribute_snapshot(
    entity: &Entity,
    active_side: WorldSide,
    game_config: &GameConfig,
) -> BTreeMap<String, i64>
Expand description

The law contribution currently folded into entity’s attributes: the active side’s slotted laws at their current level, scaled by whatever their bridge delivered at the last flip.

Callers that are about to overwrite the entity’s attributes wholesale use this to STRIP the contribution first and put it back afterwards — see logic::handler::compute_fields. Stripping is not optional: the overwrite is keyed by attribute code and only replaces codes the character itself carries a non-zero value for, so a blind re-add would double-count every law that moves a stat no other source touches.

Reads the entity’s own cores snapshot, so what it reports is exactly what was folded in — a strip can never subtract a contribution the entity never received (which is what a live CharacterState lookup would do the moment a player crossed the cores unlock chapter mid-fight).