xref: /csrg-svn/contrib/dungeon/ballop.F (revision 35973)
1*35973SbosticC BALLOP-	BALLOON FUNCTION
2*35973SbosticC
3*35973SbosticC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
4*35973SbosticC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
5*35973SbosticC WRITTEN BY R. M. SUPNIK
6*35973SbosticC
7*35973SbosticC DECLARATIONS
8*35973SbosticC
9*35973Sbostic	LOGICAL FUNCTION BALLOP(ARG)
10*35973Sbostic	IMPLICIT INTEGER (A-Z)
11*35973Sbostic	LOGICAL FINDXT,QEMPTY
12*35973Sbostic#include "parser.h"
13*35973Sbostic#include "gamestate.h"
14*35973Sbostic#include "state.h"
15*35973Sbostic#include "rooms.h"
16*35973Sbostic#include "rflag.h"
17*35973Sbostic#include "curxt.h"
18*35973Sbostic#include "xpars.h"
19*35973Sbostic#include "objects.h"
20*35973Sbostic#include "oflags.h"
21*35973Sbostic#include "oindex.h"
22*35973Sbostic#include "clock.h"
23*35973Sbostic
24*35973Sbostic#include "verbs.h"
25*35973Sbostic#include "flags.h"
26*35973SbosticC BALLOP, PAGE 2
27*35973SbosticC
28*35973Sbostic	BALLOP=.TRUE.
29*35973SbosticC						!ASSUME WINS.
30*35973Sbostic	IF(ARG.NE.2) GO TO 200
31*35973SbosticC						!READOUT?
32*35973Sbostic	IF(PRSA.NE.LOOKW) GO TO 10
33*35973SbosticC						!ONLY PROCESS LOOK.
34*35973Sbostic	IF(BINFF.NE.0) GO TO 50
35*35973SbosticC						!INFLATED?
36*35973Sbostic	CALL RSPEAK(543)
37*35973SbosticC						!NO.
38*35973Sbostic	GO TO 100
39*35973Sbostic50	CALL RSPSUB(544,ODESC2(BINFF))
40*35973SbosticC						!YES.
41*35973Sbostic100	IF(BTIEF.NE.0) CALL RSPEAK(545)
42*35973SbosticC						!HOOKED?
43*35973Sbostic	RETURN
44*35973SbosticC
45*35973Sbostic200	IF(ARG.NE.1) GO TO 500
46*35973SbosticC						!READIN?
47*35973Sbostic	IF(PRSA.NE.WALKW) GO TO 300
48*35973SbosticC						!WALK?
49*35973Sbostic	IF(FINDXT(PRSO,HERE)) GO TO 250
50*35973SbosticC						!VALID EXIT?
51*35973Sbostic	CALL RSPEAK(546)
52*35973SbosticC						!NO, JOKE.
53*35973Sbostic	RETURN
54*35973SbosticC
55*35973Sbostic250	IF(BTIEF.EQ.0) GO TO 275
56*35973SbosticC						!TIED UP?
57*35973Sbostic	CALL RSPEAK(547)
58*35973SbosticC						!YES, JOKE.
59*35973Sbostic	RETURN
60*35973SbosticC
61*35973Sbostic275	IF(XTYPE.NE.XNORM) GO TO 10
62*35973SbosticC						!NORMAL EXIT?
63*35973Sbostic	IF(and(RFLAG(XROOM1),RMUNG).EQ.0) BLOC=XROOM1
64*35973Sbostic10	BALLOP=.FALSE.
65*35973Sbostic	RETURN
66*35973SbosticC
67*35973Sbostic300	IF((PRSA.NE.TAKEW).OR.(PRSO.NE.BINFF)) GO TO 350
68*35973Sbostic	CALL RSPSUB(548,ODESC2(BINFF))
69*35973SbosticC						!RECEP CONT TOO HOT.
70*35973Sbostic	RETURN
71*35973SbosticC
72*35973Sbostic350	IF((PRSA.NE.PUTW).OR.(PRSI.NE.RECEP).OR.QEMPTY(RECEP))
73*35973Sbostic&		GO TO 10
74*35973Sbostic	CALL RSPEAK(549)
75*35973Sbostic	RETURN
76*35973SbosticC
77*35973Sbostic500	IF((PRSA.NE.UNBOAW).OR.(and(RFLAG(HERE),RLAND).EQ.0))
78*35973Sbostic&		GO TO 600
79*35973Sbostic	IF(BINFF.NE.0) CTICK(CEVBAL)=3
80*35973SbosticC						!HE GOT OUT, START BALLOON.
81*35973Sbostic	GO TO 10
82*35973SbosticC
83*35973Sbostic600	IF((PRSA.NE.BURNW).OR.(OCAN(PRSO).NE.RECEP)) GO TO 700
84*35973Sbostic	CALL RSPSUB(550,ODESC2(PRSO))
85*35973SbosticC						!LIGHT FIRE IN RECEP.
86*35973Sbostic	CTICK(CEVBRN)=OSIZE(PRSO)*20
87*35973Sbostic	OFLAG1(PRSO)=or(OFLAG1(PRSO),
88*35973Sbostic&		and((ONBT+FLAMBT+LITEBT), not(TAKEBT+READBT)))
89*35973Sbostic	IF(BINFF.NE.0) RETURN
90*35973Sbostic	IF(.NOT.BLABF) CALL NEWSTA(BLABE,0,0,BALLO,0)
91*35973Sbostic	BLABF=.TRUE.
92*35973Sbostic	BINFF=PRSO
93*35973Sbostic	CTICK(CEVBAL)=3
94*35973Sbostic	CALL RSPEAK(551)
95*35973Sbostic	RETURN
96*35973SbosticC
97*35973Sbostic700	IF((PRSA.EQ.UNBOAW).AND.(BINFF.NE.0).AND.
98*35973Sbostic&		(and(RFLAG(HERE),RLAND).NE.0))
99*35973Sbostic&		CTICK(CEVBAL)=3
100*35973Sbostic	GO TO 10
101*35973SbosticC
102*35973Sbostic	END
103