Akalabeth Main Game File

31 thoughts
last posted April 5, 2014, 6 a.m.

14 earlier thoughts

0

Lord British's Castle

This code is lines 7000–7990. We get there from line 1515.

We clear the screen and go to text mode.

7000  HOME : TEXT : HOME 
7001  CALL 62450

CALL 62450 clears the hires screen to black.

If the player has a name (in PN$) they've been here before so we skip the next part.

7010  IF PN$ <  > "" THEN 7500

However, if the player is new we welcome them.

Newcomer

7020  PRINT : PRINT : PRINT "     WELCOME PEASANT INTO THE HALLS OF": PRINT "THE MIGHTY LORD BRITISH. HEREIN THOU MAYCHOOSE TO DARE BATTLE WITH THE EVIL": PRINT "CREATURES OF THE DEPTHS, FOR GREAT": PRINT "REWARD!"

And ask their name:

7030  PRINT : PRINT "WHAT IS THY NAME PEASANT ";: INPUT PN$

We next ask if they want grand adventure. If they don't answer "Y" we remove their name and GOTO 1090.

7040  PRINT "DOEST THOU WISH FOR GRAND ADVENTURE ? ";: GET Q$: IF Q$ <  > "Y" THEN  PRINT : PRINT "THEN LEAVE AND BEGONE!":PN$ = "": PRINT : PRINT "         PRESS -SPACE- TO CONT.";: GET Q$: GOTO 1090

However, if they accept, we set them a task:

7045  PRINT 
7050  PRINT : PRINT "GOOD! THOU SHALT TRY TO BECOME A ": PRINT "KNIGHT!!!": PRINT : PRINT "THY FIRST TASK IS TO GO INTO THE": PRINT "DUNGEONS AND TO RETURN ONLY AFTER": PRINT "KILLING A(N) ";:TASK =  INT (C(4) / 3): PRINT M$(TASK)

TASK is initially calculated from the player's WISDOM stat and indicates the monster to kill (equivalent to the index into M$ which gives us the monster's name).

At quest bestowal, the player gains 1 point on all stats (including GOLD). Again we exit with a GOTO 1090.

7060  PRINT : PRINT "     GO NOW UPON THIS QUEST, AND MAY": PRINT "LADY LUCK BE FAIR UNTO YOU.....": PRINT ".....ALSO I, BRITISH, HAVE INCREASED": PRINT "EACH OF THY ATTRIBUTES BY ONE!"

7070  PRINT : PRINT "         PRESS -SPACE- TO CONT.";: GET Q$: FOR X = 0 TO 5:C(X) = C(X) + 1: NEXT : HOME : GOTO 1090

Return

First we check if TASK is still positive (indicating a quest was assigned but not completed).

If so, we remind the player of their task and send them back with a GOTO 1090.

7500  IF TASK > 0 THEN  PRINT : PRINT : PRINT PN$;" WHY HAST THOU RETURNED?": PRINT "THOU MUST KILL A(N) ";M$(TASK): PRINT "GO NOW AND COMPLETE THY QUEST!": PRINT : PRINT "         PRESS -SPACE- TO CONT.";: GET Q$: HOME : GOTO 1090

If ABS(TASK) = 10 then, at this point, TASK must be -10. If this is the case, the player has become a knight.

7510  PRINT : PRINT : PRINT : PRINT "AAHH!!.....";PN$: PRINT : PRINT "THOU HAST ACOMPLISHED THY QUEST!": IF  ABS (TASK) = 10 THEN 7900

If the player hasn't done enough to become a knight, we give them a new quest (with TASK += 1).

We then GOTO 7060 (the last part of the initial quest bestowal) where stats are increased and we leave the castle (GOTO 1090):

7520  PRINT "UNFORTUNATELY, THIS IS NOT ENOUGH TO": PRINT "BECOME A KNIGHT.":TASK =  ABS (TASK) + 1: PRINT : PRINT "NOW THOU MUST KILL A(N) ";M$(TASK)
7530  GOTO 7060

We can see from the above that a positive TASK means "kill monster M$(TASK)" whereas a negative TASK means, "player has successfully killed monster M$(ABS(TASK))".

Knighthood

Now, if the player has completed TASK 10 (the BALROG), they become a knight.

7900  TEXT : HOME : PRINT : PRINT : PRINT :PN$ = "LORD " + PN$: PRINT "     ";PN$;","
7910  PRINT "       THOU HAST PROVED THYSELF WORTHY": PRINT "OF KNIGHTHOOD, CONTINUE PLAY IF THOU": PRINT "DOTH WISH, BUT THOU HAST ACOMPLISHED": PRINT "THE MAIN OBJECTIVE OF THIS GAME..."

We skip if the level being played at was 10.

7920  IF LP = 10 THEN 7950

If the level wasn't 10, we suggest them trying at one higher level than they just played.

7930  PRINT : PRINT "   NOW MAYBE THOU ART FOOLHEARTY": PRINT "ENOUGH TO TRY DIFFICULTY LEVEL ";LP + 1

We exit with a GOTO 7070 which still ups the stats but doesn't show the message saying that's what's being done.

7940  GOTO 7070

However, if the BALROG is killed on level 10, we reach here, with a suggestion to call California Pacific Computer to report the accomplishment.

7950  PRINT : PRINT "...CALL CALIFORNIA PACIFIC COMPUTER": PRINT "AT (415)-569-9126 TO REPORT THIS": PRINT "AMAZING FEAT!"

We still bump the stats on exit from the castle (although again, without mentioning it).

7990  GOTO 7070

16 later thoughts