]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - warp/bang.c
1 /* Header: bang.c,v 7.0.1.3 86/12/12 16:57:00 lwall Exp */
4 * Revision 7.0.1.3 86/12/12 16:57:00 lwall
5 * Made circular explosions.
7 * Revision 7.0.1.2 86/10/20 14:36:02 lwall
10 * Revision 7.0.1.1 86/10/16 10:49:45 lwall
11 * Added Damage. Fixed random bugs.
13 * Revision 7.0 86/10/08 15:11:57 lwall
14 * Split into separate files. Added amoebas and pirates.
35 make_plink(int x
, int y
)
45 if (numamoebas
&& obj
->image
== ' ')
58 make_blast(int x
, int y
, int size
, long mass
)
62 bangm
[nxtbang
] = mass
;
63 bangs
[nxtbang
++] = size
;
64 assert(nxtbang
<= XSIZE
* YSIZE
);
65 if (numamoebas
&& amb
[y
][x
] == '~') {
67 modify_amoeba(y
,x
,1,'~', 10);
69 modify_amoeba(y
,x
,1,'~', 5);
70 bangs
[nxtbang
-1] = 0; /* don't propagate */
90 if (numamoebas
&& obj
->image
== ' ')
114 /* read blast list and update blast array */
115 assert(nxtbang
>= 0 && nxtbang
<= XSIZE
* YSIZE
);
116 for (i
=0; i
<nxtbang
; i
++) {
117 if (bangm
[i
] != 32767)
119 lastxy
= bangs
[i
] << 1;
120 if (lastxy
>= MAXBDIST
)
121 lastxy
= MAXBDIST
- 1;
122 for (y
=bangy
[i
]-bangs
[i
],x
=bangx
[i
]-bangs
[i
],j
=lastxy
;
125 yblasted
[yy
[j
] = (y
+YSIZE00
) % YSIZE
] |= 1;
126 xblasted
[xx
[j
] = (x
+XSIZE00
) % XSIZE
] |= 1;
129 for (y
=lastxy
;y
>=0;--y
) {
130 for (x
=lastxy
;x
>=0;--x
) {
134 if (j
< k
) /* distance is long + 1/2 short */
141 if (bangm
[i
] != 32767 ||
142 !(obj
=occupant
[yy
[y
]][xx
[x
]]) || obj
->type
!= Web
)
143 blast
[yy
[y
]][xx
[x
]] += bangm
[i
];