/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
#ifndef SHIP_H
#define SHIP_H
+#include <time.h>
#include "item.h"
#include "queue.h"
#include "retreat.h"
short shp_item[I_MAX+1]; /* amount of items on board */
short shp_pstage; /* plague stage */
short shp_ptime; /* how many etus remain in this stage */
- time_t shp_access; /* Last time mob was updated (MOB_ACCESS) */
+ short shp_access; /* Last tick mob was updated (MOB_ACCESS) */
time_t shp_timestamp; /* Last time this ship was touched. */
unsigned char shp_mobquota; /* mobility quota */
char shp_path[MAXSHPPATH];
char shp_rpath[RET_LEN]; /* retreat path */
};
-struct fltelemstr {
- int num;
- int own;
- double mobil, mobcost;
- struct fltelemstr *next;
-};
-
-struct fltheadstr {
- int leader;
- signed char real_q;
-/* defines for the real_q member */
-#define LEADER_VIRTUAL 0
-#define LEADER_REAL 1
-#define LEADER_WRONGSECT 2
- coord x, y;
- natid own;
- unsigned maxmoves;
- struct fltelemstr *head;
- struct fltheadstr *next;
-};
-
struct mchrstr {
short m_item[I_MAX+1]; /* load limit */
int m_lcm; /* units of lcm to build */
#define M_SUBT bit(12) /* allows torping of other subs */
#define M_TRADE bit(13) /* is a trade ship */
#define M_SEMILAND bit(14) /* can land 1/4 */
-/* M_XLIGHT will be automatically set in init_mchr() if m_nxlight > 0 */
-#define M_XLIGHT bit(15) /* can hold xlight planes */
-/* M_CHOPPER will be automatically set in init_mchr() if m_nchoppers > 0 */
-#define M_CHOPPER bit(16) /* can hold choppers */
+/* unused bit(15) */
+/* unused bit(16) */
#define M_OILER bit(17) /* can re-fuel ships */
#define M_SUPPLY bit(18) /* Can supply units/sects/ships */
#define M_CANAL bit(19) /* Can navigate a canal (BIG CITY) */
#define getship(n, p) ef_read(EF_SHIP, (n), (p))
#define putship(n, p) ef_write(EF_SHIP, (n), (p))
-#define getshipp(n) (struct shpstr *)ef_ptr(EF_SHIP, (n))
+#define getshipp(n) ((struct shpstr *)ef_ptr(EF_SHIP, (n)))
extern struct mchrstr mchr[SHP_TYPE_MAX + 2];
-struct mlist {
- struct emp_qelem queue; /* list of ships */
- struct mchrstr *mcp; /* pointer to desc of ship */
- struct shpstr ship; /* struct ship */
- double mobil; /* how much mobility the ship has left */
-};
-
#define SHP_DEF(b, t) (t ? (b * (logx(t, 40.0) < 1.0 ? 1.0 : \
logx(t, 40.0))) : b)
#define SHP_SPD(b, t) (t ? (b * (logx(t, 35.0) < 1.0 ? 1.0 : \