Skip to content

Equipment System

Vladyslav Vytrykush edited this page Jul 14, 2026 · 1 revision

Equipment System

The Equipment System is responsible for managing the items currently equipped by the player. By allowing weapons and armor to be equipped or unequipped, the system directly influences the character's combat statistics and overall effectiveness.

Unlike items simply stored in the inventory, equipped items actively modify the player's attributes. Every time the player changes their equipment, the Character class automatically recalculates its combat statistics, ensuring that the displayed values always reflect the currently equipped gear.

The Equipment System works closely with the Character, Inventory, Weapon, and Armory classes, forming one of the core gameplay mechanics of Adventure-Game.


Table of Contents


Overview

The Equipment System allows the player to improve their character by equipping weapons and armor obtained during gameplay.

Currently supported equipment types include:

  • Weapons
  • Armor

Each equipped item immediately affects the player's statistics.

Examples include:

  • Increased attack
  • Increased defense
  • Additional equipment bonuses

Equipment is stored separately from the inventory while remaining connected to it.


Equipment Architecture

The equipment system is centered around the Character class.

classDiagram

Character --> Weapon

Character --> Armory

Character --> MyInventory

MyInventory --> Item

Item <|-- Weapon

Item <|-- Armory
Loading

The inventory stores available equipment, while the Character keeps references to the items that are currently equipped.


Equipment Slots

Adventure-Game currently supports two equipment slots.

Slot Description
Weapon Offensive equipment that increases attack and may provide defensive bonuses.
Armor Defensive equipment that increases the player's protection.

Only one weapon and one armor piece can be equipped at the same time.

Future versions may introduce additional slots such as helmets, gloves, boots, rings, or accessories.


Equipment Lifecycle

Every piece of equipment follows the same general lifecycle.

flowchart TD

GenerateItem --> Inventory

Inventory --> Equip

Equip --> Character

Character --> StatUpdate

StatUpdate --> Gameplay

Gameplay --> Unequip

Unequip --> Inventory
Loading

An item begins in the inventory, can be equipped by the player, influences character statistics during gameplay, and may later be unequipped and returned to the inventory.


Weapon Equipment

Weapons are the player's primary offensive equipment.

Each weapon contains several properties.

Property Description
Name Weapon name.
Attack Offensive power added to the character.
Defense Bonus Additional defensive value provided by the weapon.
Durability Current condition of the weapon.
Value Gold value.
Enchanted Indicates whether the weapon has magical enhancements.
Broken Indicates whether the weapon can still be used.
Equipped Indicates whether the weapon is currently equipped.

Weapons can be:

  • Generated randomly
  • Assigned as starting equipment
  • Generated as special rare items

When equipped, the Character immediately gains the weapon's attack and defensive bonuses.


Armor Equipment

Armor provides defensive protection.

Each armor piece includes:

Property Description
Name Armor name.
Defense Protection provided to the player.
Durability Current condition.
Value Gold value.
Enchanted Indicates magical enhancement.
Broken Indicates whether the armor can still be used.
Equipped Indicates whether the armor is currently equipped.

Armor directly contributes to the player's total defense.


Equipping Items

The player equips items directly from the inventory.

The process is straightforward.

Select Item
      │
      ▼
Check Item Type
      │
      ▼
Check Usability
      │
      ▼
Equip Item
      │
      ▼
Recalculate Character Statistics

If another item of the same category is already equipped, it is replaced by the newly selected item.


Unequipping Items

Items can also be unequipped.

When an item is removed:

  • Equipment slot becomes empty.
  • Bonus statistics are removed.
  • Character statistics are recalculated.
  • Item remains inside the inventory.

Stat Calculations

Equipment contributes directly to combat statistics.

Current calculations are:

Total Attack

Total Attack = Base Strength + Weapon Attack

Total Defense

Total Defense = Base Defense
               + Armor Defense
               + Weapon Defense Bonus

Future updates may extend these calculations with:

  • Passive skills
  • Buffs
  • Debuffs
  • Enchantments
  • Temporary effects
  • Character talents

Durability

Every weapon and armor piece has a durability value.

Durability represents how worn the equipment is.

Current durability states include:

  • Fully functional
  • Damaged
  • Broken

When durability reaches zero, the equipment becomes unusable until repaired (repair mechanics are planned for future development).

The durability system encourages players to manage their equipment rather than relying on a single item indefinitely.


Enchantment System

Equipment may be generated with enchantments.

An enchanted item provides enhanced statistics compared to its standard version.

Examples include:

  • Higher attack
  • Increased defense
  • Greater overall effectiveness

Enchantment status is stored as part of the equipment object and displayed alongside its information.

Future versions may expand enchantments with unique effects or elemental bonuses.


Equipment Status

Each piece of equipment tracks its current state.

Possible states include:

State Description
Equipped Currently used by the player.
Stored Located inside the inventory.
Broken Cannot be used until repaired.
Enchanted Provides enhanced statistics.

These states determine how the item behaves during gameplay.


Relationships with Other Systems

The Equipment System interacts with multiple gameplay systems.

flowchart LR

Character --> Equipment

Equipment --> Weapon

Equipment --> Armory

Inventory --> Equipment

Weapon --> Character

Armory --> Character

Potion --> Character
Loading

Equipment relies on the inventory for storage and the Character for applying statistical changes.


Design Decisions

Several architectural choices shaped the Equipment System.

Equipment Stored Separately

Equipped items are tracked independently from the inventory.

This makes it easy to determine which items currently affect the player's statistics.


Automatic Stat Updates

Whenever equipment changes, character statistics are recalculated immediately.

This guarantees that displayed values remain accurate without requiring manual updates.


Independent Equipment Classes

Weapons and armor are implemented as separate classes because they contain different data and serve different gameplay purposes.

Despite these differences, both inherit from the common Item base class, allowing the inventory to treat them uniformly.


Future Improvements

The Equipment System has been designed for future expansion.

Possible additions include:

  • Helmets
  • Gloves
  • Boots
  • Shields
  • Rings
  • Necklaces
  • Accessories
  • Equipment sets
  • Set bonuses
  • Equipment rarity colors
  • Item comparison
  • Equipment repair
  • Upgrade system
  • Socketed gems
  • Elemental enchantments
  • Legendary equipment effects

Because the system follows a modular design, these features can be added without requiring significant changes to the existing architecture.


Summary

The Equipment System manages all items actively worn by the player and serves as the connection between collected gear and the Character's combat statistics.

By integrating weapons, armor, durability, enchantments, and automatic stat recalculation into a unified system, Adventure-Game demonstrates practical object-oriented design while providing a solid foundation for future RPG mechanics such as additional equipment slots, upgrades, repairs, and advanced item customization.

Clone this wiki locally