home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Games 2 the Maxx
/
pcgames.zip
/
pcgames
/
ADVENTUR
/
ADV350.ZIP
/
NEW1.FOR
< prev
next >
Wrap
Text File
|
1990-11-13
|
5KB
|
176 lines
SUBROUTINE NEW1(IRET)
C
INCLUDE 'ADVCOM.COM'
INCLUDE 'NEWCOM.COM'
INCLUDE 'FUNCT.H'
C
C FIGURE OUT THE NEW LOCATION
C
C GIVEN THE CURRENT LOCATION IN "LOC", AND A MOTION VERB NUMBER IN "K", PUT
C THE NEW LOCATINON IN "NEWLOC". THE CURRENT LOC IS SAVED IN "OLDLOC" IN CASE
C HE WANTS TO RETREAT. THE CURRENT OLDLOC IS SAVED IN OLDLC2, IN CASE HE
C DIES. (IF HE DOES, NEWLOC WILL BE LIMBO, AND OLDLOC WILL BE WHAT KILLED
C HIM, SO WE NEED OLDLC2, WHICH IS THE LAST PLACE HE WAS SAFE.)
8 KK=KEY(LOC)
NEWLOC=LOC
IF(KK.EQ.0) CALL BUG(26)
IF(K.EQ.NULL) GOTO 2
IF(K.EQ.BACK) GOTO 20
IF(K.EQ.LOOK) GOTO 30
IF(K.EQ.CAVE) GOTO 40
OLDLC2=OLDLOC
OLDLOC=LOC
9 LL=IABS(TRAVEL(KK))
IF(MOD(LL,1000).EQ.1.OR.MOD(LL,1000).EQ.K) GOTO 10
IF(TRAVEL(KK).LT.0) GOTO 50
KK=KK+1
GOTO 9
10 LL=LL/1000
11 NEWLOC=LL/1000
K=MOD(NEWLOC,100)
IF(NEWLOC.LE.300) GOTO 13
IF(PROP(K).NE.NEWLOC/100-3) GOTO 16
12 IF(TRAVEL(KK).LT.0) CALL BUG(25)
KK=KK+1
NEWLOC=IABS(TRAVEL(KK))/1000
IF(NEWLOC.EQ.LL) GOTO 12
LL=NEWLOC
GOTO 11
13 IF(NEWLOC.LE.100) GOTO 14
IF(TOTING(K).OR.(NEWLOC.GT.200.AND.AT(K))) GOTO 16
GOTO 12
14 IF(NEWLOC.NE.0.AND..NOT.PCT(NEWLOC)) GOTO 12
16 NEWLOC=MOD(LL,1000)
IF(NEWLOC.LE.300) GOTO 2
IF(NEWLOC.LE.500) GOTO 30000
CALL RSPEAK(NEWLOC-500)
NEWLOC=LOC
GOTO 2
C SPECIAL MOTIONS COME HERE. LABELLING CONVENTION: STATEMENT NUMBERS NNNXX
C (XX=00-99) ARE USED FOR SPECIAL CASE NUMBER NNN (NNN=301-500).
30000 NEWLOC=NEWLOC-300
GOTO (30100,30200,30300) NEWLOC
CALL BUG(20)
C TRAVEL 301. PLOVER-ALCOVE PASSAGE. CAN CARRY ONLY EMERALD. NOTE: TRAVEL
C TABLE MUST INCLUDE "USELESS" ENTRIES GOING THROUGH PASSAGE, WHICH CAN NEVER
C BE USED FOR ACTUAL MOTION, BUT CAN BE SPOTTED BY "GO BACK".
30100 NEWLOC=99+100-LOC
IF(HOLDNG.EQ.0.OR.(HOLDNG.EQ.1.AND.TOTING(EMRALD))) GOTO 2
NEWLOC=LOC
CALL RSPEAK(117)
GOTO 2
C TRAVEL 302. PLOVER TRANSPORT. DROP THE EMERALD (ONLY USE SPECIAL TRAVEL IF
C TOTING IT), SO HE'S FORCED TO USE THE PLOVER-PASSAGE TO GET IT OUT. HAVING
C DROPPED IT, GO BACK AND PRETEND HE WASN'T CARRYING IT AFTER ALL.
30200 CALL DROP(EMRALD,LOC)
GOTO 12
C TRAVEL 303. TROLL BRIDGE. MUST BE DONE ONLY AS SPECIAL MOTION SO THAT
C DWARVES WON'T WANDER ACROSS AND ENCOUNTER THE BEAR. (THEY WON'T FOLLOW THE
C PLAYER THERE BECAUSE THAT REGION IS FORBIDDEN TO THE PIRATE.) IF
C PROP(TROLL)=1, HE'S CROSSED SINCE PAYING, SO STEP OUT AND BLOCK HIM.
C (STANDARD TRAVEL ENTRIES CHECK FOR PROP(TROLL)=0.) SPECIAL STUFF FOR BEAR.
30300 IF(PROP(TROLL).NE.1) GOTO 30310
CALL PSPEAK(TROLL,1)
PROP(TROLL)=0
CALL MOVE(TROLL2,0)
CALL MOVE(TROLL2+100,0)
CALL MOVE(TROLL,PLAC(TROLL))
CALL MOVE(TROLL+100,FIXD(TROLL))
CALL JUGGLE(CHASM)
NEWLOC=LOC
GOTO 2
30310 NEWLOC=PLAC(TROLL)+FIXD(TROLL)-LOC
IF(PROP(TROLL).EQ.0) PROP(TROLL)=1
IF(.NOT.TOTING(BEAR)) GOTO 2
CALL RSPEAK(162)
PROP(CHASM)=1
PROP(TROLL)=2
CALL DROP(BEAR,NEWLOC)
FIXED(BEAR)=-1
PROP(BEAR)=3
IF(PROP(SPICES).LT.0) TALLY2=TALLY2+1
OLDLC2=NEWLOC
GOTO 99
C END OF SPECIALS
C HANDLE "GO BACK". LOOK FOR VERB WHICH GOES FROM LOC TO OLDLOC, OR TO OLDLC2
C IF OLDLOC HAS FORCED-MOTION. K2 SAVES ENTRY -> FORCED LOC -> PREVIOUS LOC.
20 K=OLDLOC
IF(FORCED(K)) K=OLDLC2
OLDLC2=OLDLOC
OLDLOC=LOC
K2=0
IF(K.NE.LOC) GOTO 21
CALL RSPEAK(91)
GOTO 2
21 LL=MOD((IABS(TRAVEL(KK))/1000),1000)
IF(LL.EQ.K) GOTO 25
IF(LL.GT.300) GOTO 22
J=KEY(LL)
IF(FORCED(LL).AND.MOD((IABS(TRAVEL(J))/1000),1000).EQ.K) K2=KK
22 IF(TRAVEL(KK).LT.0) GOTO 23
KK=KK+1
GOTO 21
23 KK=K2
IF(KK.NE.0) GOTO 25
CALL RSPEAK(140)
GOTO 2
25 K=MOD(IABS(TRAVEL(KK)),1000)
KK=KEY(LOC)
GOTO 9
C LOOK. CAN'T GIVE MORE DETAIL. PRETEND IT WASN'T DARK (THOUGH IT MAY "NOW"
C BE DARK) SO HE WON'T FALL INTO A PIT WHILE STARING INTO THE GLOOM.
30 IF(DETAIL.LT.3) CALL RSPEAK(15)
DETAIL=DETAIL+1
WZDARK=.FALSE.
ABB(LOC)=0
GOTO 2
C CAVE. DIFFERENT MESSAGES DEPENDING ON WHETHER ABOVE GROUND.
40 IF(LOC.LT.8) CALL RSPEAK(57)
IF(LOC.GE.8) CALL RSPEAK(58)
GOTO 2
C NON-APPLICABLE MOTION. VARIOUS MESSAGES DEPENDING ON WORD GIVEN.
50 SPK=12
IF(K.GE.43.AND.K.LE.50) SPK=9
IF(K.EQ.29.OR.K.EQ.30) SPK=9
IF(K.EQ.7.OR.K.EQ.36.OR.K.EQ.37) SPK=10
IF(K.EQ.11.OR.K.EQ.19) SPK=11
IF(VERB.EQ.FIND.OR.VERB.EQ.INVENT) SPK=59
IF(K.EQ.62.OR.K.EQ.65) SPK=42
IF(K.EQ.17) SPK=80
CALL RSPEAK(SPK)
C
2 CONTINUE
IRET=1
RETURN
C
99 CONTINUE
IRET=2
RETURN
END