dso2.for 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. C MOVETO- MOVE PLAYER TO NEW ROOM
  2. C
  3. C COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
  4. C ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
  5. C WRITTEN BY R. M. SUPNIK
  6. C
  7. C DECLARATIONS
  8. C
  9. LOGICAL FUNCTION MOVETO(NR,WHO)
  10. IMPLICIT INTEGER (A-Z)
  11. LOGICAL NLV,LHR,LNR
  12. include 'gamestat.h'
  13. include 'rooms.h'
  14. include 'rflag.h'
  15. include 'objects.h'
  16. include 'oindex.h'
  17. include 'advers.h'
  18. C MOVETO, PAGE 2
  19. C
  20. MOVETO=.FALSE.
  21. C !ASSUME FAILS.
  22. LHR=IAND(RFLAG(HERE),RLAND).NE.0
  23. LNR=IAND(RFLAG(NR),RLAND).NE.0
  24. J=AVEHIC(WHO)
  25. C !HIS VEHICLE
  26. C
  27. IF(J.NE.0) GO TO 100
  28. C !IN VEHICLE?
  29. IF(LNR) GO TO 500
  30. C !NO, GOING TO LAND?
  31. CALL RSPEAK(427)
  32. C !CAN'T GO WITHOUT VEHICLE.
  33. RETURN
  34. C
  35. 100 BITS=0
  36. C !ASSUME NOWHERE.
  37. IF(J.EQ.RBOAT) BITS=RWATER
  38. C !IN BOAT?
  39. IF(J.EQ.BALLO) BITS=RAIR
  40. C !IN BALLOON?
  41. IF(J.EQ.BUCKE) BITS=RBUCK
  42. C !IN BUCKET?
  43. NLV=IAND(RFLAG(NR),BITS).EQ.0
  44. IF((.NOT.LNR .AND.NLV) .OR.
  45. & (LNR.AND.LHR.AND.NLV.AND.(BITS.NE.RLAND)))
  46. & GO TO 800
  47. C
  48. 500 MOVETO=.TRUE.
  49. C !MOVE SHOULD SUCCEED.
  50. IF(IAND(RFLAG(NR),RMUNG).EQ.0) GO TO 600
  51. CALL RSPEAK(RRAND(NR))
  52. C !YES, TELL HOW.
  53. RETURN
  54. C
  55. 600 IF(WHO.NE.PLAYER) CALL NEWSTA(AOBJ(WHO),0,NR,0,0)
  56. IF(J.NE.0) CALL NEWSTA(J,0,NR,0,0)
  57. HERE=NR
  58. AROOM(WHO)=HERE
  59. CALL SCRUPD(RVAL(NR))
  60. C !SCORE ROOM
  61. RVAL(NR)=0
  62. RETURN
  63. C
  64. 800 CALL RSPSUB(428,ODESC2(J))
  65. C !WRONG VEHICLE.
  66. RETURN
  67. END
  68. C SCORE-- PRINT OUT CURRENT SCORE
  69. C
  70. C DECLARATIONS
  71. C
  72. SUBROUTINE SCORE(FLG)
  73. IMPLICIT INTEGER (A-Z)
  74. LOGICAL FLG
  75. INTEGER RANK(10),ERANK(5)
  76. include 'gamestat.h'
  77. include 'state.h'
  78. C
  79. COMMON /CHAN/ INPCH,OUTCH,DBCH
  80. include 'advers.h'
  81. include 'flags.h'
  82. C
  83. C FUNCTIONS AND DATA
  84. C
  85. DATA RANK/20,19,18,16,12,8,4,2,1,0/
  86. DATA ERANK/20,15,10,5,0/
  87. C SCORE, PAGE 2
  88. C
  89. AS=ASCORE(WINNER)
  90. C
  91. IF(ENDGMF) GO TO 60
  92. C !ENDGAME?
  93. IF(FLG) WRITE(OUTCH,100)
  94. IF(.NOT.FLG) WRITE(OUTCH,110)
  95. IF(MOVES.NE.1) WRITE(OUTCH,120) AS,MXSCOR,MOVES
  96. IF(MOVES.EQ.1) WRITE(OUTCH,130) AS,MXSCOR,MOVES
  97. C
  98. DO 10 I=1,10
  99. IF((AS*20/MXSCOR).GE.RANK(I)) GO TO 50
  100. 10 CONTINUE
  101. 50 CALL RSPEAK(484+I)
  102. RETURN
  103. C
  104. 60 IF(FLG) WRITE(OUTCH,140)
  105. IF(.NOT.FLG) WRITE(OUTCH,150)
  106. WRITE(OUTCH,120) EGSCOR,EGMXSC,MOVES
  107. DO 70 I=1,5
  108. IF((EGSCOR*20/EGMXSC).GE.ERANK(I)) GO TO 80
  109. 70 CONTINUE
  110. 80 CALL RSPEAK(786+I)
  111. RETURN
  112. 100 FORMAT(' Your score would be',$)
  113. 110 FORMAT(' Your score is',$)
  114. 120 FORMAT(I4,' [total of',I4,' points], in',I5,' moves.')
  115. 130 FORMAT(I4,' [total of',I4,' points], in',I5,' move.')
  116. 140 FORMAT(' Your score in the endgame would be',$)
  117. 150 FORMAT(' Your score in the endgame is',$)
  118. C
  119. END
  120. C SCRUPD- UPDATE WINNER'S SCORE
  121. C
  122. C DECLARATIONS
  123. C
  124. SUBROUTINE SCRUPD(N)
  125. IMPLICIT INTEGER (A-Z)
  126. include 'gamestat.h'
  127. include 'state.h'
  128. include 'clock.h'
  129. include 'advers.h'
  130. include 'flags.h'
  131. C
  132. IF(ENDGMF) GO TO 100
  133. C !ENDGAME?
  134. ASCORE(WINNER)=ASCORE(WINNER)+N
  135. C !UPDATE SCORE
  136. RWSCOR=RWSCOR+N
  137. C !UPDATE RAW SCORE
  138. IF(ASCORE(WINNER).LT.(MXSCOR-(10*DEATHS))) RETURN
  139. CFLAG(CEVEGH)=.TRUE.
  140. C !TURN ON END GAME
  141. CTICK(CEVEGH)=15
  142. RETURN
  143. C
  144. 100 EGSCOR=EGSCOR+N
  145. C !UPDATE EG SCORE.
  146. RETURN
  147. END