]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/landgun.c
Update copyright notice
[empserver] / src / lib / subs / landgun.c
index ec833ff310f4e8c539c583945fdb85f96f8b5002..8e0c3f1580848ba26ebdb754083744f2a98ab3a8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -27,7 +27,7 @@
  *  landgun.c: Fire weapons
  *
  *  Known contributors to this file:
- *     Markus Armbruster, 2006-2012
+ *     Markus Armbruster, 2006-2013
  */
 
 #include <config.h>
@@ -78,7 +78,7 @@ landunitgun(int effic, int guns)
 }
 
 /*
- * Fire from fortress SP.
+ * Fire from fortress @sp.
  * Use ammo, resupply if necessary.
  * Return damage if the fortress fires, else -1.
  */
@@ -98,7 +98,7 @@ fort_fire(struct sctstr *sp)
 }
 
 /*
- * Fire from ship SP.
+ * Fire from ship @sp.
  * Use ammo, resupply if necessary.
  * Return damage if the ship fires, else -1.
  */
@@ -122,7 +122,7 @@ shp_fire(struct shpstr *sp)
 }
 
 /*
- * Drop depth-charges from ship SP.
+ * Drop depth-charges from ship @sp.
  * Use ammo, resupply if necessary.
  * Return damage if the ship drops depth-charges, else -1.
  */
@@ -133,7 +133,7 @@ shp_dchrg(struct shpstr *sp)
 
     if (sp->shp_effic < 60 || (mchr[sp->shp_type].m_flags & M_DCH) == 0)
        return -1;
-    if (sp->shp_item[I_MILIT] == 0)
+    if (sp->shp_item[I_MILIT] == 0 || sp->shp_item[I_GUN] == 0)
        return -1;
     shp_supply(sp, I_SHELL, 2);
     dchrgs = MIN(2, sp->shp_item[I_SHELL]);
@@ -144,8 +144,9 @@ shp_dchrg(struct shpstr *sp)
 }
 
 /*
- * Fire torpedo from ship SP.
- * Use ammo and mobility, resupply if necessary.
+ * Fire torpedo from ship @sp.
+ * Use ammo, resupply if necessary.
+ * Use mobility if @usemob is non-zero.
  * Return damage if the ship fires, else -1.
  */
 int
@@ -166,7 +167,7 @@ shp_torp(struct shpstr *sp, int usemob)
 }
 
 /*
- * Fire from land unit LP.
+ * Fire from land unit @lp.
  * Use ammo, resupply if necessary.
  * Return damage if the land unit fires, else -1.
  */
@@ -203,7 +204,7 @@ lnd_fire(struct lndstr *lp)
 }
 
 /*
- * Sabotage with land unit LP.
+ * Sabotage with land unit @lp, target has @item[] commodities.
  * Use ammo.
  * Return damage if the land unit sabotages, else -1.
  */
@@ -228,7 +229,7 @@ lnd_sabo(struct lndstr *lp, short item[])
 }
 
 /*
- * Return number of guns ship SP can fire.
+ * Return number of guns ship @sp can fire.
  */
 int
 shp_usable_guns(struct shpstr *sp)
@@ -237,7 +238,7 @@ shp_usable_guns(struct shpstr *sp)
 }
 
 /*
- * Return effective firing range for range factor RNG at tech TLEV.
+ * Return effective firing range for range factor @rng at tech @tlev.
  */
 static double
 effrange(int rng, double tlev)
@@ -247,7 +248,7 @@ effrange(int rng, double tlev)
 }
 
 /*
- * Return firing range for sector SP.
+ * Return firing range for sector @sp.
  */
 double
 fortrange(struct sctstr *sp)
@@ -265,7 +266,7 @@ fortrange(struct sctstr *sp)
 }
 
 /*
- * Return firing range for ship SP.
+ * Return firing range for ship @sp.
  */
 double
 shp_fire_range(struct shpstr *sp)
@@ -274,7 +275,7 @@ shp_fire_range(struct shpstr *sp)
 }
 
 /*
- * Return torpedo range for ship SP.
+ * Return torpedo range for ship @sp.
  */
 double
 torprange(struct shpstr *sp)
@@ -284,7 +285,7 @@ torprange(struct shpstr *sp)
 }
 
 /*
- * Return hit chance for torpedo from ship SP at range RANGE.
+ * Return hit chance for torpedo from ship @sp at range @range.
  */
 double
 shp_torp_hitchance(struct shpstr *sp, int range)
@@ -293,7 +294,7 @@ shp_torp_hitchance(struct shpstr *sp, int range)
 }
 
 /*
- * Return firing range for land unit SP.
+ * Return firing range for land unit @lp.
  */
 double
 lnd_fire_range(struct lndstr *lp)