ballop.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* BALLOP- BALLOON FUNCTION */
  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. logical ballop_(arg)
  8. integer arg;
  9. {
  10. /* System generated locals */
  11. logical ret_val;
  12. ret_val = TRUE_;
  13. /* !ASSUME WINS. */
  14. if (arg != 2) {
  15. goto L200;
  16. }
  17. /* !READOUT? */
  18. if (prsvec_1.prsa != vindex_1.lookw) {
  19. goto L10;
  20. }
  21. /* !ONLY PROCESS LOOK. */
  22. if (findex_1.binff != 0) {
  23. goto L50;
  24. }
  25. /* !INFLATED? */
  26. rspeak_(543);
  27. /* !NO. */
  28. goto L100;
  29. L50:
  30. rspsub_(544, objcts_1.odesc2[findex_1.binff - 1]);
  31. /* !YES. */
  32. L100:
  33. if (findex_1.btief != 0) {
  34. rspeak_(545);
  35. }
  36. /* !HOOKED? */
  37. return ret_val;
  38. L200:
  39. if (arg != 1) {
  40. goto L500;
  41. }
  42. /* !READIN? */
  43. if (prsvec_1.prsa != vindex_1.walkw) {
  44. goto L300;
  45. }
  46. /* !WALK? */
  47. if (findxt_(prsvec_1.prso, play_1.here)) {
  48. goto L250;
  49. }
  50. /* !VALID EXIT? */
  51. rspeak_(546);
  52. /* !NO, JOKE. */
  53. return ret_val;
  54. L250:
  55. if (findex_1.btief == 0) {
  56. goto L275;
  57. }
  58. /* !TIED UP? */
  59. rspeak_(547);
  60. /* !YES, JOKE. */
  61. return ret_val;
  62. L275:
  63. if (curxt_1.xtype != xpars_1.xnorm) {
  64. goto L10;
  65. }
  66. /* !NORMAL EXIT? */
  67. if ((rooms_1.rflag[curxt_1.xroom1 - 1] & RMUNG) == 0) {
  68. state_1.bloc = curxt_1.xroom1;
  69. }
  70. L10:
  71. ret_val = FALSE_;
  72. return ret_val;
  73. L300:
  74. if (prsvec_1.prsa != vindex_1.takew || prsvec_1.prso != findex_1.binff) {
  75. goto L350;
  76. }
  77. rspsub_(548, objcts_1.odesc2[findex_1.binff - 1]);
  78. /* !RECEP CONT TOO HOT. */
  79. return ret_val;
  80. L350:
  81. if (prsvec_1.prsa != vindex_1.putw || prsvec_1.prsi != oindex_1.recep ||
  82. qempty_(oindex_1.recep)) {
  83. goto L10;
  84. }
  85. rspeak_(549);
  86. return ret_val;
  87. L500:
  88. if (prsvec_1.prsa != vindex_1.unboaw || (rooms_1.rflag[play_1.here - 1] &
  89. RLAND) == 0) {
  90. goto L600;
  91. }
  92. if (findex_1.binff != 0) {
  93. cevent_1.ctick[cindex_1.cevbal - 1] = 3;
  94. }
  95. /* !HE GOT OUT, START BALLOON. */
  96. goto L10;
  97. L600:
  98. if (prsvec_1.prsa != vindex_1.burnw || objcts_1.ocan[prsvec_1.prso - 1] !=
  99. oindex_1.recep) {
  100. goto L700;
  101. }
  102. rspsub_(550, objcts_1.odesc2[prsvec_1.prso - 1]);
  103. /* !LIGHT FIRE IN RECEP. */
  104. cevent_1.ctick[cindex_1.cevbrn - 1] = objcts_1.osize[prsvec_1.prso - 1] *
  105. 20;
  106. objcts_1.oflag1[prsvec_1.prso - 1] |= ONBT + FLAMBT +
  107. LITEBT & ~ (TAKEBT + READBT);
  108. if (findex_1.binff != 0) {
  109. return ret_val;
  110. }
  111. if (! findex_1.blabf) {
  112. newsta_(oindex_1.blabe, 0, 0, oindex_1.ballo, 0);
  113. }
  114. findex_1.blabf = TRUE_;
  115. findex_1.binff = prsvec_1.prso;
  116. cevent_1.ctick[cindex_1.cevbal - 1] = 3;
  117. rspeak_(551);
  118. return ret_val;
  119. L700:
  120. if (prsvec_1.prsa == vindex_1.unboaw && findex_1.binff != 0 && (
  121. rooms_1.rflag[play_1.here - 1] & RLAND) != 0) {
  122. cevent_1.ctick[cindex_1.cevbal - 1] = 3;
  123. }
  124. goto L10;
  125. } /* ballop_ */