1
2
3
4
5 INTEGER FWIM(F1,F2,RM,CON,ADV,NOCARE)
6 IMPLICIT INTEGER (A-Z)
7 %include dparam
8 LOGICAL NOCARE,QHERE
9
10 FWIM=0
11 DO 1000 I=1,OLNT
12 IF(((RM.EQ.0).OR.(.NOT.QHERE(I,RM))) .AND.
13 & ((ADV.EQ.0).OR.(OADV(I).NE.ADV)) .AND.
14 & ((CON.EQ.0).OR.(OCAN(I).NE.CON)))
15 & GO TO 1000
16
17
18
19
20 IF((AND(OFLAG1(I),VISIBT)).EQ.0) GO TO 1000
21
22
23
24 IF((.NOT.NOCARE .AND.((AND(OFLAG1(I),TAKEBT)).EQ.0)) .OR.
25 & (((AND(OFLAG1(I),F1)).EQ.0).AND.
26 & ((AND(OFLAG2(I),F2)).EQ.0))) GO TO 500
27 IF(FWIM.EQ.0) GO TO 400
28 FWIM=-FWIM
29 RETURN
30
31 400 FWIM=I note
32
33
34
35
36 500 IF((AND(OFLAG2(I),OPENBT)).EQ.0) GO TO 1000
37 DO 700 J=1,OLNT
38
39
40
41 IF((OCAN(J).NE.I).OR.((AND(OFLAG1(J),VISIBT)).EQ.0) .OR.
42 & (((AND(OFLAG1(J),F1)).EQ.0).AND.
43 & ((AND(OFLAG2(J),F2)).EQ.0))) GO TO 700
44 IF(FWIM.EQ.0) GO TO 600
45 FWIM=-FWIM
46 RETURN
47
48 600 FWIM=J
49 700 CONTINUE
50 1000 CONTINUE
51 RETURN
52
53
54
55
56
57
58
59 ORPHAN(OR1,OR2,OR3,OR4,OR5,OR6,OR7,OR8)
60 IMPLICIT INTEGER (A-Z)
61 %include dparam
62 CHARACTER*(*) OR6
63
64 OFLAG=OR1
65 OACT=OR2
66 OPREP1=OR3
67 OOBJ1=OR4
68 OPREP=OR5
69 ONAME=OR6
70 OPREP2=OR7
71 OOBJ2=OR8
72 RETURN
73
74
75
76
77
78
79
80
81
82 LOGICAL YESNO(Q,Y,N)
83 IMPLICIT INTEGER (A-Z)
84 %include dparam
85 CHARACTER*1 ANS
86
87 100 CALL RSPEAK(Q)
88 READ(INPCH,110,END=120) ANS
89 110 FORMAT(A)
90 IF((ANS.EQ.'Y').OR.(ANS.EQ.'y')) GO TO 200
91 IF((ANS.EQ.'N').OR.(ANS.EQ.'n')) GO TO 300
92 120 CALL RSPEAK(6)
93 GO TO 100
94
95 200 YESNO=.TRUE.
96 CALL RSPEAK(Y)
97 RETURN
98
99 300 YESNO=.FALSE.
100 CALL RSPEAK(N)
101 RETURN
102
103
104
105
106
107
108
109 INTEGER ROBADV(ADV,NR,NC,NA)
110 IMPLICIT INTEGER (A-Z)
111 %include dparam
112
113 ROBADV=0
114 DO 100 I=1,OLNT
115
116
117 IF((OADV(I).NE.ADV).OR.(OTVAL(I).LE.0).OR.
118 & ((AND(OFLAG2(I),SCRDBT)).NE.0)) GO TO 100
119 CALL NEWSTA(I,0,NR,NC,NA)
120 ROBADV=ROBADV+1
121 100 CONTINUE
122 RETURN
123
124
125
126
127
128
129
130 INTEGER ROBRM(RM,PR,NR,NC,NA)
131 IMPLICIT INTEGER (A-Z)
132 %include dparam
133 LOGICAL PROB,QHERE
134
135 ROBRM=0
136 DO 100 I=1,OLNT
137 IF(.NOT. QHERE(I,RM)) GO TO 100
138
139
140
141 IF((OTVAL(I).LE.0).OR.((AND(OFLAG2(I),SCRDBT)).NE.0).OR.
142 & ((AND(OFLAG1(I),VISIBT)).EQ.0).OR.(.NOT.PROB(PR,PR)))
143 & GO TO 50
144 CALL NEWSTA(I,0,NR,NC,NA)
145 ROBRM=ROBRM+1
146
147 OFLAG2(I)=OR(OFLAG2(I),TCHBT)
148 GO TO 100
149
150
151 50 IF((AND(OFLAG2(I),ACTRBT)).NE.0)
152 & ROBRM=ROBRM+ROBADV(OACTOR(I),NR,NC,NA)
153 100 CONTINUE
154 RETURN
155
156
157
158
159
160
161
162 LOGICAL WINNIN(VL,HR)
163 IMPLICIT INTEGER (A-Z)
164 %include dparam
165 LOGICAL PROB
166
167 VS=OCAPAC(VL)
168 PS=VS-FIGHTS(HR,.TRUE.)
169 WINNIN=PROB(90,100)
170 IF(PS.GT.3) RETURN
171 WINNIN=PROB(75,85)
172 IF(PS.GT.0) RETURN
173 WINNIN=PROB(50,30)
174 IF(PS.EQ.0) RETURN
175 WINNIN=PROB(25,25)
176 IF(VS.GT.1) RETURN
177 WINNIN=PROB(10,0)
178 RETURN
179
180