10 rem castle northstar
20 rem by dan and ed caggiani
30 rem copyright (c) 1984
35 rem fixed by Simon for CASA (24/08/2022)
40 rem poke53280,11:poke53281,12:print"[bl]"
90 x=39:y=45
100 dim l$(x+100)
110 dim lo$(y+100)
120 dim o$(y+100)
130 dim c$(30)
140 dim t(4,x+100)
150 dim c(30)
160 dim o(y+100)
480 data in a reception room,in an armory,in the musician's gallery
481 data in the ramparts,in a withdrawing room,in the western main hall
482 data in the eastern main hall,in the kitchen,in the offices,in a bedroom
483 data in a large bedroom,in a huge reception room,in the torture chamber
484 data in the dungeon cell,in the dungeon cell,in the gaoler's quarters
485 data on the northern banks of the river styx,in the tunnel of darkness
486 data still in the tunnel of darkness,in the tunnel of darkness
487 data on the styx river,on the styx river,still on the river,on the river
488 data within the river,still on the river styx,on the styx river
489 data floating on thf styx,still on the styx,on the styx river
490 data still on the river,on the southern banks of the styx
491 data in the mountains of limbo,in the limbo mountains,on limbo mountain
492 data on the plains of limbo,on the limbo plains, on the plains again
493 data at the gates of hades
494 data eight silver pieces,silver,1,lots of armor,*,2,many instruments,*,3
495 data the masonry,*,4,a desk,*,5,a guard,*,7,food on the table,food,8
496 data an ugly guard,*,10,a bed,*,10,a large colonial style bed,*,11
497 data an iron maiden,*,13,the gaoler,*,16,a silver harpie,*,17,oars,oars,17
498 data an iron harpie,*,18,a gold harpie,*,19,a platinum harpie,*,20
499 data a small boat,*,21,water,*,22,water,*,23,water,*,24,water,*,25
500 data water,*,26,water,*,27,water,*,28,water,*,29,water,*,30,water,*,31
501 data the styx river,*,32,mountains,*,33,mountains,*,34,a dark cave,*,35
502 data plains,*,36,grass,*,37,mountains in the distance,*,38,cerberus,*,39
503 data a very beautiful maiden,*,39,the large hall continuing east,*,6
504 data a large mirror,*,9,a bedroom to the west,*,12,an old skeleton,*,14
505 data cobwebs all around,*,15,the dungeon cells to the west,*,16
506 data a plate of food,*,7,a glass of wine,*,7
511 data 0,5,2,0
512 data 0,0,3,1
513 data 0,7,4,2
514 data 4,4,4,3
515 data 1,9,6,0
516 data 0,10,7,5
517 data 3,0,8,6
518 data 0,12,0,7
520 data 5,0,10,0
522 data 6,10,11,9
524 data 0,11,12,10
526 data 0,16,0,11
527 data 13,13,14,13
529 data 14,14,15,13
530 data 15,15,16,14
532 data 12,16,16,15
534 data 0,21,18,0
536 data 0,0,19,17
538 data 0,0,20,18
540 data 13,0,0,19
542 data 17,28,28,28
543 data 99,29,26,99
544 data 0,26,30,22
545 data 0,31,0,27
546 data 99,29,99,28
547 data 22,99,23,99
548 data 24,30,0,0
549 data 25,32,99,99
550 data 22,99,99,25
551 data 23,0,27,0
552 data 0,0,0,21
553 data 28,36,0,0
554 data 37,0,0,36
555 data 37,38,37,37
556 data 0,0,0,38
557 data 32,0,33,0
558 data 34,0,0,33
559 data 34,0,35,37
560 data 36,99,99,99
660 data take,1,get,1,drop,2,go,3,examine,4,exam,4,inventory,5,i,5,n,6,s
662 data 6,e,6,w,6,read,7,wear,8,use,9,open,10,eat,11,drink,12,rescue,13
670 for c=1 to x:read l$(c):nextc
680 for c=1toy:readlo$(c),o$(c),o(c):nextc
690 forc=1tox:readt(1,c),t(2,c),t(3,c),t(4,c):nextc
700 t$(1)="north":t$(2)="south":t$(3)="east":t$(4)="west"
704 x$(1)="n":x$(2)="s":x$(3)="e":x$(4)="w"
710 n=19
720 for c=1 to n:readc$(c),c(c):nextc
730 l=1
735 printchr$(147)
850 fort=1to2700:next:printchr$(147):print:print"you are ";l$(l):b$="":a$="":dr=0
855 print:print:print
880 n$="you see "
882 printn$;
890 forc=1toy:ifo(c)=lthenn$=lo$(c):printn$;",";
900 nextc
902 ifn$="you see "thenprint"nothing of interest"
905 print:print:print:print:print
940 print"obvious exits: ";
950 forc=1to4:ift(c,l)>0thenprintt$(c);" ";
960 nextc
965 print:print:print:print:print:print:print
1000 print"proceed how?-->":inputa$
1010 for c=1 to len(a$)
1011 if mid$(a$,c,1)=" " then a1$=left$(a$,c-1):b$=mid$(a$,c+1,len(a$)-c)
1012 if mid$(a$,c,1)=" " then goto 1030
1013 if mid$(a$,c,1)<>" " then next c
1020 a1$=a$
1030 forc=1ton
1040 ifc$(c)=a1$then a=c(c):goto1070
1050 next c
1060 print" i do not understand.":fort=1to600:next:goto850
1070 onagoto1080,1170,1241,1340,1450,1230,1500,1600,1700,1800,1900,2000,3000
1080 rem get
1082 ifb$="sword"andfs=1andl=2andgs=0thengs=1:goto1161
1083 ifb$="saxophone"andfi=1andl=3andgx=0thengx=1:goto1161
1084 ifb$="flute"andfi=1andl=3andgf=0thengf=1:goto1161
1085 ifb$="clarinet"andfi=1andl=3andgc=0thengc=1:goto1161
1086 ifb$="trombone"andfi=1andl=3andgt=0thengt=1:goto1161
1087 ifb$="oboe"andfi=1andl=3andgb=0thengb=1:goto1161
1088 ifb$="trumpet"andfi=1andl=3andgr=0thengr=1:goto1161
1089 ifb$="amulet"andfa=1andl=4andga=0thenga=1:goto1161
1090 ifb$="gold"andfg=1andl=11andgg=0thengg=1:goto1161
1091 ifb$="key"andgg=2andl=16orb$="keys"andgg=2andl=16thengoto1163
1129 forc=1toy
1130 ifb$=o$(c)ando(c)=lando$(c)<>"*"then o(c)=1000:print"it is taken":goto850
1150 nextc
1160 goto1060
1161 print"it is taken":goto850
1162 print"the gaoler takes the gold and hands you the cell keys!":gk=1:goto850
1163 print"you already have the keys!":goto850
1164 print"the silver harpie grabs the silver pieces!":goto850
1165 print"the iron harpie is now occupied by eating!":goto850
1170 rem drop
1172 ifb$="gold"andgg=1andl=16thengg=2:goto1162
1173 ifb$="silver"ando(1)=1000andl=17theno(1)=1001:ss=1:goto1164
1174 ifb$="food"ando(7)=1000andl=18theno(7)=1001:ii=1:goto1165
1199 forc=1toy
1200 ifb$=o$(c)ando(c)=1000theno(c)=l:print"the object has been dropped":goto850
1210 nextc
1220 print"sorry, you cannot drop "b$:goto850
1230 for c=1to4:ifa$=x$(c)then dr=c:goto1241
1240 nextc:goto1335
1241 ifl=7andt(dr,l)=3andkg=0thenprint"the guard attacks and kills you!!":goto4000
1242 ifl=7andt(dr,l)=8andkg=0thenprint"the guard attacks and kills you!!!":goto4000
1243 ifl=7andt(dr,l)=6andkg=0thenprint"the guard attacks and kills you!!i":goto4000
1244 ifl=10andt(dr,l)=9andkv=0thenprint"you feel the pain as his sword cuts your ";
1245 ifl=10andt(dr,l)=9andkv=0thenprint"heart in two!":goto4000
1246 ifl=10andt(dr,l)=6andkv=0thenprint"the guard swings his axe at you!!!":goto4000
1247 ifl=10andt(dr,l)=11andkv=0thenprint"the guard chops your head off!!":goto4000
1248 ifl=16andt(dr,l)=15andgk=0andoi=0thenprint"the cell door is locked":goto850
1249 ifb$="maiden"andl=13andol=1thenprint"you enter the maiden!":l=20:goto850
1250 ifl=20andt(dr,l)=19andpp=0thenprint"the platinum harpie attacks!":goto4000
1251 ifl=19andt(dr,l)=20andgh=0orl=19andt(dr,l)=18andgh=0thenprint"ahhh!":goto4000
1252 ifl=18andt(dr,l)=19andii=0thenprint"the iron harpie feeds on you!!!":goto4000
1253 ifl=18andt(dr,l)=17andii=0thenprint"the iron harpie feeds on you!!!":goto4000
1254 ifl=17andt(dr,l)=21andss=0thenprint"he mashes your head to the floor!":goto4000
1255 ifl=17andt(dr,l)=18andss=0thenprint"he mashes you to death!!!":goto4000
1256 ifb$="boat"andl=21andib=0thenprint"you enter the boat":ib=1:goto850
1258 ifl=21andt(dr,l)=28andib=0thenprint"you drown in the river!":goto4000
1259 ifl=21andt(dr,l)=28andib=1ando(14)<>1000thenprint"you need oars!":l=21:goto850
1260 ifb$="cave"andl=35thenl=39:print"you enter the cave!":goto850
1261 ifl=39andt(dr,l)=99thenprint"you enter the depths of hades!!!":goto4000
1262 ift(dr,l)=99thenprint"the boat is destroyed in the rapids'!":goto4000
1263 ifl=16andt(dr,l)=15andgk=1andoi=0thenprint"the cell door is locked!":goto850
1320 ift(dr,l)>0thenl=t(dr,l):goto1330
1325 ift(dr,l)<=0thenprint"you cannot go that way.":goto850
1330 rem
1332 goto850
1335 print"try a direction.":goto850
1340 if a$=a1$ then850
1341 ifb$="silver"ando(1)=1000orb$="silver"ando(1)=lthenprint"they are very old"
1342 ifb$="armor"andl=2andgs=0thenprint"you see a sword among it":fs=1:goto1000
1343 ifb$="sword"andfs=1andl=2orb$="sword"andgs=1thenprint"it is very heavy"
1344 ifb$="armory"andl=2thenprint"it is full of armor"
1345 ifb$="gallery"andl=3thenprint"it is full of musical instruments"
1346 ifb$="instruments"andl=3thenprint"you see a saxophone,flute,clarinet,"
1347 ifb$="instruments"andl=3thenprint"trombone,oboe,and trumpet":fi=1:goto1000
1348 ifb$="saxophone"andfi=1andl=3orb$="saxophone"andgx=1thenprint"it looks new"
1349 ifb$="flute"andfi=1andl=3orb$="flute"andgf=1thenprint"it is made of smooth wood"
1350 ifb$="clarinet"andfi=1andl=3orb$="clarinet"andgc=1thenprint"it's missing a reed"
1351 ifb$="trombone"andfi=1andl=3orb$="trombone"andgt=1thenprint"it slides well"
1352 ifb$="oboe"andfi=1andl=3orb$="oboe"andgb=1thenprint"the reed is broken"
1353 ifb$="trumpet"andfi=1andl=3orb$="trumpet"andgr=1thenprint"it needs trumpet oil"
1354 ifb$="ramparts"andl=4andga=0thenprint"you see something in the masonry"
1355 ifb$="masonry"andl=4andga=0thenprint"you see an amulet":fa=1:goto1000
1356 ifb$="amulet"andfa=1andl=4orb$="amulet"andga=1thenprint"you hear a hum from it"
1357 ifb$="desk"andl=5andod=0thenprint"it's closed"
1358 ifb$="note"andod=1andfm=1thenprint"why don't you read it?"
1359 ifb$="guard"andl=7andkg=0thenprint"he slices you in two with an axe!":goto4000
1360 ifb$="guard"andl=7andkg=1thenprint"he lies dead at your feet!"
1361 ifb$="food"ando(7)=1000orb$="food"ando(7)=lthenprint"it's chicken and corn!"
1362 ifb$="table"andl=8ando(7)=lthenprint"there is food on it!"
1363 ifb$="table"andl=8ando(7)<>lthenprint"there is nothing on it"
1364 ifb$="guard"andl=10andkv=0thenprint"he chops your head off!!!":goto4000
1365 ifb$="bed"andl=10thenprint"it is avery large bed made for royalty"
1366 ifb$="bed"andl=11thenprint"you see a chest on it!":fc=1:goto1000
1367 ifb$="chest"andl=11andoc=0thenprint"it's closed"
1368 ifb$="chest"andl=11andoc=1andgg=0thenprint"you see gold!":fg=1:goto1000
1369 ifb$="desk"andl=5andod=1thenprint"you see a note in it":fm=1:goto1000
1370 ifb$="gold"andoc=1andfg=1andl=11orb$="gold"andgg=1thenprint"it's priceless!"
1371 ifb$="maiden"andl=13andol=0thenprint"it is closed"
1372 ifb$="maiden"andl=13andol=1thenprint"there is a dim light coming from inside"
1373 ifb$="gaoler"andl=16andgk=0thenprint"he has the cell keys!!"
1374 ifb$="harpie"andl=17andss=0thenprint"it looks very mean!"
1375 ifb$="harpie"andl=17andss=1thenprint"it ignores you"
1376 ifb$="harpie"andl=18andii=0thenprint"it looks very hungry!"
1377 ifb$="harpie"andl=18andii=1thenprint"it is content with the food given to it"
1378 ifb$="harpie"andl=19andgh=0thenprint"it is very strong!"
1379 ifb$="harpie"andl=19andgh=1thenprint"it lies dead at your feet"
1380 ifb$="harpie"andl=20andpp=0thenprint"it is ready for a good fight!"
1381 ifb$="harpie"andl=20andpp=1thenprint"it lies in pain, on the verge of death"
1382 ifb$="oars"ando(14)=lorb$="oars"ando(14)=1000thenprint"they are made of wood"
1383 ifb$="boat"andl=21andib=0thenprint"it is in good condition"
1384 ifb$="boat"andl=21andib=1thenprint"you are in it!"
1385 ifb$="water"andib=1thenprint"it looks very deep!"
1386 ifb$="river"andl=21orb$="river"andl=32thenprint"it is rather calm"
1387 ifb$="mountains"andl>32thenprint"they are very tall"
1388 ifb$="plains"andl>35thenprint"they are very flat"
1389 ifb$="cerberus"andl=39andcd=0thenprint"it is a three-headed dog!!!"
1390 ifb$="cerberus"andl=39andcd=1thenprint"he is calmed by the music of the flute!"
1391 ifb$="maiden"andl=39thenprint"she calls for your help!"
1392 ifb$="gates"andl=39thenprint"it is dark and gloomy here!"
1393 ifb$="mirror"andl=9thenprint"you see your reflection"
1394 ifb$="reflection"andl=9thenprint"why, it looks just like you!"
1395 ifb$="skeleton"andl=14thenprint"it looks to have been here for ages!"
1396 ifb$="cobweb"andl=15orb$="cobwebs"andl=15thenprint"they're just regular cobwebs"
1397 ifb$="cave"andl=35thenprint"you hear something from inside"
1398 ifb$="grass"andl=37thenprint"it covers all of the plains"
1399 ifb$="food"andl=7thenprint"it looks and smells great!!!"
1400 ifb$="wine"andl=7thenprint"it is a very high quality red wine!"
1401 ifb$="guard"andl=10andkv=1thenprint"he is dead!"
1402 ifb$="gaoler"andl=16andgk=1andgg=2thenprint"he has lots of gold!"
1430 print:goto850
1450 print"you have:"
1451 ifgs=1 thenprint"sword"
1452 ifgx=1 thenprint"saxophone"
1453 ifgf=1 thenprint"flute"
1454 ifgc=1 thenprint"clarinet"
1455 ifgt=1 thenprint"trombone"
1456 ifgb=1 thenprint"oboe"
1457 ifgr=1 thenprint"trumpet"
1458 ifga=1 thenprint"amulet"
1459 ifgg=l thenprint"gold"
1460 ifgk=1 thenprint"cell keys"
1469 for c=1 to y
1470 ifo(c)=1000 thenprinto$(c)
1480 nextc:fort=1 to 1000:next:goto850
1500 ifb$="note"andfm=1thenprint"it reads:wearing an amulet will help you":goto850
1510 ifb$=<>"note"thenprint"you cannot read "b$:goto850
1520 goto850
1600 ifb$="amulet"andga=1thenprint"you feel revived!":wa=1:goto850
1610 print"sorry, you cannot wear "b$:goto850
1700 ifb$="sword"andgs=1andl=7andkg=0thengosub7000:goto850
1710 ifb$="sword"andgs=1andl=10andkv=0thengosub7000:goto850
1720 ifb$="sword"andgs=1andl=17thenprint"the silver harpie is too strong!":goto4000
1730 ifb$="sword"andgs=1andl=18thenprint"the iron harpie is too strong!":goto4000
1735 ifb$="sword"andgs=1andl=19thengosub8000:goto850
1740 ifb$="sword"andgs=1andl=20thengosub8000:goto850
1745 ifb$="sword"andgs=1andl=39thenprint"cerberus is too big for you!!!":goto4000
1750 ifb$="flute"andgf=1andl=39thenprint"cerberus calms into a trance!":cd=1:goto850
1752 ifb$="clarinet"andgc=1thenprint"you can't without a reed for it!":goto850
1754 ifb$="oboe"andgb=1thenprint"the reed is broken! you cannot play it!":goto850
1755 ifb$="saxophone"orb$="trumpet"orb$="trombone"thenprint"you play nicely":goto850
1760 print"sorry, you cannot use "b$:goto850
1800 ifb$="chest"andfc=1andl=11andoc=0thenoc=1:print"it opens. you see something"
1810 ifb$="desk"andl=5andod=0thenod=1:print"ok, the desk opens"
1820 ifb$="maiden"andl=13andol=0thenol=1:print"the maiden opens"
1830 ifb$="door"andl=16andgk=1thenprint"you open the door":oi=1:goto850
1835 ifb$="door"andl=16andgk=0thenprint"you can't without the key!"
1840 goto850
1900 ifb$="food"andl=7thenprint"ahhhh! the food contained arsenic!!!":goto4000
1910 ifb="food"andl=8thenprint"mmmm' that was good!":o(7)=1001:goto850
1920 print"yuchhhh!! you can't eat a "b$;"!!!":goto8s0
2000 ifb$="wine"andl=7thenprint"ahh! the wine was laced with acid!":goto4000
2010 ifb$="water"andl>21andl<32thenprint"ah! that's good!":goto850
2020 print"yuchhh!! you can't drink "b$;"!!!":goto850
3000 ifb$="maiden"andl=39andcd=1thenprint" my hero!!!":goto5000
3010 print"you cannot rescue "b$:goto850
4000 fort=1to2500:next:printchr$(147):printtab(244);"death comes quick and painlessly"
4001 print
4002 print" someone will soon come to take your"
4003 print:print"place"
4004 print:print"venture again y or n?"
4005 inputy$
4006 ify$="y"then run
4007 ify$="n"then end
4008 ify$<>"y"ory$<>"n"then goto4005
5000 fort=1to3000:next:printchr$(147):printtab(244);"congratulations young adventurer!"
5010 print:print" you have completed your quest"
5020 goto4004
7000 if wa=1thenff=int(rnd(0)*2)
7010 if wa=0thenff=int(rnd(0)*10)
7020 if ff=0andl=7thenprint"good shot! the guard bleeds to death!":kg=1:return
7030 if ff=0andl=10thenprint"nice shotl you killed the guard!":kv=1:return
7040 if ff<>0thenprint"you missed' the guard swings his sword and ";
7045 tt=int(rnd(0)*2)
7050 if tt=1thenprint"also misses!":return
7060 if tt=0 thenprint"kills you!":goto4000
8000 if wa=0 thenhf=int(rnd(0)*10)
8010 if wa=1 thenhf=int(rnd(0)*2)
8020 ifhf=0andl=20thenprint"great shot!the harpie is wounded!":pp=1:return
8030 ifhf=0andl=19thenprint"dlrect hit! the gold harpie lies dead!":gh=1:return
8040 ifhf>0thenprint"you missed! the harpie attacks and ";
8050 hh=int(rnd(0)*2)
8060 if hh=0 thenprint"also misses!":return
8070 if hh=1 thenprint"kills you!":goto4000



