dungeoncli

Crates.iodungeoncli
lib.rsdungeoncli
version1.0.0
created_at2025-11-11 03:32:44.716417+00
updated_at2025-11-11 03:32:44.716417+00
descriptionA Rust CLI dungeon crawler featuring combat, loot, and leveling.
homepage
repositoryhttps://github.com/Chisom-rgb/dungeoncli
max_upload_size
id1926663
size12,713
(Chisom-rgb)

documentation

README

DungeonCLI: Ultimate Edition+

A text-based dungeon crawler RPG built with Rust, featuring turn-based combat, character progression, and save/load functionality.

Features

  • Turn-based Combat: Battle enemies with Attack, Defend, Heal, and Run options
  • Character Progression: Level up system with stat increases
  • Random Events: Discover treasure chests or trigger hidden traps
  • Save/Load System: Save your progress and continue later
  • Scaling Difficulty: Enemies get stronger as you descend deeper into the dungeon
  • Colored Terminal Output: Enhanced gameplay experience with colored text

Installation

Prerequisites

  • Rust (1.70 or later)
  • Cargo

Building from Source

# Clone or navigate to the project directory
cd "Rust Project"

# Build the project
cargo build --release --package dungeoncli

# Run the game
cargo run --package dungeoncli

How to Play

Starting the Game

When you launch DungeonCLI, you'll be prompted to:

  1. Start a new game
  2. Load a previously saved game

Combat

During battle, you have four actions:

  • Attack โš”๏ธ: Deal damage to the enemy
  • Defend ๐Ÿ›ก๏ธ: Increase your defense temporarily
  • Heal ๐Ÿงช: Use a potion to restore health
  • Run ๐Ÿƒ: Attempt to flee (50% success rate)

Character Stats

  • Health: Your current HP / maximum HP
  • Attack: Base damage dealt to enemies
  • Defense: Reduces incoming damage
  • Potions: Number of healing potions available
  • Gold: Currency earned from defeated enemies
  • XP: Experience points for leveling up
  • Level: Current character level

Leveling Up

Gain XP by defeating enemies. Each level requires Level ร— 50 XP. Upon leveling up:

  • Max Health +10
  • Attack +3
  • Defense +2
  • Health fully restored
  • +1 Potion

Random Events

As you explore, you may encounter:

  • Treasure Chests ๐Ÿ’ฐ: Gain 10-30 gold
  • Hidden Traps ๐Ÿ’€: Take 5-15 damage

Game Progression

  • Descend through increasingly difficult dungeon levels
  • Enemies scale with the dungeon level
  • Save your progress after each battle
  • Exit the dungeon anytime with your accumulated gold and XP

Dependencies

  • colored (3.0.0) - Terminal color output
  • rand (0.9.2) - Random number generation

File Structure

Rust Project/
โ”œโ”€โ”€ Cargo.toml          # Workspace configuration
โ”œโ”€โ”€ dungeoncli/         # Main game package
โ”‚   โ”œโ”€โ”€ Cargo.toml
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ””โ”€โ”€ main.rs     # Game logic
โ””โ”€โ”€ src/
    โ””โ”€โ”€ main.rs         # Template file

Save Files

Game progress is saved to save.txt in the current directory. The save file contains:

  • Character name
  • Current health and max health
  • Attack and defense stats
  • Number of potions
  • Gold and XP
  • Current level

License

This project is available for personal and educational use.

Commit count: 0

cargo fmt