Caverns of Freitag is an action role-playing game for the Apple II, written in 1982 by David Shapiro (a/k/a "Dr. Cat"). It has the standard elements -- running around in a maze bashing various monsters to death to become strong enough to face the boss -- making it one of the earliest examples of the ARPG genre. The interface is a clever mix of text and hi-res graphics.
The game is written primarily in Applesoft, with assembly-language routines for animation. The disassembly is based on the (very clean) 4am crack.
When reading the CF source code, it can be helpful to have the list of variables handy.
You can download the SourceGen project set for the binaries. The disk image is available on asimov.
Caverns of Freitag is copyright 1982 David Shapiro.
The goal is to kill the dragon (technically "Dwagon") in the bottom-right part of the maze, and return safely to the Inn.
During setup you can pick your character name, skill level, and game speed. Skill level 1 is the easiest. It affects the initial monster generation, the number of experience points required to level up, and how far you can run while fleeing. At skill levels 8 and 9, two walls are added near the Inn, blocking the most direct route to the dragon and making the bottom half of the maze difficult to access.
The speed determines how long the game will wait before moving without you; speed 50 is the slowest. In hi-res mode you'll see a timer dot running across the bottom, in text mode an asterisk. The game cannot be paused. (Dr. Cat pointed out that you can pause if you're quick... if you bump into a wall and immediately hit Ctrl+S, the firmware text output code will catch it and pause until you hit another key.)
You can move in 8 directions, using keys centered around the 'H' key:
T Y U \|/ G-H-J /|\ B N M
Holding the Ctrl key down attacks in that direction. Hitting H passes the turn, which can be useful when you want an enemy to approach.
Moving onto the Inn restores all your hit points, and if you have enough experience, raises you one level. (If you have a lot of experience, move on and off the Inn a few times to get all of your new levels.) The only other way to heal is to walk onto a Healer or kill the dragon. You start with 125 HP, and gain 100 HP each time you level up.
The damage you do is based on your experience level. You start
at level 1, and can reach level 8. When you kill the dragon, you
are immediately promoted to level 9 ("Dragon Slayer").
Swords do rnd(1-10) * level
per hit. Magic swords
add their bonus (1-3) to the experience level. Arrows do
rnd(1-6) * (level + 2)
. Arrows do not fly off screen.
Every experience level gives you a 5% chance to block attacks with your shield, so at max level (9) you have a 45% chance. Magic shields add 5% per bonus point (1-3). Your shield doesn't work when the bow is readied, and Invisoids can't be blocked.
The maze is initially populated with 62 chests. 5/6ths of the time, chests contain 1-50 gold coins. The other 17% of the time, you have even odds of finding arrows, a magic sword, a magic shield, a teleportation trap, or nothing at all. A new chest is created every other time you open one, so new chests will appear but you will eventually run out.
Initially there are 110 monsters. Every time you kill one, two more are spawned, until there are 169 monsters. The types of spawned monsters are completely random, and not based on skill level or location. (The initial set of monsters *is* based on skill level; the highest monster it will create is equal to your skill level plus 4. So at level 1 the maze will be filled with nothing but Serpents and Electric Moths until you start killing things.) Moving onto a healer "kills" the healer and fills its slot with a wizard.
The game can feel a bit sluggish, but if you run it in an emulator at 2x it perks right up.
Monsters will tend to move toward you, but have a 1 in 8 chance of moving randomly. Some monsters have special movement patterns, e.g. Mad Robots can't move diagonally, Wizards will prefer to run rather than melee, and Healers will tend to move away from you.
Monster melee attacks hit for 1 to N points of damage, where N is the damage value from the table below multiplied by 0.7. The experience you receive for killing a monster is equal to their hit points.
Num | Img | Name | HP | Dam | Notes |
---|---|---|---|---|---|
3 | Serpent | 30 | 20 | ||
4 | Electric Moth | 15 | 15 | ||
5 | Mad Robot | 50 | 30 | Can't move diagonally. | |
6 | Burbleblort | 75 | 45 | ||
7 | Griffin | 150 | 100 | ||
8 | Flamebat | 100 | 70 | ||
9 | Invisoid | 20 | 20 | Invisible; attacks cannot be blocked. | |
10 | Thunderbug | 5 | 150 | Can move twice in one turn (but only attacks once). | |
11 | Coldcrystal | 300 | 8 | ||
12 | Phoenix | 200 | 150 | ||
13 | Mimic | 88 | 200 | Doesn't move. Successful attack immobilizes player. | |
14 | Healer | 1 | 1 | Walk onto for healing (26-175 pts). | |
15 | Wizard | 65 | 20 | No melee attacks. Ranged "zappo" attack does 26-75. | |
35 | Dwagon | 350 | 120 | Boss. Flame attack does 250. |
Copyright 2020 by Andy McFadden