]> git.pond.sub.org Git - empserver/blob - include/combat.h
Update copyright notice
[empserver] / include / combat.h
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2012, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                Ken Stevens, Steve McClure, Markus Armbruster
5  *
6  *  Empire 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 3 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, see <http://www.gnu.org/licenses/>.
18  *
19  *  ---
20  *
21  *  See files README, COPYING and CREDITS in the root of the source
22  *  tree for related information and legal notices.  It is expected
23  *  that future projects/authors will amend these files as needed.
24  *
25  *  ---
26  *
27  *  combat.h: Definitions for things having to do with combat
28  *
29  *  Known contributors to this file:
30  *     Ken Stevens, 1995
31  */
32
33 #ifndef COMBAT_H
34 #define COMBAT_H
35
36 #include "types.h"
37 #include "ship.h"
38
39 struct combat {
40     int type;                   /* EF_BAD, EF_SECTOR, EF_SHIP, or EF_PLANE */
41     int set;                    /* Has the struct been initialized? */
42     int last;                   /* The index of the last element in off array */
43     coord x;                    /* location of attacking sector/ship/plane */
44     coord y;
45     natid own;
46     int eff;
47     int mob;
48     int mobcost;
49     int mil;                    /* mil in the sector/ship/unit */
50     int troops;                 /* mil in the combat */
51     int plague;
52     int sct_type;
53     int shp_uid;
54     int lnd_uid;
55     struct dchrstr *sct_dcp;
56     struct mchrstr *shp_mcp;
57     struct lchrstr *lnd_lcp;
58     char shp_name[MAXSHPNAMLEN]; /* FIXME huh? pulls in ship.h */
59     int relations_checked;
60 };
61
62 /* Types of combat for use by attack routines */
63 #define A_DEFEND        0
64 #define A_ATTACK        1
65 #define A_ASSAULT       2
66 #define A_PARA          3
67 #define A_BOARD         4
68 #define A_LBOARD        5
69
70 /* src/lib/subs/attsub.c */
71 extern double att_combat_eff(struct combat *);
72 extern void att_move_in_off(int, struct combat *, struct emp_qelem *,
73                             struct combat *);
74 extern int att_combat_init(struct combat *, int);
75 extern int att_get_combat(struct combat *, int);
76 extern int att_abort(int, struct combat *, struct combat *);
77 extern int att_approach(struct combat *, struct combat *);
78 extern int att_show(struct combat *);
79 extern int att_ask_support(int, int *, int *, int *, int *);
80 extern int att_ask_offense(int, struct combat *, struct combat *,
81                            struct emp_qelem *, int *, int *);
82 extern double sector_strength(struct sctstr *);
83 extern int att_get_offense(int, struct combat *, struct emp_qelem *,
84                            struct combat *);
85 extern int att_empty_attack(int, int, struct combat *);
86 extern int att_get_defense(struct emp_qelem *, struct combat *,
87                            struct emp_qelem *, int, int);
88 extern double att_reacting_units(struct combat *, struct emp_qelem *, int,
89                                  int *, int);
90 extern int att_get_support(int, int, int, int, int, struct emp_qelem *,
91                            struct combat *, struct emp_qelem *,
92                            struct combat *, double *, double *, int);
93 extern int att_fight(int, struct combat *, struct emp_qelem *, double,
94                      struct combat *, struct emp_qelem *, double);
95 extern int att_free_lists(struct emp_qelem *, struct emp_qelem *);
96
97
98 extern char *att_mode[A_LBOARD + 1];
99
100 #endif