games-request@tekred.TEK.COM (07/24/87)
Submitted by: "J.D. McDonald " <mcdonald@uxe.cso.uiuc.edu>
Comp.sources.games: Volume 1, Issue 103
Archive-name: world/Part04
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 4 (of 7)."
# Contents: Makefile data.dat motion.c variab.h
# Wrapped by billr@tekred on Thu Jul 23 17:17:58 1987
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f Makefile -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"Makefile\"
else
echo shar: Extracting \"Makefile\" \(1538 characters\)
sed "s/^X//" >Makefile <<'END_OF_Makefile'
X# Makefile for world and support programs for Unix
X#
X# The program has been tested and compiles and runs properly on the
X# following systems:
X#
X# 1) VAX/VMS Digital CC compiler. No particular tricks are needed.
X# 2) IBM PC-AT Xenix 1.00. It seems to be necessary to use the large
X# memory model, although I'm not sure why since it runs on the
X# same machine under DOS in the small model.
X# 3) IBM PC under Microsoft C version 4.00. It works in the default
X# small memory model if you compile with the -Os switch. Note
X# that on this setup you MUST link the main program World with
X# binmode.obj, provided by Microsoft, for it to work right.
X# Vtxtcn and vcnvrt must NOT be linked with binmode.obj.
X# This compiler generates a few harmless warning messages.
X# You may need to use EXEMOD to increase the stack size.
X# 4) VAX/4.3bsd Unix. No particular tricks needed.
X#
X# NOTE: Edit helper.c to adjust the pathname for q1text.dat for
X# your particular system.
X#
X
XWHEADERS = arrays.h variab.h
XWOBJS = demons.o helper.o motion.o parser.o verbs1.o verbs2.o world.o
XCFLAGS = -O
X
Xall: world
X
Xinstall: world
X cp world /usr/games/world
X cp q1text.dat /usr/games/lib/q1text.dat
X
Xconvert: vcnvrt vtxtcn vtext.dat
X @echo "creating data files..."
X ./vtxtcn
X ./vcnvrt
X touch convert
X
Xvtext.dat:
X cat vtext.dat.aa vtext.dat.ab vtext.dat.ac >vtext.dat
X
Xvcnvrt: vcnvrt.c
X cc $(CFLAGS) -o vcnvrt vcnvrt.c
X
Xvtxtcn: vtxtcn.c
X cc $(CFLAGS) -o vtxtcn vtxtcn.c
X
Xworld: convert $(WOBJS) $(WHEADERS)
X cc -s -o world $(WOBJS)
END_OF_Makefile
if test 1538 -ne `wc -c <Makefile`; then
echo shar: \"Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f data.dat -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"data.dat\"
else
echo shar: Extracting \"data.dat\" \(31769 characters\)
sed "s/^X//" >data.dat <<'END_OF_data.dat'
X*THIS IS THE DATA TABLE FOR THE GAME
X*A STAR IN THE FIRST COLUMN IS A COMMENT
X*THE FIRST SECTION IS THE TRAVEL TABLE
X*THE SECOND SECTION IS THE LOCATION DATA
X*THE THIRD SECTION IS THE DATA ON MOVEABLE OBJECTS
X*THE FOURTH SECTION IS THE DATA ON FIXED OBJECTS
X*THE SECTIONS ARE SEPARATED BY 9999 IN THE FIRST FOUR COLUMNS
X*THE TRAVEL TABLE WORKS AS FOLLOWS:
X* IT APPLIES ONLY TO "GO" OR TO WORDS WHICH TRANSLATE TO GO,
X* SUCH AS RUN. IT DOES NOT APPLY TO SWIM OR JUMP OR CRAWL OR STAND
X* OR SIT. THESE ARE HANDLED BY SPECIAL CODE.
X*AN ENTEY BEGINNING IN COLUMN TWO IS A "FROM" LOCATION,
X*WHICH MUST OCCUR IN ORDER.
X*THE NEXT ENTRY
X*MAY BE BLANK OR C FOR CAREFULLY, S FOR SLOWLY, OR Q FOR QUICKLY
X*THE NEXT ENTRY IS A DIRECTION: N,NW,E,...NW,U,D OR BLANK
X* THESE TWO ARE COMBINED IN THE TABLE IN THE FORM:
X* C*16+S*32+Q*64+DIR (WHERE 1<=DIR<=10)
X*THE NEXT ENTRY INDICATES WHAT TYPE OF CONDITION:
X*1) MEANS NEXT IS LOCATION;UNCONDITIONAL MOTION
X*2) MEANS NEXT IS A MESSAGE NUMBER; STAY WHERE HE IS
X*3) MEANS NEXT IS VARIABLE FOR COMPUTED GOTO
X*4) MEANS HE DIED. NEXT IS THE MESSAGE.
X*5) MEANS HE MUST BE DEAD, AND HAVE BEEN THERE BEFORE.
X*6) IS SAME AS 2 EXCEPT 512 IS ADDED TO MESSAGE NUMBER
X*7-15 ARE UNUSED
X*16-31) MEANS NEXT IS NEWLOC;GO WITH (NUMBER-15)*6 % CHANCE
X* THESE TWO ARE COMBINED IN THE FORM 512*(FIRST WORD)+SECOND WORD
X*EACH LOC AND DIRECTION MAY HAVE SEVERAL POSSIBILITIES; THEY
X*ARE TAKEN IN ORDER UNTIL SOMETHING SUCEEDS OR THE END IS REACHED,
X*IN WHICH CASE NOTHING AT ALL HAPPENS.
X*IF A DIRECTION IS MISSING, HE GETS A "YOU CAN'T POSSIBLY GO THERE"
X*MESSAGE
X*
X 1 D 2 30
X S 2 30
X U 1 2
X N 1 2
X 2 D 1 1
X S 1 1
X U 1 3
X N 1 3
X 3 D 1 4
X S 1 2
X N 1 4
X 4 S 2 31
X U 2 31
X D 2 32
X NW 1 5
X NE 1 18
X 5 SE 1 4
X N 1 19
X W 5 6
X W 2 47
X NW 2 61
X SW 2 61
X 6 S 1 7
X E 5 5
X E 2 47
X 7 N 1 8
X S 1 6
X E 1 10
X W 1 7
X 8 N 1 11
X S 28 9
X S 1 12
X E 1 7
X W 22 9
X W 1 12
X 9 N 1 10
X S 1 12
X E 1 11
X W 24 9
X W 1 8
X 10 N 1 7
X S 1 10
X E 1 9
X W 1 15
X 11 N 1 9
X S 1 12
X E 1 8
X W 1 11
X 12 D 1 11
X E 1 9
X U 3 1
X U 2 33
X 13 D C 1 12
X D 24 12
X D 4 37
X U C 1 14
X U 24 14
X U 4 37
X 14 D C 1 13
X D 20 13
X D 4 37
X U 2 34
X 15 S 1 10
X N 5 17
X N 2 47
X 16 N 2 47
X S 5 6
X S 2 47
X E 2 47
X W 5 15
X W 2 47
X NE 2 47
X SE 2 47
X NW 2 47
X SW 2 47
X 17 N 1 57
X E 1 19
X S 5 15
X S 2 47
X 18 SW 1 4
X NE 1 22
X 19 NE C 1 21
X NE 5 21
X NE 20 21
X NE 4 38
X W 23 17
X W 2 36
X SW 20 17
X SW 25 5
X SW 2 36
X S 24 5
X S 2 36
X 20 W 1 57
X E 1 22
X U 1 52
X 21 SW C 1 19
X SW 5 19
X SW 20 19
X SW 4 38
X E 1 26
X 22 N 1 20
X S 1 18
X E 1 23
X 23 E 1 24
X W 1 22
X 24 W 1 23
X E 3 2
X E 2 118
X 25 W 1 24
X E 1 98
X 26 SW 1 21
X NE Q 1 27
X NE 5 27
X NE 2 130
X 27 SW Q 1 26
X SW 5 26
X SW 2 130
X NE 1 46
X E 1 28
X 28 W 1 27
X NE 1 29
X SE 1 30
X 29 W 1 28
X E 1 37
X S 1 31
X N 1 45
X 30 W 1 28
X E 1 31
X S 3 3
X S 2 129
X 31 N 1 29
X W 1 30
X NE 1 32
X 32 SW 1 31
X N 1 37
X SE 1 33
X E 1 38
X NE 1 38
X 33 NW 1 32
X NE 1 34
X N 1 38
X 34 SW 1 33
X N 1 35
X W 1 38
X NW 1 38
X 35 S 1 34
X NW 1 36
X N 1 39
X W 1 38
X SW 1 38
X 36 SW 1 37
X SE 1 35
X S 1 38
X 37 W 1 29
X S 1 32
X NE 1 36
X E 1 38
X SE 1 38
X 38 N 5 36
X N 2 131
X NE 5 35
X NE 2 131
X E 5 35
X E 2 131
X SE 5 34
X SE 2 131
X S 5 33
X S 2 131
X SW 5 32
X SW 2 131
X W 5 37
X W 2 131
X NW 5 37
X NW 2 131
X U 5 35
X U 2 131
X 39 S 1 35
X W 1 40
X 40 E 1 39
X NW 1 41
X 41 SE 1 40
X SW 1 44
X D 3 4
X D 2 132
X 42 N 1 30
X 43 W 1 47
X E 1 45
X NE 1 44
X 44 S 1 45
X SW 1 43
X NE 1 41
X NW 1 50
X 45 N 1 44
X S 1 29
X W 1 43
X 46 SW 1 27
X N 1 47
X 47 S 1 46
X E 1 43
X NW 1 48
X N 3 5
X N 2 239
X 48 U 2 133
X SE 1 47
X 49 D 1 48
X 50 SE 1 44
X N Q 1 86
X N 5 86
X N 2 130
X 51 S 3 5
X S 2 239
X 52 D 1 20
X E 1 53
X W 1 54
X 53 W 1 52
X 54 E 1 52
X U 1 55
X 55 U 1 56
X D 1 54
X 56 D 1 55
X 57 E 1 20
X S 1 17
X NW 1 58
X 58 SE 1 57
X NW 1 62
X D 1 59
X 59 U 1 58
X NE 1 58
X SW 1 60
X 60 NE 1 59
X S 1 61
X 61 N 1 60
X 62 S 1 58
X N Q 1 63
X N 5 63
X N 2 130
X W 2 246
X 63 N 1 64
X S Q 1 62
X S 5 62
X S 2 130
X 64 S 1 63
X N 1 65
X 65 S 1 64
X N 1 67
X U 1 66
X 66 D 1 65
X 67 S 1 65
X N 1 68
X 68 S 1 67
X W 3 13
X W 2 246
X N 1 69
X E 1 71
X 69 S 1 68
X E 1 73
X 70 N 1 74
X W 1 73
X S 1 71
X E 1 78
X 71 N 1 70
X S 1 72
X E 1 81
X W 1 68
X 72 N 1 71
X S 1 83
X 73 W 1 69
X E 1 70
X D 3 7
X D 2 260
X 74 S 5 73
X S 3 6
X S 2 259
X 75 D 1 77
X E 1 76
X 76 W 1 75
X D 3 8
X D 5 79
X D 4 261
X 77 U 1 75
X D 1 78
X 78 U 1 77
X W 1 70
X E 1 79
X 79 U 2 262
X W 1 78
X 80 U 2 263
X D 1 79
X 81 W 1 71
X N 1 82
X E 1 89
X 82 S 1 81
X N 3 15
X N 5 151
X N 2 440
X U 3 15
X U 5 151
X U 2 440
X 83 N 1 72
X D 1 84
X 84 U 1 83
X D 1 85
X E 1 86
X 85 U 1 84
X S 3 9
X S 2 272
X 86 W 1 84
X S Q 1 50
X S 5 50
X S 2 130
X N 1 87
X 87 S 1 86
X N 3 10
X N 2 264
X 88 S 3 10
X S 2 264
X 89 W 1 81
X E 2 265
X 90 E 1 68
X N 1 91
X S 1 95
X 91 S 1 90
X W 1 92
X 92 E 1 91
X SW 1 93
X 93 NE 1 92
X SE 1 94
X 94 NW 1 93
X E 1 95
X 95 W 1 94
X N 1 90
X 96 D 4 266
X E 5 102
X E 4 266
X U 5 73
X U 2 267
X 97 U 5 96
X 98 W 1 25
X N 3 14
X N 2 281
X SE 1 117
X 99 S 1 108
X 100 U 1 115
X 101 N 1 107
X E 1 116
X W 1 108
X D 1 103
X 102 S 1 96
X W 1 102
X SE 1 107
X U 1 112
X 103 E 1 104
X D 1 116
X 104 N 1 103
X NW 1 105
X U 1 107
X 105 S 1 114
X SE 1 104
X NW 1 110
X 106 S 1 108
X W 1 106
X U 1 116
X 107 NE 1 106
X NW 1 101
X U 1 102
X 108 N 1 99
X W 1 101
X NW 1 116
X 109 S 1 102
X U 1 116
X D 1 104
X 110 W 1 111
X NE 1 117
X D 1 110
X 111 N 1 103
X E 1 110
X SE 1 112
X 112 S 1 113
X NW 1 111
X U 1 112
X 113 N 1 112
X SE 1 114
X SW 1 130
X 114 S 1 105
X U 1 115
X D 1 114
X 115 N 1 116
X W 1 114
X D 1 100
X 116 S 1 104
X NE 1 101
X U 1 109
X 117 NW 1 98
X N 1 118
X E 1 101
X 118 S 1 117
X N 1 119
X NE 1 129
X 119 S 1 118
X E 1 120
X NW 1 119
X SW 1 119
X 120 S 1 119
X E 1 130
X D 1 121
X 121 U 1 120
X D 1 122
X SE 1 122
X 122 W 1 121
X U 1 121
X 123 U 5 121
X U 2 269
X SE 1 124
X S 1 125
X SW 1 126
X 124 NW 1 123
X 125 N 1 123
X 126 NE 1 123
X D 1 127
X U 1 128
X 127 U 2 270
X 128 U 2 271
X D 1 129
X 129 SW 1 118
X U 2 271
X 130 N 1 132
X NE 1 113
X SE 1 131
X W 1 120
X 131 NW 1 130
X 132 S 1 130
X 133 W 1 139
X S 1 134
X E 1 135
X 134 N 1 133
X 135 W 1 133
X E 3 11
X E 2 272
X 136 N 3 12
X N 2 272
X S 1 137
X 137 N 1 136
X S 1 138
X W 1 143
X E 1 147
X 138 N 1 137
X S 1 139
X W 1 144
X E 1 148
X 139 N 1 138
X E 1 133
X S 1 140
X 140 N 1 139
X S 1 141
X W 1 145
X E 1 149
X 141 N 1 140
X S 1 142
X W 1 146
X E 1 150
X 142 N 1 141
X S 5 98
X S 3 14
X S 2 281
X 143 E 1 137
X 144 E 1 138
X 145 E 1 140
X 146 E 1 141
X 147 W 1 137
X 148 W 1 138
X 149 W 1 140
X 150 W 1 141
X 151 D 1 82
X N 1 152
X 152 S 1 151
X 153 D 1 154
X 154 U 1 153
X N 1 155
X NE 1 156
X E 1 157
X SE 1 158
X S 1 159
X SW 1 160
X W 1 161
X NW 1 162
X 155 S 1 154
X E 1 156
X SE 1 157
X SW 1 161
X W 1 162
X N 1 163
X 156 W 1 155
X SW 1 154
X S 1 157
X 157 N 1 156
X NW 1 155
X W 1 154
X SW 1 159
X S 1 158
X E 1 167
X 158 N 1 157
X NW 1 154
X W 1 159
X 159 NE 1 157
X E 1 158
X N 1 154
X NW 1 161
X W 1 160
X S 1 172
X 160 E 1 159
X NE 1 154
X N 1 161
X 161 SE 1 159
X E 1 154
X S 1 160
X NE 1 155
X N 1 162
X W 1 164
X 162 S 1 161
X SE 1 154
X E 1 155
X 163 S 1 155
X W 1 165
X 164 E 1 161
X N 1 165
X 165 E 1 163
X S 1 164
X NW 3 16
X NW 2 239
X 166 SE 3 16
X SE 2 239
X 167 W 1 157
X E 1 168
X S 1 169
X 168 W 1 167
X 169 N 1 167
X E 1 171
X S 3 18
X S 2 58
X 170 N 1 169
X W 1 174
X 171 W 1 169
X E 4 498
X S 4 498
X N 4 498
X 172 N 1 159
X S 1 173
X 173 S 2 239
X N 1 172
X 174 N 2 239
X S 3 17
X S 2 239
X E 1 170
X 175 N 3 17
X N 2 239
X 176 N 2 272
X 177 N 2 272
X 178 N 2 272
X 179 N 2 272
X 180 N 2 272
X 181 N 3 17
X N 2 239
X 182 S 1 181
X N 1 183
X 183 S 1 182
X 184 N 3 17
X N 2 239
X 185 N 1 186
X S 1 184
X 186 S 1 185
X 187 N 3 17
X N 2 239
X 188 S 1 187
X N 1 189
X 189 S 1 188
X N 2 499
X W 1 190
X 190 E 2 499
X 9999
X*LOCATION DATA
X*BITS ARE: 1)LIGHT ALWAYS
X* 2)DARK ALWAYS (NEEDS LAMP)
X* 4)HAS LIGHTS
X* 8)OUTDOORS
X* 16)LIGHTS ARE ON
X* 32)ADVENTURER CAN ENTER ROOM
X* 64,128,256,512)OTHER PLAYES CAN ENTER
X* 1024)THERE IS WATER HERE
X* 2048)THERE ARE OAKS HERE
X* 16384)HAS BEEN VISITED
X 0001 16424
X 0002 40
X 0003 40
X 0004 2088
X 0005 3112
X 0006 3112
X 0007 2088
X 0008 2088
X 0009 2088
X 0010 2088
X 0011 2088
X 0012 2088
X 0013 40
X 0014 40
X 0015 3112
X 0016 3112
X 0017 3112
X 0018 40
X 0019 2088
X 0020 1064
X 0021 40
X 0022 1064
X 0023 1064
X 0024 1064
X 0025 33
X 0026 40
X 0027 40
X 0028 40
X 0029 40
X 0030 40
X 0031 40
X 0032 40
X 0033 40
X 0034 40
X 0035 40
X 0036 40
X 0037 40
X 0038 40
X 0039 40
X 0040 40
X 0041 40
X 0042 40
X 0043 40
X 0044 40
X 0045 40
X 0046 40
X 0047 40
X 0048 40
X 0049 40
X 0050 40
X 0051 33
X 0052 40
X 0053 40
X 0054 40
X 0055 40
X 0056 40
X 0057 3112
X 0058 1064
X 0059 1064
X 0060 1064
X 0061 1064
X 0062 40
X 0063 40
X 0064 40
X 0065 104
X 0066 40
X 0067 104
X 0068 104
X 0069 104
X 0070 104
X 0071 104
X 0072 104
X 0073 40
X 0074 104
X 0075 40
X 0076 40
X 0077 40
X 0078 104
X 0079 40
X 0080 40
X 0081 40
X 0082 40
X 0083 40
X 0084 33
X 0085 33
X 0086 40
X 0087 40
X 0088 40
X 0089 40
X 0090 65
X 0091 65
X 0092 65
X 0093 65
X 0094 65
X 0095 65
X 0096 34
X 0097 34
X 0098 33
X 0099 33
X 0100 33
X 0101 34
X 0102 34
X 0103 34
X 0104 34
X 0105 34
X 0106 34
X 0107 34
X 0108 34
X 0109 34
X 0110 34
X 0111 34
X 0112 34
X 0113 34
X 0114 34
X 0115 34
X 0116 34
X 0117 34
X 0118 34
X 0119 34
X 0120 34
X 0121 34
X 0122 1062
X 0123 1062
X 0124 1062
X 0125 1062
X 0126 1062
X 0127 1062
X 0128 34
X 0129 34
X 0130 34
X 0131 33
X 0132 33
X 0133 33
X 0134 33
X 0135 33
X 0136 33
X 0137 33
X 0138 33
X 0139 33
X 0140 33
X 0141 33
X 0142 33
X 0143 1076
X 0144 36
X 0145 36
X 0146 33
X 0147 36
X 0148 36
X 0149 52
X 0150 36
X 0151 40
X 0152 40
X 0153 33
X 0154 33
X 0155 33
X 0156 33
X 0157 33
X 0158 33
X 0159 33
X 0160 33
X 0161 33
X 0162 33
X 0163 33
X 0164 33
X 0165 33
X 0166 33
X 0167 33
X 0168 33
X 0169 33
X 0170 33
X 0171 33
X 0172 33
X 0173 33
X 0174 33
X 0175 33
X 0176 33
X 0177 33
X 0178 33
X 0179 33
X 0180 33
X 0181 33
X 0182 33
X 0183 1057
X 0184 33
X 0185 33
X 0186 33
X 0187 33
X 0188 33
X 0189 33
X 0190 33
X 9999
X*THE PROPERTIES OF OBJECTS IS DESCRIBED HERE
X*THE PROPERTIES OF ALL MOVEABLE OBJECTS IS DESCRIBED BEFORE
X*THOSE OF FIXED OBJECTS.
X*THE PROPERTIES ARE:
X*1) THE NOUN
X*2) THE ADJECTIVE, MINUS IF OPTIONAL
X*3) WEIGHT*256+SIZE IF MOVEABLE LOCATION IF FIXED
X* THE ITEMS ABOVE AND BELOW ARE SPLIT IN TWO ON THE CHART
X*4) VALUE*4096+LOCATION FOR ALL POINTS (FLOC) IF MOVEABLE
X* A LOCATION >=4000 IMPLIES THAT CREDIT IS GIVEN IF THE
X* LOCATION OF THE OBJECT IN NOT LOCATION-4000
X* ;LOCAT #2 IF FIXED
X*5) FIXED ("PURE") PROPERTY WORD. BITS ARE:
X* 1)CAN BE CLOSED (I.E. PPRP)
X* 2)DRINKABLE
X* 4)FOOD
X* 8)POISON
X* 16)READABLE
X* 32)SENTIENT
X* 64)WEARABLE
X* 128)OPAQUE
X* 256)PLURAL
X* 512)LOCKABLE
X* 2048*M 0<M<16 CONTAINER VALUE (I.E.CVAL)
X*6) VARIABLE ("IMPURE") PROPERTY WORD (I.E. IMPRP)
X* 1)HAS BEEN SEEN (I.E. IF PREVIOUSLY HIDDEN)
X* 2)CURRENTLY CLOSED
X* 4)CURRENTLY LOCKED
X* +8*(INDEX TO DESCRIPTORS)+ 64*(RESPONSE TO EXAMINE OR READ)
X* +512*(CONTAINER DESCRIPTION, E.G. THE BOTTLE IS EMPTY)
X* +4096*(CURRENT SPECIAL PROPERTY)
X* SPECIAL PROPERTY 1 MEANS INCREMENT
X* INDEX TO DESCRIPTORS WHEN TAKEN
X*7) PRESENT ONLY FOR MOVEABLE OBJECTS, THE LOCATION (ILOC)
X* ZERO MEANS NONEXISTENT
X* 1 TO 500 MEANS A PLACE NUMBER
X* 1000 IS CARRIED BY ADVENTURER
X* 1001 IS CARRIED BY FIRST MOVEABLE BEING
X* 1002 IS CARRIED BY SECOND BEING ET.
X* 2001 MEANS INSIDE OBJECT NUMBER 1
X* 2002 MEANS INSIDE OBJECT NUMBER 2
X* 6001 MEANS INSIDE fixed OBJECT NUMBER 1
X*NUM NOUN ADJ WT SIZE VAL FLOC PPRP IMPRP ILOC CVAL PARAM
X 0001 KEY -CHROME 1 1 2 4014 64 4105 14 0 CKEY
X 0002 SAPPHI -BLUE 1 1 1 1000 64 4105 18 0 BSAPPH
X 0003 FISH COLORF 2 2 3 2015 8 4297 16 0 CFISH
X 0004 FISH DEAD 2 2 1 2015 8 0 0 0 DFISH
X 0005 KNAPSA 0 20 100 0 1000 192 1673 3000 15 ZKNAPS
X 0006 SHIRT RED 3 4 0 0 64 9 3000 0 RSHIRT
X 0007 SHIRT GREEN 3 4 0 0 64 9 2005 0 GSHIRT
X 0008 BOOTS -HEAVY 20 5 0 0 320 137 3000 0 HBOOTS
X 0009 SHOES -CANVAS 10 5 0 0 320 137 2005 0 CSHOES
X 0010 PANTS BLUE 3 4 0 0 320 9 3000 0 LPANT
X 0011 PANTS BROWN 3 4 0 0 320 9 2005 0 RPANT
X 0012 NET -BUTTER 1 3 0 0 0 1033 2005 2 BNET
X 0013 TUBE -PLASTI 1 2 0 0 24 137 2005 0 BREPEL
X 0014 CAMERA -INSTAN 6 4 0 0 0 137 2005 0 ICAMER
X 0015 BAG -PLASTI 1 3 0 0 0 1673 2005 2 PLBAG
X 0016 FOSSIL -CRABLI 10 5 1 1000 64 4105 56 0 CFOSSI
X 0017 PHOTOG PTEROD 1 2 1 1000 0 137 0 0 PPHOTO
X 0018 PHOTOG MARTIA 1 2 1 1000 0 137 0 0 MPHOTO
X 0019 DIAMON -HUGE 6 5 2 1000 0 9 49 0 ZDIAMO
X 0020 PUCK -HOCKEY 10 3 2 1000 0 137 38 0 HPUCK
X 0021 BOULDE -RED 100 101 0 0 0 4097 27 0 RBOULD
X 0022 MOSS -GREEN 2 5 0 0 0 4225 19 0 GMOSS
X 0023 GLASS -GLASS 10 101 1 4000 0 137 0 0 PGLASS
X 0024 WIRE -WIRE 5 3 0 0 16 137 88 0 ZWIRE
X 0025 SPHERE -GLOWIN 14 4 2 4051 0 137 51 0 GSPHER
X 0026 LATEX -GOOEY 6 6 0 0 12 4361 66 0 ZLATEX
X 0027 CABLE BROKEN 2 2 0 0 0 4225 6023 0 DCABLE
X 0028 CABLE GOOD 2 2 0 0 0 137 148 0 GCABLE
X 0029 ORCHID 0 1 2 1 1000 0 4297 70 0 ZORCHI
X 0030 FLYTRA -VENUS 1 2 1 1000 0 4297 72 0 ZFLYTR
X 0031 CASSET -HUGE 2 9 0 0 0 137 149 0 ZCASSE
X 0032 PHOTOG OVEREX 1 2 0 0 0 137 0 0 OPHOTO
X 0033 TOMATO 0 2 4 0 0 12 137 73 0 ZTOMAT
X 0034 LETTUC 0 2 4 0 0 4 137 73 0 ZLETTU
X 0035 CABBAG 0 2 3 0 0 4 137 73 0 ZCABBA
X 0036 STRAWB 0 2 2 0 0 4 137 74 0 ZSTRAW
X 0037 GRAPE 0 2 2 0 0 4 4297 74 0 ZGRAPE
X 0038 SEED -BLACK 5 4 0 0 0 4297 86 0 ZSEED
X 0039 BUCKET 0 10 101 0 0 0 1545 149 13 ZBUCKE
X 0040 PITCHF 0 10 101 0 0 0 9 88 0 ZPITCH
X 0041 SHOVEL 0 10 101 0 0 0 9 88 0 ZSHOVE
X 0042 ROBOT 0 127 101 0 0 48 2249 70 0 ZROBOT
X 0043 STATUE 0 5 5 2 1000 0 137 99 0 ZSTATU
X 0044 MUSHRO -HUGE 1 3 0 0 4 9 118 0 ZMUSHR
X 0045 NUGGET -NUGGET 10 2 3 1000 0 9 128 0 ZNUGGE
X 0046 PHOTOG PAINTI 1 2 1 1000 0 137 0 0 APHOTO
X 0047 PHOTOG FAMILY 1 2 1 1000 0 137 0 0 FPHOTO
X 0048 CAT -BLACK 6 5 3 4080 0 4105 80 0 ZCAT
X 0049 DEET 0 2 2 0 0 8 137 147 0 ZDEET
X 0050 METOL 0 2 2 0 0 8 137 147 0 ZMETOL
X 0051 HYPO 0 2 2 0 0 8 137 147 0 ZHYPO
X 0052 CARTRI TERRAN 2 2 3 4000 0 137 0 0 ZCART
X 0053 KNIFE 0 3 3 0 0 0 9 150 0 ZKNIFE
X 0054 HAMMER 0 5 3 0 0 0 9 150 0 ZHAMME
X 0055 SCREWD 0 2 3 0 0 0 9 150 0 ZSCREW
X 0056 CARTRI CYGNAN 2 2 0 0 0 137 146 0 CCART
X 0057 BEAD -GLOWIN 2 4 1 4000 0 137 0 0 ZBEAD
X 0058 INSECT -SILICO 1 2 3 1000 0 201 94 0 ZINSEC
X 0059 FILM -XRAY 1 4 0 0 0 137 0 0 ZFILM
X 0060 BOX -MAGNES 3 5 0 0 129 1679 6032 5 ZBOX
X 0061 DISC GOOD 1 1 5 0 0 137 2060 0 GDISC
X 0062 DISC BROKEN 1 1 0 0 0 137 2060 0 BDISC
X 0063 MINERA -VIOLET 3 1 3 1000 0 137 152 0 LMINER
X 0064 EGG -CHOCOL 3 2 0 0 4 4105 0 0 CEGG
X 0065 COIN SILVER 2 2 2 1000 16 137 0 0 SCOIN
X 0066 COIN BRASS 2 2 0 0 16 137 0 0 BCOIN
X 0067 COIN NICKEL 2 2 0 0 16 137 0 0 NCOIN
X 0068 COIN COPPER 2 2 0 0 16 137 0 0 CCOIN
X 0069 COIN PLATIN 2 2 0 0 16 137 0 0 PCOIN
X 0070 MAP 0 2 2 0 0 16 137 0 0 MMAP
X 0071 BALL -RED 2 2 0 0 4 9 0 0 BBALL
X 0072 NEWSPA 0 2 2 0 0 16 137 0 0 NNEWS
X 0073 ROD -YELLOW 1 1 0 0 0 9 166 0 YROD
X 0074 NOTE 0 2 2 0 0 16 137 6071 0 NNOTE
X 9999
X 0001 SPIRE 0 12 13 0 129 0 ZSPIRE
X 0002 PTEROD -SMALL 24 0 0 65 0 ZPTERO
X 0003 STOOL -CERAMI 42 0 0 65 0 ZSTOOL
X 0004 KNOB -METAL 42 0 0 65 0 ZKNOB
X 0005 WINDOW 0 42 30 0 65 0 ZWINDO
X 0006 DOOR ROUND 47 51 513 207 0 RDOOR
X 0007 TOWER 0 48 0 0 1 0 ZTOWER
X 0008 DIMPLE -METAL 47 0 0 1 0 MDIMPL
X 0009 CUBE -STONE 61 0 16 65 0 SCUBE
X 0010 HORSET 0 24 25 256 65 0 ZHORSE
X 0011 DOOR METAL 41 135 513 15 0 MDOOR
X 0012 DOOR GLASS 85 136 513 15 0 GDOOR
X 0013 HOLE -RABBIT 73 0 0 9 0 RHOLE
X 0014 LOUVER 0 98 142 0 1 0 ZLOUVE
X 0015 VINE -GRAPE 74 0 0 9 0 ZVINE
X 0016 SLOT SLOT 146 0 0 513 2 RSLOT
X 0017 BUTTON TRIANG 146 0 0 1 0 TBUTTO
X 0018 BUTTON SQUARE 146 0 0 1 0 SBUTTO
X 0019 BUTTON ROUND 146 0 0 1 0 RBUTTO
X 0020 BUTTON HEXAGO 146 0 0 1 0 HBUTTO
X 0021 SCREEN -VIDEO 146 0 0 9 0 ZSCREE
X 0022 SINK 0 143 0 0 513 10 ZSINK
X 0023 ANTENN -MICROW 69 0 0 65 0 ZANTEN
X 0024 ENLARG -ENLARG 143 0 0 513 6 ZENLAR
X 0025 RACK -HUGE 143 0 0 1089 10 ZRACK
X 0026 TRAY -SMALL 143 0 0 513 5 ZTRAY
X 0027 HOPPER 0 143 0 0 513 5 ZHOPPE
X 0028 FUNNEL LEFT 143 0 0 1 3 LFUNNE
X 0029 FUNNEL MIDDLE 143 0 0 1 3 MFUNNE
X 0030 FUNNEL RIGHT 143 0 0 1 3 RFUNNE
X 0031 BUTTON RED 143 0 0 1 0 RDBUTT
X 0032 DESK 0 145 0 129 515 10 ZDESK
X 0033 INDICA -LEVEL 143 0 0 73 0 ZINDIC
X 0034 LIGHT RED 143 0 0 73 0 RLIGHT
X 0035 LIGHT GREEN 143 0 0 73 0 GLIGHT
X 0036 ACID -ACID 91 0 0 513 15 ZACID
X 0037 PIT -FIERY 94 0 0 1 15 FPIT
X 0038 MUD -SULFUR 95 0 0 1 15 ZMUD
X 0039 BUTTON VIOLET 134 0 0 1 0 VBUTTO
X 0040 BUTTON ORANGE 134 0 0 1 0 OBUTTO
X 0041 BUTTON WHITE 134 0 0 1 0 WBUTTO
X 0042 BUTTON BLUE 134 0 0 1 0 BBUTTO
X 0043 RECESS 0 134 0 0 513 2 ZRECES
X 0044 VAPOR RED 93 0 0 513 15 RVAPOR
X 0045 VAPOR GREEN 93 0 0 513 15 GVAPOR
X 0046 FROG -GREEN 67 0 0 65 0 ZFROG
X 0047 BIRD RED 65 66 0 65 0 RBIRD
X 0048 BIRD BEAUTI 78 79 0 65 0 XBIRD
X 0049 BIRD BEAUTI 77 80 0 65 0 YBIRD
X 0050 BIRD BEAUTI 75 76 0 65 0 ZBIRD
X 0051 BEES 0 87 0 0 1 0 ZBEES
X 0052 CACTUS 0 82 0 0 1 0 ZCACTU
X 0053 HOUSE -DOLL 132 0 0 65 0 DHOUSE
X 0054 WATERF 0 24 0 0 65 0 FALLS
X 0055 MACHIN VENDIN 156 0 16 137 0 TMACH
X 0056 SLOT SLOT 156 0 0 1 0 TSLOT
X 0057 MACHIN VENDIN 158 0 16 137 0 NMACH
X 0058 SLOT SLOT 158 0 0 1 0 NSLOT
X 0059 MACHIN VENDIN 160 0 16 137 0 SMACH
X 0060 SLOT SLOT 160 0 0 1 0 SSLOT
X 0061 MACHIN VENDIN 162 0 16 137 0 MMACH
X 0062 SLOT SLOT 162 0 0 1 0 MSLOT
X 0063 MACHIN HUGE 153 0 0 65 0 PMACH
X 0064 DOOR ORANGE 165 166 513 15 0 ODOOR
X 0065 DOOR PINK 173 174 513 15 0 PDOOR
X 0066 DOOR BLUE 174 175 1 11 0 BDOOR
X 0067 CLIP ORANGE 166 0 0 513 2 OCLIP
X 0068 CLIP VIOLET 166 0 0 513 2 VCLIP
X 0069 CLIP YELLOW 175 0 0 513 2 YCLIP
X 0070 CLIP BLUE 175 0 0 513 2 BCLIP
X 0071 CABINE -FILEC 169 0 129 515 12 FCABIN
X 0072 BUTTON GREEN 169 0 0 1 0 GBUTTO
X 0073 MURAL -HUGE 169 0 0 201 0 HMURAL
X 0074 RED GREEN 1 0 0 0 0 WDUMMX
X 9999
END_OF_data.dat
if test 31769 -ne `wc -c <data.dat`; then
echo shar: \"data.dat\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f motion.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"motion.c\"
else
echo shar: Extracting \"motion.c\" \(16932 characters\)
sed "s/^X//" >motion.c <<'END_OF_motion.c'
X#include "parame.inc"
X#include "variab.h"
X#include "arrays.h"
X#include "trvtbl.inc"
X
X/* World C Version 1.00 copyright 1987 J.D.McDonald
X Use as you like for non-commercial purposes, but please
X leave this note, and document any changes you make as yours */
X
X static int rax[] = {556, 2445, 7552, 1105, 3111};
X static int dx[] = {2331, 4293, 2204, 6339, 3325};
X static int locx[] = {176, 177, 178, 179, 180};
X
Xvship()
X{
X int locy, i;
X
X if (wrdnum[0] == ACTIVA) {
X if ((loc < 175 || loc > 181) && loc != 184 && loc != 187)
X speak(71);
X else if (lpill == 0)
X speak(237);
X else if (obloc[YROD] != 2000 + YCLIP || obloc[BSAPPH] != BCLIP + 2000)
X speak(539);
X else if ((obimpr[BDOOR] & 2) == 0)
X speak(544);
X else if (spcloc != 2)
X speak(542);
X else if (loc == 181 || loc == 184 || loc == 187) {
X speak(536);
X oldloc = 0;
X oldlc2 = 0;
X if (loc == 181)
X loc = 177;
X else if (loc == 184)
X loc = 180;
X else
X loc = 179;
X } else {
X locy = 0;
X for (i = 0; i < 5; i++) {
X if (rax[i] == raset && dx[i] == decset)
X locy = locx[i];
X }
X if (locy == 0)
X speak(537);
X else if (loc == locy)
X speak(500);
X else {
X speak(538);
X if (loc == 175)
X speak(545);
X for (i = 1; i <= MOVMAX; i++)
X if (obloc[i] == loc)
X obloc[i] = locy;
X loc = locy;
X oldloc = 0;
X oldlc2 = 0;
X }
X }
X } else if (loc < 176 || loc > 180)
X speak(71);
X else if (lpill == 0)
X speak(237);
X else if (obloc[YROD] != YCLIP + 2000 || obloc[BSAPPH]
X != BCLIP + 2000)
X speak(539);
X else if ((obimpr[BDOOR] & 2) == 0)
X speak(544);
X else if (spcloc != 2)
X speak(542);
X else if (loc == 176)
X speak(540);
X else if (loc == 178)
X speak(541);
X else if (spcloc != 2)
X speak(543);
X else {
X oldloc = 0;
X oldlc2 = 0;
X speak(543);
X if (loc == 177)
X locy = 181;
X else if (loc == 179)
X locy = 187;
X else
X locy = 184;
X for (i = 1; i <= MOVMAX; i++)
X if (obloc[i] == loc)
X obloc[i] = locy;
X loc = locy;
X }
X}
X
X
Xvcross()
X{
X int result;
X
X result = 0;
X /* the tree over the chasm */
X
X if ((loc == 19 || loc == 21) && (dobjs[0] == TREE ||
X dobjs[0] == LOG || dobjs[0] == CHASM) && (prepdo == 0
X || prepdo == OVER) && (iobj == TREE || iobj ==
X LOG || iobj == 0)) {
X result = 1;
X prepdo = 0;
X dobjs[0] = NORTHE;
X if (loc == 21)
X dobjs[0] = SOUTHW;
X }
X /* you can't "cross" the lake */
X
X else if ((loc == 5 || loc == 6 || loc == 15 || loc == 17) && (
X dobjs[0] == WATER))
X speak(47);
X else
X speak(94);
X return (result);
X}
X
X
Xvcrawl()
X{
X int result;
X result = 0;
X /* you can crawl over the log */
X
X if ((loc == 19 || loc == 21) && (dobjs[0] == TREE ||
X dobjs[0] == LOG || dobjs[0] == CHASM) &&
X prepdo == OVER) {
X adverb = CAREFU;
X prepdo = 0;
X oldlc2 = oldloc;
X oldloc = loc;
X if (loc == 19)
X loc = 21;
X else
X loc = 19;
X }
X /* if "crawl direction" but not u or d, then call go */
X
X else if (dobjs[0] <= NORTHW && prepdo == 0) {
X if (loc == 19 || loc == 21)
X adverb = CAREFU;
X result = 1;
X speak(109);
X }
X /* otherwise, don't understand */
X
X else
X speak(94);
X return (result);
X
X}
X
X
X
X
X
X
X
Xvjump()
X{
X int result, ncarrd, nweigh, kcarrd, kweigh;
X result = 0;
X /* can't jump if dead */
X
X if (deadf) {
X speak(46);
X return (result);
X }
X /* jumping off the spire is fatal */
X
X if ((loc == 13 || loc == 14) && ((dobjs[0] == SPIRE &&
X prepdo == OFF) || dobjs[0] == 0)) {
X speak(49);
X speak(37);
X oldlc2 = 0;
X oldloc = 0;
X loc = 12;
X vdead();
X return (result);
X }
X /* trying to jump the chasm isn't too smart either */
X
X if ((loc == 21 || loc == 19) && (dobjs[0] == 0 || ((dobjs[0] ==
X CHASM || dobjs[0] == TREE || dobjs[0] == LOG) && (prepdo ==
X 0 || prepdo == OVER)))) {
X speak(49);
X speak(38);
X oldlc2 = 0;
X oldloc = 0;
X loc = 22;
X locdat[22] |= 16384;
X vdead();
X return (result);
X }
X /* but you can jump onto the tower */
X
X if (loc == 48 && (dobjs[0] == 0 || dobjs[0] == TOWER) &&
X (prepdo == ON || prepdo == 0)) {
X /* if you're not carrying too much */
X
X burden(&ncarrd, &nweigh, &kcarrd, &kweigh);
X if (ncarrd == 0 && (obloc[ZKNAPS] != 1000 && obloc[ZKNAPS]
X != 3000) && wirelc[5] != 1000) {
X speak(136);
X oldlc2 = oldloc;
X oldloc = loc;
X loc = 49;
X } else
X speak(139);
X
X return (result);
X }
X /* but not off the tower */
X
X if ((loc == 49) && ((dobjs[0] == TOWER &&
X prepdo == OFF) || dobjs[0] == 0)) {
X speak(49);
X speak(137);
X oldlc2 = 0;
X oldloc = 0;
X loc = 48;
X vdead();
X return (result);
X }
X /* jumping at the barrier */
X
X if ((loc == 26 || loc == 27) && dobjs[0] == BARRIE) {
X if (prepdo == OVER || prepdo == 0) {
X speak(170);
X return (result);
X } else if (prepdo == THROUG) {
X oldloc = 0;
X oldlc2 = 0;
X if (loc == 26)
X loc = 27;
X else
X loc = 26;
X }
X }
X /* bottomless pit */
X
X if (loc == 96) {
X oldloc = 0;
X oldlc2 = 0;
X if (dobjs[0] == TUNNEL)
X loc = 102;
X else {
X speak(266);
X vdead();
X loc = 97;
X }
X }
X /* wheeeeeee!!! */
X
X speak(49);
X return (result);
X}
X
X
Xvgo()
X{
X int aloc, xretr, dir, errno, nloc, k, kkk, indx1, ix;
X int m, n, xgox, kk, indx2, s;
X
X
X /* the entrance to the cave at the waterfall */
X
X rmove = 0;
X if (prepdo == BEHIND && loc == 24 && dobjs[0] == HORSET) {
X horflg = 1;
X oldlc2 = oldloc;
X oldloc = loc;
X loc = 25;
X return;
X }
X aloc = loc;
X if (actor == ROBOT)
X aloc = obloc[ZROBOT];
X /* translate go through barrier to direction */
X
X if (dobjs[0] == BARRIE && prepdo == THROUG) {
X prepdo = 0;
X if (aloc == 26)
X dobjs[0] = NORTHE;
X else if (aloc == 19)
X dobjs[0] = SOUTHW;
X else if (aloc == 62 || aloc == 50)
X dobjs[0] = NORTH;
X else if (aloc == 86 || aloc == 63)
X dobjs[0] = SOUTH;
X else if (aloc == 68)
X dobjs[0] = WEST;
X else if (aloc == 90)
X dobjs[0] = EAST;
X else
X prepdo = THROUG;
X }
X /*
X
X * all prepositional expressions must be handled by special code above
X
X * this point
X
X
X*/
X
X if (prepdo > DOWN) {
X speak(94);
X return;
X }
X xretr = 0;
X dir = 0;
X errno = 0;
X if (prepdo == UP || prepdo == DOWN) {
X if (dobjs[0] == 0)
X dir = prepdo + 9 - PRPMIN;
X else if (dobjs[0] > 0 && dobjs[0] <= NORTHW)
X errno = 57;
X else if (dobjs[0] == SPIRE && (aloc >= 12 && aloc <= 14))
X dobjs[0] = 0;
X else
X errno = 28;
X } else if (dobjs[0] > 0 && dobjs[0] <= NORTHW)
X dir = dobjs[0] + 1 - NUNMIN;
X else
X errno = 28;
X if (errno != 0)
X goto lab9000;
X /****** we have reached the point where we use the travel table */
X xgox = 0;
X k = dir;
X kkk = k;
X if (adverb == QUICKL)
X k = k + 64;
X if (adverb == SLOWLY)
X k = k + 32;
X if (adverb == CAREFU)
X k = k + 16;
X /*
X * if he says "go quickly" that will match "go quickly" or just "go" but
X * "go" will not match "go quickly" . same for other adverbs
X */
X
X if (deadf)
X k = kkk;
X indx1 = dispat[aloc];
X indx2 = dispat[aloc + 1];
X for (ix = indx1; ix <= indx2 - 2; ix += 2)
X if (trvtbl[ix] == k || kkk == trvtbl[ix])
X goto lab200;
X errno = 58;
X goto lab9000;
Xlab200:
X indx1 = ix + 1;
X m = trvtbl[indx1] / 512;
X n = trvtbl[indx1] - m * 512;
X if (actor != 1 && actor != ROBOT)
X return;
X else if (actor == ROBOT) {
X if (m == 1) {
X xgox = 1;
X nloc = n;
X } else if (m == 3 && n == 13 && aloc == 68) {
X xgox = 1;
X nloc = 90;
X } else if (m == 3 && n == 6 && aloc == 74) {
X xgox = 1;
X nloc = 70;
X } else;
X }
X /* unconditional motion */
X
X else if (m == 1) {
X xgox = 1;
X nloc = n;
X xretr = 1;
X /* unconditional stay where is */
X
X } else if (m == 2) {
X errno = n;
X /* forced to get out of chair */
X
X if (aloc == 184 || aloc == 187 || aloc == 166 ||
X (aloc >= 175 && aloc <= 181))
X spcloc = 0;
X else;
X } else if (m == 3) {
X /*** special conditions */
X
X if (n == 1) {
X /*
X * to climb the spire you must wear shoes, but nothing else, and
X * it must be daytime
X */
X
X if (daytim == 0 || (turns % 100) > 73) {
X speak(123);
X return;
X }
X if (obloc[CSHOES] == 3000) {
X for (kk = 1; kk <= MOVMAX; kk++) {
X if (kk == CSHOES)
X continue;
X if (obloc[kk] == 1000 || (obloc[kk] == 3000 && kk != CKEY))
X errno = 60;
X }
X if (errno != 60) {
X xgox = 1;
X nloc = 13;
X }
X }
X }
X /* to get behind the horsetails */
X
X else if (n == 2) {
X if (horflg || (locdat[25] & 16384) != 0) {
X xgox = 1;
X nloc = 25;
X }
X }
X /* into the bar */
X
X else if (n == 3) {
X if (daytim == 1 || deadf) {
X xgox = 1;
X xretr = 1;
X nloc = 42;
X } else if (marflg[0]) {
X speak(128);
X return;
X }
X }
X /* underground from mars */
X
X else if (n == 4 || n == 11) {
X if ((obimpr[MDOOR] & 2) == 0) {
X xgox = 1;
X xretr = 1;
X nloc = 135;
X if (n == 11)
X nloc = 41;
X }
X } else if (n == 5) {
X /* warehouse */
X
X if ((obimpr[RDOOR] & 2) != 2) {
X xgox = 1;
X xretr = 0;
X nloc = 47;
X if (aloc == 47)
X nloc = 51;
X }
X } else if (n == 6) {
X if ((obimpr[ZVINE] & 56) == 16) {
X xgox = 1;
X nloc = 70;
X xretr = 1;
X }
X } else if (n == 7) {
X /* rabbit hole */
X
X if (obimpr[RHOLE] == 17) {
X xgox = 1;
X nloc = 96;
X }
X } else if (n == 8) {
X /* going down the pole c */
X
X if ((obimpr[ZLATEX] & 56) == 24) {
X xgox = 1;
X nloc = 80;
X }
X } else if (n == 9 || n == 12) {
X /* glass door */
X
X if ((obimpr[GDOOR] & 2) == 0) {
X xgox = 1;
X xretr = 1;
X nloc = 136;
X if (aloc == 136)
X nloc = 85;
X }
X }
X /* beehive */
X
X else if (n == 10) {
X if (obimpr[ZDEET] >= 4096) {
X xgox = 1;
X nloc = 88;
X if (aloc == 88)
X nloc = 87;
X }
X } else if (n == 13);
X else if (n == 14) {
X if (obimpr[ZLOUVE] == 9) {
X xgox = 1;
X xretr = 1;
X nloc = 142;
X if (aloc == 142)
X nloc = 98;
X }
X }
X /* the scree slope */
X
X else if (n == 15) {
X if (screef > 0) {
X xgox = 1;
X xretr = 1;
X nloc = 151;
X }
X } else if (n == 16) {
X if ((obimpr[ODOOR] & 2) == 0) {
X xgox = 1;
X xretr = 1;
X nloc = 166;
X if (aloc == 166)
X nloc = 165;
X }
X } else if (n == 17) {
X if ((obimpr[BDOOR] & 2) == 0) {
X xgox = 1;
X xretr = 1;
X if (aloc == 174)
X nloc = 175;
X else if (aloc == 175)
X nloc = 174;
X else if (aloc == 181)
X nloc = 182;
X else if (aloc == 184)
X nloc = 185;
X else if (aloc == 187)
X nloc = 188;
X else;
X }
X } else if (n == 18) {
X if (obimpr[HMURAL] == 209) {
X xgox = 1;
X xretr = 1;
X nloc = 170;
X }
X } else {
X linout("bug in travel table", 19);
X return;
X }
X }
X /*** end special conditions
X
X he dies. code give his final location */
X
X else if (m == 4) {
X if (deadf)
X errno = 46;
X else {
X oldlc2 = 0;
X oldloc = 0;
X if (loc == 13 || loc == 14)
X loc = 12;
X if (loc == 19 || loc == 21)
X loc = 22;
X if (loc == 76)
X loc = 79;
X /* if he moved when he dies, special code goes here */
X
X locdat[loc] |= 16384;
X vdead();
X if (loc == 96) {
X loc = 97;
X locdat[97] |= 16384;
X }
X errno = n;
X }
X }
X /* goes to newloc if he is dead and has been there before */
X
X else if (m == 5) {
X if (deadf && (locdat[n] & 16384) != 0) {
X xgox = 1;
X nloc = n;
X }
X }
X /* motion with some probability */
X
X else if (m >= 16 && m <= 31) {
X s = (m - 15) * 6;
X if (pct(s)) {
X xgox = 1;
X nloc = n;
X }
X } else {
X speak(252);
X return;
X }
X
X
X if (errno != 0)
X goto lab9000;
X if (xgox && actor == 1) {
X if ((locdat[nloc] & 25) == 0 && obloc[25] != 1000 && !deadf)
X errno = 258;
X else if ((locdat[nloc] & 32) != 0) {
X oldlc2 = oldloc;
X oldloc = loc;
X loc = nloc;
X if (!xretr || loc == 38 || loc == 97 || loc == 127
X || loc == 88 || loc == 74 || loc == 96) {
X oldloc = 0;
X oldlc2 = 0;
X }
X } else
X errno = 59;
X } else if (xgox && actor == ROBOT) {
X if ((locdat[nloc] & 64) != 0) {
X obloc[ZROBOT] = nloc;
X rmove = 1;
X } else
X errno = 299;
X } else {
X ix = indx1 + 1;
X if (trvtbl[ix] == kkk || trvtbl[ix] == k)
X goto lab200;
X errno = 58;
X if (actor == 1)
X errno = 299;
X }
X /*** all errors and "you are dead" or "impossibility" messages go here */
X
Xlab9000:
X if (errno != 0)
X speak(errno);
X}
X
X
X
Xvretre()
X/* retreat or back */
X
X{
X if (oldloc == 0)
X speak(65);
X else {
X loc = oldloc;
X oldloc = oldlc2;
X oldlc2 = 0;
X }
X}
X
Xvclimb()
X{
X int result;
X
X result = 0;
X /*
X
X * if result is 1 call vgo rubber tree jungle trees
X
X
X*/
X
X if ((loc == 64 || loc == 67) && (dobjs[0] == TREE || dobjs[0]
X == 0))
X speak(430);
X else if ((loc == 78 || loc == 79) && (dobjs[0] == TREE || dobjs[0]
X == 0))
X speak(431);
X else if (loc == 65 && (prepdo == 0 || prepdo == UP) && (dobjs[0]
X == TREE || dobjs[0] == 0)) {
X oldlc2 = oldloc;
X oldloc = loc;
X loc = 66;
X } else if (loc == 66 && (prepdo == DOWN || prepdo == 0) && (dobjs[0]
X == 0 || dobjs[0] == TREE)) {
X oldlc2 = oldloc;
X oldloc = loc;
X loc = 65;
X }
X /* pole */
X
X else if ((loc == 80 || loc == 79 || loc == 76) && (dobjs[0] == POLE
X || dobjs[0] == 0)) {
X result = 1;
X wrdnum[0] = GO;
X dobjs[0] = 0;
X if (prepdo == 0)
X prepdo = UP;
X }
X /*
X
X * you can climb the spire if you are careful but the actual motion is
X
X * done by "vgo"
X
X
X*/
X
X else if ((loc >= 12 && loc <= 14) && (dobjs[0] == 0 || dobjs[0]
X == SPIRE)) {
X wrdnum[0] = GO;
X dobjs[0] = 0;
X result = 1;
X if ((loc == 12 && (prepdo == 0 || prepdo == UP)) ||
X (loc == 13 && (prepdo == 0 || prepdo == UP)))
X prepdo = UP;
X else if (((loc == 13 || loc == 14) && prepdo == DOWN) ||
X (loc == 14 && prepdo == 0))
X prepdo = DOWN;
X else;
X }
X /* you can climb over the log but not up a tree! */
X
X else if (loc == 19 || loc == 21) {
X if ((dobjs[0] == TREE || dobjs[0] == LOG) && prepdo == OVER) {
X prepdo = 0;
X result = 1;
X dobjs[0] = NORTHE;
X {
X if (loc == 21)
X dobjs[0] = SOUTHW;
X }
X } else if (dobjs[0] == TREE && (prepdo == UP || prepdo == 0))
X speak(108);
X else
X speak(94);
X }
X /* you can't climb the tower */
X
X else if (loc == 48 && (prepdo == 0 || prepdo == UP) &&
X (dobjs[0] == 0 || dobjs[0] == TOWER))
X speak(138);
X /* but you can climb down the tower */
X
X else if (loc == 49 && (prepdo == 0 || prepdo == DOWN) &&
X (dobjs[0] == TOWER || dobjs[0] == 0)) {
X oldlc2 = oldloc;
X oldloc = loc;
X loc = 48;
X }
X /* you can't climb the barrier */
X
X else if ((loc == 26 || loc == 27) && dobjs[0] == BARRIE)
X speak(170);
X else if (dobjs[0] == TREE) {
X if ((locdat[loc] & 2048) == 2048)
X speak(244);
X else
X speak(245);
X } else if (loc == 20 || (loc >= 52 && loc <= 56)) {
X wrdnum[0] = GO;
X {
X if (prepdo == 0)
X prepdo = UP;
X }
X result = 1;
X } else
X speak(50);
X return (result);
X}
X
X
Xvrun()
X{
X int result;
X result = 0;
X /* ru translates to "go quickly" */
X
X if (adverb == SLOWLY)
X speak(51);
X else {
X result = 1;
X adverb = QUICKL;
X wrdnum[0] = GO;
X }
X return (result);
X}
X
X
Xvswim()
X{
X int spk, m, i, xloc;
X spk = 0;
X /* he can't swim at night (for no real reason) */
X
X if (daytim == 0 && (loc == 5 || loc == 6 || loc == 15 || loc
X == 17))
X spk = 122;
X /* he can't swim while dead */
X
X else if (deadf)
X spk = 46;
X /* you must swim in the lake or poool */
X
X else if ((loc < 5 || loc > 17 || (loc > 6 && loc < 15))
X && loc != 122)
X spk = 52;
X else;
X if (spk != 0) {
X speak(spk);
X return (0);
X }
X m = dobjs[0];
X if ((m == WATER && prepdo != IN) || ((m == ISLAND || m == SHORE)
X && prepdo != TO) || (m == POOL && prepdo != IN))
X spk = 28;
X else if ((loc == 5 && (m == WEST || m == ISLAND)) ||
X (loc == 15 && m == EAST) ||
X (loc == 16 && m == SOUTH))
X xloc = 6;
X else if (loc == 6 && (m == EAST || m == SHORE))
X xloc = 5;
X else if ((loc == 6 && m == NORTH) ||
X (loc == 17 && (m == SOUTH || m == ISLAND)) ||
X (loc == 16 && m == WEST))
X xloc = 15;
X else if ((loc == 6 && m == SOUTH) || (loc == 15 && m == WEST))
X xloc = 16;
X else if (loc == 15 && (m == NORTH || m == SHORE))
X xloc = 17;
X else if ((loc == 5 || loc == 6 || (loc <= 17 && loc >= 15))
X && (m == WATER)) {
X if (dirty < 10)
X spk = 110;
X else
X spk = 111;
X } else if (loc == 122 && m == POOL)
X xloc = 123;
X else
X spk = 54;
X if (spk == 0) {
X /* but not if you are wearing too much */
X
X for (i = 1; i <= MOVMAX; i++) {
X if (i == CSHOES || i == CKEY || i == CFISH || i == DFISH
X || i == BNET || i == GSPHER)
X continue;
X if(obloc[i] == 1000 || obloc[i] == 3000) {
X speak(53);
X return (0);
X }
X }
X oldlc2 = 0;
X oldloc = 0;
X loc = xloc;
X return (0);
X }
X speak(spk);
X return (0);
X}
END_OF_motion.c
if test 16932 -ne `wc -c <motion.c`; then
echo shar: \"motion.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f variab.h -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"variab.h\"
else
echo shar: Extracting \"variab.h\" \(772 characters\)
sed "s/^X//" >variab.h <<'END_OF_variab.h'
X
X int horflg, wirelc[6], punct, three[3] ,eolflg ,lptr ,dotflg ,clause;
X int zadjs[12], zobjs[12], ziadj, ziobj, zpdo, zpio, zactor, zadvrb;
X int zverb, znumb, zall, zbut;
X int wrdnum[30], wrdtyp[30], adverb, actor;
X int dobjs[30], iobj, doadjs[12], ioadj, prepdo, prepio;
X int numdo, butflg, allflg, turns, loc, oldloc, oldlc2, brfflg;
X int deadf, dirty, nonext ,spcloc;
X int fshlif, noshoe, daytim, martim ,marflg[9] ,oextim, rdietm;
X int rvtim, gvtim, eattim, easttm, filmtm, screef;
X int filmst, machst, fimage, dial1, dial2, dial1x, dial2x;
X int wwflag, kmax, xindnt, slflag, more, nomor, rmove, chgact;
X int eastsc, cactsc, diesc, bonus, jackpo, lpill, pbstat, decset;
X int raset, dcombi, chaset, chaser, guardl;
X char outst2[66];
X char inbuf[128];
END_OF_variab.h
if test 772 -ne `wc -c <variab.h`; then
echo shar: \"variab.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 4 \(of 7\).
cp /dev/null ark4isdone
MISSING=""
for I in 1 2 3 4 5 6 7 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 7 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archivElse if (n