]> git.pond.sub.org Git - empserver/blob - include/news.h
e07cf97ca646a1316baa0c30d69518f48636af73
[empserver] / include / news.h
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2013, 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  *  news.h: Definitions for Empire News
28  *
29  *  Known contributors to this file:
30  *     Dave Pare
31  *     Thomas Ruschak
32  *     Steve McClure
33  */
34
35 /*
36  *      News codes for new options are not #ifdefed, since defining maxverb
37  *      would be a pain, and it doesn't hurt to leave them in --ts
38  */
39
40 #ifndef NEWS_H
41 #define NEWS_H
42
43 #include <time.h>
44 #include "nsc.h"
45
46 struct nwsstr {
47     natid nws_ano;              /* "actor" country # */
48     unsigned char nws_vrb;      /* action (verb) */
49     natid nws_vno;              /* "victim" country # */
50     signed char nws_ntm;        /* number of times */
51     short nws_duration;         /* last time at nws_when + nws_duration */
52     time_t nws_when;            /* time of action */
53 };
54
55 #define NUM_RPTS        2       /* number of story alternates */
56
57 struct rptstr {
58     signed char r_uid;
59     int r_good_will;            /* how "nice" the action is */
60     int r_newspage;             /* which page this item belongs on */
61     char *r_newstory[NUM_RPTS]; /* texts for fmt( */
62 };
63
64         /* news verbs */
65 #define N_WON_SECT      1
66 #define N_SCT_LOSE      2
67 #define N_SPY_SHOT      3
68 #define N_SENT_TEL      4
69 #define N_SIGN_TRE      5
70 #define N_MAKE_LOAN     6
71 #define N_REPAY_LOAN    7
72 #define N_MAKE_SALE     8
73 #define N_OVFLY_SECT    9
74 #define N_SCT_SHELL     10
75 #define N_SHP_SHELL     11
76 #define N_TOOK_UNOCC    12
77 #define N_TORP_SHIP     13
78 #define N_FIRE_BACK     14
79 #define N_BROKE_SANCT   15
80 #define N_SCT_BOMB      16
81 #define N_SHP_BOMB      17
82 #define N_BOARD_SHIP    18
83 #define N_SHP_LOSE      19
84 /* unused               20 */
85 #define N_SEIZE_SECT    21
86 #define N_HONOR_TRE     22
87 #define N_VIOL_TRE      23
88 /* unused               24 */
89 #define N_HIT_MINE      25
90 #define N_DECL_ALLY     26
91 /* unused               27 */
92 #define N_DECL_WAR      28
93 #define N_DIS_ALLY      29
94 #define N_DIS_WAR       30
95 #define N_OUT_PLAGUE    31
96 #define N_DIE_PLAGUE    32
97 #define N_NAME_CHNG     33
98 #define N_DIE_FAMINE    34
99 /* unused               35 */
100 #define N_DOWN_PLANE    36
101 #define N_NUKE          37
102 #define N_FREEDOM_FIGHT 38
103 #define N_SHOOT_CIV     39
104 #define N_LAUNCH        40
105 #define N_SAT_KILL      41
106 #define N_GIFT          42
107 #define N_AIDS          43
108 #define N_HURTS         44
109 #define N_TAKE          45
110 #define N_NUKE_STOP     46
111 #define N_SCT_MISS      47
112 #define N_SHP_MISS      48
113 #define N_TRADE         49
114 #define N_PIRATE_TRADE  50
115 #define N_PIRATE_KEEP   51
116 #define N_SHIP_TORP     52
117 #define N_SUB_BOMB      53
118 /* unused               54 */
119 #define N_UNIT_BOMB     55
120 #define N_LHIT_MINE     56
121 #define N_FIRE_F_ATTACK 57
122 #define N_FIRE_L_ATTACK 58
123 #define N_FIRE_S_ATTACK 59
124 #define N_SACK_CAP      60
125 #define N_UP_FRIENDLY   61
126 #define N_DOWN_FRIENDLY 62
127 #define N_UP_NEUTRAL    63
128 #define N_DOWN_NEUTRAL  64
129 #define N_UP_HOSTILE    65
130 #define N_DOWN_HOSTILE  66
131 #define N_SCT_SMISS     67
132 #define N_SHP_SMISS     68
133 #define N_START_COL     69
134 #define N_NUKE_SSTOP    70
135 #define N_LND_MISS      71
136 #define N_LND_SMISS     72
137 #define N_AWON_SECT     73
138 #define N_PWON_SECT     74
139 #define N_PARA_UNOCC    75
140 #define N_ALOSE_SCT     76
141 #define N_PLOSE_SCT     77
142 /* unused               78 */
143 /* unused               79 */
144 #define N_WELCH_DEAL    80
145 #define N_LND_LOSE      81
146 #define N_BOARD_LAND    82
147 #define N_MAX_VERB      82
148
149 #define N_NOTUSED        0
150 #define N_FOR            1
151 #define N_FRONT          2
152 #define N_SEA            3
153 #define N_SKY            4
154 #define N_MISS           5
155 #define N_ARTY           6
156 #define N_ECON           7
157 #define N_COLONY         8
158 #define N_HOME           9
159 #define N_SPY           10
160 #define N_TELE          11
161 #define N_MAX_PAGE      11
162
163 #define getnews(n, p) ef_read(EF_NEWS, (n), (p))
164 #define putnews(n, p) ef_write(EF_NEWS, (n), (p))
165 #define getnewsp(n) ((struct nwsstr *)ef_ptr(EF_NEWS, (n)))
166
167 extern struct rptstr rpt[N_MAX_VERB + 2];
168 extern struct symbol page_headings[N_MAX_PAGE + 2];
169
170 #endif