X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=include%2Fplane.h;h=35a807b1b02e689fc1f89f0e2bf6f3c90ed2c859;hp=3dfe4fa3aa3c14b297412048567fa753b5d3164a;hb=HEAD;hpb=1118f1c0ca13ca25b662fa600c5101ff1d38b67d diff --git a/include/plane.h b/include/plane.h index 3dfe4fa3a..35a807b1b 100644 --- a/include/plane.h +++ b/include/plane.h @@ -1,6 +1,6 @@ /* * Empire - A multi-player, client/server Internet based war game. - * Copyright (C) 1986-2012, 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 @@ -30,17 +30,17 @@ * Dave Pare, 1986 * Ken Stevens, 1995 * Steve McClure, 1998 - * Markus Armbruster, 2004-2010 + * Markus Armbruster, 2004-2020 */ #ifndef PLANE_H #define PLANE_H -#include +#include "file.h" +#include "item.h" #include "queue.h" #include "types.h" -#define PLN_TYPE_MAX 46 #define PLANE_MINEFF 10 struct plnstr { @@ -48,7 +48,7 @@ struct plnstr { signed ef_type: 8; unsigned pln_seqno: 12; unsigned pln_generation: 12; - int pln_uid; /* unit id (plane #) */ + int pln_uid; /* unit ID (plane #) */ time_t pln_timestamp; /* Last time this plane was touched */ natid pln_own; /* owning country */ coord pln_x; /* plane x-y */ @@ -65,10 +65,10 @@ struct plnstr { short pln_radius; /* mission radius */ /* end of part matching struct empobj */ unsigned char pln_range; /* total distance, not radius */ - int pln_ship; /* uid of carrier, or -1 */ - int pln_land; /* uid of transporting land unit, or -1 */ signed char pln_harden; /* for missiles */ - signed char pln_flags; /* State of the plane */ + int pln_ship; /* UID of carrier, or -1 */ + int pln_land; /* UID of transporting land unit, or -1 */ + int pln_flags; /* State of the plane */ short pln_access; /* Last tick mob was updated (MOB_ACCESS) */ float pln_theta; /* position in orbital sine wave */ }; @@ -79,16 +79,16 @@ struct plnstr { struct plchrstr { char *pl_name; /* full name of type of plane */ - int pl_lcm; /* costs to build */ - int pl_hcm; - int pl_cost; + short pl_mat[I_MAX+1]; /* materials to build 100% */ + /* only I_LCM, I_HCM, I_MILIT non-zero */ + int pl_bwork; /* work to build 100% */ int pl_tech; /* tech needed to build */ + int pl_cost; /* how much it costs to build */ int pl_acc; /* bombing accuracy (higher the better) */ int pl_load; /* bomb load, also for carrying cargo */ int pl_att; /* air-air attack/defense strengths */ int pl_def; int pl_range; /* how many sectors it can fly */ - int pl_crew; /* number of mil to crew it */ int pl_fuel; /* fuel consumption */ int pl_stealth; /* how stealthy is it? */ int pl_flags; /* description of capability */ @@ -106,7 +106,7 @@ struct plchrstr { #define P_I bit(8) /* Imaging ability (advanced spying) */ #define P_O bit(9) /* Orbital ability (a satellite) */ /* unused bit(10) */ -#define P_N bit(11) /* Nuclear RV interceptor (abm) */ +#define P_N bit(11) /* Nuclear RV interceptor (ABM) */ /* unused bit(12) */ #define P_E bit(13) /* extra light */ #define P_K bit(14) /* chopper */ @@ -125,6 +125,7 @@ struct plchrstr { struct plist { struct emp_qelem queue; /* list of planes */ int load; /* number of bombs or items carried */ + short pstage; /* plague stage */ struct plchrstr *pcp; /* pointer to desc of plane */ struct plnstr plane; /* struct plane */ }; @@ -133,16 +134,14 @@ struct plist { #define putplane(n, p) ef_write(EF_PLANE, (n), (p)) #define getplanep(n) ((struct plnstr *)ef_ptr(EF_PLANE, (n))) -extern struct plchrstr plchr[PLN_TYPE_MAX + 2]; +#define PLCHR_SZ 128 +extern struct plchrstr plchr[PLCHR_SZ]; struct shiplist { int uid; struct shiplist *next; }; -/* Work required for building 100% */ -#define PLN_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm)) - extern int pl_att(struct plchrstr *, int); extern int pl_def(struct plchrstr *, int); extern int pl_acc(struct plchrstr *, int); @@ -170,6 +169,5 @@ extern int ac_damage_plane(struct plnstr *, natid, int, int, char *); extern int on_shiplist(int, struct shiplist *); extern void add_shiplist(int, struct shiplist **); extern void free_shiplist(struct shiplist **); -extern void print_shiplist(struct shiplist *); #endif