]> git.pond.sub.org Git - empserver/blob - include/nuke.h
(nukstr): Make it a struct genitem: add members nuk_effic, nuk_mobil,
[empserver] / include / nuke.h
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                           Ken Stevens, Steve McClure
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  *  ---
21  *
22  *  See files README, COPYING and CREDITS in the root of the source
23  *  tree for related information and legal notices.  It is expected
24  *  that future projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  nuke.h: Definitions for things having to do with nukes
29  * 
30  *  Known contributors to this file:
31  *     Dave Pare, 1986
32  */
33
34 #ifndef NUKE_H
35 #define NUKE_H
36
37 #define N_MAXNUKE       20
38 #define MIN_DRNUKE_CONST        0.001
39
40 struct nukstr {
41     /* initial part must match struct genitem */
42     short ef_type;
43     natid nuk_own;
44     short nuk_uid;
45     coord nuk_x, nuk_y;         /* current loc of device */
46     signed char nuk_type;       /* index in plchr[] */
47     signed char nuk_effic;      /* unused, always 100% */
48     signed char nuk_mobil;      /* unused, always 0 */
49     short nuk_tech;             /* nuke's tech level */
50     char nuk_stockpile;         /* group membership, unused, always ' ' */
51     coord nuk_opx, nuk_opy;     /* Op sector coords, unused */
52     short nuk_mission;          /* mission code, unused */
53     short nuk_radius;           /* mission radius, unused */
54     /* end of part matching struct genitem */
55     short nuk_ship;             /* currently aboard ship (unused) */
56     short nuk_plane;            /* currently aboard plane */
57     short nuk_land;             /* currently aboard land (unused) */
58     time_t nuk_timestamp;       /* Last time this nuke was touched */
59 };
60
61 struct nchrstr {
62     char *n_name;               /* warhead unit name */
63     int n_lcm;                  /* costs to build */
64     int n_hcm;
65     int n_oil;
66     int n_rad;
67     int n_blast;                /* blast radius */
68     int n_dam;                  /* damage at center */
69     int n_cost;
70     int n_tech;                 /* tech needed to build */
71     int n_weight;
72     int n_flags;                /* description of capability */
73     signed char n_type;         /* index in nchr[] */
74 };
75
76 #define N_NEUT  bit(0)          /* Neutron bomb (low damage, high fallout) */
77
78 #define getnuke(n, p) ef_read(EF_NUKE, (n), (p))
79 #define putnuke(n, p) ef_write(EF_NUKE, (n), (p))
80 #define getnukep(n) (struct nukstr *)ef_ptr(EF_NUKE, (n))
81
82 /* Work required for building */
83 #define NUK_BLD_WORK(lcm, hcm, oil, rad) \
84   (((lcm) + 2 * (hcm) + (oil) + (rad) + 4) / 5)
85
86 extern struct nchrstr nchr[N_MAXNUKE + 1];
87
88 #endif