X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=include%2Fship.h;h=83db8c034caa6f68eb4487527559d7ad1166f517;hp=826de914168a051cf66740ad6c8ef1b389148de7;hb=HEAD;hpb=c70d9375ef5e92dad10006f330cf79d990b8a6d7 diff --git a/include/ship.h b/include/ship.h index 826de9141..83db8c034 100644 --- a/include/ship.h +++ b/include/ship.h @@ -1,6 +1,6 @@ /* * Empire - A multi-player, client/server Internet based war game. - * Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak, + * Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak, * Ken Stevens, Steve McClure, Markus Armbruster * * Empire is free software: you can redistribute it and/or modify @@ -31,21 +31,19 @@ * Thomas Ruschak, 1992 * Ken Stevens, 1995 * Steve McClure, 1998 - * Markus Armbruster, 2004-2014 + * Markus Armbruster, 2004-2020 */ #ifndef SHIP_H #define SHIP_H -#include +#include "file.h" #include "item.h" #include "retreat.h" #include "types.h" -#define SHP_TYPE_MAX 46 #define SHIP_MINEFF 20 -#define MAXSHPPATH 28 #define MAXSHPNAMLEN 24 struct shpstr { @@ -70,7 +68,7 @@ struct shpstr { /* end of part matching struct empobj */ 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 */ + short shp_ptime; /* how many ETUs remain in this stage */ short shp_access; /* Last tick mob was updated (MOB_ACCESS) */ char shp_name[MAXSHPNAMLEN]; /* name set with the "name" command */ coord shp_orig_x; @@ -82,8 +80,6 @@ struct shpstr { struct mchrstr { short m_item[I_MAX+1]; /* load limit */ - int m_lcm; /* units of lcm to build */ - int m_hcm; /* units of hcm to build */ int m_armor; /* how well armored it is */ int m_speed; /* how fast it can go */ int m_visib; /* how well it can be seen */ @@ -93,6 +89,9 @@ struct mchrstr { unsigned char m_nxlight; /* maximum number of xlight planes */ unsigned char m_nchoppers; /* maximum number of choppers */ char *m_name; /* full name of type of ship */ + short m_mat[I_MAX+1]; /* materials to build 100% */ + /* only I_LCM and I_HCM non-zero */ + int m_bwork; /* work to build 100% */ int m_tech; /* tech required to build */ int m_cost; /* how much it costs to build */ int m_flags; /* what special things can this ship do */ @@ -105,8 +104,6 @@ struct mchrstr { #define M_TORP bit(1) /* fire torpedoes */ #define M_DCH bit(2) /* drop depth charges on subs */ #define M_FLY bit(3) /* launch and recover planes */ -/* M_MSL will be automatically set in init_mchr() if m_nplanes > 0 - and M_FLY is not set */ #define M_MSL bit(4) /* launch missiles */ #define M_OIL bit(5) /* drill for oil */ #define M_SONAR bit(6) /* locate submarines */ @@ -129,10 +126,8 @@ struct mchrstr { #define putship(n, p) ef_write(EF_SHIP, (n), (p)) #define getshipp(n) ((struct shpstr *)ef_ptr(EF_SHIP, (n))) -extern struct mchrstr mchr[SHP_TYPE_MAX + 2]; - -/* Work required for building 100% */ -#define SHP_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm)) +#define MCHR_SZ 128 +extern struct mchrstr mchr[MCHR_SZ]; enum { SHP_AIROPS_EFF = 50, /* min. efficiency for air ops */ @@ -169,14 +164,17 @@ extern int shp_usable_guns(struct shpstr *); extern double shp_torp_hitchance(struct shpstr *, int); /* src/lib/subs/shpsub.c */ +extern int shp_may_nav(struct shpstr *, struct shpstr *, char *); extern void shp_sel(struct nstr_item *, struct emp_qelem *); extern struct ulist *shp_insque(struct shpstr *, struct emp_qelem *); -extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid); +extern void shp_nav_stay_behind(struct emp_qelem *, natid); +extern void shp_nav_put(struct emp_qelem *, natid); extern int shp_sweep(struct emp_qelem *, int, int, natid); extern enum shp_stuck shp_check_nav(struct shpstr *, struct sctstr *); extern int sect_has_dock(struct sctstr *); extern int shp_hardtarget(struct shpstr *); -extern int shp_nav_one_sector(struct emp_qelem *, int, natid, int); +extern int shp_nav_dir(struct emp_qelem *, int, natid); +extern int shp_nav_gauntlet(struct emp_qelem *, int, natid); extern int shp_missile_defense(coord, coord, natid, int); extern void shp_missdef(struct shpstr *, natid); extern double shp_mobcost(struct shpstr *);