Function veloren_common::comp::inventory::item::modular::random_weapon_primary_component
source ยท pub fn random_weapon_primary_component(
tool: ToolKind,
material: Material,
hand_restriction: Option<Hands>,
rng: &mut impl Rng,
) -> Result<(Item, Option<Hands>), ModularWeaponCreationError>
Expand description
Creates a random modular weapon primary component when provided with a toolkind, material, and optionally the handedness
NOTE: The component produced is not necessarily restricted to that handedness, but rather is able to produce a weapon of that handedness depending on what secondary component is used
Returns the compatible handednesses that can be used with provided restriction and generated component (useful for cases where no restriction was passed in, but generated component has a restriction)