Skip to content

Commit

Permalink
Changes to be committed:
Browse files Browse the repository at this point in the history
	modified:   C1GADV.m
	modified:   C1GADV2.m
	modified:   C1GADV3.m
	modified:   C1GADV4.m
	modified:   C1GADV5.m
	modified:   C1GADV6.m
	modified:   C1GADV7.m
	modified:   C1GADV8.m
	modified:   C1GADV9.m
	modified:   C1GADVDC.m
	modified:   XINDX2.m
	modified:   XINDX3.m

Commit the code changes

DO/GOTO Routines: ADV* -> C1GADV*
change glvn Global: ^ADV(  -> ^C1GADV(711000,
change glvn Global: ^ADVG( -> ^C1GADV(711000.1,
  • Loading branch information
whitten committed Mar 26, 2016
1 parent 36bc4a4 commit da4061e
Show file tree
Hide file tree
Showing 12 changed files with 308 additions and 303 deletions.
112 changes: 56 additions & 56 deletions C1GADV.m
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
ADV ;ADVENTURE V1.0. FLH. DJW/WV ; 07 FEB 83 3:37 PM
;;1.0;C1GAMES;****;March 1, 2016
;DNL;20May89 13:00;Copyright (c) 1989 PRx, Inc.
;ADVENTURE V1.0. FLH ; 07 FEB 83 3:37 PM
;
;K S:$ZS<6 $ZS=6 S $ZE="ERR1" S GAVEUP=0,S=1
S GAME=$P(XID,"^",2),NAME=XID("USER")
;NEW (GAME,NAME)
; CTRL-C allowed during debugging- change IF to disallow
I 1 X ^%ZOSF("BRK")
I 0 X ^%ZOSF("NBRK")
S X="^ERR1" X ^%ZOSF("TRAP")
S GAVEUP=0,S=1
S Q=65,Y=54,N=201 D YES I D OLDNAM I D GETGAM I 1
E D NEWNAM,GCOPY,GETGAM
S X="ERR^ADV" X ^%ZOSF("TRAP")
S Q=208,Y=1,N=0 D YES I I 'HINTED(3) S HINTED(3)=1,LIMIT=LIMIT+670
G ^ADV2
ENDGAM I '(SAVED&GAVEUP) K ^ADVG(G)
E D PUTGAM
S X="^ERR1" X ^%ZOSF("TRAP") S G="" F Z=0:0 S G=$O(^ADVG(G)) Q:G="" I $H-10>^(G) K ^(G)
S X="^%ZTER" X ^%ZOSF("TRAP") Q
TIMO S GAVEUP=1 D ENDGAM G ^XUSCLEAN
;
; no Standard ANSI M way to detect CONTROL-C
ERR ;I $ZE?1"<INRPT".E S $ZE="ERR^ADV",RET="TURN^ADV3" D @$P(^ADV("QUIT"),"/",3) G @RET
ERR1 D ^%ZTER Q
OLDNAM S M=205 D SPK
OL1 D GETIN I U1="?"!(U1="HELP") D LIST G OLDNAM
I W'?1.5AN S M=203 D SPK G OL1
Q:U1="NEW" S G=U1 I $D(^ADVG(G)) S M=207 D SPK Q
S M=206 D SPK G OLDNAM
LIST W !! S G="" F X=0:8 S G=$O(^ADVG(G)) Q:G="" W ?X,G I X>70 W ! S X=0
Q
NEWNAM S M=202 D SPK
NE1 D GETIN S G=U1,M=$S(W'?1.5AN:203,G="NEW":210,$D(^ADVG(G)):204,1:207) D SPK G:M-207 NE1 S ^ADVG(G)=$H Q
GCOPY F L=1:1:140 S ^ADVG(G,L,"A")=0,^("O")="/"
S N=0,F(N)="^ADV(""i"",",T(N)="^ADVG(G,",X=$H D COP K D,F,IN,N,OUT,T,SAVE,X Q
COP S SAVE(N)="",IN(N)=F(N)_"SAVE(N))",OUT(N)=T(N)_"SAVE(N))"
CO1 S SAVE(N)=$O(@IN(N)) I SAVE(N)="" Q
S D=$D(@IN(N)) I D#2 S @OUT(N)=@IN(N) I X'=$H S X=$H W "."
I D>9 S F(N+1)=F(N)_""""_SAVE(N)_""",",T(N+1)=T(N)_""""_SAVE(N)_""",",N=N+1 D COP S N=N-1
G CO1
GETGAM S X="" F Z=0:0 S X=$O(^ADVG(G,"i",X)) Q:X="" S @X=^(X)
Q
PUTGAM S X="" F Z=0:0 S X=$O(^ADVG(G,"i",X)) Q:X="" S ^(X)=@X
W !!,"This adventure saved with name ",G,"." Q
GETIN D KBD S W1=$P(W," ",1),W2=$P(W," ",2),U1=$E($P(SAVE," ",1),1,5),U2=$E($P(SAVE," ",2),1,5) K SAVE 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^ADV 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:^ADV("t",M,0) W !,^(I)
K I Q
C1GADV ;ADVENTURE V1.0. FLH. DJW/WV ; 07 FEB 83 3:37 PM
;;1.0;C1GAMES;****;March 1, 2016;
;DNL;20May89 13:00;Copyright (c) 1989 PRx, Inc.
;ADVENTURE V1.0. FLH ; 07 FEB 83 3:37 PM
;
;K S:$ZS<6 $ZS=6 S $ZE="ERR1" S GAVEUP=0,S=1
S GAME=$P(XID,"^",2),NAME=XID("USER")
;NEW (GAME,NAME)
; CTRL-C allowed during debugging- change IF to disallow
I 1 X ^%ZOSF("BRK")
I 0 X ^%ZOSF("NBRK")
S X="^ERR1" X ^%ZOSF("TRAP")
S GAVEUP=0,S=1
S Q=65,Y=54,N=201 D YES I D OLDNAM I D GETGAM I 1
E D NEWNAM,GCOPY,GETGAM
S X="ERR^C1GADV" X ^%ZOSF("TRAP")
S Q=208,Y=1,N=0 D YES I I 'HINTED(3) S HINTED(3)=1,LIMIT=LIMIT+670
G ^C1GADV2
ENDGAM I '(SAVED&GAVEUP) K ^C1GADV(71100.1,G)
E D PUTGAM
S X="^ERR1" X ^%ZOSF("TRAP") S G="" F Z=0:0 S G=$O(^C1GADV(71100.1,G)) Q:G="" I $H-10>^(G) K ^(G)
S X="^%ZTER" X ^%ZOSF("TRAP") Q
TIMO S GAVEUP=1 D ENDGAM G ^XUSCLEAN
;
; no Standard ANSI M way to detect CONTROL-C
ERR ;I $ZE?1"<INRPT".E S $ZE="ERR^C1GADV",RET="TURN^C1GADV3" D @$P(^C1GADV(71100,"QUIT"),"/",3) G @RET
ERR1 D ^%ZTER Q
OLDNAM S M=205 D SPK
OL1 D GETIN I U1="?"!(U1="HELP") D LIST G OLDNAM
I W'?1.5AN S M=203 D SPK G OL1
Q:U1="NEW" S G=U1 I $D(^C1GADV(71100.1,G)) S M=207 D SPK Q
S M=206 D SPK G OLDNAM
LIST W !! S G="" F X=0:8 S G=$O(^C1GADV(71100.1,G)) Q:G="" W ?X,G I X>70 W ! S X=0
Q
NEWNAM S M=202 D SPK
NE1 D GETIN S G=U1,M=$S(W'?1.5AN:203,G="NEW":210,$D(^C1GADV(71100.1,G)):204,1:207) D SPK G:M-207 NE1 S ^C1GADV(71100.1,G)=$H Q
GCOPY F L=1:1:140 S ^C1GADV(71100.1,G,L,"A")=0,^("O")="/"
S N=0,F(N)="^C1GADV(71100,""i"",",T(N)="^C1GADV(71100.1,G,",X=$H D COP K D,F,IN,N,OUT,T,SAVE,X Q
COP S SAVE(N)="",IN(N)=F(N)_"SAVE(N))",OUT(N)=T(N)_"SAVE(N))"
CO1 S SAVE(N)=$O(@IN(N)) I SAVE(N)="" Q
S D=$D(@IN(N)) I D#2 S @OUT(N)=@IN(N) I X'=$H S X=$H W "."
I D>9 S F(N+1)=F(N)_""""_SAVE(N)_""",",T(N+1)=T(N)_""""_SAVE(N)_""",",N=N+1 D COP S N=N-1
G CO1
GETGAM S X="" F Z=0:0 S X=$O(^C1GADV(71100.1,G,"i",X)) Q:X="" S @X=^(X)
Q
PUTGAM S X="" F Z=0:0 S X=$O(^C1GADV(71100.1,G,"i",X)) Q:X="" S ^(X)=@X
W !!,"This adventure saved with name ",G,"." Q
GETIN D KBD S W1=$P(W," ",1),W2=$P(W," ",2),U1=$E($P(SAVE," ",1),1,5),U2=$E($P(SAVE," ",2),1,5) K SAVE 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
50 changes: 25 additions & 25 deletions C1GADV2.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ADV2 ;ADVENTURE. FLH, DJW/WV ; 07 FEB 83 12:39 PM
;;1.0;C1GAMES;****;March 1, 2016
C1GADV2 ;ADVENTURE. FLH, DJW/WV ; 07 FEB 83 12:39 PM
;;1.0;C1GAMES;****;March 1, 2016;
;FLH ; 07 FEB 83 12:39 PM
; DJW/WV ;March 1, 2016
NEWLP I CLOSNG,LNEW,LNEW<9 S LNEW=LP,M=130 D SPK S:'PANIC CLK2=15,PANIC=1
S CONDLP=^ADV(LP,"c") I LNEW-LP,$E(CONDLP,1,2)="00" F DW=1:1:5 I DSEEN(DW),LD1(DW)=LNEW S LNEW=LP,M=2 D SPK Q
S LP=LNEW I LP S CONDLP=^ADV(LP,"c") I $E(CONDLP,1,2)="00" D @$S(DFLAG=0:"DW1",DFLAG=1:"DW2",1:"DW3")
SHOW G:'LP DEAD^ADV8
S DARK=0,L=^ADVG(G,"LAMP","L") I L'<0!'LIT,L-LP!'LIT,'$E(CONDLP,3) S DARK=1
D SHOWL G:'LP DEAD^ADV8 I $E(CONDLP) S WD1="FORCED",WD1X=^ADV(WD1) G TRAVEL^ADV3
S CONDLP=^C1GADV(71100,LP,"c") I LNEW-LP,$E(CONDLP,1,2)="00" F DW=1:1:5 I DSEEN(DW),LD1(DW)=LNEW S LNEW=LP,M=2 D SPK Q
S LP=LNEW I LP S CONDLP=^C1GADV(71100,LP,"c") I $E(CONDLP,1,2)="00" D @$S(DFLAG=0:"DW1",DFLAG=1:"DW2",1:"DW3")
SHOW G:'LP DEAD^C1GADV8
S DARK=0,L=^C1GADV(71100.1,G,"LAMP","L") I L'<0!'LIT,L-LP!'LIT,'$E(CONDLP,3) S DARK=1
D SHOWL G:'LP DEAD^C1GADV8 I $E(CONDLP) S WD1="FORCED",WD1X=^C1GADV(71100,WD1) G TRAVEL^C1GADV3
I LP=33,'CLOSNG,$R(10000)<2500 S M=8 D SPK
I 'DARK S X=^ADVG(G,LP,"O") F J=2:1:$L(X,"/")-1 S O=$P(X,"/",J) D SHOWO
S M=0 G TURN^ADV3
I 'DARK S X=^C1GADV(71100.1,G,LP,"O") F J=2:1:$L(X,"/")-1 S O=$P(X,"/",J) D SHOWO
S M=0 G TURN^C1GADV3
DW1 S:LP>14 DFLAG=1 Q
DW2 I LP>14,$R(10000)<500 D DW2A,DW2B S DFLAG=2,M=3,O="AXE",L=LP D SPK,DROP
Q
Expand All @@ -27,43 +27,43 @@ I LD(6) S K="p",DW=6 D DMOV,PIRAT:DSEEN(DW)
I STICK>1 W:S ! W !,STICK," of them get you!!"
E S M=M+STICK D SPK Q:'STICK
S LP2=LP,LP=0 Q
DMOV S Y=^ADV(LD(DW),K),N=0 F I=2:1:Y+1 S L=$P(Y,"/",I) I L-LD1(DW) S LL(N)=L,N=N+1
DMOV S Y=^C1GADV(71100,LD(DW),K),N=0 F I=2:1:Y+1 S L=$P(Y,"/",I) I L-LD1(DW) S LL(N)=L,N=N+1
S L=$S(N:LL($R(10000)*N\10000),1:LD1(DW)),LD1(DW)=LD(DW),LD(DW)=L K I,L,LL,N,Y
S DSEEN(DW)=DSEEN(DW)&(LP>14)!(LD(DW)=LP)!(LD1(DW)=LP) S:DSEEN(DW) LD(DW)=LP Q
DWARF S ND=ND+1 I LD(DW)=LD1(DW) S ATTACK=ATTACK+1 S:KNFL'<0 KNFL=LP S:$R(10000)<(DFLAG-2*950) STICK=STICK+1
Q
PIRAT Q:LP=114!(^ADVG(G,"CHEST","P")'<0) S F=0
F J=2:1:16 S O=$P(TR,"/",J) D PI1 E S L=^ADVG(G,O,"L") G:L<0 STEAL S:L=LP F=1
I TALLY2+1=TALLY,'F,^ADVG(G,"CHEST","L")=0 S L=^ADVG(G,"LAMP","L") I L<0!(L=LP),LIT G ST2
PIRAT Q:LP=114!(^C1GADV(71100.1,G,"CHEST","P")'<0) S F=0
F J=2:1:16 S O=$P(TR,"/",J) D PI1 E S L=^C1GADV(71100.1,G,O,"L") G:L<0 STEAL S:L=LP F=1
I TALLY2+1=TALLY,'F,^C1GADV(71100.1,G,"CHEST","L")=0 S L=^C1GADV(71100.1,G,"LAMP","L") I L<0!(L=LP),LIT G ST2
I LD(6)-LD1(6),$R(10000)<2000 S M=127 D SPK
Q
PI1 I O="PLATI",LP=100!(LP=101)
Q
STEAL S M=128 D SPK I ^ADVG(G,"MESSA","L")=0 S O="CHEST",L=114 D MOVE
STEAL S M=128 D SPK I ^C1GADV(71100.1,G,"MESSA","L")=0 S O="CHEST",L=114 D MOVE
S O="MESSA",L=140 D MOVE
F J=2:1:16 S O=$P(TR,"/",J) D PI1 E S L=LP D:L=^ADVG(G,O,"L")&'^("F") CARRY I TOTING[("/"_O_"/") S L=114 D DROP
F J=2:1:16 S O=$P(TR,"/",J) D PI1 E S L=LP D:L=^C1GADV(71100.1,G,O,"L")&'^("F") CARRY I TOTING[("/"_O_"/") S L=114 D DROP
G ST3
ST2 S M=186 D SPK S O="CHEST",L=114 D MOVE S O="MESSA",L=140 D MOVE
ST3 S (LD(6),LD1(6))=114,DSEEN(6)=0 Q
SHOWL I DARK,'$E(CONDLP),WZDARK,$R(10000)<3500 S M=23,LP2=LP,LP=0 D SPK Q
I TOTING["/BEAR/" S M=141 D SPK
I DARK S M=16 D SPK Q
S J=^ADVG(G,LP,"A"),^("A")=J+1#ABB,X=^ADV(LP,0) I J,X["/" W:S ! W !,$P(X,"/",2) Q
S J=^C1GADV(71100.1,G,LP,"A"),^("A")=J+1#ABB,X=^C1GADV(71100,LP,0) I J,X["/" W:S ! W !,$P(X,"/",2) Q
I X W:S ! F I=1:1:X W !,^(I)
Q
SHOWO I O="STEPS",TOTING["/GOLD/" Q
S P=^ADVG(G,O,"P") I P<0 Q:CLOSED S (^("P"),P)=O="RUG"!(O="CHAIN"),TALLY=TALLY-1 I TALLY,TALLY=TALLY2,LIMIT>35 S LIMIT=35
I O="STEPS",LP=^ADVG(G,O,"F") S P=1
S P=^C1GADV(71100.1,G,O,"P") I P<0 Q:CLOSED S (^("P"),P)=O="RUG"!(O="CHAIN"),TALLY=TALLY-1 I TALLY,TALLY=TALLY2,LIMIT>35 S LIMIT=35
I O="STEPS",LP=^C1GADV(71100.1,G,O,"F") S P=1
D PSPK Q
SPK W:S ! F I=1:1:^ADV("t",M,0) W !,^(I)
SPK W:S ! F I=1:1:^C1GADV(71100,"t",M,0) W !,^(I)
K I Q
PSPK S N=^ADV(O,P,0) I N W:S ! F I=.1:.1:N W !,^(I)
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 ^ADVG(G,O,"L")=L
DR1 I L>0 S ^("O")="/"_O_^ADVG(G,L,"O")
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 ^ADVG(G,O,"L")=-1,HOLDNG=HOLDNG+1,TOTING="/"_O_TOTING
CARRYF S Y=^ADVG(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
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=^ADVG(G,O,"L") D:L>0 CARRY S L=MOL D DROP Q
MOVE S MOL=L,L=^C1GADV(71100.1,G,O,"L") D:L>0 CARRY S L=MOL D DROP Q
48 changes: 24 additions & 24 deletions C1GADV3.m
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
ADV3 ;ADVENTURE. FLH, DJW/WV ; 27 JAN 83 12:32 PM
;;1.0;C1GAMES;****;March 1, 2016
C1GADV3 ;ADVENTURE. FLH, DJW/WV ; 27 JAN 83 12:32 PM
;;1.0;C1GAMES;****;March 1, 2016;
;ADVENTURE. FLH ; 27 JAN 83 12:32 PM
;PRX;24Apr89 18:52;Copyright (c) 1989 PRx, Inc.
; DJW/WV ;March 1, 2016
TURN S (VERB,OBJ)="" D:M SPK
TU1 F J=4:1:9 I 'HINTED(J) S HINTLC(J)=$S($E(CONDLP,5)=J:HINTLC(J)+1,1:0) I HINTLC(J)'<HINTH(J) D HINT^ADV9
I CLOSED,TOTING["/OYSTE/" S O="OYSTE",P=1 I ^ADVG(G,O,"P")<0 D PSPK
I CLOSED F J=2:1:HOLDNG+1 S O=$P(TOTING,"/",J),P=^ADVG(G,O,"P") I P<0 S ^("P")=-P-1
TU1 F J=4:1:9 I 'HINTED(J) S HINTLC(J)=$S($E(CONDLP,5)=J:HINTLC(J)+1,1:0) I HINTLC(J)'<HINTH(J) D HINT^C1GADV9
I CLOSED,TOTING["/OYSTE/" S O="OYSTE",P=1 I ^C1GADV(71100.1,G,O,"P")<0 D PSPK
I CLOSED F J=2:1:HOLDNG+1 S O=$P(TOTING,"/",J),P=^C1GADV(71100.1,G,O,"P") I P<0 S ^("P")=-P-1
S WZDARK=DARK I KNFL>0,KNFL-LP S KNFL=0
D GETIN
TU3 S FOOBAR=$S(FOOBAR>0:-FOOBAR,1:0),TURNS=TURNS+1,WD1=U1,WD2=U2,(WD1X,WD2X)=""
G1 I WD1?1.U.E,$D(^ADV(WD1)) S WD1X=^(WD1) I WD1X?1"0".E S WD1=$E(WD1X,2,99) G G1
G2 I WD2?1.U.E,$D(^ADV(WD2)) S WD2X=^(WD2) I WD2X?1"0".E S WD2=$E(WD2X,2,99) G G2
I TALLY=0,LP>14,LP-33 S CLK1=CLK1-1 I CLK1=0 D CLOSEUP^ADV8 G WD1
I CLK1<0 S CLK2=CLK2-1 I CLK2=0 D CLOSED^ADV8 G NEWLP^ADV2
S LIMIT=LIMIT-LIT I LIMIT<31 D LAMP^ADV8 I GAVEUP G SCORE^ADV8
G1 I WD1?1.U.E,$D(^C1GADV(71100,WD1)) S WD1X=^(WD1) I WD1X?1"0".E S WD1=$E(WD1X,2,99) G G1
G2 I WD2?1.U.E,$D(^C1GADV(71100,WD2)) S WD2X=^(WD2) I WD2X?1"0".E S WD2=$E(WD2X,2,99) G G2
I TALLY=0,LP>14,LP-33 S CLK1=CLK1-1 I CLK1=0 D CLOSEUP^C1GADV8 G WD1
I CLK1<0 S CLK2=CLK2-1 I CLK2=0 D CLOSED^C1GADV8 G NEWLP^C1GADV2
S LIMIT=LIMIT-LIT I LIMIT<31 D LAMP^C1GADV8 I GAVEUP G SCORE^C1GADV8
WD1 I WD1="ENTER",WD2="WATER"!(WD2="STREA") S M=$S($E(CONDLP,4)=1:70,1:43) G TURN
I WD1="WATER"!(WD1="OIL"),WD2="PLANT"!(WD2="DOOR") S WD2="POUR",WD2X=^ADV(WD2)
I WD1="WATER"!(WD1="OIL"),WD2="PLANT"!(WD2="DOOR") S WD2="POUR",WD2X=^C1GADV(71100,WD2)
G WD2A
WD2 S WD1=WD2,W1=W2,U1=U2,WD1X=WD2X,(WD2,W2,U2,WD2X)=""
WD2A I WD1X="" S I=$R(10000),M=$S(I<2000:13,I<3600:61,1:60) G TURN
I U1="WEST",$R(10000)<2000 S M=17 D SPK
G @$P("TRAVEL/OBJECT/ACTION/SPEC","/",$E(WD1X))
TRAVEL S LNEW=LP,MOV=WD1,MOX=$E(WD1X,2,99) I MOX?3U.E D @MOX G NEWLP^ADV2
TRAVEL S LNEW=LP,MOV=WD1,MOX=$E(WD1X,2,99) I MOX?3U.E D @MOX G NEWLP^C1GADV2
S LP2=LP1,LP1=LP
TR1 I $D(^ADV(LP,MOV,0)) F J=1:1:^(0) S Y=^ADV(LP,MOV,J) X $P(Y,"\",1) I S RET="NEWLP^ADV2" D @$P(Y,"\",2) G @RET
S M=$S(VERB="FIND"!(VERB="INVEN"):59,MOX:MOX,1:12) D SPK G NEWLP^ADV2
TR1 I $D(^C1GADV(71100,LP,MOV,0)) F J=1:1:^(0) S Y=^C1GADV(71100,LP,MOV,J) X $P(Y,"\",1) I S RET="NEWLP^C1GADV2" D @$P(Y,"\",2) G @RET
S M=$S(VERB="FIND"!(VERB="INVEN"):59,MOX:MOX,1:12) D SPK G NEWLP^C1GADV2
TR2 S LNEW=$P(Y,"\",3) Q
TR3 S M=$P(Y,"\",3) D SPK Q
OBJECT S (O,OBJ)=WD1 D HERE E I ^ADVG(G,O,"F")-LP G OBJ2
OBJECT S (O,OBJ)=WD1 D HERE E I ^C1GADV(71100.1,G,O,"F")-LP G OBJ2
OBJ1 G WD2:WD2]"",ACT1:VERB]"" W:S ! W !,"What do you want to do with the ",W1,"?" G TU1
OBJ2 I OBJ="GRATE" S OBJ=$S(LP=1!(LP=4)!(LP=7):"DEPRE",LP>9&(LP<15):"ENTRA",1:OBJ) I OBJ'="GRATE" S WD1=OBJ,WD1X=^ADV(OBJ) G TRAVEL
OBJ2 I OBJ="GRATE" S OBJ=$S(LP=1!(LP=4)!(LP=7):"DEPRE",LP>9&(LP<15):"ENTRA",1:OBJ) I OBJ'="GRATE" S WD1=OBJ,WD1X=^C1GADV(71100,OBJ) G TRAVEL
I OBJ="DWARF",DFLAG>1 F DW=1:1:5 I LD(DW)=LP G OBJ1
I OBJ=$P("WATER/OIL","/",$E(CONDLP,4)) G OBJ1
D LIQ I O=OBJ S O="BOTTL" D HERE I G OBJ1
I OBJ="PLANT" S O="PLANT2" D AT I I ^ADVG(G,O,"P")=0 S OBJ=O G OBJ1
I OBJ="PLANT" S O="PLANT2" D AT I I ^C1GADV(71100.1,G,O,"P")=0 S OBJ=O G OBJ1
I OBJ="ROD" S O="ROD2" D HERE I S OBJ=O G OBJ1
I OBJ="KNIFE",KNFL=LP S KNFL=-1,M=116 G TURN
I OBJ="BRIEF" S:WD2="" WD2="ON",WD2X=^ADV("ON") G OBJ1
I OBJ="BRIEF" S:WD2="" WD2="ON",WD2X=^C1GADV(71100,"ON") G OBJ1
OBNONE I WD2="",VERB="FIND"!(VERB="INVEN") G OBJ1
W:S ! W !,"I don't see any ",W1,"." S M=0 G TURN
ACTION S VERB=WD1,VBX=WD1X I VERB="SAY" S OBJ=WD2
Expand All @@ -47,16 +47,16 @@ OBJECT S (O,OBJ)=WD1 D HERE E I ^ADVG(G,O,"F")-LP G OBJ2
SPEC S M=$E(WD1X,2,99) G TURN
GETIN D KBD
S W1=$P(W," ",1),W2=$P(W," ",2),U1=$E($P(SAVE," ",1),1,5),U2=$E($P(SAVE," ",2),1,5) K SAVE Q
KBD W:S ! R !,W:600 G:'$T TIMO^ADV
KBD W:S ! R !,W:600 G:'$T TIMO^C1GADV
I W="^"!(W="^Q") S W="QUIT" ;MSM;24Apr89
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:^ADV("t",M,0) W !,^(I)
SPK W:S ! F I=1:1:^C1GADV(71100,"t",M,0) W !,^(I)
K I Q
PSPK S N=^ADV(O,P,0) I N W:S ! F I=.1:.1:N W !,^(I)
PSPK S N=^C1GADV(71100,O,P,0) I N W:S ! F I=.1:.1:N W !,^(I)
K I,N Q
HERE S L=^ADVG(G,O,"L") I L<0!(L=LP)
HERE S L=^C1GADV(71100.1,G,O,"L") I L<0!(L=LP)
K L Q
AT I ^ADVG(G,O,"L")=LP!(^("F")=LP)
AT I ^C1GADV(71100.1,G,O,"L")=LP!(^("F")=LP)
Q
LIQ S O=^ADVG(G,"BOTTL","P") S:O<0 O=-1-O S O=$P("WATER//OIL","/",O+1) Q
LIQ S O=^C1GADV(71100.1,G,"BOTTL","P") S:O<0 O=-1-O S O=$P("WATER//OIL","/",O+1) Q
Loading

0 comments on commit da4061e

Please sign in to comment.