-
Notifications
You must be signed in to change notification settings - Fork 1
/
emessages.h
executable file
·324 lines (255 loc) · 8.46 KB
/
emessages.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
#ifndef EMESSAGES_H
#define EMESSAGES_H
#include "emessage.h"
#include <map>
enum class eGodType;
enum class eHeroType;
enum class eMonsterType;
struct eQuestMessages {
eEventMessageType fQuest;
eEventMessageType fFulfilled;
};
struct eGodMessages {
mutable int fLastMessage = -1;
eMessageType fWooing0;
eMessageType fJealousy1;
eMessageType fJealousy2;
eMessageType fInvades;
eEventMessageType fHelps;
eEventMessageType fMonster;
eQuestMessages fQuest1;
eQuestMessages fQuest2;
eMessageType fSanctuaryComplete;
eMessageType fDisaster;
eMessageType fDisasterEnds;
};
struct eMonsterMessages {
eMessageType fPrediction;
eMessageType fInvasion36;
eMessageType fInvasion24;
eMessageType fInvasion12;
eMessageType fInvasion6;
eMessageType fInvasion1;
eMessageType fInvasion;
eMessageType fSlain;
std::string fToSlainReason;
std::string fSlainReason;
std::string fMonsterAttackReason;
};
struct eHeroMessages {
eEventMessageType fArrival;
eConsequenceMessageType fHallAvailable;
};
struct eReceiveRequestMessages {
eMessageType fInitial;
eMessageType fReminder;
eMessageType fOverdue;
eMessageType fWarning;
eMessageType fComply;
eMessageType fTooLate;
eMessageType fRefuse;
eReason fEarlyReason;
eReason fComplyReason;
eReason fTooLateReason;
eReason fRefuseReason;
};
struct eResourceGrantedMessages {
eMessageType fGranted;
eMessageType fCashGranted;
eMessageType fPartialSpace;
eMessageType fInsufficientSpace;
eMessageType fLastChance;
eMessageType fForfeited;
eMessageType fAccepted;
eMessageType fCashAccepted;
eMessageType fPostponed;
eMessageType fRefused;
};
struct eTroopsRequestedMessages {
eMessageType fInitialAnnouncement;
eMessageType fFirstReminder;
eMessageType fLastReminder;
eReason fEarlyReason;
eReason fComplyReason;
eReason fTooLateReason;
eReason fRefuseReason;
eReason fLostBattleReason;
eMessageType fConquered;
};
class eMessages {
public:
eMessages() {}
static eMessages instance;
static bool load();
static bool loaded();
static const std::string& message(const std::string& key);
static eMessageType favorMessage(const eMessageType& reason);
static eMessageType dfavorMessage(const eMessageType& reason);
static eMessageType invasionMessage(const eMessageType& baseMsg,
const std::string& reason,
const int months);
std::map<std::string, std::string> fMessages;
eMessageType fPop100;
eMessageType fPop500;
eMessageType fPop1000; // comm
eMessageType fPop2000; // comm
eMessageType fPop3000;
eMessageType fPop5000; // comm
eMessageType fPop10000; // comm
eMessageType fPop15000; // comm
eMessageType fPop20000; // comm
eMessageType fPop25000; // comm
eMessageType fHappinessMonument;
eMessageType fFire;
eMessageType fCollapse;
eMessageType fPlagueStrikes;
const eGodMessages* godMessages(const eGodType godType) const;
eGodMessages fAphrodite;
eGodMessages fApollo;
eGodMessages fAres;
eGodMessages fArtemis;
eGodMessages fAthena;
eGodMessages fAtlas;
eGodMessages fDemeter;
eGodMessages fDionysus;
eGodMessages fHades;
eGodMessages fHephaestus;
eGodMessages fHera;
eGodMessages fHermes;
eGodMessages fPoseidon;
eGodMessages fZeus;
eMessageType fZeusTradeResumes;
eMessageType fPoseidonTradeResumes;
eMessageType fHermesTradeResumes;
const eHeroMessages* heroMessages(const eHeroType heroType) const;
eHeroMessages fAchilles;
eHeroMessages fAtalanta;
eHeroMessages fBellerophon;
eHeroMessages fHercules;
eHeroMessages fJason;
eHeroMessages fOdysseus;
eHeroMessages fPerseus;
eHeroMessages fTheseus;
const eMonsterMessages* monsterMessages(const eMonsterType monsterType) const;
eMonsterMessages fCalydonianBoar;
eMonsterMessages fCerberus;
eMonsterMessages fChimera;
eMonsterMessages fCyclops;
eMonsterMessages fDragon;
eMonsterMessages fEchidna;
eMonsterMessages fHarpies;
eMonsterMessages fHector;
eMonsterMessages fHydra;
eMonsterMessages fKraken;
eMonsterMessages fMaenads;
eMonsterMessages fMedusa;
eMonsterMessages fMinotaur;
eMonsterMessages fScylla;
eMonsterMessages fSphinx;
eMonsterMessages fTalos;
eGameMessages fHomeGames;
eGameMessages fIsthmianGames;
eGameMessages fNemeanGames;
eGameMessages fPythianGames;
eGameMessages fOlympianGames;
eMessageType fInvasion36;
eMessageType fInvasion24;
eMessageType fInvasion12;
eMessageType fInvasion6;
eMessageType fInvasion1;
eMessageType fInvasion;
std::string fInvasionNoReason;
eMessageType fInvasionBribed;
eMessageType fInvasionDefeat;
eMessageType fInvasionVictory;
eMessageType fInvasionVictoryMonument;
eMessageType fTributePaidGranted;
eMessageType fTributePaidAccepted;
eMessageType fTributePaidRefused;
eMessageType fTributePostponed;
eMessageType fRequestGranted;
eMessageType fRequestPartialSpace;
eMessageType fRequestInsufficientSpace;
eMessageType fRequestLastChance;
eMessageType fRequestAccepted;
eMessageType fRequestPostponed;
eMessageType fRequestRefused;
eMessageType fRequestForfeited;
eMessageType fDemandRefused;
eMessageType fGiftReceivedDrachmas;
eMessageType fGiftReceivedNeeded;
eMessageType fGiftReceivedSells;
eMessageType fGiftReceivedNotNeeded;
eMessageType fGiftReceivedRefuse;
eReceiveRequestMessages fGeneralRequestAllyS;
eReceiveRequestMessages fGeneralRequestRivalD;
eReceiveRequestMessages fGeneralRequestSubjectP;
eReceiveRequestMessages fGeneralRequestParentR;
eReceiveRequestMessages fTributeRequest;
eResourceGrantedMessages fGiftGranted;
eMessageType fSupportTroopsArrive;
eMessageType fSupportTroopsDepart;
eMessageType fSupportTroopsDefeated;
eMessageType fStrikeDepart;
eMessageType fStrikeSuccessful;
eMessageType fStrikeUnsuccessul;
eMessageType fRivalArmyAway;
eMessageType fIncreasedFavor;
eMessageType fDecreasedFavor;
eMessageType fUnemployment;
eMessageType fEmployees;
eMessageType fPlague;
eMessageType fCityConqueredByPlayer;
eMessageType fCityConquerFailedByPlayer;
eResourceGrantedMessages fRaidGranted;
eMessageType fCityRaidFailedByPlayer;
eMessageType fAllyAttackedByPlayer;
eMessageType fArmyReturns;
eMessageType fMilitaryBuildup;
eMessageType fMilitaryDecline;
eMessageType fEconomicProsperity;
eMessageType fEconomicDecline;
eTroopsRequestedMessages fAllyTroopsRequest;
eTroopsRequestedMessages fVassalTroopsRequest;
eTroopsRequestedMessages fColonyTroopsRequest;
eTroopsRequestedMessages fParentCityTroopsRequest;
eMessageType fTroopsRequestAttackAverted;
eMessageType fEarthqauke;
eMessageType fCityBecomesAlly;
eMessageType fCityBecomesRival;
eMessageType fCityBecomesVassal;
eMessageType fColonyRestored;
eMessageType fDebtAnniversary;
eMessageType fColonyMonument;
eMessageType fPriceIncrease;
eMessageType fPriceDecrease;
eMessageType fDemandIncrease;
eMessageType fDemandDecrease;
eMessageType fSupplyIncrease;
eMessageType fSupplyDecrease;
eMessageType fTradeShutsDown;
eMessageType fTradeOpensUp;
eMessageType fWageIncrease;
eMessageType fWageDecrease;
private:
bool loadImpl();
void loadMessage(eMessageType& m,
const std::string& titleKey,
const std::string& textKey);
void loadReason(eReason& r, const std::string& key);
void load(eGodMessages& god, const std::string& godName);
void load(eHeroMessages& hero, const std::string& heroName);
void load(eMonsterMessages& monster,
const std::string& monsterName1,
const std::string& monsterName2);
void loadGeneralRequest(eReceiveRequestMessages& request,
const std::string& letter,
const std::string& mid = "general_request");
void loadResourceGranted(eResourceGrantedMessages& granted,
const std::string& name);
void load(eTroopsRequestedMessages& troops,
const std::string& name,
const std::string& letter);
bool mLoaded = false;
};
#endif // EMESSAGES_H