RE:ZONE is a text-based, deckbuilding RPG built entirely in Python. It combines real-world task management, classic deckbuilding combat, and a rich post-apocalyptic world driven by dynamic AI and immersive lore.
-
Clone or download the project
git clone https://github.com/rasool404/rezone cd rezone -
Install dependencies
pip install -r reqs.txt
Required libraries:
pyfiglet(ASCII art generation)
-
Run the game
python main.py
-
First time setup
- The game will create save directories automatically
- Enter your character name when prompted
- Enjoy the prologue and start your post-apocalyptic adventure!
- Use number keys to select menu options
- Follow on-screen prompts for combat and navigation
- Access the task manager GUI through the bunker menu
- Genre: Deckbuilding RPG (text-based, ASCII visuals)
- Setting: A world devastated by nuclear war, with survivors scraping by in bunkers
- Core Loop:
- Explore dangerous zones
- Battle enemies and bosses
- Return to the bunker to rest, buy cards/potions, and manage real-life tasks
- Level up and build your ultimate deck
- Players hold a hand of 3 cards, drawing 1 new card at the start of each turn
- Cards cost energy (stamina)
- Use cards wiselyβif you run out of energy, retreat to the bunker to rest!
- Card types:
- Attack: Deal direct damage
- Defense: Temporary, 1-turn shields
- Utility: Buffs, debuffs, status effects
- Zones are defined in
locations.json - Each zone has a unique theme, enemies, and a final boss
- Enemies adapt their actions based on your health and theirs
- Buy cards, health potions, and manage your loadout
- Health potions come in small, medium, and large, restoring different amounts of HP
- A gamified task manager (using
TaskManagerGUI) for real-world productivity - Completing real tasks rewards you with in-game money
- Missing tasks costs you HP!
- Earn XP to level up
- Each level grants new cards to unlock
- Stats increase (+2 ATK, +2 DEF, +10 HP) per level
- All text output uses ASCII art and effects for immersion
- Game state is saved in JSON (
progress.json,tasks.json) and auto-loaded
- Rich backstory and world-building in
lore.json - The AI bot "ARIA" shares random lore snippets dynamically
rezone/
βββ main.py # Starts the game, main loop
βββ modules/ # Core logic & data models
β βββ game_engine.py # Main game engine
β βββ player.py # Player stats, deck, progression
β βββ enemy.py # Enemies, including raiders, mutants, bosses
β βββ battle_manager.py # Combat loop and interactions
β βββ inventory_manager.py# Item handling, adding/removing items
β βββ location.py # Zone definitions, enemy rotations
β βββ data_manager.py # Saving/loading game progress
β βββ cards.py # Card classes: Attack, Defense, Utility
β βββ items.py # Inventory items (CardItems, Consumables)
β βββ lore_manager.py # Loading and serving lore snippets
β βββ task_manager.py # Real-life task handling
β βββ task_base.py # Abstract task definition
β βββ simple_task.py # Single-instance tasks
β βββ daily_task.py # Daily recurring tasks
β βββ task_manager_gui.py # Tkinter-based GUI for task management
β βββ bot.py # AI bot ARIA
β βββ exceptions.py # Custom error classes
βββ components/ # Bunker, map, inventory, start flow
βββ utils/ # ASCII effects, terminal tools
βββ data/ # JSON data: lore, locations, ASCII art
βββ saves/ # Save files
βββ reqs.txt # Required libraries (pyfiglet)
βββ README.md # This file!
The heart of the game:
- Starts with
start_game(), showing the prologue and getting your name - Main loop: Controlled by the
self.statevariable. States include:bunkerexploretask-managerstatsinventorybed
- Each state triggers a different UI component from
components/(e.g.,bunker.pyfor safehouse actions)
Starts with start_battle():
-
Player turn:
- Pick a card by index
- Check energy/stamina
- Use it (resolves damage, healing, or buffs)
-
Enemy turn:
- Uses enemy-specific AI in
enemy.py - Can attack, defend, or (for bosses) use Utility cards
- Uses enemy-specific AI in
Combat mechanics:
- Cards cost energy. Run out β go back to bunker
- Dynamic enemy AI:
- Raider: Defends more at low HP
- Mutant: More aggressive as it weakens
- Boss: Can buff itself or burn/poison you
- Defense only lasts 1 turnβreset at the start of each turn
- Victory: Gain XP and level up if threshold met (
gain_xp()inplayer.py) - Death: Respawn with 5 HP and zero balance
- 3-card hand at a time
- After playing a card β draw 1 new card from deck
- Deck reshuffles from discard pile when empty
- Starter deck includes strikes, guards, and utilities (like Focus and Regenerate)
- Level-up unlocks new cards (e.g., Overclock, Exploit Weakness)
- Buy health potions (small/medium/large)
- Card shop sells new cards once unlocked by level
- Manage deck: Move cards in/out of your deck
- If stamina is 0, go to bed
- Bed fully restores your stamina
- Return to battle-ready!
- Base:
Enemy(inheritsCharacter) - Raiders: Use "Brace" defense at low HP
- Mutants: Use "Frenzy" for higher damage at low HP
- Bosses:
- Use
UtilityCardslike "Battle Roar" for +3 ATK for 3 turns - Use "Corrosive Shout" to poison the player
- Use
- Add real-life tasks:
- Simple Tasks (can expire)
- Daily Tasks (reset each day)
- Completing tasks gives in-game money!
- Missing tasks costs 10 HP
- GUI built with Tkinter:
- View tasks
- Mark as complete
- See task stats (completed/pending/expired)
- Auto-saves on exit
- Tracks:
- Player stats, deck, money
- Location completion (boss defeated?)
- Task progress
- Data stored in JSON (
progress.json,tasks.json)
- Prologue on first launch (text-based cinematic)
- Random lore snippets shared by ARIA (the AI bot) when bored
- Categories in JSON:
intro_lore: Opening world storyai_random_lore: ARIA's sarcastic commentary
- Uses
pyfigletfor ASCII banners (ascii()function) - Adds noise & cracks for a post-apocalyptic effect
- ASCII progress bars for HP, energy, and XP
- All UI is in the terminalβno graphicsβbut immersive!
| Principle | Implementation |
|---|---|
| Abstraction | Abstract base classes: Card, Character, Item, Task |
| Encapsulation | Controlled access to attributes and internal state |
| Inheritance | Deep hierarchy (e.g., Character β Player, Enemy, etc.) |
| Polymorphism | Overridden methods like use(), __str__(), get_next_action() |
| Operator Overloading | Example: __str__() in Character, Player, Enemy classes |
| Data-Driven | Zones, enemies, and lore loaded from JSON |
| State Pattern | Game state transitions (bunker, explore, etc.) control flow |
| Factory Pattern | Card creation in the shop uses factory-like lambda functions |
| Strategy Pattern | Enemy AI adapts to player/enemy HP (different get_next_action() methods) |
| Observer Pattern | Task manager uses event handlers for task updates |
| Template Method | Abstract Card.use() method, implemented by each card type |