]> 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-2004, 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 the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23  *  related information and legal notices. It is expected that any future
24  *  projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  combat.h: Definitions for things having to do with combat
29  * 
30  *  Known contributors to this file:
31  *     Ken Stevens, 1995
32  */
33
34 #ifndef _COMBAT_H_
35 #define _COMBAT_H_
36
37 #include "sect.h"
38 #include "queue.h"
39
40 struct combat {
41     int type;                   /* EF_BAD, EF_SECTOR, EF_SHIP, or EF_PLANE */
42     int set;                    /* Has the struct been initialized? */
43     int last;                   /* The index of the last element in off array */
44     coord x;                    /* location of attacking sector/ship/plane */
45     coord y;
46     natid own;
47     int eff;
48     int mob;
49     int mobcost;
50     int mil;                    /* mil in the sector/ship/unit */
51     int troops;                 /* mil in the combat */
52     int plague;
53     int sct_type;
54     int shp_uid;
55     int lnd_uid;
56     struct dchrstr *sct_dcp;
57     struct mchrstr *shp_mcp;
58     struct lchrstr *lnd_lcp;
59     s_char shp_name[MAXSHPNAMLEN];
60     int relations_checked;
61 };
62
63 /* Types of combat for use by attack routines */
64 #define A_DEFEND        0
65 #define A_ATTACK        1
66 #define A_ASSAULT       2
67 #define A_PARA          3
68 #define A_BOARD         4
69 #define A_LBOARD        5
70
71 /* src/lib/subs/attsub.c */
72 extern double att_calcodds(int, int);
73 extern double att_combat_eff(struct combat *);
74 extern void att_move_in_off(int, struct combat *, struct emp_qelem *,
75                             struct combat *);
76 extern int att_combat_init(struct combat *, int);
77 extern int att_get_combat(struct combat *, int);
78 extern int att_abort(int, struct combat *, struct combat *);
79 extern int att_approach(struct combat *, struct combat *);
80 extern int att_show(struct combat *);
81 extern int att_ask_support(int, int *, int *, int *, int *);
82 extern int att_ask_offense(int, struct combat *, struct combat *,
83                            struct emp_qelem *, int *, int *);
84 extern double sector_strength(struct sctstr *);
85 extern int att_estimate_defense(int, struct combat *, struct emp_qelem *,
86                                 struct combat *, int);
87 extern int att_empty_attack(int, int, struct combat *);
88 extern int att_get_defense(struct emp_qelem *, struct combat *,
89                            struct emp_qelem *, int, int);
90 extern int att_reacting_units(struct combat *, struct emp_qelem *, int,
91                               int *, int);
92 extern int att_get_support(int, int, int, int, int, struct emp_qelem *,
93                            struct combat *, struct emp_qelem *,
94                            struct combat *, double *, double *, int);
95 extern int att_fight(int, struct combat *, struct emp_qelem *, double,
96                      struct combat *, struct emp_qelem *, double);
97 extern int att_free_lists(struct emp_qelem *, struct emp_qelem *);
98
99
100 extern s_char *att_mode[];
101
102 #endif /* _COMBAT_H_ */