}
return 0;
}
-
-/* Keep launching missiles on list until mindam damage has been done */
-int
-msl_launch_mindam(struct emp_qelem *list, coord x, coord y, int hardtarget,
- int type, int mindam, char *whatp, int victim)
-{
- struct emp_qelem *qp;
- struct emp_qelem *next;
- struct plist *plp;
- int newdam, dam = 0;
- int news_item;
- int snews_item;
-
- if (type == EF_SHIP) {
- news_item = N_SHP_MISS;
- snews_item = N_SHP_SMISS;
- } else if (type == EF_LAND) {
- news_item = N_LND_MISS;
- snews_item = N_LND_SMISS;
- } else {
- news_item = N_SCT_MISS;
- snews_item = N_SCT_SMISS;
- }
-
- for (qp = list->q_back; qp != list && dam < mindam;
- qp = next) {
- next = qp->q_back;
- plp = (struct plist *)qp;
-
- if (mission_pln_equip(plp, NULL, 'p') >= 0) {
- if (msl_hit(&plp->plane,
- hardtarget, type, news_item, snews_item,
- whatp, x, y, victim)) {
- newdam = pln_damage(&plp->plane, 'p', 1);
- dam += newdam;
-#if 0
- /*
- * FIXME want collateral damage on miss, but we get here
- * too when launch fails or missile is intercepted
- */
- } else {
- /* Missiles that miss have to hit somewhere! */
- newdam = pln_damage(&plp->plane, 'p', 0);
- collateral_damage(x, y, newdam);
-#endif
- }
- plp->plane.pln_effic = 0;
- putplane(plp->plane.pln_uid, &plp->plane);
- emp_remque(qp);
- free(qp);
- }
- }
- return dam;
-}