home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume17 / dinkum3 / part02 < prev    next >
Encoding:
Internet Message Format  |  1993-03-20  |  53.4 KB

  1. Path: uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!news.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i007:  dinkum3 - australian text adventure game, V2.12, Part02/07
  5. Message-ID: <4518@master.CNA.TEK.COM>
  6. Date: 9 Feb 93 20:02:00 GMT
  7. Article-I.D.: master.4518
  8. Sender: news@master.CNA.TEK.COM
  9. Lines: 1944
  10. Approved: billr@saab.CNA.TEK.COM
  11. Xref: uunet comp.sources.games:1686
  12.  
  13. Submitted-by: Gary Allen <gary@sun.mech.uq.oz.au>
  14. Posting-number: Volume 17, Issue 7
  15. Archive-name: dinkum3/Part02
  16. Supersedes: dinkum2: Volume 15, Issue 36-43
  17. Environment: Unix, DOS
  18.  
  19.  
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of archive 2 (of 7)."
  28. # Contents:  dink_sym.h dinkum.c make.unx makefile
  29. # Wrapped by billr@saab on Mon Feb  8 13:40:50 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'dink_sym.h' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'dink_sym.h'\"
  33. else
  34. echo shar: Extracting \"'dink_sym.h'\" \(12377 characters\)
  35. sed "s/^X//" >'dink_sym.h' <<'END_OF_FILE'
  36. X/***********************************************************/
  37. X/*                                                         */
  38. X/*          --- Dinkum Symbol Definition File ---          */
  39. X/*                                                         */
  40. X/*            Version:  Mk 1.13,   16 January 1993         */
  41. X/*                                                         */
  42. X/***********************************************************/
  43. X
  44. X#include <stdio.h> 
  45. X
  46. X/* Deal with K&R C versus ANSI-C */
  47. X#if sun
  48. X#define void    int
  49. X#define PROTOTYPE    0
  50. X#else
  51. X#define PROTOTYPE    1
  52. X#endif
  53. X
  54. X#ifdef CLASSIC
  55. X#define PROTOTYPE    0
  56. X#endif
  57. X
  58. X/* Definitions for Bugs subroutine */
  59. X#define Failed        0
  60. X#define Request        1
  61. X#define Logic_error    2
  62. X/* Room code numbers */
  63. X/*  These code numbers 'n' point to the table entry in room[n][] */
  64. X#define R_WALL        -1
  65. X#define R_meadow    0
  66. X#define R_dike        3
  67. X#define R_river_edge    4
  68. X#define R_river        5
  69. X#define R_stream    6
  70. X#define R_slime        7
  71. X#define R_bunyip    8
  72. X#define R_river_exit    9
  73. X#define R_forest    11
  74. X#define R_billabong    14
  75. X#define R_taipan    18
  76. X#define R_mine_head    22
  77. X#define R_lift_entr    27
  78. X#define R_bitumen    29
  79. X#define R_office_entr    36
  80. X#define R_office_hall    37
  81. X#define R_office_mang    38
  82. X#define R_geo_w        39
  83. X#define R_store_room    40
  84. X#define R_geo_e        41
  85. X#define R_lift_inside    43
  86. X#define R_L49_entr      44
  87. X#define R_L67_entr      45
  88. X#define R_L82_entr      46
  89. X#define R_hideout_entr    144
  90. X#define R_hideout    146
  91. X#define R_bend        147
  92. X#define R_no_treasure    159
  93. X#define R_manhole_1    166
  94. X#define R_manhole_2    170
  95. X#define R_foreman    177
  96. X#define R_blast_point    185
  97. X#define R_ufo_w        191
  98. X#define R_ufo_nw    192
  99. X#define R_ufo_n        193
  100. X#define R_ufo_ne    194
  101. X#define R_ufo_e        195
  102. X#define R_ufo_se    196
  103. X#define R_ufo_s        197
  104. X#define R_ufo_sw    198
  105. X#define R_air_lock    199
  106. X#define R_ship_passage    200
  107. X#define R_flight_deck    201
  108. X#define R_panel        202
  109. X#define R_transporter    203
  110. X#define R_gleep_tank    206
  111. X#define R_warning    217
  112. X#define R_gong        238
  113. X#define R_closet    240 
  114. X#define R_guard     241
  115. X#define R_prayer    242
  116. X#define R_road_kill_s    245
  117. X#define R_road_kill_n    248
  118. X
  119. X/* Room category indicator for room[n][i] where "i" is below */
  120. X#define M_rm_type    10
  121. X#define M_obj_cnt    11
  122. X#define M_unmov_obj     12
  123. X#define M_monster    13
  124. X#define M_gleep        14
  125. X#define M_descp        15
  126. X
  127. X/* Room type, referred to by room[n][M_rm_type] */
  128. X#define T_lethal    -1
  129. X#define T_short_descp    0
  130. X#define T_long_descp    1
  131. X#define T_was_long    3
  132. X#define T_looping    5
  133. X
  134. X/* Unmovable object status, i.e.  Safe->Status  */
  135. X#define S_closed    0
  136. X#define S_revealed    1
  137. X#define S_flashing    1
  138. X#define S_dialed    2
  139. X#define S_unlocked    2
  140. X#define S_open        3
  141. X#define S_kicked    8
  142. X#define S_recorder    4
  143. X#define S_told        5
  144. X#define S_fair_game    6
  145. X#define S_recording    7
  146. X#define S_playing    9
  147. X#define S_inactive    10
  148. X
  149. X#define L0        0
  150. X#define L49        49
  151. X#define L67        67
  152. X#define L82        82
  153. X
  154. X/* Vocabulary code numbers */
  155. X/*  numbers -1 to 10 to not correspond to actual vocabulary words */
  156. X#define V_LINE_END    -1
  157. X#define V_NULL        0
  158. X#define V_MOVE        1
  159. X#define V_PLURAL    2
  160. X#define V_VERB_ONLY    3
  161. X#define V_DIRECTION    4
  162. X#define V_NUMBER    5
  163. X
  164. X/* --- below are real word symbols --- */
  165. X#define V_east        3
  166. X#define V_west        4
  167. X#define V_up        5
  168. X#define V_down         6
  169. X#define V_u        15
  170. X#define V_quit        21
  171. X#define V_unlock    22
  172. X#define V_lock        23
  173. X#define V_take        24
  174. X#define V_leave        25
  175. X#define V_drop        26
  176. X#define V_can        27
  177. X#define V_bottle    28
  178. X#define V_mat        29  
  179. X#define V_key        30
  180. X#define V_butt        31
  181. X#define V_look        32
  182. X#define V_door        33
  183. X#define V_open        34
  184. X#define V_get        35
  185. X#define V_throw        36
  186. X#define V_turn        37
  187. X#define V_on        38
  188. X#define V_off        39
  189. X#define V_push        40
  190. X#define V_button    41
  191. X#define V_enter        42
  192. X#define V_switch    43
  193. X#define V_zero        44
  194. X#define V_forty_nine    45
  195. X#define V_sixty_seven    46
  196. X#define V_eighty_two    47
  197. X#define V_0        48
  198. X#define V_49        49
  199. X#define V_67        50
  200. X#define V_82        51
  201. X#define V_beer        52
  202. X#define V_lager        53
  203. X#define V_doormat    54
  204. X#define V_lift        55
  205. X#define V_on_q        56
  206. X#define V_off_q        57
  207. X#define V_svc        58
  208. X#define V_map        59
  209. X#define V_picture    60
  210. X#define V_safe        61
  211. X#define V_dial        62
  212. X#define V_paper        63
  213. X#define V_put        64
  214. X#define V_close        65
  215. X#define V_read        66
  216. X#define V_gold        67
  217. X#define V_bar        68
  218. X#define V_dynamite    69
  219. X#define V_rifle        70
  220. X#define V_M16        71
  221. X#define V_m16        72
  222. X#define V_cap        73
  223. X#define V_matches    74
  224. X#define V_diamond    75
  225. X#define V_ring        76
  226. X#define V_ruby        77
  227. X#define V_silver    78
  228. X#define V_coin        79
  229. X#define V_bill        80
  230. X#define V_money        81
  231. X#define V_teapot    82
  232. X#define V_clip        83
  233. X#define V_ammo        84
  234. X#define V_box        85
  235. X#define V_stick        86
  236. X#define V_pills        87
  237. X#define V_orange    88
  238. X#define V_glowing    89
  239. X#define V_saphire    90
  240. X#define V_emerald    91
  241. X#define V_score        92
  242. X#define V_inventory    93
  243. X#define V_examine    94
  244. X#define V_describe    95
  245. X#define V_drink     96
  246. X#define V_fill        97
  247. X#define V_water        98
  248. X#define V_fourex    99
  249. X#define V_invent    100
  250. X#define V_view        101
  251. X#define V_press        102
  252. X#define V_exit        103
  253. X#define V_all        104
  254. X#define V_Fourex    105
  255. X#define V_everything    106
  256. X#define V_shoot        107
  257. X#define V_kill        108
  258. X#define V_ned        109
  259. X#define V_Ned        110
  260. X#define V_kelly        111
  261. X#define V_Kelly        112
  262. X#define V_pick        113
  263. X#define V_grab        114
  264. X#define V_combination    115
  265. X#define V_select    116
  266. X#define V_safety    117
  267. X#define V_SAFE        118
  268. X#define V_triple    119
  269. X#define V_III        120
  270. X#define V_single    121
  271. X#define V_I        122
  272. X#define V_auto        123
  273. X#define V_AUTO        124
  274. X#define V_automatic    125
  275. X#define V_set        126
  276. X#define V_insert    127
  277. X#define V_attach    128
  278. X#define V_plan        129
  279. X#define V_gun        130
  280. X#define V_magazine    131
  281. X#define V_hoop        132
  282. X#define V_snake        133
  283. X#define V_bear        134
  284. X#define V_wombat    135
  285. X#define V_remove    136
  286. X#define V_eject        137
  287. X#define V_org_clip    138
  288. X#define V_shut        139
  289. X#define V_gleep        140
  290. X#define V_gleeps    141
  291. X#define V_letter    142
  292. X#define V_envelope    143
  293. X#define V_torch        144
  294. X#define V_mail        145
  295. X#define V_tank        146
  296. X#define V_carefully    147
  297. X#define V_gently    148
  298. X#define V_softly    149
  299. X#define V_slow_drop    150
  300. X#define V_light        151
  301. X#define V_ignite    152
  302. X#define V_fuse        153
  303. X#define V_slowly    154
  304. X#define V_match        155
  305. X#define V_cube        156
  306. X#define V_blue        157
  307. X#define V_blue_button    158
  308. X#define V_gray        159
  309. X#define V_gray_button    160
  310. X#define V_clapper    161
  311. X#define V_sound        162
  312. X#define V_bang        163
  313. X#define V_hit        164
  314. X#define V_strike    165
  315. X#define V_gong        166
  316. X#define V_detector    167
  317. X#define V_give        168
  318. X#define V_stats        169
  319. X#define V_jsys        170
  320. X#define V_su        171
  321. X#define V_yellow    172
  322. X#define V_yellow_button    173
  323. X#define V_poster    174
  324. X#define V_eat        175
  325. X#define V_swallow    176
  326. X#define V_pill        177
  327. X#define V_atropine    178
  328. X#define V_packet    179
  329. X#define V_wrapper    180
  330. X#define V_tire        181
  331. X#define V_shell        182
  332. X#define V_brick        183
  333. X#define V_rope        184
  334. X#define V_package    185
  335. X#define V_belt        186
  336. X#define V_filter    187
  337. X#define V_string    188
  338. X#define V_cabinet    189
  339. X#define V_calendar    190
  340. X#define V_tackle    191
  341. X#define V_bit        192
  342. X#define V_jack        193
  343. X#define V_pen        194
  344. X#define V_pencil    195
  345. X#define V_wire        196
  346. X#define V_pipe        197
  347. X#define V_panel        198
  348. X#define V_opener    199
  349. X#define V_cord        200
  350. X#define V_photo        201
  351. X#define V_chair        202
  352. X#define V_bulb        203
  353. X#define V_rag        204
  354. X#define V_tube        205
  355. X#define V_carpet    206
  356. X#define V_branch    207
  357. X#define V_cork        208
  358. X#define V_trap        209
  359. X#define V_lighter    210
  360. X#define V_lace        211
  361. X#define V_comb        212
  362. X#define V_umbrella    213
  363. X#define V_meadow    214
  364. X#define V_billabong    215
  365. X#define V_river        216
  366. X#define V_road        217
  367. X#define V_forest    218
  368. X#define V_grass        219
  369. X#define V_stream    220
  370. X#define V_desert    221
  371. X#define V_building    222
  372. X#define V_office    223
  373. X#define V_hideout    224
  374. X#define V_dust        225
  375. X#define V_mine        226
  376. X#define V_tunnel    227
  377. X#define V_tree        228
  378. X#define V_spinifex    229
  379. X#define V_hexagon    230
  380. X#define V_spacecaft    231
  381. X#define V_airlock    232
  382. X#define V_wing        233
  383. X#define V_hole        234
  384. X#define V_tray        235
  385. X#define V_liquid    236
  386. X#define V_cockroach    237
  387. X#define V_go        238
  388. X#define V_scream    239
  389. X#define V_yell        240
  390. X#define V_bring        241
  391. X#define V_help        242
  392. X#define V_dump        243
  393. X#define V_attack    244
  394. X#define V_check        245
  395. X#define V_inspect    246
  396. X#define V_place        247
  397. X#define V_touch        248
  398. X#define V_pull        249
  399. X#define V_extinguish    250
  400. X#define V_ask        251
  401. X#define V_talk        252
  402. X#define V_tell        253
  403. X#define V_find        254
  404. X#define V_move        255
  405. X#define V_break        256
  406. X#define V_kick        257
  407. X#define V_smash        258
  408. X#define V_feed        259
  409. X#define V_taste        260
  410. X#define V_smell        261
  411. X#define V_slam        262
  412. X#define V_desk        263
  413. X#define V_in        264
  414. X#define V_into        265
  415. X#define V_under        266
  416. X#define V_out        267
  417. X#define V_from        268
  418. X#define V_by        269
  419. X#define V_with        270
  420. X#define V_fling        271
  421. X#define V_what        272
  422. X#define V_where        273
  423. X#define V_are        274
  424. X#define V_am        275
  425. X#define V_have        276
  426. X#define V_QUESTION    277
  427. X#define V_how        278
  428. X#define V_why        279
  429. X#define V_who        280
  430. X#define V_when        281
  431. X#define V_leap        282
  432. X#define V_walk        283
  433. X#define V_run        284
  434. X#define V_jump        285
  435. X#define V_hop        286
  436. X#define V_stroll    287
  437. X#define V_saunter    288
  438. X#define V_swagger    289
  439. X#define V_swing        290
  440. X#define V_dig        291
  441. X#define V_swim        292
  442. X#define V_depart    293
  443. X#define V_info        294
  444. X#define V_back        295
  445. X#define V_hold        296
  446. X#define V_fire        297
  447. X#define V_stand        298
  448. X#define V_painting    299
  449. X#define V_doors        300
  450. X#define V_treasure    301
  451. X#define V_trigger    302
  452. X#define V_load        303
  453. X#define V_unload    304
  454. X#define V_sand        305
  455. X#define V_cockroaches    306
  456. X#define V_kangaroo    307
  457. X#define V_climb        308
  458. X#define V_bulldust    309
  459. X#define V_kangaroos    310
  460. X#define V_spinifexes    311
  461. X#define V_fuze        312
  462. X#define V_message    313
  463. X#define V_wall        314
  464. X#define V_recorder    315
  465. X#define V_red        316
  466. X#define V_white        317
  467. X#define V_green        318
  468. X#define V_red_button    319
  469. X#define V_white_button    320
  470. X#define V_green_button    321
  471. X#define V_grey        322
  472. X#define V_matchbox    323
  473. X#define V_map_frag    324
  474. X#define V_circuit    325
  475. X#define V_lift_door    326
  476. X#define V_transporter    327
  477. X#define V_warning    328
  478. X#define V_explosive    329
  479. X#define V_self        330
  480. X#define V_myself    331
  481. X#define V_yourself    332
  482. X#define V_one        333
  483. X#define V_two        334
  484. X#define V_three        335
  485. X#define V_four        336
  486. X#define V_five        337
  487. X#define V_toss        338
  488. X#define V_chart        339
  489. X#define V_charts    340
  490. X#define V_schedule    341
  491. X#define V_schedules    342
  492. X#define V_orange_button    343
  493. X
  494. X/* Miscellaneous flags */
  495. X#define FALSE        0
  496. X#define TRUE        1
  497. X#define F_asleep    8
  498. X#define F_stealing    9
  499. X#define F_passive    10
  500. X#define F_aggressive    11
  501. X#define F_killing    12
  502. X#define F_no_monster    13
  503. X#define F_monster_active    14
  504. X#define F_no_argument    15
  505. X#define F_safety    16
  506. X#define F_single    17
  507. X#define F_triple    18
  508. X#define F_auto        19
  509. X#define F_no_clip    20
  510. X#define F_normal_clip    21
  511. X#define F_org_clip    22
  512. X#define F_wounded    23
  513. X#define F_replace    24
  514. X#define F_ignore    25
  515. X#define F_died        26
  516. X#define F_quit        27
  517. X
  518. X/* enemy/monster symbols */
  519. X#define N_ned        0
  520. X#define N_wombat    1
  521. X#define N_drop_bear    2
  522. X/* 2-5 drop bear   */
  523. X#define N_hoop_snake    6
  524. X/* 6-13 hoop snake */
  525. X#define N_guards    14
  526. X#define N_mullah    15
  527. X/* Object status as referred to in object->Location */
  528. X#define B_have      -1
  529. X#define B_unmade    -2
  530. X#define B_destroyed    -3
  531. X#define B_in_safe    -5
  532. X
  533. X/* Object external property as referred to in object->Type */
  534. X#define Z_normal    0
  535. X#define Z_transform    1
  536. X#define Z_alias        2
  537. X#define Z_unmovable    3
  538. X
  539. X/* Structure for monsters */
  540. Xstruct monster_struct { 
  541. X    int Type ;    /* Monster type                  */
  542. X    int Location ;    /* Location of the monster            */
  543. X    int Status ;    /* Status of the monster              */
  544. X    int Hits ;    /* Number of bullet hits into monster */
  545. X} ;
  546. X
  547. Xtypedef struct monster_struct MONSTER_STRUCT;
  548. X
  549. X/* Structure for objects */
  550. Xstruct object_struct {
  551. X    int Location ;     /* Object's location or status   */
  552. X    int Value ;    /* Treasure value                */
  553. X    int Type ;    /* Object's external property    */
  554. X    int ID ;    /* Object ID number              */
  555. X    int Weight ;    /* Object weight                 */
  556. X    int Status ;     /* Object's internal property    */
  557. X    char *Text ;    /* Text string describing object */
  558. X} ;
  559. X
  560. Xtypedef struct object_struct OBJECT_STRUCT;
  561. X
  562. X/* Structure for objects which can be examined or read */
  563. Xstruct read_struct {
  564. X    int ID ;    /* Object ID number              */
  565. X    int Readable ;    /* TRUE if readable              */
  566. X} ;
  567. X
  568. Xtypedef struct read_struct READ_STRUCT;
  569. X
  570. X/* Structure for adjectives */
  571. Xstruct adjective_struct {
  572. X    int Adjective ;        /* Adjective word number */
  573. X    int Modified_noun ;    /* Noun to be modified word number */
  574. X    int Generated_noun ;    /* Resultant noun from above adjective & noun */
  575. X    int Command ;        /* Command or action done with resultant noun */
  576. X} ;
  577. X
  578. Xtypedef struct adjective_struct ADJECTIVE_STRUCT;
  579. X
  580. X/* Structure for adverbs */
  581. Xstruct adverb_struct {
  582. X    int Adverb ;        /* Adverb word number */
  583. X    int Modified_verb ;    /* Verb to be modified word number */
  584. X    int Generated_verb ;    /* Resultant verb from above adverb & verb */
  585. X} ;
  586. X
  587. Xtypedef struct adverb_struct ADVERB_STRUCT;
  588. X
  589. X
  590. X
  591. END_OF_FILE
  592. if test 12377 -ne `wc -c <'dink_sym.h'`; then
  593.     echo shar: \"'dink_sym.h'\" unpacked with wrong size!
  594. fi
  595. # end of 'dink_sym.h'
  596. fi
  597. if test -f 'dinkum.c' -a "${1}" != "-c" ; then 
  598.   echo shar: Will not clobber existing file \"'dinkum.c'\"
  599. else
  600. echo shar: Extracting \"'dinkum.c'\" \(35524 characters\)
  601. sed "s/^X//" >'dinkum.c' <<'END_OF_FILE'
  602. X#define DINKUM
  603. X#include "dink_sym.h"
  604. X#include "dink_glb.h"
  605. X#include <stdlib.h>
  606. X
  607. X/* ---------------- Version Date --------------- */
  608. Xchar *lb_date = "30 January 1993" ;
  609. X/* --------------------------------------------- */
  610. X
  611. X/*  ---- Version Number  ---- */
  612. Xchar *lb_version = "2.12" ;
  613. X/*  ------------------------- */
  614. X
  615. X/* ---------------- Version Type --------------- */
  616. Xchar *lb_share = "[GAMES.SOURCES Version]" ;
  617. X/* --------------------------------------------- */
  618. X
  619. X/*  ---- Serial Number  ---- */
  620. X#define S_number     1
  621. Xint serial = S_number ;
  622. X/*  ------------------------ */
  623. X/* Global variables local to this file only */
  624. Xint sw_help = FALSE, sw_null = FALSE, sw_number = FALSE, sw_standard = FALSE ;
  625. X
  626. X/* MAIN PROGRAM --- MAIN PROGRAM --- MAIN PROGRAM --- MAIN PROGRAM */
  627. X#if (PROTOTYPE)
  628. Xvoid main(int argc, char *argv[])
  629. X#else
  630. Xvoid main(argc,argv)
  631. Xint argc ;
  632. Xchar *argv[] ;
  633. X#endif
  634. X/*********************************************************************/
  635. X/*                                                                   */
  636. X/*                   --- The Dinkum Program ---                      */
  637. X/*                                                                   */
  638. X/* Software by Gary A. Allen, Jr. 30 January 1993  Version: Mk 2.12  */
  639. X/*            (c) Copyright 1993 by Gary A. Allen, Jr.               */
  640. X/*                                                                   */
  641. X/*********************************************************************/
  642. X{
  643. Xregister int i, j ;
  644. X
  645. Xint dig_1, dig_2, sw_loop ;
  646. Xint move_dir, i_rand1, i_rand2, i_rand3, loc[3] ;
  647. Xlong l_pass, l_base, *time_arg = 0 ;
  648. Xchar chr, cmd[8] ;
  649. X
  650. XMONSTER_STRUCT *mnstr ;
  651. XOBJECT_STRUCT *pnt ;
  652. X
  653. X#if (PROTOTYPE)
  654. X/* Function prototypes ANSI C */
  655. Xvoid cmd_switch(char[8], int, int, char *[]) ;
  656. Xvoid bugs(int), help(void), locker(int) ;
  657. Xvoid kelly(int), long_descp(int), objlooker(int), killer(int) ;
  658. Xvoid gleeper(int), actor(int), ender(int), closer(int), opener(int) ;
  659. Xvoid dialer(int), taker(int), dropper(int), describe(int) ;
  660. Xvoid igniter(int), switcher(int), unlocker(int), sounder(int) ;
  661. Xvoid loader(void), eater(void), filler(void), looker(int), exit(int) ;
  662. Xvoid monster(int[3]), new_score(void), boom(void), parse(void) ;
  663. Xint mover(int,int[3]) ; 
  664. Xint yes_no(void) ;
  665. Xvoid inventer(void), drinker(void), reader(int), pusher(int*);
  666. Xvoid cheater(void) ; 
  667. Xvoid pass(void), unloader(int) ;
  668. Xlong time(long*) ;
  669. Xchar getch(void), getche(void) ;
  670. XOBJECT_STRUCT* point_to_object(int) ;
  671. X
  672. X#else
  673. X/* Function prototypes K&R-C */
  674. Xint mover() ; 
  675. Xint yes_no() ;
  676. Xlong time() ;
  677. Xchar getch(), getche() ;
  678. XOBJECT_STRUCT* point_to_object() ;
  679. X#endif
  680. X
  681. X/* Software security */
  682. Xif (serial != S_number) exit(0) ;  /* abort if serial number changed */
  683. X
  684. X/* Load the object pointers */
  685. XRifle = point_to_object(V_rifle) ;
  686. XTeapot = point_to_object(V_teapot) ;
  687. XCan = point_to_object(V_can) ;
  688. XClip = point_to_object(V_clip) ;
  689. XOrg_clip = point_to_object(V_org_clip) ;
  690. XRecorder = point_to_object(V_recorder) ;
  691. XCap = point_to_object(V_cap) ;
  692. XDynamite = point_to_object(V_dynamite) ;
  693. XLetter = point_to_object(V_letter) ;
  694. XClapper = point_to_object(V_clapper) ;
  695. XDetector = point_to_object(V_detector) ;
  696. XKey = point_to_object(V_key) ;
  697. XUmbrella = point_to_object(V_umbrella) ;
  698. XMatches = point_to_object(V_matches) ;
  699. XPills = point_to_object(V_pills) ;
  700. XCube = point_to_object(V_cube) ;
  701. XTorch = point_to_object(V_torch) ;
  702. XMat = point_to_object(V_mat) ;
  703. XMap = point_to_object(V_map) ;
  704. XMap_frag = point_to_object(V_map_frag) ;
  705. XBottle = point_to_object(V_bottle) ;
  706. XCircuit_breaker = point_to_object(V_circuit) ;
  707. XLift = point_to_object(V_lift) ;
  708. XDoor = point_to_object(V_door) ;
  709. XSafe = point_to_object(V_safe) ;
  710. XLift_door = point_to_object(V_lift_door) ;
  711. XPicture = point_to_object(V_picture) ;
  712. XTank = point_to_object(V_tank) ;
  713. XGong = point_to_object(V_gong) ;
  714. XTransporter = point_to_object(V_transporter) ;
  715. X
  716. X/* Scan the after the DOS/Unix command for switches or file name */
  717. Xif (argc > 1) {
  718. Xfor (i = 1; i <= argc-1; i++) {
  719. X    /* Flush command vector */
  720. X    for (j = 0; j <= 7; j++) cmd[j] = '\0' ;
  721. X    /* Get command vector */
  722. X    sscanf(argv[i],"%c%c%c%c%c%c%c%c%c", &chr, &cmd[0], &cmd[1],
  723. X        &cmd[2], &cmd[3], &cmd[4], &cmd[5], &cmd[6], &cmd[7]) ;
  724. X    sw_null = FALSE ;
  725. X    if (chr == '?') help() ;
  726. X    if (chr == '-') {
  727. X        for (j = 0; j <= 7; j++) {
  728. X            cmd_switch(cmd, j, i, argv) ;
  729. X            if (sw_number) {
  730. X                i++ ;
  731. X                sw_number = FALSE ;
  732. X                break ;
  733. X            }
  734. X            if (sw_null) break ;
  735. X        } /* end of command "for" loop */
  736. X
  737. X        if (j > 7) {
  738. Xprintf("\n!!!! Too many commands on one \"-\" switch group.\n") ;
  739. Xprintf("!!!! Break up the commands into several \"-\" switch groups.\n") ;
  740. X            bugs(Failed) ;
  741. X        }  
  742. X    } /* end of the "-" marker block */
  743. X
  744. X    /* Deal with garbage on the command line */
  745. X    else {
  746. Xprintf ("\n!!!! The following on the command line was not understood:  %s \n",
  747. X    argv[i]);
  748. X        bugs(Failed) ;
  749. X    } /* Nondefault scratch file opening block */
  750. X
  751. X} /* end of argument token "for" loop */
  752. X
  753. Xif (sw_help) help() ;
  754. X} /* end of the command switch block */
  755. X
  756. X/* Deal with someone cheating with switch "-s" */
  757. Xif (sw_standard && (!sw_wizard)) {
  758. X    printf("!!!! Command line switch -s is unknown.\n") ;
  759. X    bugs(Failed) ;
  760. X}
  761. X/* Software security */
  762. Xif (serial != S_number) exit(0) ;  /* abort if serial number changed */
  763. X
  764. X/* Initialize the program */
  765. Xsw_warned = FALSE ;
  766. Xl_time = time(time_arg) ;
  767. Xl_base = l_time/10 ;
  768. Xl_base *= 10 ;
  769. Xl_pass = l_time - l_base ;
  770. Xdig_1 = (int)l_pass ;
  771. Xloc[2] = 0 ;     /* zero out the "old" location */
  772. X
  773. Xprintf("                    ") ;
  774. Xprintf("                   --- Dinkum --- \n");
  775. Xprintf("                    ") ;
  776. Xprintf("     (c) Copyright 1993 by Gary A. Allen, Jr.\n") ;
  777. Xprintf("                    ") ;
  778. Xprintf("  All Rights Reserved. Version %s, %s\n\n",
  779. X    lb_version, lb_date);
  780. X
  781. Xprintf("Would like some initial help with Dinkum?\n") ;
  782. X
  783. Xif (yes_no()) {
  784. Xprintf("\nG'day Mate!  Welcome to \"Dinkum\" the Australian adventure");
  785. Xprintf("\ngame.  In Dinkum you'll search for treasure in the\n") ;
  786. Xprintf("Australian Outback.  You give the commands and I'll do the\n");
  787. Xprintf("dangerous work. I understand most plain English sentences.\n");
  788. Xprintf("If you want me to go east then type \"Will you please go\n");
  789. Xprintf("east?\" and press the RETURN or ENTER key.  If you don't\n") ;
  790. Xprintf("enjoy typing then just type \"e\" and press RETURN.  I'll\n");
  791. Xprintf("still go east.  After you have gathered up some things\n") ;
  792. Xprintf("you can see what you have by typing \"inventory\".\n") ;
  793. Xprintf("Sometimes you can learn more about an object by typing\n");
  794. Xprintf("\"examine NAME-OF-OBJECT\".  I understand many other\n") ;
  795. Xprintf("commands and words.  However I'll let you have the fun of\n") ;
  796. Xprintf("finding out what I can and can not understand. Good luck!\n\n");
  797. X}
  798. X
  799. X/* produce two random numbers ranging from 0-9 based on system clock*/
  800. Xl_time = time(time_arg) ;
  801. Xstart_time = l_time ;
  802. Xl_base = l_time/10 ;
  803. Xl_base *= 10 ;
  804. Xl_pass = l_time - l_base ;
  805. Xdig_2 = (int)l_pass ;
  806. X
  807. X/* generate the actual random array pointers */
  808. Xif (sw_standard) {
  809. X    i_rand1 = 2 ; 
  810. X    i_rand2 = 3 ;
  811. X    i_rand3 = 1 ;
  812. X}
  813. Xelse {
  814. X    i_rand3 = (dig_1 + dig_2)/2 ;
  815. X    i_rand2 = dig_2/3 ;
  816. X    i_rand1 = (dig_1/3) + 1 ;
  817. X}
  818. X
  819. Xprintf("\nIt's a hot summer day (in January) in ") ;
  820. Xprintf("Queensland, Australia.\n") ;
  821. Xloc[1] = R_meadow ;
  822. Xloc[0] = R_meadow ;
  823. X
  824. X/* Software security */
  825. Xif (serial != S_number) exit(0) ;  /* abort if serial number changed */
  826. X
  827. X/* load objects into the rooms */
  828. Xif (Gong->Status == S_recorder) Recorder->Location = R_meadow ;
  829. Xpnt = object ;
  830. Xfor (j = 0; j < Objcnt; j++) {
  831. X    for (i = 0; i < Obj_init_max; i++) {
  832. X        if (pnt->ID == obj_init[i][0]) {
  833. X            pnt->Location = obj_init[i][i_rand1] ;
  834. X            break ;
  835. X        }
  836. X    }
  837. X    i = pnt->Location ;
  838. X
  839. X    /* Flag the presence of unmovable objects in each room */
  840. X        if (pnt->Type == Z_unmovable) room[i][M_unmov_obj] = TRUE ; 
  841. X
  842. X    /* Count up number of movable objects in each room */
  843. X    else if (i >= 0) ++room[i][M_obj_cnt] ;
  844. X    
  845. X    pnt++ ;
  846. X}
  847. X
  848. Xcarry_count = 0 ;
  849. Xcarry_weight = 0 ;
  850. X
  851. X/* Initialize the Monsters */
  852. Xif ((monster_start = (MONSTER_STRUCT *)calloc((unsigned)(Enemy_cnt+1),
  853. X        sizeof(MONSTER_STRUCT))) == 0) {
  854. X    printf("\n---- PROBLEMS ----\n") ;
  855. X    printf("RAM memory is full!\n") ; 
  856. X    printf(" PROGRAM ABORTED\n") ;
  857. X    exit(0) ;
  858. X}
  859. X
  860. XNed = (monster_start + N_ned) ;        /* point to the Ned Kelly structure */
  861. XGuards = (monster_start + N_guards) ;  /* point to the Guards structure */
  862. XWombat = (monster_start + N_wombat) ;  /* point to the Wombat structure */
  863. XMullah = (monster_start + N_mullah) ;  /* point to the Mullah structure */
  864. X
  865. X/* Load up the monster data structure */
  866. Xfor (i = 0; i <= Enemy_cnt; i++) { 
  867. X    mnstr = (monster_start + i) ;     /* point to the monster */
  868. X
  869. X     /* locate the monster */
  870. X    if (i == 0) mnstr->Location = B_unmade ;
  871. X    else mnstr->Location = mon_init[i-1][i_rand2] ;
  872. X
  873. X    /* All monsters are initially asleep */
  874. X    mnstr->Status = F_asleep ;
  875. X
  876. X    /* Load Type numbers for the different monsters */
  877. X    switch(i) {
  878. X    case 2:
  879. X    case 3:
  880. X    case 4:
  881. X    case 5:
  882. X        mnstr->Type = N_drop_bear ;
  883. X        break ;
  884. X    case 6:
  885. X    case 7:
  886. X    case 8:
  887. X    case 9:
  888. X    case 10:
  889. X    case 11:
  890. X    case 12:
  891. X    case 13:
  892. X        mnstr->Type = N_hoop_snake ;
  893. X        break ;
  894. X    default:
  895. X        mnstr->Type = i ;
  896. X    } /* end of the monster Type switch block */
  897. X
  898. X    /* Monsters are initially healthy */
  899. X    mnstr->Hits = 0 ;    
  900. X
  901. X    j = mnstr->Location ;
  902. X    if (j != B_unmade) ++room[j][M_monster] ;
  903. X} /* end of the monster data structure loadup "for" loop */
  904. X/* load the gleep reproductive locations and seed gleep */
  905. Xfor (i = 0; i <= 9; i++)  
  906. X    gleep_spot[i] = gleep_init[i][i_rand2] ;
  907. Xroom[gleep_spot[0]-1][M_gleep] = 1 ; /* seed a nonreproductive spot */ 
  908. X
  909. X/* load safe passage for end-game killing passages  */
  910. Xroom[218 + i_rand3][M_rm_type] = T_short_descp ;
  911. X
  912. X/* Beginning of outer infinite "for" loop */
  913. Xfor(;;) {
  914. X/* special action routine */
  915. Xnew_score() ;  /* update the score */
  916. X
  917. X/* See if the game has timed out */
  918. Xl_time = time(time_arg) ;
  919. Xif ((!sw_warned) && (l_time > start_time + 3300L)) {
  920. X    sw_warned = TRUE ;
  921. X    start_time = l_time ;
  922. Xprintf("There's suddenly a puff of blue smoke which fills the room\n") ;
  923. Xprintf("with a hazy cloud.  Slowly this cloud coalesces into a\n") ;
  924. Xprintf("ghostly human form.  This ethereal being is wearing a grey\n") ;
  925. Xprintf("flannel suit, a bowler hat, and glancing at a gold pocket\n") ;
  926. Xprintf("watch which is attached to a long golden chain.  You can\n");
  927. Xprintf("hear \"Waltzing Matilda\" being played softly in the\n") ;
  928. Xprintf("background.  You know what?  I think this ethereal being\n") ;
  929. Xprintf("is none other than the ghost of Banjo Patterson!  With\n") ;
  930. Xprintf("this realization Banjo looks up in your direction and\n") ;
  931. Xprintf("begins to speak:\n\n") ;
  932. Xprintf("\"Sorry mate, you've been at this for too long!  You've\n") ;
  933. Xprintf("got five more minutes to go and then you're history!\"\n\n") ;
  934. Xprintf("Then just as suddenly Banjo Patterson dissolves back into\n") ;
  935. Xprintf("smoke and disappears from view.\n\n") ;
  936. X}
  937. Xif (sw_warned && (l_time > start_time + 300L)) {
  938. Xprintf("You hear someone clearing his throat behind you.  You turn\n") ;
  939. Xprintf("around and see Banjo Patterson has appeared once again.  An\n");
  940. Xprintf("old brass chain is hanging from mid air next to Banjo.  On\n") ;
  941. Xprintf("the end of the chain is a white porcelain tear drop shaped\n");
  942. Xprintf("nob with the word \"PULL\" written on it in black letters.\n") ;
  943. Xprintf("Banjo reaches for the nob and says the following:\n\n\"Sorry") ;
  944. Xprintf(" mate, your time has come!  Better luck next time!\"\n\n");
  945. Xprintf("He gives the chain a quick jerk and everything around you\n") ;
  946. Xprintf("slowly fades from view.\n\n") ;
  947. X    ender(F_quit) ;
  948. X}
  949. X
  950. Xkelly(loc[0]) ; /* check if Ned Kelly can do something */
  951. X/* Check if there is a long description */
  952. Xif ((!((room[R_hideout][M_monster] > 0) && (loc[0] == R_hideout))) &&
  953. X    (!((monster_flag == F_monster_active) && (loc[2] == loc[0])))) {
  954. X
  955. X    loc[2] = 0 ;
  956. X
  957. X/* Check if there is to be a long room description */
  958. Xif (room[loc[0]][M_rm_type] == T_long_descp) long_descp(loc[0]) ;
  959. Xelse {
  960. X    describe(loc[0]) ;  /* short description */
  961. X
  962. X    /* describe unmovable action objects and status */
  963. X    if (room[loc[0]][M_unmov_obj]) actor(loc[0]) ;
  964. X}
  965. X
  966. Xobjlooker(loc[0]) ; /* Check if there are objects in the room */
  967. Xgleeper(loc[0]) ;   /* check for gleeps and update the gleep count */
  968. X
  969. X/* see if the spaceship's transporter is active */
  970. Xif (Transporter->Status) {
  971. X    if (loc[0] == R_ship_passage) Transporter->Status = FALSE ;
  972. X    else if (loc[0] == R_transporter) {
  973. X        loc[0] = R_closet ;
  974. X        Transporter->Status = FALSE ;
  975. Xprintf("\nSuddenly radiant energy seems to surge from the hexagons\n");
  976. Xprintf("around you.  Then there is a bright flash and you find\n");
  977. Xprintf("yourself in.....\n\n") ;
  978. Xprintf("A closet stinking of moth balls full of nondescript junk.\n") ;
  979. Xprintf("The only exit is to the north through a curtain hanging\n");
  980. Xprintf("over the entrance.\n\n") ; 
  981. X    }
  982. X} /* end of the "transporter" block */
  983. X} /* end of long description check block */
  984. X
  985. Xfor(;;) {
  986. Xsw_loop = FALSE ;
  987. X
  988. X/* monster check */
  989. Xif ((room[loc[0]][M_monster] > 0)||(monster_flag != F_no_monster)) {
  990. X    if (monster_flag == F_wounded) monster_flag = F_monster_active ;
  991. X    else monster(loc) ;
  992. X} /* end of the monster check block */
  993. X
  994. X/* parse in the command */
  995. Xparse();
  996. X
  997. X/* poison check */
  998. X/* remove atropine drug with each game cycle */
  999. Xif (i_poison > 0) --i_poison ;
  1000. Xelse {
  1001. X    /* accumulate poison if holding the orange clip */
  1002. X    if (Org_clip->Location == B_have) {
  1003. X        --i_poison ;
  1004. X        switch (i_poison) {
  1005. X        case -20:
  1006. X    printf("You've developed a nervous tick near your eye.\n") ;
  1007. X            break ;
  1008. X        case -30:
  1009. X    printf("You're hands are starting to shake ") ;
  1010. X    printf("and you're sweating like a pig.\n") ;    
  1011. X            break ;
  1012. X        case -35:
  1013. X    printf("You're shaking so bad you can barely stand and you ");
  1014. X    printf("could lose your lunch\nat any moment.\n") ;
  1015. X            break ;
  1016. X        case -40:
  1017. Xprintf("The toxic fumes coming off of the orange ammo clip you were ") ;
  1018. Xprintf("carrying finally\ncaught up with you.  You fall over DEAD!\n") ;
  1019. X            ender(F_died) ;
  1020. X        }
  1021. X    }
  1022. X    /* remove poison after release of orange clip */
  1023. X    else if (i_poison < 0) ++i_poison ;
  1024. X} /* end of the poison check block */
  1025. X
  1026. X/* clock check */
  1027. Xif (sw_clock) {
  1028. X    switch (flag_clock) {
  1029. X    /* see if the blasting cap is to explode */
  1030. X    case V_cap:
  1031. X        if (time(time_arg) > clock_explode) {
  1032. X            if (Cap->Location == B_have) {
  1033. Xprintf("                           POP!!\n") ;
  1034. Xprintf("The blasting cap which you were stupidly holding in your\n") ;
  1035. Xprintf("hand just blew up and took two of your fingers with it!\n") ;
  1036. Xprintf("Good thing you've got another eight fingers to spare!\n\n") ;
  1037. X                carry_count-- ;
  1038. X                carry_weight -= Cap->Weight ;
  1039. X            }
  1040. X            else {
  1041. Xprintf("Far down the tunnel you hear a POP!\n") ;
  1042. Xprintf("The blasting cap has finally exploded, not that it\n");
  1043. Xprintf("achieved much except make a loud noise.\n\n") ;
  1044. X            }
  1045. X            Cap->Location = B_destroyed ;
  1046. X            sw_clock = FALSE ;
  1047. X        }
  1048. X        break ;
  1049. X    
  1050. X    /* see if the dynamite is to explode */
  1051. X    case V_dynamite:
  1052. X        if (time(time_arg) > clock_explode) {
  1053. X            /* player dies if he is holding the dynamite */
  1054. X            if (Dynamite->Location == B_have) {
  1055. X            boom() ;
  1056. X
  1057. Xprintf("The dynamite which you were holding and had earlier ignited\n");
  1058. Xprintf("the fuse has finally exploded.  That was a rather noisy\n");
  1059. Xprintf("and messy way to commit suicide!  Needless to say there is\n");
  1060. Xprintf("nothing left of you but a greasy spot.\n") ;
  1061. X            ender(F_died) ;
  1062. X            }
  1063. X            /* player dies if too close during explosion */
  1064. X            else {
  1065. X                if (((loc[0] <= 185) && (loc[0] >= 178))
  1066. X                  || ((loc[0] <= 170) && (loc[0] >= 166))) {
  1067. X                    boom() ;
  1068. X
  1069. Xprintf("You weren't far enough away from the dynamite when it\n");
  1070. Xprintf("exploded!  The shock wave was still strong enough to blow\n");
  1071. Xprintf("your brains out your ears.  Next time try to get to the\n") ;
  1072. Xprintf("upper level before the dynamite goes off.\n") ;
  1073. X                    ender(F_died) ;
  1074. X                }
  1075. X
  1076. X                /* dynamite explodes and player survives */
  1077. X                else {
  1078. Xprintf("Far down the tunnel you hear a low BOOM!\n") ;
  1079. Xprintf("That dynamite you set burning has finally exploded.\n\n");
  1080. X
  1081. X/* open up the passage to the UFO */
  1082. Xif (Dynamite->Location == R_blast_point) {
  1083. X    room[R_blast_point][1] = 186 ;
  1084. X    room[R_blast_point][M_descp] = 55 ;
  1085. X                    }
  1086. X                }
  1087. X            }
  1088. X            Dynamite->Location = B_destroyed ;
  1089. X            sw_clock = FALSE ;
  1090. X        } /* end of the dynamite explodes block */
  1091. X        break ;
  1092. X    }
  1093. X} /* end of the clock block */
  1094. X
  1095. X/* the command is a simple move command */
  1096. Xif (tag[V_MOVE]) {
  1097. X    if (mover(verb,loc)) break ;
  1098. X    continue ;
  1099. X} /* end of the "move" block */
  1100. X
  1101. X/* complicated command decoder */
  1102. Xswitch (verb) {
  1103. X/* "help" command */
  1104. Xcase V_help:
  1105. Xcase V_info:
  1106. Xprintf("There is no help available.  You're on your own!\n") ;
  1107. X    break ;
  1108. X/* "quit" command */
  1109. Xcase V_quit:
  1110. X    ender(F_quit) ;
  1111. X
  1112. X/* "question" command */
  1113. Xcase V_QUESTION:
  1114. X    if (tag[V_VERB_ONLY]) {
  1115. X        if (tag[V_how]) {
  1116. Xprintf("That's for you to figure out.\n") ;
  1117. X            break ;
  1118. X        }
  1119. Xprintf("I don't have a clue!\n") ;
  1120. X        break ;
  1121. X    }
  1122. X
  1123. X    /* Question "Where am I?" */
  1124. X    if (tag[V_where] && tag[V_am]) {
  1125. X        tag[V_VERB_ONLY] = TRUE ; /* This is for "looker" */
  1126. X        looker(loc[0]) ;
  1127. X        break ;
  1128. X    }
  1129. X
  1130. X    /* Question "What have I got?" */
  1131. X    if (tag[V_what] && tag[V_have]) {
  1132. X        inventer() ;
  1133. X        break ;
  1134. X    }
  1135. X
  1136. X    /* Question which can't be processed */
  1137. Xprintf("You asked a question.  Unfortunately I have no answers.\n") ;
  1138. X    break ;
  1139. X
  1140. X/* "inventory" command */
  1141. Xcase V_inventory: 
  1142. Xcase V_invent:
  1143. X    inventer() ;
  1144. X    break;
  1145. X
  1146. X/* "close" command  */
  1147. Xcase V_close:
  1148. Xcase V_shut:
  1149. X    closer(loc[0]) ;
  1150. X    break;
  1151. X
  1152. X/* "open" command  */
  1153. Xcase V_open:
  1154. Xcase V_swing:
  1155. X    opener(loc[0]) ;
  1156. X    break;
  1157. X
  1158. X/* "dial" command  */
  1159. Xcase V_dial:
  1160. Xcase V_combination:
  1161. X    dialer(loc[0]) ;
  1162. X    break ;
  1163. X/* "drink" command */
  1164. Xcase V_drink: 
  1165. X    drinker() ;
  1166. X    break ;
  1167. X
  1168. X/* "ignite" command */
  1169. Xcase V_ignite: 
  1170. Xcase V_light: 
  1171. X    igniter(loc[0]) ;
  1172. X    break ;
  1173. X
  1174. X/* "read" command  */
  1175. Xcase V_read:
  1176. X    reader(loc[0]) ;
  1177. X    break;
  1178. X/* "push" command  */
  1179. Xcase V_push:
  1180. Xcase V_press:
  1181. X    pusher(&loc[0]) ; 
  1182. X    break ;
  1183. X/* "turn", "switch" command */
  1184. Xcase V_switch:
  1185. Xcase V_turn:
  1186. Xcase V_select:
  1187. Xcase V_set:
  1188. X    switcher(loc[0]) ;
  1189. X    break ;
  1190. X/* "shoot" command  */
  1191. Xcase V_shoot:
  1192. Xcase V_fire:
  1193. Xcase V_kill:
  1194. X    killer(loc[0]) ;
  1195. X    break;
  1196. X/* "unlock" command  */
  1197. Xcase V_unlock:
  1198. X    unlocker(loc[0]) ;
  1199. X    break;
  1200. X/* "lock" command  */
  1201. Xcase V_lock:
  1202. X    locker(loc[0]) ;
  1203. X    break;
  1204. X/* "eat" command  */
  1205. Xcase V_eat:
  1206. Xcase V_swallow:
  1207. X    eater() ;
  1208. X    break;
  1209. X/* "fill" command  */
  1210. Xcase V_fill:
  1211. X    filler() ;
  1212. X    break;
  1213. X/* "sound" command  */
  1214. Xcase V_sound:
  1215. Xcase V_bang:
  1216. Xcase V_hit:
  1217. Xcase V_strike:
  1218. X    sounder(loc[0]) ;
  1219. X    break;
  1220. X
  1221. X/* "SVC" wizard move command */
  1222. X/* This command had an error in it discovered by Per-Anders Eriksson. */
  1223. X/*      Thanks, Per-Anders!                                           */
  1224. Xcase V_svc:
  1225. X    if (sw_wizard) {
  1226. X        printf ("Enter room coordinate number:  ");
  1227. X        scanf ("%d",&loc[0]);
  1228. X        monster_flag = F_no_monster ; /* turn off monsters */
  1229. X        sw_loop = TRUE ;
  1230. X        break ;
  1231. X    }
  1232. X    else cheater() ;
  1233. X
  1234. X/* "STATS" game statistics */
  1235. Xcase V_stats :
  1236. X        printf("      --- Dinkum --- \n");
  1237. X        printf("Version: %s, %s\n\n", lb_version, lb_date);
  1238. X        printf("i_rand1 = %d, i_rand2 = %d, i_rand3 = %d\n",
  1239. X            i_rand1, i_rand2, i_rand3) ;
  1240. X        printf("Room Number = %d\n", loc[0]) ;
  1241. X        printf("Room object count = %d \n",
  1242. X            room[loc[0]][M_obj_cnt]) ;
  1243. X        printf("Room monster count = %d\n",
  1244. X            room[loc[0]][M_monster]) ; 
  1245. X        printf("Gleeps on room's floor count = %d\n",
  1246. X            room[loc[0]][M_gleep]) ;
  1247. X        printf("Poison level = %d\n",i_poison) ;
  1248. X        printf("Gleep count = %d\n", gleep_count) ;
  1249. X        printf("carry_count = %d, carry_weight = %d\n",
  1250. X            carry_count, carry_weight) ;
  1251. X        break ;
  1252. X
  1253. X/* "SU" wizard initiation command */
  1254. Xcase V_su:
  1255. X    pass() ;
  1256. X    break ;
  1257. X
  1258. X/* "JSYS" wizard command which deactivates a monster */
  1259. Xcase V_jsys:
  1260. X    if (sw_wizard) monster_flag = F_no_monster ;
  1261. X    else cheater() ;
  1262. X    break ;
  1263. X
  1264. X/* "score" command */
  1265. Xcase V_score: 
  1266. X    new_score() ;
  1267. X    if ((Tank->Status == 0)&&(score == 0)) {
  1268. Xprintf("You haven't scored anything at all, Bozo! Try putting\n");
  1269. Xprintf("a valuable into the safe or find some gleeps.\n") ;
  1270. X        break ;
  1271. X    }
  1272. X    if (score == 0) { 
  1273. X        if (Tank->Status > 1) {
  1274. Xprintf("You haven't scored any points but you splashed ") ;
  1275. Xprintf ("%d gleeps into the gleep tank.\n",Tank->Status) ;
  1276. X        }
  1277. X        else {
  1278. Xprintf("You haven't scored any points at all but you did put a\n");
  1279. Xprintf ("gleep in the gleep tank (big deal!).\n") ;
  1280. X        }
  1281. X    }
  1282. X    else {
  1283. Xprintf ("You scored %d points ",score) ;
  1284. X        if (Tank->Status == 0) 
  1285. Xprintf ("but have yet to put any gleeps in the gleep tank.\n") ;
  1286. X        else {
  1287. X            if (Tank->Status > 1) 
  1288. Xprintf ("and put %d gleeps into the gleep tank.\n",Tank->Status) ;
  1289. X    
  1290. X            else 
  1291. Xprintf ("and put a gleep in the gleep tank.\n") ;
  1292. X        }
  1293. X    }
  1294. X    break ;
  1295. X/* "enter" command  */
  1296. Xcase V_enter:
  1297. Xswitch (loc[0]) {
  1298. X    /* Lift entrance at the ground level */
  1299. X    case R_lift_entr:
  1300. X        if (room[R_lift_entr][2] == R_WALL) {
  1301. Xprintf("I can't do it!  The lift door needs to be opened.\n") ;
  1302. X            continue ;
  1303. X        }
  1304. X        move_dir = V_east ;
  1305. X        break ;
  1306. X    /* office door */
  1307. X    case R_office_entr:
  1308. X        if (room[R_office_entr][2] == R_WALL) {
  1309. Xprintf("I can't go in!  The office door needs to be opened.\n") ;
  1310. X            continue ;
  1311. X        }
  1312. X        move_dir = V_east ;
  1313. X        break ;
  1314. X    /* Lift entrance at level #49 */
  1315. X    case R_L49_entr:
  1316. X        move_dir = V_east ;
  1317. X        break ;
  1318. X    /* Entrance to Ned Kelly's hideout */
  1319. X    case R_hideout_entr:
  1320. X        move_dir = V_east ;
  1321. X        break ;
  1322. X
  1323. X    /* Enter gleep tank (and suicide) */
  1324. X    case R_gleep_tank:
  1325. X        if (tag[V_tank]) {
  1326. Xprintf("\nYou climb up onto the edge of the gleep tank and dip your\n");
  1327. Xprintf("foot into the dark blue fluid.  Suddenly the fluid begins a\n");
  1328. Xprintf("furious boiling that instantly reduces your foot into\n") ;
  1329. Xprintf("bleached white bones.  The shock and pain disturbs your\n");
  1330. Xprintf("balance and you fall into the horrible stuff!!  There is\n");
  1331. Xprintf("once again a furious boiling.  Eventually the fluid stills\n");
  1332. Xprintf("and becomes clear again.  On the bottom of the tank can\n") ;
  1333. Xprintf("be seen a white, clean, \"medical school quality\" human\n");
  1334. Xprintf("skeleton.\n") ;
  1335. X            ender(F_died) ;
  1336. X        }
  1337. X    default:
  1338. X    printf("I don't understand exactly how to enter. \n");
  1339. X        continue ;
  1340. X} /* end of the "enter" switch block */
  1341. Xif (mover(move_dir, loc)) sw_loop = TRUE ;
  1342. Xbreak ;
  1343. X
  1344. X/* "exit" command  */
  1345. Xcase V_exit:
  1346. Xcase V_leave:
  1347. Xcase V_depart:
  1348. Xswitch (loc[0]) {
  1349. X    /* Lift entrance at the ground level */
  1350. X    case R_lift_inside:
  1351. X        move_dir = V_west ;
  1352. X        break ;
  1353. X    /* office door */
  1354. X    case R_office_hall:
  1355. X        move_dir = V_west ;
  1356. X        break ;
  1357. X    /* Ned Kelly's hideout */
  1358. X    case R_hideout :
  1359. X        move_dir = V_west ;
  1360. X        break ;
  1361. X    default:
  1362. Xprintf("I don't understand exactly how you want to exit.\n");
  1363. X        continue ;
  1364. X} /* end of the "depart" switch block */
  1365. Xif (mover(move_dir, loc)) sw_loop = TRUE ;
  1366. Xbreak ;
  1367. X
  1368. X/* "dig" command */
  1369. Xcase V_dig:
  1370. Xprintf("You get on your knees and scrape away at the ground for\n") ;
  1371. Xprintf("awhile. Except for getting your hands dirty you didn't\n") ;
  1372. Xprintf("achieve much.\n") ;
  1373. X    break ;
  1374. X
  1375. X/* "stand" command */
  1376. Xcase V_stand:
  1377. Xprintf("You're standing there very nicely.  However you're not\n");
  1378. Xprintf("achieving much by doing so.\n") ;
  1379. X    break ;
  1380. X
  1381. X/* "load" rifle command */
  1382. Xcase V_load:
  1383. X    loader() ;
  1384. X    break ;
  1385. X
  1386. X/* "unload" rifle command */
  1387. Xcase V_unload:
  1388. X    unloader(loc[0]) ;
  1389. X    break ;
  1390. X
  1391. X/* "pull" command */
  1392. Xcase V_pull:
  1393. X    if (tag[V_trigger]) {
  1394. X        /* alias in the "shoot" command */
  1395. X        verb = V_shoot ;
  1396. X        tag[V_VERB_ONLY] = TRUE ;
  1397. X        killer(loc[0]) ;   /* "pull trigger" */
  1398. X    }
  1399. X    else  printf("I don't see how I could pull that.\n") ;
  1400. X    break ;
  1401. X
  1402. X/* "climb" command */
  1403. Xcase V_climb:
  1404. Xprintf("I'm not climbing anything!  (I'm afraid of heights.)\n") ;
  1405. X    break ;
  1406. X
  1407. X/* "swim" command */
  1408. Xcase V_swim:
  1409. Xprintf("I'm not going for a swim!  (I'm afraid of the water.)\n") ;
  1410. X    break ;
  1411. X
  1412. X/* Go backwards to previous location */
  1413. Xcase V_back:
  1414. X    loc[0] = loc[1] ;
  1415. X    sw_loop = TRUE ;
  1416. X    break ;
  1417. X/* "take", "get", "lift" command */
  1418. Xcase V_take:
  1419. Xcase V_get:
  1420. Xcase V_lift:
  1421. Xcase V_pick:
  1422. Xcase V_grab:
  1423. Xcase V_remove:
  1424. Xcase V_attach:
  1425. Xcase V_hold:
  1426. X    taker(loc[0]) ;
  1427. X    break ;
  1428. X/* "drop", "throw", "put" command */
  1429. Xcase V_drop:
  1430. Xcase V_throw:
  1431. Xcase V_put:
  1432. Xcase V_fling:
  1433. Xcase V_toss:
  1434. Xcase V_insert:
  1435. Xcase V_give:
  1436. Xcase V_eject:
  1437. Xcase V_slow_drop:
  1438. X    dropper(loc[0]) ;
  1439. X    break ;
  1440. X
  1441. X/* "look" command */
  1442. Xcase V_look:
  1443. Xcase V_view:
  1444. Xcase V_examine:
  1445. Xcase V_inspect:
  1446. Xcase V_describe:
  1447. X    looker(loc[0]) ;
  1448. X    break;
  1449. X
  1450. X/* gibberish command */
  1451. Xdefault:
  1452. Xprintf("Huh?  You will have to make yourself clearer! \n");
  1453. X
  1454. X} /* end of "decoder" switch */
  1455. Xif (sw_loop) break ;
  1456. X} /* end of the inner infinite "for" loop */
  1457. X} /* end of the outer infinite "for" loop */
  1458. X
  1459. X} /* --- end of Main routine --- */
  1460. X
  1461. X#if (PROTOTYPE)
  1462. Xvoid cmd_switch(char cmd[8], int cmd_arg, int i_point, char *argv[])
  1463. X#else
  1464. Xvoid cmd_switch(cmd, cmd_arg, i_point, argv)
  1465. Xchar cmd[8], *argv[] ;
  1466. Xint cmd_arg, i_point ;
  1467. X#endif
  1468. X/*****************************************************/
  1469. X/*                                                   */
  1470. X/*         --- Command line Switch Parser ---        */
  1471. X/*                                                   */
  1472. X/*  (c) Copyright 1992,   University of Queensland   */
  1473. X/*        Program written by Gary A. Allen, Jr.      */
  1474. X/*           Version:  Mk 1.1   24 February 1992     */
  1475. X/*                                                   */
  1476. X/*****************************************************/
  1477. X{
  1478. X
  1479. X#if (PROTOTYPE)
  1480. Xvoid bugs(int), pass(void) ;
  1481. X#endif
  1482. X
  1483. Xswitch (cmd[cmd_arg]) {
  1484. Xcase '\0':
  1485. Xcase -1:
  1486. X    sw_null = TRUE ;
  1487. X    return ;
  1488. X
  1489. X/* Activate save script capability */
  1490. Xcase 's':
  1491. Xcase 'S':
  1492. X    Gong->Status = S_recorder ;
  1493. X    break ;
  1494. X
  1495. X/* Version verification command switch */
  1496. Xcase 'v':
  1497. X    if ((cmd[cmd_arg+1] == 'e')&&(cmd[cmd_arg+2] == 'r')) {
  1498. X        printf("Version: %s, Serial Number: %06d %s \n", 
  1499. X            lb_version, serial, lb_share) ;
  1500. X        bugs(Request) ;
  1501. X    }
  1502. X    else {
  1503. X        printf("!!!! Command line switch -v is unknown.\n") ;
  1504. X        bugs(Failed) ;
  1505. X    }
  1506. X
  1507. X/* Wizard mode command switch */
  1508. Xcase 'w':
  1509. Xcase 'W':
  1510. X    pass() ;
  1511. X    break ;
  1512. X
  1513. X/* Standard matrix load command switch */
  1514. Xcase 'x':
  1515. Xcase 'X':
  1516. X    sw_standard = TRUE ;
  1517. X    break ;
  1518. X
  1519. X/* Rubbish option to supress a warning */
  1520. Xcase 'y':
  1521. Xcase 'Y':
  1522. X    sw_number = TRUE ;
  1523. X    printf("y = %d\n", atoi(argv[i_point+1])) ;
  1524. X    return ;
  1525. X
  1526. X/* Help option */
  1527. Xcase '?':
  1528. Xcase 'h':
  1529. Xcase 'H':
  1530. X    sw_help = TRUE ;
  1531. X    return ;
  1532. X
  1533. Xcase ' ':
  1534. Xcase '-':
  1535. Xcase '1':
  1536. Xcase '2':
  1537. Xcase '3':
  1538. Xcase '4':
  1539. Xcase '5':
  1540. Xcase '6':
  1541. Xcase '7':
  1542. Xcase '8':
  1543. Xcase '9':
  1544. X    return ;
  1545. X
  1546. Xdefault:
  1547. Xprintf("!!!! Command line switch -%c is unknown.\n", cmd[cmd_arg]) ;
  1548. X    bugs(Failed) ;
  1549. X}
  1550. X} /* --- end of the cmd_switch subroutine --- */
  1551. X
  1552. X#if (PROTOTYPE)
  1553. Xvoid bugs(int i_type)
  1554. X#else
  1555. Xvoid bugs(i_type)
  1556. Xint i_type ;
  1557. X#endif
  1558. X/***************************************************************/
  1559. X/*                                                             */
  1560. X/*       (c) Copyright 1992,   University of Queensland        */
  1561. X/*            Program written by Gary A. Allen, Jr.            */
  1562. X/*             Version:  Mk 1.0        24 April 1992           */
  1563. X/*                                                             */
  1564. X/***************************************************************/
  1565. X{
  1566. Xswitch(i_type) {
  1567. Xcase Failed:
  1568. X    printf("!!!! If confused, type:  dinkum -h \n");
  1569. X    printf("!!!! --- Program ABORTED --- \n");
  1570. X    break ;
  1571. X
  1572. Xcase Request:
  1573. X    printf("Program terminated by user request.\n") ;
  1574. X    break ;
  1575. X
  1576. Xcase Logic_error:
  1577. X    printf("Please refer to program author's address by typing\n") ;
  1578. X    printf("\"dinkum -h\" and inform the author of this error.\n") ;
  1579. X    printf("             --- Program ABORTED ---\n") ;
  1580. X    break ;
  1581. X}
  1582. Xexit (0) ; 
  1583. X} /* --- end of the "bugs" subroutine --- */
  1584. X
  1585. X#if (PROTOTYPE)
  1586. Xvoid help(void) 
  1587. X#else
  1588. Xvoid help() 
  1589. X#endif
  1590. X/*****************************************************/
  1591. X/*                                                   */
  1592. X/*                    Help Routine                   */
  1593. X/*                                                   */
  1594. X/*  (c) Copyright 1992,   University of Queensland   */
  1595. X/*        Program written by Gary A. Allen, Jr.      */
  1596. X/*           Version:  Mk 1.0    24 April 1992       */
  1597. X/*                                                   */
  1598. X/*****************************************************/
  1599. X{
  1600. Xchar chr ;
  1601. X
  1602. Xprintf("                    --- Dinkum --- \n");
  1603. Xprintf("       (c) Copyright 1993 by Gary A. Allen, Jr.\n") ;
  1604. Xprintf("   All Rights Reserved. Version: %s, %s\n\n", 
  1605. X        lb_version, lb_date);
  1606. X
  1607. Xprintf("      Dinkum is a text style \"adventure\" game.\n\n") ;
  1608. X
  1609. Xprintf("You are free to use, copy and distribute Dinkum provided:\n") ;
  1610. Xprintf("       NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.\n") ;
  1611. Xprintf("       THIS PROGRAM IS FOR PRIVATE, NONCOMMERICAL USE ONLY.\n");
  1612. Xprintf("       THE PROGRAM MAY NOT BE MODIFIED IN ANY WAY.\n\n") ;
  1613. X
  1614. Xprintf("This program is provided AS IS without any warranty,\n") ;
  1615. Xprintf("expressed or implied, including but not limited to fitness\n") ;
  1616. Xprintf("for any particular purpose.\n\n") ;
  1617. X
  1618. X/* keep the screen from scrolling */
  1619. X#ifndef __TURBOC__
  1620. Xprintf("         [Press RETURN or ENTER to continue]") ;
  1621. Xchr = getchar() ;
  1622. X#endif
  1623. X
  1624. X#ifdef __TURBOC__
  1625. Xprintf("  [Press \"q\" to quit or any other key to continue]") ;
  1626. Xchr = getche() ;
  1627. Xprintf("\r                                                        \r") ;
  1628. X#endif
  1629. X
  1630. Xif ((chr == 'q')||(chr == 'Q')) exit (0) ;
  1631. X
  1632. Xprintf("If you start the game by typing \"dinkum -s\" rather than \n");
  1633. Xprintf("simply \"dinkum\" then the game creates a \"data recorder\" \n"); 
  1634. Xprintf("which appears in the beginning  of  the game.  The data \n"); 
  1635. Xprintf("recorder acts like a tape recorder allowing the user to \n"); 
  1636. Xprintf("save moves and play them back in the current  or  later \n"); 
  1637. Xprintf("games.  The generated file is in ASCII format  and  can \n"); 
  1638. Xprintf("be  edited  after  finishing  Dinkum.    Type  \"examine \n"); 
  1639. Xprintf("recorder\" after having taken it and Dinkum will explain \n"); 
  1640. Xprintf("how to use it.  This data  recorder  has  a  couple  of \n"); 
  1641. Xprintf("important  limitations:   Unlike  most adventure games, \n"); 
  1642. Xprintf("Dinkum is  dynamic,  viz.  the  game changes every time \n"); 
  1643. Xprintf("you play it.  So if you record  a  script  for  a  game \n"); 
  1644. Xprintf("which takes you to a room where you find a  weapon  and \n"); 
  1645. Xprintf("then to another room where you find a monster, then the \n"); 
  1646. Xprintf("next time you use  that script you may find the monster \n"); 
  1647. Xprintf("where you  previously  found  the  weapon (leading to a \n"); 
  1648. Xprintf("fairly short game). The other limitation  of  the  data \n"); 
  1649. Xprintf("recorder is if you use the \"dinkum -s\" switch then  you \n"); 
  1650. Xprintf("will  not  be  admitted  into  the  end  game  with the \n"); 
  1651. Xprintf("consequence being that  \"winning\" Dinkum is impossible. \n"); 
  1652. Xprintf("To win Dinkum you must  play  it  \"on your own\" without \n"); 
  1653. Xprintf("the unfair advantage of script files and data recorders.\n\n");
  1654. X
  1655. X/* keep the screen from scrolling */
  1656. X#ifndef __TURBOC__
  1657. Xprintf("         [Press RETURN or ENTER to continue]") ;
  1658. Xchr = getchar() ;
  1659. X#endif
  1660. X
  1661. X#ifdef __TURBOC__
  1662. Xprintf("  [Press \"q\" to quit or any other key to continue]") ;
  1663. Xchr = getche() ;
  1664. Xprintf("\r                                                        \r") ;
  1665. X#endif
  1666. X
  1667. Xif ((chr == 'q')||(chr == 'Q')) exit (0) ;
  1668. X
  1669. Xprintf("When corresponding please state the current version of\n") ;
  1670. Xprintf("Dinkum which you are using.  Contributions and questions\n") ;
  1671. Xprintf("about this program should be sent to the following address:\n\n") ;
  1672. Xprintf("          E-mail address:     gary@sun.mech.uq.oz.au\n\n") ;
  1673. Xprintf("          Postal address:     Gary A. Allen, Jr. \n");
  1674. Xprintf("                              P.O. Box 13\n") ;       
  1675. Xprintf("                              St. Lucia, Queensland  4067\n");
  1676. Xprintf("                              Australia\n") ;
  1677. X
  1678. Xexit(0);
  1679. X} /* ---- end of the "help" subroutine ---- */
  1680. X
  1681. X#if (PROTOTYPE)
  1682. Xvoid cheater(void) 
  1683. X#else
  1684. Xvoid cheater() 
  1685. X#endif
  1686. X/*****************************************************/
  1687. X/*                                                   */
  1688. X/*  (c) Copyright 1992,   University of Queensland   */
  1689. X/*        Program written by Gary A. Allen, Jr.      */
  1690. X/*           Version:  Mk 1.0   9 December 1992      */
  1691. X/*                                                   */
  1692. X/*****************************************************/
  1693. X{
  1694. Xprintf("Rather than cheat at this game by using a disassembler, you\n");
  1695. Xprintf("should send the author $150 and he'll gladly send you\n") ;
  1696. Xprintf("the source code.  If you just want a clue, then send $20\n") ;
  1697. Xprintf("with your question and he'll provide the answer.  You can find\n") ;
  1698. Xprintf("the author's address by typing:  dinkum -h\n") ;
  1699. X        exit(0) ;
  1700. X} /* ---- end of the "cheater" subroutine ---- */
  1701. X
  1702. X#if (PROTOTYPE)
  1703. Xint mover(int direction, int loc[3])
  1704. X#else
  1705. Xint mover(direction,loc)
  1706. Xint direction, loc[3] ;
  1707. X#endif
  1708. X/*****************************************************/
  1709. X/*                                                   */
  1710. X/*  (c) Copyright 1992,   University of Queensland   */
  1711. X/*        Program written by Gary A. Allen, Jr.      */
  1712. X/*           Version:  Mk 1.0  17 December 1992      */
  1713. X/*                                                   */
  1714. X/*****************************************************/
  1715. X{
  1716. X
  1717. X#if (PROTOTYPE)
  1718. X/* Function prototypes */
  1719. Xvoid long_descp(int), ender(int), boom(void) ;
  1720. X#endif
  1721. X
  1722. X/* see if this movement prohibits blasting caps */
  1723. Xif (((direction == V_u)||(direction == V_up)) &&
  1724. X        ((loc[0] == R_manhole_1)||(loc[0] == R_manhole_2))) {
  1725. X
  1726. X    if (Cap->Location == B_have) {
  1727. Xprintf("As you were climbing up through the hole in the ceiling,\n");
  1728. Xprintf("the blasting cap slipped from your grasp and fell to the\n") ;
  1729. Xprintf("floor below where it detonated on impact.  The explosion\n") ;
  1730. Xprintf("was deafening, but caused no damage.\n") ;
  1731. X        carry_count-- ;
  1732. X        carry_weight -= Cap->Weight ;
  1733. X        Cap->Location = B_destroyed; 
  1734. X    }
  1735. X    else {
  1736. X        if ((Dynamite->Location == B_have)&&(Dynamite->Type == Z_alias)) {
  1737. X            boom() ;
  1738. X
  1739. Xprintf("As you were climbing up through the hole in the ceiling,\n");
  1740. Xprintf("the dynamite with the blasting cap inside slipped from\n") ;
  1741. Xprintf("your grasp and fell to the floor below where it detonated\n") ;
  1742. Xprintf("on impact.  At that point you literally became a human\n");
  1743. Xprintf("cannon ball as the shock wave carried you up the vertical\n");
  1744. Xprintf("passage and splattered you into protoplasmic jelly on the\n");
  1745. Xprintf("ceiling above.\n") ; 
  1746. X            ender(F_died) ;
  1747. X        }
  1748. X    }
  1749. X} /* end of the cap/manhole block */
  1750. X
  1751. Xdirection-- ;
  1752. Xif (room[loc[0]][direction] == R_WALL) {
  1753. X    printf("You can't go that way. \n");
  1754. X    return(FALSE) ;
  1755. X}
  1756. X
  1757. X/* save previous location */
  1758. Xloc[1] = loc[0] ;
  1759. Xloc[0] = room[loc[0]][direction] ;
  1760. X
  1761. X/* See if player walked into a lethal room */
  1762. Xif (room[loc[0]][M_rm_type] == T_lethal) {
  1763. X    long_descp(loc[0]) ;
  1764. X    ender(F_died) ;
  1765. X}
  1766. Xreturn(TRUE) ;
  1767. X} /* --- end of the "mover" function --- */
  1768. X
  1769. X#if (PROTOTYPE)
  1770. Xint yes_no(void)
  1771. X#else
  1772. Xint yes_no()
  1773. X#endif
  1774. X/*****************************************************/
  1775. X/*                                                   */
  1776. X/*  (c) Copyright 1993,   University of Queensland   */
  1777. X/*        Program written by Gary A. Allen, Jr.      */
  1778. X/*           Version:  Mk 1.0  27 January 1993       */
  1779. X/*                                                   */
  1780. X/*****************************************************/
  1781. X{
  1782. X
  1783. Xchar chr ;
  1784. X
  1785. X#if (PROTOTYPE)
  1786. X/* Function prototypes ANSI C */
  1787. Xchar getch(void), getche(void) ;
  1788. X
  1789. X#else
  1790. X/* Function prototypes K&R-C */
  1791. Xchar getch(), getche() ;
  1792. X#endif
  1793. X
  1794. Xfor (;;) {
  1795. X
  1796. X#ifndef __TURBOC__
  1797. X    do {
  1798. X        printf("(Answer:  Yes or No) ") ; 
  1799. X    } while ('\n' == (chr = getchar())) ;
  1800. X
  1801. X    while ('\n' != getchar()) ;
  1802. X#endif
  1803. X
  1804. X#ifdef __TURBOC__
  1805. X    printf("\n") ;
  1806. X    do {
  1807. X        printf("(Answer:  Yes or No) ") ; 
  1808. X    } while ('\n' == (chr = getch())) ;
  1809. X    printf("\n") ;
  1810. X#endif
  1811. X
  1812. X    if (('n' == chr)||('N' == chr)||('y' == chr)||('Y' == chr)) break ;
  1813. X} /* end of the infinite "for" loop */
  1814. X
  1815. Xif (('y' == chr)||('Y' == chr)) return(TRUE) ;
  1816. Xelse return(FALSE) ;
  1817. X
  1818. X} /* --- end of the "yes_no" function --- */
  1819. END_OF_FILE
  1820. if test 35524 -ne `wc -c <'dinkum.c'`; then
  1821.     echo shar: \"'dinkum.c'\" unpacked with wrong size!
  1822. fi
  1823. # end of 'dinkum.c'
  1824. fi
  1825. if test -f 'make.unx' -a "${1}" != "-c" ; then 
  1826.   echo shar: Will not clobber existing file \"'make.unx'\"
  1827. else
  1828. echo shar: Extracting \"'make.unx'\" \(972 characters\)
  1829. sed "s/^X//" >'make.unx' <<'END_OF_FILE'
  1830. XCFLAGS =  -c
  1831. XHEAD = dink_sym.h dink_glb.h
  1832. X
  1833. X# Don't add anymore files because the makefile with the Borland Ver. 2
  1834. X#    Tlink will choke and die.
  1835. X
  1836. XOBJECTS = dinkum.o describe.o longdsc.o objlook.o actor.o \
  1837. Xpusher.o monster.o opener.o parse.o taker.o
  1838. Xdinkum: $(OBJECTS)
  1839. X    cc $(OBJECTS) -o dinkum
  1840. Xdinkum.o: dinkum.c $(HEAD)
  1841. X    cc $(CFLAGS) dinkum.c
  1842. Xdescribe.o: describe.c $(HEAD)
  1843. X    cc $(CFLAGS) describe.c
  1844. Xlongdsc.o: longdsc.c $(HEAD)
  1845. X    cc $(CFLAGS) longdsc.c
  1846. Xobjlook.o: objlook.c $(HEAD)
  1847. X    cc $(CFLAGS) objlook.c
  1848. Xpusher.o: pusher.c $(HEAD)
  1849. X    cc $(CFLAGS) pusher.c
  1850. Xactor.o: actor.c $(HEAD)
  1851. X    cc $(CFLAGS) actor.c
  1852. Xmonster.o: monster.c $(HEAD)
  1853. X    cc $(CFLAGS) monster.c
  1854. Xopener.o: opener.c $(HEAD)
  1855. X    cc $(CFLAGS) opener.c
  1856. Xtaker.o: taker.c $(HEAD)
  1857. X    cc $(CFLAGS) taker.c
  1858. X
  1859. Xparse.o: parse.c $(HEAD)
  1860. X# Replace with PROMPT if you want a prompt with every command entry.
  1861. X# This modification was suggested by Chris Herborth.  Thanks, Chris!
  1862. X#    cc $(CFLAGS) -DPROMPT parse.c
  1863. X    cc $(CFLAGS) parse.c
  1864. X
  1865. END_OF_FILE
  1866. if test 972 -ne `wc -c <'make.unx'`; then
  1867.     echo shar: \"'make.unx'\" unpacked with wrong size!
  1868. fi
  1869. # end of 'make.unx'
  1870. fi
  1871. if test -f 'makefile' -a "${1}" != "-c" ; then 
  1872.   echo shar: Will not clobber existing file \"'makefile'\"
  1873. else
  1874. echo shar: Extracting \"'makefile'\" \(972 characters\)
  1875. sed "s/^X//" >'makefile' <<'END_OF_FILE'
  1876. XCFLAGS =  -c
  1877. XHEAD = dink_sym.h dink_glb.h
  1878. X
  1879. X# Don't add anymore files because the makefile with the Borland Ver. 2
  1880. X#    Tlink will choke and die.
  1881. X
  1882. XOBJECTS = dinkum.o describe.o longdsc.o objlook.o actor.o \
  1883. Xpusher.o monster.o opener.o parse.o taker.o
  1884. Xdinkum: $(OBJECTS)
  1885. X    cc $(OBJECTS) -o dinkum
  1886. Xdinkum.o: dinkum.c $(HEAD)
  1887. X    cc $(CFLAGS) dinkum.c
  1888. Xdescribe.o: describe.c $(HEAD)
  1889. X    cc $(CFLAGS) describe.c
  1890. Xlongdsc.o: longdsc.c $(HEAD)
  1891. X    cc $(CFLAGS) longdsc.c
  1892. Xobjlook.o: objlook.c $(HEAD)
  1893. X    cc $(CFLAGS) objlook.c
  1894. Xpusher.o: pusher.c $(HEAD)
  1895. X    cc $(CFLAGS) pusher.c
  1896. Xactor.o: actor.c $(HEAD)
  1897. X    cc $(CFLAGS) actor.c
  1898. Xmonster.o: monster.c $(HEAD)
  1899. X    cc $(CFLAGS) monster.c
  1900. Xopener.o: opener.c $(HEAD)
  1901. X    cc $(CFLAGS) opener.c
  1902. Xtaker.o: taker.c $(HEAD)
  1903. X    cc $(CFLAGS) taker.c
  1904. X
  1905. Xparse.o: parse.c $(HEAD)
  1906. X# Replace with PROMPT if you want a prompt with every command entry.
  1907. X# This modification was suggested by Chris Herborth.  Thanks, Chris!
  1908. X#    cc $(CFLAGS) -DPROMPT parse.c
  1909. X    cc $(CFLAGS) parse.c
  1910. X
  1911. END_OF_FILE
  1912. if test 972 -ne `wc -c <'makefile'`; then
  1913.     echo shar: \"'makefile'\" unpacked with wrong size!
  1914. fi
  1915. # end of 'makefile'
  1916. fi
  1917. echo shar: End of archive 2 \(of 7\).
  1918. cp /dev/null ark2isdone
  1919. MISSING=""
  1920. for I in 1 2 3 4 5 6 7 ; do
  1921.     if test ! -f ark${I}isdone ; then
  1922.     MISSING="${MISSING} ${I}"
  1923.     fi
  1924. done
  1925. if test "${MISSING}" = "" ; then
  1926.     echo You have unpacked all 7 archives.
  1927.     rm -f ark[1-9]isdone
  1928. else
  1929.     echo You still need to unpack the following archives:
  1930.     echo "        " ${MISSING}
  1931. fi
  1932. ##  End of shell archive.
  1933. exit 0
  1934.