Skip to content

item_factories

item_factories

ArmorFactory

Factory class to create Armor items.

EquipmentFactory

Factory class to create equipment items.

ItemDataNotFoundError

ItemDataNotFoundError(item_name)

Bases: Exception

Raised when item data is not found.

WeaponFactory

Factory class to create items of type Weapon.

equip_cleric

equip_cleric(character: PlayerCharacter)

Equip a Cleric character with starting gear.

equip_dwarf

equip_dwarf(character: PlayerCharacter)

Equip a Dwarf character with starting gear.

equip_elf

equip_elf(character: PlayerCharacter)

Equip an Elf character with starting gear.

equip_fighter

equip_fighter(character: PlayerCharacter)

Equip a Fighter character with starting gear.

equip_halfling

equip_halfling(character: PlayerCharacter)

Equip a Halfling character with starting gear.

equip_magic_user

equip_magic_user(character: PlayerCharacter)

Equip a Magic User character with starting gear.

equip_party

equip_party(party: Party)

Equip a party with default starting gear based on their character classes.

equip_thief

equip_thief(character: PlayerCharacter)

Equip a Thief character with starting gear.

get_random_item

get_random_item(item_type: ItemType, magical: bool = False) -> Item

Gets a randomn (optionally magic) item from the given category.

Parameters:

  • item_type (ItemType) –

    The category of item to get.

  • magical (bool, default: False ) –

    Whether to get a magical version of the item.

Returns:

  • Item ( Item ) –

    An instance of the selected item.