TERMINARIA — Turn-Based Squad Combat in the Terminal
make # builds ./terminaria
make run # builds and launches immediately
make clean # removes object files and binaryRequirements: g++ with C++17 support (GCC 9+ or Clang 10+).
macOS: xcode-select --install is sufficient.
Linux: sudo apt install g++ or equivalent.
./terminariaAll interaction is through numbered menus and coordinate input.
| Mode | Description |
|---|---|
| Campaign | 5 escalating battles culminating in a Boss fight vs. Lord Kross |
| Skirmish | Single custom battle with chosen difficulty |
| Survival | Endless enemy waves — survive as long as possible |
| Class | HP | ATK | DEF | SPD | Range | Role |
|---|---|---|---|---|---|---|
| Warrior | 120 | 20 | 18 | 8 | 1 | Melee bruiser |
| Archer | 90 | 16 | 10 | 12 | 4 | Ranged DPS |
| Mage | 75 | 28 | 6 | 11 | 4 | AoE magic |
| Healer | 80 | 10 | 8 | 10 | 3 | Support / heal |
| Tank | 160 | 14 | 28 | 5 | 1 | Frontline shield |
| Rogue | 85 | 22 | 8 | 15 | 1 | Assassin / DoT |
Promoted classes unlock at Level 10:
- Warrior → Knight or Berserker
- Archer → Sniper
- Mage → Elementalist
- Healer → Priest
Warrior: Slash (1.5× ATK), Shield Bash (stun), Taunt (Rage buff)
Archer: Piercing Arrow (ignore DEF), Multi Shot (AoE), Snipe (2.5× ATK long range)
Mage: Fireball (AoE burn), Ice Nova (freeze AoE), Lightning Chain (chain 3 targets)
Healer: Heal (+25 HP), Purify (cleanse statuses), Barrier (20 HP shield)
Tank: Guard (shield ally), Counter Stance (Rage), Fortify (30 HP shield self)
Rogue: Backstab (2.2× + bleed), Dash (stun), Poison Strike (3-turn poison)
| Symbol | Type | Effect |
|---|---|---|
|
Empty | Normal movement |
## |
Wall | Impassable |
%% |
Forest | 2× move cost, +15% evasion, +3 DEF |
~~ |
Water | 2× move cost |
/\ |
Mountain | Impassable |
^^ |
Trap | −8 HP on entry |
++ |
Healing Spring | +5 HP per turn |
^^ |
High Ground | +1 attack range, +5 DEF |
Poison Burn Bleed — HP loss per turn
Freeze Stun — prevent movement / actions
Slow — −1 movement range
Shield — absorb incoming damage
Rage — +ATK, −DEF
Armor Break — halve DEF
Silence — cannot use skills
All input is number-based:
- Action menu: type the action number and press Enter
- Move target:
row col(e.g.3 5to move to row 3, col 5) - Cancel / Back:
0
[1] Move — pick a destination tile
[2] Attack — pick an enemy in range
[3] Skill — choose skill, then target
[4] Item — use a team inventory item
[5] Status — view all unit cards
[6] Defend — +50% DEF, end turn
[7] Wait — end turn immediately
[8] Save — save to file
- Saves are written to
saves/slot1.sav(etc.) - Save during battle from the action menu
- Load from the main menu → "Load Game"
- Up to 3 save slots supported
main.cpp Entry point
src/
Types.h Shared enums and Position struct
Utils.h ANSI colors, bars, input helpers, RNG
StatusEffect.h/.cpp Status effect data and tick logic
Skill.h/.cpp Skill data + SkillFactory
Item.h/.cpp Item data + Inventory + ItemFactory
Unit.h/.cpp Base Unit class + 6 concrete classes + UnitFactory
Tile.h/.cpp Single map tile with terrain properties
Map.h/.cpp 2D grid + A* pathfinding + BFS reachable + renderer
BattleSystem.h/.cpp Combat engine, turn queue, XP, item use
AIController.h/.cpp Rule-based enemy AI with priority targeting
SaveManager.h/.cpp File-based save / load
InputManager.h/.cpp All terminal input parsing
Game.h/.cpp Game state machine and screen orchestration
- Factory —
UnitFactory,SkillFactory,ItemFactory - State —
GameStateenum drives the main loop - Strategy —
AIControllerdecoupled from BattleSystem - Observer-lite —
BattleLogcollects all events; rendered at frame end - Polymorphism —
Unitbase with 6 concrete derived classes
- Healers are priority targets for the AI — keep yours protected.
- High ground tiles extend your ranged attackers' reach by +1.
- Forest gives +15% evasion — park your Rogue there for near-immunity to hits.
- Silence the enemy Healer with the Rogue's Poison Strike combo before focusing them.
- Fortify + Barrier stack: Tank can absorb 50 damage before any HP is lost.
- The Boss (Lord Kross) has a Priest healer — kill it first or he will sustain forever.