/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
- * Ken Stevens, Steve McClure
+ * Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Ken Stevens, Steve McClure, Markus Armbruster
*
- * This program is free software; you can redistribute it and/or modify
+ * Empire is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ---
*
* Thomas Ruschak, 1992
* Ken Stevens, 1995
* Steve McClure, 1998
- * Markus Armbruster, 2004-2008
+ * Markus Armbruster, 2004-2010
*/
#ifndef LAND_H
#include <time.h>
#include "item.h"
-#include "queue.h"
#include "retreat.h"
#include "types.h"
struct lndstr {
/* initial part must match struct empobj */
- short ef_type;
- short lnd_uid; /* unit id (land unit) */
- unsigned lnd_seqno;
+ signed ef_type: 8;
+ unsigned lnd_seqno: 12;
+ unsigned lnd_generation: 12;
+ int lnd_uid; /* unit id (land #) */
time_t lnd_timestamp; /* Last time this unit was touched */
natid lnd_own; /* owner's country num */
coord lnd_x; /* x location in abs coords */
short lnd_mission; /* mission code */
short lnd_radius; /* mission radius */
/* end of part matching struct empobj */
- signed char lnd_flags; /* unit flags (unused) */
- short lnd_ship; /* pointer to transporting ship */
+ int lnd_ship; /* uid of transporting ship, or -1 */
signed char lnd_harden; /* fortification */
short lnd_retreat; /* retreat percentage */
int lnd_rflags; /* When do I retreat? */
char lnd_rpath[RET_LEN]; /* retreat path */
- unsigned char lnd_rad_max; /* max radius for this unit */
unsigned char lnd_scar; /* how experienced the unit is (not used) */
short lnd_item[I_MAX+1]; /* amount of items on board */
short lnd_pstage; /* plague stage */
short lnd_ptime; /* how many etus remain in this stage */
- short lnd_land; /* pointer to transporting unit */
+ int lnd_land; /* uid of transporting land unit, or -1 */
short lnd_access; /* Last tick mob was updated (MOB_ACCESS) */
};
};
/* Land unit ability flags */
-#define L_ENGINEER bit(1) /* Do engineering things */
-#define L_SUPPLY bit(2) /* supply other units/sects */
-#define L_SECURITY bit(3) /* anti-terrorist troops */
-#define L_LIGHT bit(4) /* can go on ships */
-#define L_MARINE bit(5) /* marine units, good at assaulting */
-#define L_RECON bit(6) /* recon units, good at spying */
+#define L_ENGINEER bit(1) /* Do engineering things */
+#define L_SUPPLY bit(2) /* supply other units/sects */
+#define L_SECURITY bit(3) /* anti-terrorist troops */
+#define L_LIGHT bit(4) /* can go on ships */
+#define L_MARINE bit(5) /* marine units, good at assaulting */
+#define L_RECON bit(6) /* recon units, good at spying */
#define L_RADAR bit(7) /* radar unit */
#define L_ASSAULT bit(8) /* can assault */
#define L_FLAK bit(9) /* flak unit */
-#define L_SPY bit(10) /* spy unit - way cool */
-#define L_TRAIN bit(11) /* train unit - neato */
-#define L_HEAVY bit(12) /* heavy unit - can't go on trains */
+#define L_SPY bit(10) /* spy unit - way cool */
+#define L_TRAIN bit(11) /* train unit - neato */
+#define L_HEAVY bit(12) /* heavy unit - can't go on trains */
/* Work required for building 100% */
#define LND_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm))
extern int lnd_nland(struct lndstr *);
extern int lnd_fire(struct lndstr *);
+extern int lnd_sabo(struct lndstr *, short *);
extern double lnd_fire_range(struct lndstr *);
/* src/lib/subs/lndsub.c */
extern double attack_val(int, struct lndstr *);
extern double defense_val(struct lndstr *);
extern int lnd_reaction_range(struct lndstr *);
-extern void lnd_print(struct ulist *, char *);
-extern void lnd_delete(struct ulist *, char *);
+extern void lnd_print(natid, struct ulist *, char *);
+extern void lnd_delete(struct ulist *);
extern int lnd_take_casualty(int, struct ulist *, int);
extern void lnd_submil(struct lndstr *, int);
extern void lnd_takemob(struct emp_qelem *, double);
extern int lnd_mar_one_sector(struct emp_qelem *, int, natid, int);
extern int lnd_support(natid, natid, coord, coord, int);
extern int lnd_can_attack(struct lndstr *);
-extern int lnd_fortify (struct lndstr *lp, int hard_amt);
+extern int lnd_fortify(struct lndstr *lp, int hard_amt);
extern void lnd_set_tech(struct lndstr *, int);
#endif