-
Notifications
You must be signed in to change notification settings - Fork 1
/
C1GADV6.m
68 lines (68 loc) · 3.46 KB
/
C1GADV6.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
C1GADV6 ;ADVENTURE. FLH, DJW/WV ; 28 DEC 82 9:53 AM
;;1.0;C1GAMES;****;March 1, 2016;
;ADVENTURE. FLH ; 28 DEC 82 9:53 AM
; DJW/WV ;March 1, 2016
AVB I CLOSED,^C1GADV(71100.1,G,"ROD2","P")'<0 S O="ROD2" D HERE S @$S($T:"M=135,BONUS=25",LP=115:"M=134,BONUS=30",1:"M=133,BONUS=45"),RET="SCORE^C1GADV8" D SPK
Q
AVF S I=$E(CONDLP,4) I OBJ="VASE" S M=$S('I:144,1:29) Q:TOTING'["/VASE/"!'I S M=145 D SPK S M=0 G AVDV^C1GADV4
I "BOTTL"[OBJ S O="BOTTL" D HERE G:OBJ=""&'$T AV0^C1GADV5 D LIQ S M=$S(O]"":105,'I:106,1:107) I M=107 S ^C1GADV(71100.1,G,"BOTTL","P")=$E("102",I+1),L=1 D LIQ,CARRY:TOTING["/BOTTL/" S:O="OIL" M=108
Q
AVK I OBJ="BIRD" S M=100 Q
S J=$S(OBJ="TROLL":182,OBJ="DRAGO":102,1:0) I J=102,^C1GADV(71100.1,G,OBJ,"P") S J=110
I J S M=J Q
I OBJ="SNAKE" S M=102 Q:CLOSED S O="BIRD" D HERE Q:'$T S M=101,L=0,^C1GADV(71100.1,G,O,"P")=0,TALLY2=TALLY2+1 D MOVE Q
I OBJ="DWARF" S O="FOOD" D HERE Q:'$T S M=103 S:DFLAG<3 DFLAG=DFLAG+1 Q
AVK3 I OBJ="BEAR" S P=^C1GADV(71100.1,G,OBJ,"P"),M=$S(P=0:102,P=3:110,1:M),O="FOOD" D HERE Q:'$T S M=168,^C1GADV(71100.1,G,"AXE","P")=0,^("F")=0,^C1GADV(71100.1,G,OBJ,"P")=1,L=0 D MOVE Q
S M=14 Q
AVM S J=$F("FEEFIEFOEFOOFUM",U1)\3,M=42 I FOOBAR-1+J S:FOOBAR M=151 Q
I J-4 S FOOBAR=J,M=54 Q
S FOOBAR=0,O="EGGS",L=^C1GADV(71100.1,G,O,"L") Q:L=92!(LP=92&(TOTING["/EGGS/"))
I L=0,^C1GADV(71100.1,G,"TROLL","L")=0,^("P")=0 S ^("P")=1
D HERE S M=0,L=92,P=$S(LP=92:0,$T:1,1:2) D MOVE,PSPK Q
AVON G:OBJ="BRIEF" AVONB
AVON1 I OBJ'="LAMP" S M=13 Q
AVONL S O="LAMP" D HERE I S M=184 I LIMIT'<0 S (LIT,^C1GADV(71100.1,G,O,"P"))=1,DARK=0,M=39 D SPK S M=0 I WZDARK S RET="SHOW^C1GADV2"
Q
AVONB S ABB=10000,DETAIL=3,S=0,M=156 Q
AVOF G:OBJ="BRIEF" AVOFB
AVOF1 I OBJ'="LAMP" S M=13 Q
AVOFL S O="LAMP" D HERE I S (LIT,^C1GADV(71100.1,G,O,"P"))=0,M=40 D SPK S DARK='$E(CONDLP,3),M=$S(DARK:16,1:0)
Q
AVOFB S ABB=5,DETAIL=0,S=1,M=54 Q
AVS D SC1^C1GADV8 W:S ! W !,"If you were to quit now, you would score ",SCORE," out of a possible ",MXSCOR,"."
S Q=143,(Y,N)=54 D YES S GAVEUP=$T,M=0 S:$T RET="SCORE^C1GADV8" Q
AVV S J=0 I DARK
E I CLOSED,TOTING["/OYSTE/" S OBJ="OYSTE",J=1
E S O="MAGAZ" D AVVJ
E S O="TABLE" D AVVJ
E S O="MESSA" D AVVJ
G:J-1 AV0^C1GADV5
AVV1 I DARK S RET="OBNONE^C1GADV3" Q
S J=OBJ="OYSTE"&(TOTING["/OYSTE/")
S M=$S(J&HINTED(2):194,OBJ="MESSA":191,OBJ="TABLE":196,OBJ="MAGAZ":190,1:M)
I J,'HINTED(2) S Q=192,Y=193,N=54 D YES S HINTED(2)=$T,M=0
Q
AVVJ D HERE I S OBJ=O,J=J+1 I J>1
Q
AVZ S SAVED=1,M=0 D PUTGAM^C1GADV Q
YES S M=Q D SPK,KBD I SAVE?1"Y".1"ES" S M=Y D:M SPK
E I SAVE'?1"N".1"O" W " Please answer the question." G YES
E S M=N D:M SPK
K M Q
KBD W:S ! R !,W:600 G:'$T TIMO^C1GADV S SAVE=W F I=1:1 Q:SAVE?.CNPU I $E(SAVE,I)?1L S SAVE=$E(SAVE,1,I-1)_$C($A(SAVE,I)-32)_$E(SAVE,I+1,99)
K I Q
SPK W:S ! F I=1:1:^C1GADV(71100,"t",M,0) W !,^(I)
K I Q
PSPK S N=^C1GADV(71100,O,P,0) I N W:S ! F I=.1:.1:N W !,^(I)
K I,N Q
DROP F Z=2:1:HOLDNG+1 I $P(TOTING,"/",Z)=O S TOTING=$P(TOTING,"/",1,Z-1)_"/"_$P(TOTING,"/",Z+1,99),HOLDNG=HOLDNG-1 Q
S ^C1GADV(71100.1,G,O,"L")=L
DR1 I L>0 S ^("O")="/"_O_^C1GADV(71100.1,G,L,"O")
Q
CARRY Q:TOTING[("/"_O_"/") S ^C1GADV(71100.1,G,O,"L")=-1,HOLDNG=HOLDNG+1,TOTING="/"_O_TOTING
CARRYF S Y=^C1GADV(71100.1,G,L,"O") F Z=2:1:$L(Y,"/")-1 I $P(Y,"/",Z)=O S ^("O")=$P(Y,"/",1,Z-1)_"/"_$P(Y,"/",Z+1,99) Q
K Y,Z Q
MOVE S MOL=L,L=^C1GADV(71100.1,G,O,"L") D:L>0 CARRY S L=MOL D DROP Q
HERE S L=^C1GADV(71100.1,G,O,"L") I L<0!(L=LP)
K L Q
LIQ S O=^C1GADV(71100.1,G,"BOTTL","P") S:O<0 O=-1-O S O=$P("WATER//OIL","/",O+1) Q