you make your bombing run, the specific unit/ship you are bombing
gets to fire flak at you again. This number of guns firing flak
in these cases does NOT saturate.
-.s1
-When a sector fires flak, the amount of shells required is the # of
-guns fired divided by 2. If not enough shells are available, either no flak
-is fired, or the flak is reduced to the number of shells available.
-Note that the shells are not consumed during flak fire, they just need
-to be available.
-.s1
-When a ship fires flak, at least 1 shell must be available.
-If no shells are available, no flak is fired. Note that the shell is
-not consumed during flak fire, it just needs to be available.
-.s1
-Land units use no shells when firing flak. Any land unit with an
-aaf rating of > 0 will fire flak when pin-bombed.
+Land units do not need capability flak to fire here.
.s1
The formulas for determining the # of guns fired in a general volley
is:
them from supply sources. Other things may use the same routines, such as
loyal sectors, which will draw food from supply sources when in danger of
starvation, and ships/forts/sectors, which will draw shells when they need
-them to fire defensively or fire AA at planes.
+them to fire defensively.
.s1
.L "Supply Sources"
.s1
int nukedam;
int flak;
int gun;
- int shell;
for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
free_shiplist(&head);
if ((plp->pcp->pl_flags & P_A) && !on_shiplist(shipno, head))
continue;
- shell = 0;
gun = shp_usable_guns(&ship);
- if (gun > 0) {
- shell = ship.shp_item[I_SHELL];
- if (shell <= 0)
- shell = supply_commod(ship.shp_own,
- ship.shp_x, ship.shp_y, I_SHELL, 1);
- }
mcp = &mchr[(int)ship.shp_type];
- if (gun > 0 && shell > 0 && !(mcp->m_flags & M_SUB)) {
+ if (gun > 0 && !(mcp->m_flags & M_SUB)) {
flak = (int)(techfact(ship.shp_tech, gun) * 2.0);
- ship.shp_item[I_SHELL] = shell;
- putship(ship.shp_uid, &ship);
PR(ship.shp_own, "Flak! Firing %d guns from ship %s\n",
flak, prship(&ship));
if (pinflak_planedamage(&plp->plane, plp->pcp, ship.shp_own, flak))
static void
ac_doflak(struct emp_qelem *list, struct sctstr *from)
{
- int shell;
int gun;
natid plane_owner;
struct plist *plp;
plane_owner = plp->plane.pln_own;
gun = MIN(FLAK_GUN_MAX, from->sct_item[I_GUN]);
- shell = from->sct_item[I_SHELL];
- if (gun > shell * 2) {
- shell += supply_commod(from->sct_own, from->sct_x, from->sct_y,
- I_SHELL, (gun + 1) / 2 - shell);
- from->sct_item[I_SHELL] = shell;
- putsect(from);
- }
- if (gun > shell * 2)
- gun = shell * 2;
-
gun = roundavg(tfact(from->sct_own, 2.0 * gun));
if (gun > 0) {
PR(plane_owner, "firing %d flak guns in %s...\n",
struct shpstr ship;
struct mchrstr *mcp;
double flak, total, ngun;
- int gun, shell;
+ int gun;
int rel;
struct plist *plp;
natid plane_owner;
rel = getrel(getnatp(ship.shp_own), plane_owner);
if (rel > HOSTILE)
continue;
- shell = 0;
gun = shp_usable_guns(&ship);
- if (gun) {
- shell = ship.shp_item[I_SHELL];
- if (shell <= 0) {
- shell = supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
- I_SHELL, 1);
- ship.shp_item[I_SHELL] = shell;
- putship(ship.shp_uid, &ship);
- }
- }
- if (gun == 0 || shell == 0)
+ if (gun == 0)
continue;
flak = gun * (ship.shp_effic / 100.0);
ngun += flak;