Lines Matching refs:bp

69           BULLET *bp, *next;  in moveshots()  local
87 for (bp = blist; bp != NULL; bp = next) { in moveshots()
88 next = bp->b_next; in moveshots()
89 x = bp->b_x; in moveshots()
90 y = bp->b_y; in moveshots()
91 Maze[y][x] = bp->b_over; in moveshots()
99 switch (bp->b_type) { in moveshots()
104 if (move_normal_shot(bp)) { in moveshots()
105 bp->b_next = Bullets; in moveshots()
106 Bullets = bp; in moveshots()
111 if (bp->b_expl || move_normal_shot(bp)) { in moveshots()
112 bp->b_next = Bullets; in moveshots()
113 Bullets = bp; in moveshots()
119 if (move_drone(bp)) { in moveshots()
120 bp->b_next = Bullets; in moveshots()
121 Bullets = bp; in moveshots()
126 bp->b_next = Bullets; in moveshots()
127 Bullets = bp; in moveshots()
134 for (bp = blist; bp != NULL; bp = next) { in moveshots()
135 next = bp->b_next; in moveshots()
136 if (!bp->b_expl) { in moveshots()
137 save_bullet(bp); in moveshots()
140 check(pp, bp->b_y, bp->b_x); in moveshots()
143 if (bp->b_type == DSHOT) in moveshots()
146 check(pp, bp->b_y, bp->b_x); in moveshots()
151 chkshot(bp, next); in moveshots()
152 free(bp); in moveshots()
186 move_normal_shot(BULLET *bp) in move_normal_shot() argument
192 if (bp->b_expl) in move_normal_shot()
195 x = bp->b_x; in move_normal_shot()
196 y = bp->b_y; in move_normal_shot()
198 switch (bp->b_face) { in move_normal_shot()
216 zapshot(Bullets, bp); in move_normal_shot()
217 zapshot(bp->b_next, bp); in move_normal_shot()
222 zapshot(Bullets, bp); in move_normal_shot()
223 zapshot(bp->b_next, bp); in move_normal_shot()
228 switch (bp->b_face) { in move_normal_shot()
230 bp->b_face = BELOW; in move_normal_shot()
233 bp->b_face = ABOVE; in move_normal_shot()
236 bp->b_face = RIGHT; in move_normal_shot()
239 bp->b_face = LEFTS; in move_normal_shot()
249 switch (bp->b_face) { in move_normal_shot()
251 bp->b_face = ABOVE; in move_normal_shot()
254 bp->b_face = BELOW; in move_normal_shot()
257 bp->b_face = LEFTS; in move_normal_shot()
260 bp->b_face = RIGHT; in move_normal_shot()
274 bp->b_face = ABOVE; in move_normal_shot()
277 bp->b_face = BELOW; in move_normal_shot()
280 bp->b_face = LEFTS; in move_normal_shot()
283 bp->b_face = RIGHT; in move_normal_shot()
303 pp->p_ident->i_shot += bp->b_charge; in move_normal_shot()
304 if (opposite(bp->b_face, Maze[y][x])) { in move_normal_shot()
306 if (bp->b_owner != NULL) in move_normal_shot()
307 message(bp->b_owner, in move_normal_shot()
309 if (bp->b_score != NULL) in move_normal_shot()
310 bp->b_score->i_robbed += bp->b_charge; in move_normal_shot()
311 pp->p_ammo += bp->b_charge; in move_normal_shot()
312 if (pp->p_damage + bp->b_size * MINDAM in move_normal_shot()
316 pp->p_ident->i_absorbed += bp->b_charge; in move_normal_shot()
317 free(bp); in move_normal_shot()
324 pp->p_ident->i_faced += bp->b_charge; in move_normal_shot()
332 pp->p_ident->i_ducked += bp->b_charge; in move_normal_shot()
333 if (pp->p_damage + bp->b_size * MINDAM in move_normal_shot()
336 if (bp->b_score != NULL) in move_normal_shot()
337 bp->b_score->i_missed += bp->b_charge; in move_normal_shot()
339 if (bp->b_owner == NULL) in move_normal_shot()
341 message(bp->b_owner, bp->b_score && in move_normal_shot()
342 ((bp->b_score->i_missed & 0x7) == 0x7) ? in move_normal_shot()
358 bp->b_expl = true; in move_normal_shot()
362 bp->b_x = x; in move_normal_shot()
363 bp->b_y = y; in move_normal_shot()
374 move_drone(BULLET *bp) in move_drone() argument
383 if (isplayer(Maze[bp->b_y][bp->b_x - 1])) { in move_drone()
387 if (isplayer(Maze[bp->b_y - 1][bp->b_x])) { in move_drone()
391 if (isplayer(Maze[bp->b_y + 1][bp->b_x])) { in move_drone()
395 if (isplayer(Maze[bp->b_y][bp->b_x + 1])) { in move_drone()
404 if (!iswall(bp->b_y, bp->b_x - 1)) in move_drone()
406 if (!iswall(bp->b_y - 1, bp->b_x)) in move_drone()
408 if (!iswall(bp->b_y + 1, bp->b_x)) in move_drone()
410 if (!iswall(bp->b_y, bp->b_x + 1)) in move_drone()
430 switch (bp->b_face) { in move_drone()
469 bp->b_x--; in move_drone()
470 bp->b_face = LEFTS; in move_drone()
473 bp->b_x++; in move_drone()
474 bp->b_face = RIGHT; in move_drone()
477 bp->b_y--; in move_drone()
478 bp->b_face = ABOVE; in move_drone()
481 bp->b_y++; in move_drone()
482 bp->b_face = BELOW; in move_drone()
485 switch (Maze[bp->b_y][bp->b_x]) { in move_drone()
495 opposite(bp->b_face, Maze[bp->b_y][bp->b_x])) { in move_drone()
496 pp = play_at(bp->b_y, bp->b_x); in move_drone()
497 pp->p_ammo += bp->b_charge; in move_drone()
499 free(bp); in move_drone()
505 bp->b_expl = true; in move_drone()
517 save_bullet(BULLET *bp) in save_bullet() argument
519 bp->b_over = Maze[bp->b_y][bp->b_x]; in save_bullet()
520 switch (bp->b_over) { in save_bullet()
534 find_under(Bullets, bp); in save_bullet()
538 switch (bp->b_over) { in save_bullet()
546 mark_player(bp); in save_bullet()
551 mark_boot(bp); in save_bullet()
556 Maze[bp->b_y][bp->b_x] = bp->b_type; in save_bullet()
560 bp->b_next = Bullets; in save_bullet()
561 Bullets = bp; in save_bullet()
659 chkshot(BULLET *bp, BULLET *next) in chkshot() argument
668 switch (bp->b_type) { in chkshot()
675 delta = bp->b_size - 1; in chkshot()
682 chkslime(bp, next); in chkshot()
687 bp->b_type = SLIME; in chkshot()
688 chkslime(bp, next); in chkshot()
692 for (y = bp->b_y - delta; y <= bp->b_y + delta; y++) { in chkshot()
695 dy = y - bp->b_y; in chkshot()
697 for (x = bp->b_x - delta; x <= bp->b_x + delta; x++) { in chkshot()
700 dx = x - bp->b_x; in chkshot()
723 damage = bp->b_size - absdy; in chkshot()
725 damage = bp->b_size - dx; in chkshot()
727 checkdam(pp, bp->b_owner, bp->b_score, in chkshot()
728 damage * MINDAM, bp->b_type); in chkshot()
751 chkslime(BULLET *bp, BULLET *next) in chkslime() argument
755 switch (Maze[bp->b_y][bp->b_x]) { in chkslime()
766 switch (bp->b_face) { in chkslime()
768 bp->b_x++; in chkslime()
771 bp->b_x--; in chkslime()
774 bp->b_y++; in chkslime()
777 bp->b_y--; in chkslime()
783 *nbp = *bp; in chkslime()
797 move_slime(BULLET *bp, int speed, BULLET *next) in move_slime() argument
804 if (bp->b_charge <= 0) in move_slime()
805 free(bp); in move_slime()
807 save_bullet(bp); in move_slime()
812 showexpl(bp->b_y, bp->b_x, bp->b_type == LAVA ? LAVA : '*'); in move_slime()
814 showexpl(bp->b_y, bp->b_x, '*'); in move_slime()
816 switch (Maze[bp->b_y][bp->b_x]) { in move_slime()
824 pp = play_at(bp->b_y, bp->b_x); in move_slime()
826 checkdam(pp, bp->b_owner, bp->b_score, MINDAM, bp->b_type); in move_slime()
835 explshot(next, bp->b_y, bp->b_x); in move_slime()
836 explshot(Bullets, bp->b_y, bp->b_x); in move_slime()
840 if (--bp->b_charge <= 0) { in move_slime()
841 free(bp); in move_slime()
847 switch (bp->b_face) { in move_slime()
849 if (!iswall(bp->b_y, bp->b_x - 1)) in move_slime()
851 if (!iswall(bp->b_y - 1, bp->b_x)) in move_slime()
853 if (!iswall(bp->b_y + 1, bp->b_x)) in move_slime()
856 if (!iswall(bp->b_y, bp->b_x + 1)) in move_slime()
860 if (!iswall(bp->b_y, bp->b_x + 1)) in move_slime()
862 if (!iswall(bp->b_y - 1, bp->b_x)) in move_slime()
864 if (!iswall(bp->b_y + 1, bp->b_x)) in move_slime()
867 if (!iswall(bp->b_y, bp->b_x - 1)) in move_slime()
871 if (!iswall(bp->b_y - 1, bp->b_x)) in move_slime()
873 if (!iswall(bp->b_y, bp->b_x - 1)) in move_slime()
875 if (!iswall(bp->b_y, bp->b_x + 1)) in move_slime()
878 if (!iswall(bp->b_y + 1, bp->b_x)) in move_slime()
882 if (!iswall(bp->b_y + 1, bp->b_x)) in move_slime()
884 if (!iswall(bp->b_y, bp->b_x - 1)) in move_slime()
886 if (!iswall(bp->b_y, bp->b_x + 1)) in move_slime()
889 if (!iswall(bp->b_y - 1, bp->b_x)) in move_slime()
898 save_bullet(bp); in move_slime()
901 if (bp->b_charge < count) { in move_slime()
903 while (count > bp->b_charge) { in move_slime()
916 i = bp->b_charge / count; in move_slime()
917 j = bp->b_charge % count; in move_slime()
920 nbp = create_shot(bp->b_type, bp->b_y, bp->b_x - 1, LEFTS, in move_slime()
921 i, bp->b_size, bp->b_owner, bp->b_score, true, SPACE); in move_slime()
926 nbp = create_shot(bp->b_type, bp->b_y, bp->b_x + 1, RIGHT, in move_slime()
927 (count < j) ? i + 1 : i, bp->b_size, bp->b_owner, in move_slime()
928 bp->b_score, true, SPACE); in move_slime()
933 nbp = create_shot(bp->b_type, bp->b_y - 1, bp->b_x, ABOVE, in move_slime()
934 (count < j) ? i + 1 : i, bp->b_size, bp->b_owner, in move_slime()
935 bp->b_score, true, SPACE); in move_slime()
940 nbp = create_shot(bp->b_type, bp->b_y + 1, bp->b_x, BELOW, in move_slime()
941 (count < j) ? i + 1 : i, bp->b_size, bp->b_owner, in move_slime()
942 bp->b_score, true, SPACE); in move_slime()
946 free(bp); in move_slime()
988 BULLET *bp; in zapshot() local
992 for (bp = blist; bp != NULL; bp = bp->b_next) { in zapshot()
993 if (bp->b_x != obp->b_x || bp->b_y != obp->b_y) in zapshot()
995 if (bp->b_face == obp->b_face) in zapshot()
1012 BULLET *bp; in explshot() local
1014 for (bp = blist; bp != NULL; bp = bp->b_next) in explshot()
1015 if (bp->b_x == x && bp->b_y == y) { in explshot()
1016 bp->b_expl = true; in explshot()
1017 if (bp->b_owner != NULL) in explshot()
1018 message(bp->b_owner, "Shot intercepted"); in explshot()
1068 BULLET *bp; in is_bullet() local
1070 for (bp = Bullets; bp != NULL; bp = bp->b_next) in is_bullet()
1071 if (bp->b_y == y && bp->b_x == x) in is_bullet()
1072 return bp; in is_bullet()
1084 BULLET *bp; in fixshots() local
1086 for (bp = Bullets; bp != NULL; bp = bp->b_next) in fixshots()
1087 if (bp->b_y == y && bp->b_x == x) in fixshots()
1088 bp->b_over = over; in fixshots()
1097 find_under(BULLET *blist, BULLET *bp) in find_under() argument
1102 if (bp->b_y == nbp->b_y && bp->b_x == nbp->b_x) { in find_under()
1103 bp->b_over = nbp->b_over; in find_under()
1113 mark_player(BULLET *bp) in mark_player() argument
1118 if (pp->p_y == bp->b_y && pp->p_x == bp->b_x) { in mark_player()
1130 mark_boot(BULLET *bp) in mark_boot() argument
1135 if (pp->p_y == bp->b_y && pp->p_x == bp->b_x) { in mark_boot()