]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - warp/play.c
1 /* Header: play.c,v 7.0.1.1 86/10/16 10:52:39 lwall Exp */
4 * Revision 7.0.1.1 86/10/16 10:52:39 lwall
5 * Added Damage. Fixed random bugs.
7 * Revision 7.0 86/10/08 15:13:09 lwall
8 * Split into separate files. Added amoebas and pirates.
44 while (output_pending() > charsperhalfsec
)
45 sleep(1); /* allow buffers to empty */
54 while (output_pending() > charsperhalfsec
)
64 if (cloaking
&& ent
->energy
>= 250 && !damflag
[NOCLOAKING
]) {
67 damflag
[NOCLOAKING
] = rand_mod(smarts
+1)+2;
69 ent
->energy
-= ent
->energy
/40;
88 if (lookfor(realapollo
->posy
,realapollo
->posx
,
93 else if (lookfor(root
.next
->posy
,root
.next
->posx
,
96 realapollo
= root
.next
;
97 mvaddch(realapollo
->posy
+1,realapollo
->posx
*2,
99 realapollo
->image
= 'A';
100 realapollo
->mass
= 6000;
104 possiblescore
+= 5000;
107 if (blast
[realapollo
->posy
][realapollo
->posx
] <= 32000)
109 realapollo
->energy
= 32000;
122 if (lookfor(realapollo
->posy
,realapollo
->posx
,
127 else if (lookfor(root
.next
->posy
,root
.next
->posx
,
130 realapollo
= root
.next
;
131 mvaddch(realapollo
->posy
+1,realapollo
->posx
*2,
133 realapollo
->image
= 'A';
134 realapollo
->mass
= 6000;
138 possiblescore
+= 5000;
140 if (apolloflag
& 2) {
141 if (blast
[realapollo
->posy
][realapollo
->posx
] <= 32000)
143 realapollo
->energy
= 32000;
154 for (i
=0;i
<2;i
++) for (y
=0;y
<3;y
++) for (x
=0;x
<3;x
++) {
155 if ((curobj
= isatorp
[i
][y
][x
]) != NULL
) {
156 to
= occupant
[(curobj
->posy
+curobj
->vely
+YSIZE00
)%YSIZE
]
157 [(curobj
->posx
+curobj
->velx
+XSIZE00
)%XSIZE
];
158 if (to
&& !to
->vely
&& !to
->velx
) {
159 unmake_object(curobj
);
172 if (!finish
&& (!(numenemies
|| numos
) || (!ent
&& !base
))) {
177 else if (!banging
&& (!(numenemies
|| numos
) || (!ent
&& !base
)))