* Copyright (c) 1985 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)expl.c 5.2 (Berkeley) 6/27/88";
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
* San Francisco, California
* Show the explosions as they currently are
if (y
< 0 || y
>= HEIGHT
)
ep
= (EXPL
*) malloc(sizeof (EXPL
)); /* NOSTRICT */
for (pp
= Player
; pp
< End_player
; pp
++) {
if (pp
->p_maze
[y
][x
] == type
)
for (pp
= Monitor
; pp
< End_monitor
; pp
++) {
if (pp
->p_maze
[y
][x
] == type
)
if (y
>= UBOUND
&& y
< DBOUND
&& x
>= LBOUND
&& x
< RBOUND
)
* Roll the explosions over, so the next one in the list is at the
for (ep
= Expl
[EXPLEN
- 1]; ep
!= NULL
; ep
= nextep
) {
if (y
< UBOUND
|| y
>= DBOUND
|| x
< LBOUND
|| x
>= RBOUND
)
for (pp
= Player
; pp
< End_player
; pp
++)
if (pp
->p_maze
[y
][x
] == ep
->e_char
) {
for (pp
= Monitor
; pp
< End_monitor
; pp
++)
for (x
= EXPLEN
- 1; x
> 0; x
--)
/* There's about 700 walls in the initial maze. So we pick a number
* that keeps the maze relatively full. */
static REGEN removed
[MAXREMOVE
];
static REGEN
*rem_index
= removed
;
* remove_wall - add a location where the wall was blown away.
* if there is no space left over, put the a wall at
* the location currently pointed at.
# if defined(MONITOR) || defined(FLY)
switch (Maze
[r
->r_y
][r
->r_x
]) {
save_char
= Maze
[r
->r_y
][r
->r_x
];
if (Maze
[r
->r_y
][r
->r_x
] == SPACE
)
if (++r
>= &removed
[MAXREMOVE
])
/* Slot being used, put back this wall */
Maze
[r
->r_y
][r
->r_x
] = Orig_maze
[r
->r_y
][r
->r_x
];
pp
= play_at(r
->r_y
, r
->r_x
);
pp
->p_flying
+= rand_num(10);
pp
->p_flying
= rand_num(20);
pp
->p_flyx
= 2 * rand_num(6) - 5;
pp
->p_flyy
= 2 * rand_num(6) - 5;
pp
->p_over
= Orig_maze
[r
->r_y
][r
->r_x
];
Maze
[r
->r_y
][r
->r_x
] = FLYER
;
showexpl(r
->r_y
, r
->r_x
, FLYER
);
Maze
[r
->r_y
][r
->r_x
] = Orig_maze
[r
->r_y
][r
->r_x
];
Maze
[r
->r_y
][r
->r_x
] = DOOR
;
if (rand_num(100) == 0) /* one percent of the time */
Maze
[r
->r_y
][r
->r_x
] = WALL4
;
for (pp
= Monitor
; pp
< End_monitor
; pp
++)
check(pp
, r
->r_y
, r
->r_x
);
if (++r
>= &removed
[MAXREMOVE
])
for (pp
= Monitor
; pp
< End_monitor
; pp
++)