]> git.pond.sub.org Git - empserver/commitdiff
(M_TORP_SHELLS, SHP_TORP_SHELLS): Rename.
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Aug 2004 18:45:04 +0000 (18:45 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Aug 2004 18:45:04 +0000 (18:45 +0000)
include/ship.h
src/lib/commands/mfir.c
src/lib/commands/torp.c
src/lib/subs/mission.c

index 1b265e9c407aed8afc66cf9f03bab6b915760b68..46759d5f097b59ffbeb49cf66c430e0f59d66a80 100644 (file)
@@ -215,7 +215,7 @@ struct mlist {
 
 enum {
     SHP_AIROPS_EFF = 50,       /* min. efficiency for air ops */
-    M_TORP_SHELLS = 3          /* number of shells used by a torpedo */
+    SHP_TORP_SHELLS = 3                /* number of shells used by a torpedo */
 };
 
 #endif /* _SHIP_H_ */
index 05799837cc4db50fef1ecad918ae287ec41afbba..c98e7571cf197583412ef8fcf44fc08c67d2db69 100644 (file)
@@ -811,10 +811,10 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
            continue;
 
        if (mchr[(int)ship.shp_type].m_flags & M_SUB) {
-           if (shell < M_TORP_SHELLS)
+           if (shell < SHP_TORP_SHELLS)
                shell += supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
-                                      I_SHELL, M_TORP_SHELLS - shell);
-           if (shell < M_TORP_SHELLS)
+                                      I_SHELL, SHP_TORP_SHELLS - shell);
+           if (shell < SHP_TORP_SHELLS)
                continue;
            if (gun < 1)
                continue;
@@ -1008,7 +1008,7 @@ use_ammo(struct emp_qelem *list)
            item = ship.shp_item;
            if (mchr[(int)ship.shp_type].m_flags & M_SUB) {
                shell = item[I_SHELL];
-               shell -= M_TORP_SHELLS - 1;
+               shell -= SHP_TORP_SHELLS - 1;
                if (shell < 0)
                    shell = 0;
                item[I_SHELL] = shell;
index 01261df8fb33175522deda5d09f826f32ce0d0a8..cb03d663b073e02ed0136458eb1c86b429cfe4e2 100644 (file)
@@ -88,10 +88,10 @@ torp(void)
        if ((mchr[(int)sub.shp_type].m_flags & M_TORP) == 0)
            continue;
        shells = sub.shp_item[I_SHELL];
-       if (shells < M_TORP_SHELLS)
+       if (shells < SHP_TORP_SHELLS)
            shells += supply_commod(sub.shp_own, sub.shp_x, sub.shp_y,
-                                   I_SHELL, M_TORP_SHELLS - shells);
-       if (sub.shp_item[I_GUN] == 0 || shells < M_TORP_SHELLS)
+                                   I_SHELL, SHP_TORP_SHELLS - shells);
+       if (sub.shp_item[I_GUN] == 0 || shells < SHP_TORP_SHELLS)
            continue;
        if (sub.shp_item[I_MILIT] < 1)
            continue;
@@ -115,10 +115,10 @@ torp(void)
            continue;
        }
        shells = sub.shp_item[I_SHELL];
-       if (shells < M_TORP_SHELLS)
+       if (shells < SHP_TORP_SHELLS)
            shells += supply_commod(sub.shp_own, sub.shp_x, sub.shp_y,
-                                   I_SHELL, M_TORP_SHELLS - shells);
-       if (sub.shp_item[I_GUN] == 0 || shells < M_TORP_SHELLS) {
+                                   I_SHELL, SHP_TORP_SHELLS - shells);
+       if (sub.shp_item[I_GUN] == 0 || shells < SHP_TORP_SHELLS) {
            pr("Ship #%d has insufficient armament\n", sub.shp_uid);
            continue;
        }
@@ -167,7 +167,7 @@ torp(void)
            techfact(sub.shp_tech, ((double)sub.shp_frnge));
        erange = (double)roundrange(erange);
        pr("Effective torpedo range is %.1f\n", erange);
-       shells -= M_TORP_SHELLS;
+       shells -= SHP_TORP_SHELLS;
        sub.shp_item[I_SHELL] = shells;
        putship(sub.shp_uid, &sub);
        mcp = &mchr[(int)sub.shp_type];
@@ -407,11 +407,11 @@ fire_torp(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
 
     shells = sp->shp_item[I_SHELL];
 
-    if (shells < M_TORP_SHELLS)
+    if (shells < SHP_TORP_SHELLS)
        shells += supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, I_SHELL,
-                               M_TORP_SHELLS - shells);
+                               SHP_TORP_SHELLS - shells);
 
-    if (sp->shp_item[I_GUN] == 0 || shells < M_TORP_SHELLS)
+    if (sp->shp_item[I_GUN] == 0 || shells < SHP_TORP_SHELLS)
        return 0;
 
     if (sp->shp_item[I_MILIT] < 1)
@@ -424,7 +424,7 @@ fire_torp(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
        return 0;
 
     /* All set.. fire! */
-    shells -= M_TORP_SHELLS;
+    shells -= SHP_TORP_SHELLS;
     sp->shp_item[I_SHELL] = shells;
     putship(sp->shp_uid, sp);
 
index 114ef2b7631affa6e3aeb8ee238191dd3abd0cd8..8b0f55bc15a7b3149e420b6b3537dbad19da4b0a 100644 (file)
@@ -562,11 +562,11 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
                if (gun < 1)
                    continue;
                shell = sp->shp_item[I_SHELL];
-               if (shell < M_TORP_SHELLS)
+               if (shell < SHP_TORP_SHELLS)
                    shell += supply_commod(sp->shp_own,
                                           sp->shp_x, sp->shp_y, I_SHELL,
-                                          M_TORP_SHELLS - shell);
-               if (shell < M_TORP_SHELLS)
+                                          SHP_TORP_SHELLS - shell);
+               if (shell < SHP_TORP_SHELLS)
                    continue;
 
                range = sp->shp_effic * techfact(sp->shp_tech,
@@ -579,7 +579,7 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
 
                if (!line_of_sight((s_char **)0, x, y, gp->x, gp->y))
                    continue;
-               sp->shp_item[I_SHELL] = shell - M_TORP_SHELLS;
+               sp->shp_item[I_SHELL] = shell - SHP_TORP_SHELLS;
                mobcost = sp->shp_effic * 0.01 * sp->shp_speed;
                mobcost = (480.0 / (mobcost +
                                    techfact(sp->shp_tech, mobcost)));