dso1.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /* PRINCR- PRINT CONTENTS OF ROOM */
  2. /*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/
  3. /* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */
  4. /* WRITTEN BY R. M. SUPNIK */
  5. #include "funcs.h"
  6. #include "vars.h"
  7. void princr_(full, rm)
  8. logical full;
  9. integer rm;
  10. {
  11. /* System generated locals */
  12. integer i__1, i__2;
  13. /* Local variables */
  14. integer i, j, k;
  15. j = 329;
  16. /* !ASSUME SUPERBRIEF FORMAT. */
  17. i__1 = objcts_1.olnt;
  18. for (i = 1; i <= i__1; ++i) {
  19. /* !LOOP ON OBJECTS */
  20. if (! qhere_(i, rm) || (objcts_1.oflag1[i - 1] & VISIBT +
  21. NDSCBT) != VISIBT || i == advs_1.avehic[
  22. play_1.winner - 1]) {
  23. goto L500;
  24. }
  25. if (! (full) && (findex_1.superf || findex_1.brieff && (
  26. rooms_1.rflag[play_1.here - 1] & RSEEN) != 0)) {
  27. goto L200;
  28. }
  29. /* DO LONG DESCRIPTION OF OBJECT. */
  30. k = objcts_1.odesco[i - 1];
  31. /* !GET UNTOUCHED. */
  32. if (k == 0 || (objcts_1.oflag2[i - 1] & TCHBT) != 0) {
  33. k = objcts_1.odesc1[i - 1];
  34. }
  35. rspeak_(k);
  36. /* !DESCRIBE. */
  37. goto L500;
  38. /* DO SHORT DESCRIPTION OF OBJECT. */
  39. L200:
  40. rspsub_(j, objcts_1.odesc2[i - 1]);
  41. /* !YOU CAN SEE IT. */
  42. j = 502;
  43. L500:
  44. ;
  45. }
  46. /* NOW LOOP TO PRINT CONTENTS OF OBJECTS IN ROOM. */
  47. i__1 = objcts_1.olnt;
  48. for (i = 1; i <= i__1; ++i) {
  49. /* !LOOP ON OBJECTS. */
  50. if (! qhere_(i, rm) || (objcts_1.oflag1[i - 1] & VISIBT +
  51. NDSCBT) != VISIBT) {
  52. goto L1000;
  53. }
  54. if ((objcts_1.oflag2[i - 1] & ACTRBT) != 0) {
  55. i__2 = oactor_(i);
  56. invent_(i__2);
  57. }
  58. if ((objcts_1.oflag1[i - 1] & TRANBT) == 0 && (
  59. objcts_1.oflag2[i - 1] & OPENBT) == 0 || qempty_(i))
  60. {
  61. goto L1000;
  62. }
  63. /* OBJECT IS NOT EMPTY AND IS OPEN OR TRANSPARENT. */
  64. j = 573;
  65. if (i != oindex_1.tcase) {
  66. goto L600;
  67. }
  68. /* !TROPHY CASE? */
  69. j = 574;
  70. if ((findex_1.brieff || findex_1.superf) && ! (full)) {
  71. goto L1000;
  72. }
  73. L600:
  74. princo_(i, j);
  75. /* !PRINT CONTENTS. */
  76. L1000:
  77. ;
  78. }
  79. } /* princr_ */
  80. /* INVENT- PRINT CONTENTS OF ADVENTURER */
  81. /* DECLARATIONS */
  82. void invent_(adv)
  83. integer adv;
  84. {
  85. /* System generated locals */
  86. integer i__1;
  87. /* Local variables */
  88. integer i, j;
  89. i = 575;
  90. /* !FIRST LINE. */
  91. if (adv != aindex_1.player) {
  92. i = 576;
  93. }
  94. /* !IF NOT ME. */
  95. i__1 = objcts_1.olnt;
  96. for (j = 1; j <= i__1; ++j) {
  97. /* !LOOP */
  98. if (objcts_1.oadv[j - 1] != adv || (objcts_1.oflag1[j - 1] &
  99. VISIBT) == 0) {
  100. goto L10;
  101. }
  102. rspsub_(i, objcts_1.odesc2[advs_1.aobj[adv - 1] - 1]);
  103. i = 0;
  104. rspsub_(502, objcts_1.odesc2[j - 1]);
  105. L10:
  106. ;
  107. }
  108. if (i == 0) {
  109. goto L25;
  110. }
  111. /* !ANY OBJECTS? */
  112. if (adv == aindex_1.player) {
  113. rspeak_(578);
  114. }
  115. /* !NO, TELL HIM. */
  116. return;
  117. L25:
  118. i__1 = objcts_1.olnt;
  119. for (j = 1; j <= i__1; ++j) {
  120. /* !LOOP. */
  121. if (objcts_1.oadv[j - 1] != adv || (objcts_1.oflag1[j - 1] &
  122. VISIBT) == 0 || (objcts_1.oflag1[j - 1] &
  123. TRANBT) == 0 && (objcts_1.oflag2[j - 1] &
  124. OPENBT) == 0) {
  125. goto L100;
  126. }
  127. if (! qempty_(j)) {
  128. princo_(j, 573);
  129. }
  130. /* !IF NOT EMPTY, LIST. */
  131. L100:
  132. ;
  133. }
  134. } /* invent_ */
  135. /* PRINCO- PRINT CONTENTS OF OBJECT */
  136. /* DECLARATIONS */
  137. void princo_(obj, desc)
  138. integer obj;
  139. integer desc;
  140. {
  141. /* System generated locals */
  142. integer i__1;
  143. /* Local variables */
  144. integer i;
  145. rspsub_(desc, objcts_1.odesc2[obj - 1]);
  146. /* !PRINT HEADER. */
  147. i__1 = objcts_1.olnt;
  148. for (i = 1; i <= i__1; ++i) {
  149. /* !LOOP THRU. */
  150. if (objcts_1.ocan[i - 1] == obj) {
  151. rspsub_(502, objcts_1.odesc2[i - 1]);
  152. }
  153. /* L100: */
  154. }
  155. } /* princo_ */