Item Types - wwestlake/Labyrinth GitHub Wiki
Item Types in the Game
Overview
In this game, items are categorized into different types, each with specific properties and capabilities. This page provides an overview of the various item categories and their associated attributes.
Item Categories
1. Weapon
Weapons are used by characters to deal damage to opponents.
Common Properties:
- Damage: The amount of damage the weapon can inflict.
- WeaponType: The type of weapon (e.g., Sword, Bow, Axe).
- Range: The effective range of the weapon (e.g., Melee, Ranged).
- Durability: How much usage the weapon can endure before it breaks.
- CriticalChance: The probability of dealing a critical hit.
- Speed: How fast the weapon can be used (e.g., slow, medium, fast).
Common Capabilities:
- Attack(): Method to perform an attack using the weapon.
- Equip(): Method to equip the weapon to a character.
- Repair(): Method to repair the weapon if it has durability.
2. Armor
Armor items are used to protect characters from damage.
Common Properties:
- Defense: The amount of damage the armor can absorb or deflect.
- ArmorType: The type of armor (e.g., Helmet, Chestplate, Shield).
- Durability: How much damage the armor can take before it breaks.
- Weight: The weight of the armor, which might affect the character's speed or agility.
- ElementalResistance: Resistance to specific types of elemental damage (e.g., fire, ice).
Common Capabilities:
- Equip(): Method to equip the armor on a character.
- Repair(): Method to repair the armor if it has durability.
- Enhance(): Method to enhance or upgrade the armor's properties.
3. Consumable
Consumables are items that can be used or consumed by characters to provide temporary benefits.
Common Properties:
- Effect: The effect that the consumable has (e.g., Healing, Buff, Mana Restoration).
- Duration: How long the effect lasts (if applicable).
- Quantity: The number of uses or charges the item has.
Common Capabilities:
- Use(): Method to consume or use the item.
- Discard(): Method to discard the item if itโs no longer needed.
4. Treasure
Treasures are items of value that can be collected, traded, or used as currency.
Common Properties:
- Value: The monetary worth of the treasure.
- Rarity: The rarity level of the treasure (e.g., Common, Rare, Epic).
- Weight: How heavy the treasure is, which could affect carrying capacity.
Common Capabilities:
- Sell(): Method to sell the treasure for currency.
- Inspect(): Method to inspect the treasure, possibly revealing hidden properties.
5. Quest Item
Quest items are special items that are often required to complete certain tasks or missions in the game.
Common Properties:
- QuestId: The ID of the quest the item is associated with.
- Description: A description of the item's purpose within the quest.
- IsUnique: Indicates whether the item is unique (i.e., only one can exist at a time).
Common Capabilities:
- Activate(): Method to activate the quest item, if applicable.
- Combine(): Method to combine the item with other items to complete a quest.
6. Tool
Tools are items used to perform specific tasks or actions in the game (e.g., crafting, gathering).
Common Properties:
- ToolType: The type of tool (e.g., Pickaxe, Fishing Rod).
- Durability: How much usage the tool can withstand before breaking.
- Efficiency: How effective the tool is at performing its task.
Common Capabilities:
- Use(): Method to use the tool for its intended purpose.
- Repair(): Method to repair the tool if it has durability.
- Upgrade(): Method to upgrade the tool to improve its efficiency or durability.
7. Magic Item
Magic items are enchanted or mystical items that provide special abilities or effects.
Common Properties:
- MagicEffect: The magical effect that the item grants (e.g., Invisibility, Teleportation).
- ManaCost: The amount of mana required to use the item's effect.
- Cooldown: The time required before the item can be used again.
Common Capabilities:
- Cast(): Method to activate the item's magical effect.
- Recharge(): Method to recharge the item's magical energy.
- Disenchant(): Method to remove the magical properties from the item.
8. Container
Containers are items that can hold other items.
Common Properties:
- Capacity: The maximum number of items the container can hold.
- WeightLimit: The maximum weight of items the container can carry.
- Contents: A list of items stored in the container.
Common Capabilities:
- Open(): Method to open the container and access its contents.
- Store(): Method to store an item in the container.
- Remove(): Method to remove an item from the container.
Summary of Common Capabilities
- Equip/Use/Activate: Depending on the type, items can be equipped, used, or activated.
- Repair/Recharge/Upgrade: Many items have durability or charges that can be repaired, recharged, or upgraded.
- Inspect/Sell/Discard: Items can often be inspected for more details, sold for currency, or discarded if no longer needed.
Conclusion
This structure provides a solid foundation for organizing and managing different types of items in the game. By using a base Item
class and extending it with specific properties and methods for each category, you create a flexible system that can easily accommodate new item types as your game evolves.