def build_leather_hood():
    _item = Item(
        uid="hood",
        name="hood",
        description="A leather hood.",
        display=Display(Colors.DARK_GRAY, Colors.BLACK_COLOR, "!"),
    )
    _item.register_component(data.python_templates.material.Leather.copy())
    _item.register_component(Stats(health=10, size=Size.Medium, weight=2))
    _item.register_component(
        Armor(base_armor_class=2,
              armor_category=item_enums.ArmorCategory.Medium,
              wearable_body_parts_uid=["humanoid_head"],
              worn_layer=item_enums.WornLayer.Outer))

    return _item
def build_boot():
    _boot = Item(
        uid="boot",
        name="Boot",
        description="An iron boot",
        display=Display(Colors.DARK_GRAY, Colors.BLACK_COLOR, "!"),
    )
    _boot.register_component(data.python_templates.material.Iron.copy())
    _boot.register_component(Stats(health=10, size=Size.Medium, weight=0.5))
    _boot.register_component(
        Armor(base_armor_class=0.5,
              armor_category=item_enums.ArmorCategory.Medium,
              wearable_body_parts_uid=["humanoid_foot"],
              worn_layer=item_enums.WornLayer.Outer,
              maximum_dexterity_bonus=2))

    return _boot
def build_long_sword():
    _long_sword = Item(
        uid="long_sword",
        name="Longsword",
        description="A longsword.",
        display=Display(Colors.DARK_GRAY, Colors.BLACK_COLOR, "!"),
    )
    _long_sword.register_component(data.python_templates.material.Iron.copy())
    _long_sword.register_component(Stats(health=1, size=Size.Medium))
    _long_sword.register_component(
        Weapon(weapon_category=item_enums.WeaponCategory.Martial,
               weapon_type=item_enums.WeaponType.Melee,
               size=Size.Medium,
               melee_damage_type=DamageType.Slash,
               damage_dice=DiceStack(1, Dice(8))))

    return _long_sword
def build_leather_pants():
    # TODO Some items need to take two slots rather than one.
    item = Item(
        uid="pants",
        name="pants",
        description="Leather pants",
        display=Display(Colors.DARK_GRAY, Colors.BLACK_COLOR, "!"),
    )
    item.register_component(data.python_templates.material.Leather.copy())
    item.register_component(Stats(health=10, size=Size.Medium, weight=0.5))
    item.register_component(
        Armor(base_armor_class=1,
              armor_category=item_enums.ArmorCategory.Medium,
              wearable_body_parts_uid=["humanoid_leg"],
              worn_layer=item_enums.WornLayer.Outer,
              maximum_dexterity_bonus=2))

    return item