-
Notifications
You must be signed in to change notification settings - Fork 0
Armor System
The Armor System is responsible for managing the player's defensive equipment in Adventure-Game. Armor plays a crucial role in improving survivability by increasing the player's defense and reducing incoming damage during combat.
Each armor piece is represented as an independent object with its own statistics, durability, enchantment status, and value. Like weapons, armor inherits from the common Item base class, allowing it to integrate seamlessly with the Inventory and Equipment systems while maintaining specialized behavior.
The Armor System has been designed to be modular and extensible, providing a solid foundation for future RPG features such as armor sets, rarity tiers, upgrades, and magical effects.
- Overview
- Armor Architecture
- Armor Properties
- Armor Types
- Armor Generation
- Durability
- Enchantments
- Equipping Armor
- Defense Calculations
- Relationships with Other Systems
- Design Decisions
- Future Improvements
- Summary
Armor represents the player's primary source of protection.
Every armor object contributes to the player's defensive statistics and helps reduce damage taken during gameplay.
The Armor System is responsible for:
- Creating armor pieces
- Managing defense values
- Tracking durability
- Handling enchantments
- Managing equipped status
- Displaying armor information
Armor can be obtained from:
- Starting equipment
- Loot chests
- Random item generation
- Future quest rewards and merchants
Armor is implemented as a derived class of Item.
classDiagram
Item <|-- Armory
Character --> Armory
MyInventory --> Armory
Chest --> Armory
Using inheritance allows armor to share common functionality with all collectible items while providing specialized defensive behavior.
Every armor object contains several attributes.
| Property | Description |
|---|---|
| Name | Display name of the armor. |
| Defense | Amount of defense added to the player. |
| Durability | Current condition of the armor. |
| Value | Gold value of the armor. |
| Equipped | Indicates whether the armor is currently equipped. |
| Broken | Determines whether the armor is still usable. |
| Enchanted | Indicates magical enhancements. |
These values define how the armor behaves during gameplay.
Adventure-Game currently supports multiple armor categories.
Examples include:
| Armor Type | Description |
|---|---|
| Cloth Armor | Lightweight protection with low defense. |
| Leather Armor | Balanced protection and mobility. |
| Chainmail | Medium armor offering improved defense. |
| Plate Armor | Heavy armor with excellent protection. |
| Magic Robe | Intended for intelligence-based professions. |
Additional armor types may be introduced as development continues.
Armor can be generated automatically by the game.
Generation methods include:
Every new character begins with armor appropriate for their selected profession.
The game creates randomized armor with different statistics.
Generated values may include:
- Defense
- Durability
- Value
- Enchantment status
Random generation increases replayability by ensuring that every playthrough offers different equipment.
Armor may also be obtained by opening treasure chests.
The quality of generated armor depends on the rarity of the chest.
Higher rarity chests are more likely to contain stronger defensive equipment.
Armor objects are initialized with all required properties.
Example:
Armory(
"Leather Armor",
defense,
durability,
value,
isEquipped,
isBroken,
isEnchanted
);This allows every armor piece to maintain its own unique statistics.
The lifecycle of an armor piece is illustrated below.
flowchart TD
GenerateArmor --> Inventory
Inventory --> EquipArmor
EquipArmor --> Character
Character --> Gameplay
Gameplay --> DurabilityLoss
DurabilityLoss --> BrokenArmor
BrokenArmor --> UnequipArmor
UnequipArmor --> Inventory
Armor remains in the player's inventory until it is equipped, unequipped, or replaced.
Every armor piece has a durability value representing its physical condition.
Durability allows the game to distinguish between:
| State | Description |
|---|---|
| New | Maximum durability. |
| Used | Reduced durability but fully functional. |
| Damaged | Near breaking point. |
| Broken | No longer usable. |
Currently, durability is stored and displayed as part of the armor object.
Future updates may reduce durability during combat and introduce repair mechanics.
Armor may possess magical enhancements.
An enchanted armor piece provides stronger defensive capabilities than its standard counterpart.
Future enchantments may include:
- Increased defense
- Bonus health
- Increased agility
- Magic resistance
- Poison resistance
- Fire resistance
- Ice resistance
- Durability improvements
The enchantment system has been designed to allow easy expansion.
Players equip armor directly from the inventory.
The equipment process follows these steps.
Select Armor
│
▼
Check Item Status
│
▼
Equip Armor
│
▼
Update Character Defense
Only one armor piece can be equipped at a time.
Equipping a new armor item automatically replaces the currently equipped armor.
Armor contributes directly to the player's defensive statistics.
Current calculation:
Total Defense =
Base Defense
+ Armor Defense
+ Weapon Defense Bonus
Future versions may also include bonuses from:
- Skills
- Passive abilities
- Active effects
- Equipment sets
- Enchantments
- Temporary buffs
Armor objects provide detailed information when inspected.
Displayed information typically includes:
- Name
- Defense value
- Durability
- Gold value
- Equipped status
- Broken status
- Enchantment status
This allows players to compare equipment before making decisions.
The Armor System communicates with several gameplay systems.
flowchart LR
Character --> Armory
Inventory --> Armory
Chest --> Armory
Armory --> Character
Armory --> Item
Armor interacts with the Character to modify defense, the Inventory for storage, and Chests for loot generation.
Several architectural decisions shaped the Armor System.
Armor inherits from the abstract Item class, allowing it to share common functionality with every collectible object.
Each armor object stores its own:
- Defense
- Durability
- Value
- Enchantment
- Equipped state
This keeps armor self-contained and easy to manage.
Whenever armor is equipped or unequipped, the Character automatically recalculates defensive statistics.
This guarantees consistency throughout gameplay.
The Armor System focuses exclusively on defensive equipment.
Inventory management, loot generation, and character progression remain the responsibility of their respective systems.
The Armor System has been designed to support future expansion.
Planned additions include:
- Helmet slot
- Gloves
- Boots
- Shields
- Cloaks
- Accessories
- Equipment sets
- Set bonuses
- Armor rarity tiers
- Upgrade system
- Repair system
- Elemental resistances
- Crafting
- Cosmetic skins
- Legendary armor
- Unique named equipment
These additions can be implemented without major architectural changes thanks to the modular design of the system.
The Armor System provides the defensive foundation of Adventure-Game. Through object-oriented design, each armor piece manages its own statistics, durability, enchantments, and equipment state while integrating seamlessly with the Character, Inventory, and Chest systems.
Its modular architecture not only supports the current gameplay mechanics but also provides a scalable framework for future RPG features such as advanced equipment progression, crafting, repair systems, and specialized defensive abilities.