text_game_maker.crafting package¶
Submodules¶
-
text_game_maker.crafting.crafting.
add
(items, item)¶ Add new craftable item
Parameters: - items ([text_game_maker.game_objects.items.Item]) – list of ingredients
- item (text_game_maker.game_objects.items.Item) – new item created by combining ingredients
-
text_game_maker.crafting.crafting.
can_craft
(name)¶ Check if player has the ability to craft an item by name. Note this function only checks if player has acquired the blueprint to craft an item, and does not care whether the player has ingredients required to craft the item.
Parameters: name (str) – item name Returns: True if player can craft the item, False otherwise Return type: bool
-
text_game_maker.crafting.crafting.
craft
(name, word, player)¶ Craft an item by name. Deletes ingredients from player’s inventory and places crafted item into player’s inventory.
Parameters: - name (str) – name of the item to craft
- word (str) – command/action word used by player
- player (text_game_maker.player.player.Player) – player instance
Returns: crafted item, or None if crafting fails
Return type: text_game_maker.game_objects.items.Item
-
text_game_maker.crafting.crafting.
deserialize
(data, version)¶
-
text_game_maker.crafting.crafting.
help_text
()¶ Retreive human-readable description of all added craftable items
Returns: description of all added craftable items Return type: str
-
text_game_maker.crafting.crafting.
serialize
()¶