Function try_finalize_item

Source
pub fn try_finalize_item(
    item: &mut Item,
    game_config: &GameConfig,
    behaviors: &BehaviorRegistry,
    random: &GameRng,
) -> Result<(), String>
Expand description

Finalize a freshly-rolled item: price, XP, and every attribute value.

random is supplied by the caller rather than minted here. It used to be a GameRng::from_entropy() created per item, which made attribute values the single largest source of run-to-run spread in the simulator and meant no seed anywhere could reproduce a chest open. Callers on the authoritative path pass the session-seeded stream; cheats and bot fixtures pass their own.