-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathgenrules.cpp
5336 lines (5076 loc) · 288 KB
/
genrules.cpp
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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// START A3HEADER
//
// This source file is part of the Atlantis PBM game program.
// Copyright (C) 1995-1999 Geoff Dunbar
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program, in the file license.txt. If not, write
// to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
//
// See the Atlantis Project web page for details:
// http://www.prankster.com/project
//
// END A3HEADER
#include "game.h"
#include "gamedata.h"
#include "indenter.hpp"
#include <iostream>
#include <fstream>
#include <sstream>
#include <ctime>
#include <iomanip>
using namespace std;
struct tag_data { string tag; bool open;};
static inline tag_data enclose(string tag, bool open) { return { tag, open }; }
template<typename _CharT, typename _Traits>
static inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& os, tag_data data) {
if (!data.open) os << indent::decr;
os << "<" << (data.open ? "" : "/") << data.tag << ">" << '\n';
if (data.open) os << indent::incr;
return os;
}
struct pre_data { bool open;};
static inline pre_data pre(bool open) { return { open }; }
template<typename _CharT, typename _Traits>
static inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& os, pre_data data) {
if (!data.open) {
os << indent::pop_indent();
os << indent::wrap(78, 70, 0);
}
os << enclose("pre", data.open);
if (data.open) {
os << indent::push_indent(0);
os << indent::wrap(70, 30, 2);
}
return os;
}
static inline string class_tag(string tag, string css_class) { return tag + " class=\"" + css_class + "\""; }
static inline string anchor(string name) { return "<a name=\"" + name + "\"></a>"; }
static inline string url(string href, string text) { return "<a href=\"" + href + "\">" + text + "</a>"; }
struct example_data { string header; bool start; };
static inline example_data example_start(string header) { return { header, true }; }
static inline example_data example_end() { return { "", false }; }
template<typename _CharT, typename _Traits>
static inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& os, example_data data) {
if (data.start) {
os << enclose("p", true) << data.header << '\n' << enclose("p", false);
os << enclose("p", true) << '\n' << enclose("p", false);
os << pre(true);
os << indent::suppress_format(true);
} else {
os << indent::suppress_format(false);
os << pre(false);
}
return os;
}
static string inline num_to_word(int n) {
static string vals [] = {
"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen",
"seventeen", "eighteen", "nineteen", "twenty"
};
if (n > 20 || n < 0) return to_string(n);
return vals[n];
}
static int study_rate(int days, int exp) {
static SkillList sl;
sl.SetDays(1,days);
sl.SetExp(1,exp);
return sl.GetStudyRate(1, 1);
}
inline string faction_point_usage(Faction& fac, bool verbose=true) {
string seperator;
stringstream ss;
for (const auto& [key, value] : fac.type) {
if (value <= 0) continue;
if (verbose) {
ss << seperator << to_string(value) << " " << plural(value, "point", "points") << " on " << key;
} else {
ss << seperator << key << " " << to_string(value);
}
seperator = (verbose ? ", " : " ");
}
return ss.str();
}
// This function is an utter abomination capable of summoning eldritch horrors from beyond. This needs to
// be cleaned up, but that can wait until after this pass. It's just too messy to fix right now.
inline string unit_tax_description() {
string temp, temp2, temp3;
int prev = 0, hold = 0;
if (Globals->WHO_CAN_TAX &
(GameDefs::TAX_COMBAT_SKILL | GameDefs::TAX_BOW_SKILL |
GameDefs::TAX_RIDING_SKILL | GameDefs::TAX_STEALTH_SKILL)) {
int prev2 = 0, hold2 = 0;
if (hold) {
if (prev) temp += ", ";
temp += temp2;
prev= 1;
}
temp2 = "has ";
if (Globals->WHO_CAN_TAX & GameDefs::TAX_COMBAT_SKILL) {
temp3 = "Combat";
hold2 = 1;
}
if (Globals->WHO_CAN_TAX & GameDefs::TAX_BOW_SKILL) {
if (hold2) {
temp2 += temp3;
prev2 = 1;
}
if (prev2) temp2 += ", ";
temp2 += "Longbow";
prev2 = 1;
temp3 = "Crossbow";
hold2 = 1;
}
if (Globals->WHO_CAN_TAX & GameDefs::TAX_RIDING_SKILL) {
if (hold2) {
if (prev2) temp2 += ", ";
temp2 += temp3;
prev2 = 1;
}
temp3 = "Riding";
hold2 = 1;
}
if (Globals->WHO_CAN_TAX & GameDefs::TAX_STEALTH_SKILL) {
if (hold2) {
if (prev2) temp2 += ", ";
temp2 += temp3;
prev2= 1;
}
temp3 = "Stealth";
hold2 = 1;
}
if (prev2) temp2 += " or ";
temp2 += temp3;
temp2 += " skill of at least level 1";
hold = 1;
}
if (Globals->WHO_CAN_TAX &
(GameDefs::TAX_ANY_WEAPON | GameDefs::TAX_USABLE_WEAPON |
GameDefs::TAX_MELEE_WEAPON_AND_MATCHING_SKILL |
GameDefs::TAX_BOW_SKILL_AND_MATCHING_WEAPON)) {
if (hold) {
if (prev) temp += ", ";
temp += temp2;
prev= 1;
}
temp2 = "has ";
if (Globals->WHO_CAN_TAX & GameDefs::TAX_ANY_WEAPON)
temp2 += "a weapon (regardless of skill requirements)";
else if (Globals->WHO_CAN_TAX & GameDefs::TAX_USABLE_WEAPON)
temp2 += "a weapon and the appropriate skill to use it";
else if (Globals->WHO_CAN_TAX &
(GameDefs::TAX_MELEE_WEAPON_AND_MATCHING_SKILL |
GameDefs::TAX_BOW_SKILL_AND_MATCHING_WEAPON)) {
string temp3;
int prev2 = 0, hold2 = 0;
if (Globals->WHO_CAN_TAX &
GameDefs::TAX_MELEE_WEAPON_AND_MATCHING_SKILL) {
temp2 += "Combat skill of at least level 1 and a "
"weapon which does not require any skill";
temp3 = "Riding skill of at least level 1 and "
"a weapon which requires riding skill";
prev2 = 1;
hold2 = 1;
}
if (Globals->WHO_CAN_TAX &
GameDefs::TAX_BOW_SKILL_AND_MATCHING_WEAPON) {
if (hold2) {
temp2 += ", ";
temp2 += temp3;
}
temp3 = "a Bow (Longbow or Crossbow) skill and a weapon "
"which requires that skill";
hold2 = 1;
}
if (prev2) temp2 += " or ";
temp2 += temp3;
}
hold = 1;
}
if (Globals->WHO_CAN_TAX &
(GameDefs::TAX_HORSE | GameDefs::TAX_HORSE_AND_RIDING_SKILL)) {
if (hold) {
if (prev) temp += ", ";
temp += temp2;
prev= 1;
}
temp2 = "has a mount";
if (!(Globals->WHO_CAN_TAX & GameDefs::TAX_HORSE))
temp2 += " and sufficient skill to ride it in combat";
hold = 1;
}
if (Globals->WHO_CAN_TAX &
(GameDefs::TAX_ANY_MAGE | GameDefs::TAX_MAGE_DAMAGE |
GameDefs::TAX_MAGE_FEAR | GameDefs::TAX_MAGE_OTHER)) {
if (hold) {
if (prev) temp += ", ";
temp += temp2;
prev= 1;
}
temp2 = "is a mage ";
if ((Globals->WHO_CAN_TAX &
(GameDefs::TAX_MAGE_DAMAGE |
GameDefs::TAX_MAGE_FEAR |
GameDefs::TAX_MAGE_OTHER)) ==
(GameDefs::TAX_MAGE_DAMAGE | GameDefs::TAX_MAGE_FEAR |
GameDefs::TAX_MAGE_OTHER)) {
if (Globals->WHO_CAN_TAX & GameDefs::TAX_MAGE_COMBAT_SPELL)
temp2 += "who has a combat spell set";
else
temp2 += "who knows a combat spell";
} else {
int hold2 = 0, prev2 = 0;
string temp3;
if (Globals->WHO_CAN_TAX & GameDefs::TAX_MAGE_COMBAT_SPELL)
temp2 += "whose combat spell ";
else
temp2 += "who knows a spell which ";
if (Globals->WHO_CAN_TAX & GameDefs::TAX_MAGE_DAMAGE) {
temp3 = "damages enemies";
hold2 = 1;
}
if (Globals->WHO_CAN_TAX & GameDefs::TAX_MAGE_FEAR) {
if (hold2) {
temp2 += temp3;
prev2 = 1;
}
temp3 = "weakens opponents";
hold2 = 1;
}
if (Globals->WHO_CAN_TAX & GameDefs::TAX_MAGE_OTHER) {
if (hold2) {
if (prev2) temp2 += ", ";
temp2 += temp3;
prev2 = 1;
}
temp3 = "protects in combat";
hold2 = 1;
}
if (prev2) temp2 += " or ";
temp2 += temp3;
}
hold = 1;
}
if (Globals->WHO_CAN_TAX &
(GameDefs::TAX_BATTLE_ITEM |
GameDefs::TAX_USABLE_BATTLE_ITEM)) {
if (hold) {
if (prev) temp += ", ";
temp += temp2;
prev= 1;
}
if (Globals->WHO_CAN_TAX & GameDefs::TAX_USABLE_BATTLE_ITEM)
temp2 = "has a ";
else
temp2 = "can use a ";
temp2 += "magical item which gives a special attack in combat";
hold = 1;
}
if (prev) temp += " or ";
temp += temp2;
temp += ". ";
return temp;
}
string Game::FactionTypeDescription(Faction &fac) {
stringstream buffer;
std::vector<std::string> missingTypes;
std::vector<std::string> types;
int nm = AllowedMages(&fac);
int na = AllowedApprentices(&fac);
int nq = AllowedQuarterMasters(&fac);
int nt = AllowedTrades(&fac);
int nw = AllowedTaxes(&fac);
int nma = AllowedMartial(&fac);
for (auto &key : *FactionTypes) (fac.type[key] > 0 ? types : missingTypes).push_back(key);
int count = 0;
for (auto &key : types) {
buffer << (count > 0 ? (count == (int)types.size() - 1 ? ", and " : ", ") : "");
if (key == F_WAR) buffer << "tax " << nw << " " << plural(nw, "region", "regions");
if (key == F_TRADE) buffer << "perform trade in " << nt << " " << plural(nt, "region", "regions");
if (key == F_MAGIC) {
buffer << "have " << nm << " " << plural(nm, "mage", "mages");
}
if (key == F_MARTIAL) {
buffer << "perform tax " << (Globals->FACTION_ACTIVITY == FactionActivityRules::MARTIAL ? "or" : "and")
<< " trade in " << nma << " " << plural(nma, "region", "regions");
}
count++;
}
// This has to be down here because at least one ruleset (Havilah) allows 1 apprentice even at magic 0
if (Globals->APPRENTICES_EXIST && na > 0)
buffer << ", as well have " << na << " " << Globals->APPRENTICE_NAME << (na > 1 ? "s" : "");
if (Globals->TRANSPORT & GameDefs::ALLOW_TRANSPORT && nq > 0)
buffer << ", and " << nq << " " << plural(nq, "quartermaster", "quartermasters");
if (missingTypes.size() > 0) buffer << ", but ";
count = 0;
for (auto &fp : missingTypes) {
buffer << (count > 0 ? (count == (int)missingTypes.size() - 1 ? ", and " : ", ") : "");
if (fp == F_WAR) buffer << "could not perform tax in any regions";
if (fp == F_TRADE) buffer << "could not perform trade in any regions";
if (fp == F_MAGIC) buffer << "could not possess any mages";
if (fp == F_MARTIAL) buffer << "could not perform tax or trade in regions";
count++;
}
if (Globals->APPRENTICES_EXIST && na <= 0)
buffer << ", as well could not possess any" << Globals->APPRENTICE_NAME << "s";
if (Globals->TRANSPORT & GameDefs::ALLOW_TRANSPORT && nq <= 0)
buffer << ", and could not possess any quartermasters";
return buffer.str();
}
// LLS - converted HTML tags to lowercase
int Game::GenRules(const AString &rules, const AString &css, const AString &intro)
{
Faction fac;
bool found;
SkillType *pS;
ofstream f(rules.const_str(), ios::out|ios::trunc);
if (!f.is_open()) return 0;
ifstream introf(intro.const_str(), ios::in);
if (!introf.is_open()) return 0;
// Perform a number of ruleset sanity checks to make sure we don't output rules for something which is not truly
// enabled in a consistent manner.
bool may_sail = (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED)) &&
(!(SkillDefs[S_SHIPBUILDING].flags & SkillType::DISABLED));
bool move_over_water = (Globals->FLIGHT_OVER_WATER != GameDefs::WFLIGHT_NONE);
bool has_stea = !(SkillDefs[S_STEALTH].flags & SkillType::DISABLED);
bool has_obse = !(SkillDefs[S_OBSERVATION].flags & SkillType::DISABLED);
bool has_annihilate = !(SkillDefs[S_ANNIHILATION].flags & SkillType::DISABLED);
bool app_exist = (Globals->APPRENTICES_EXIST);
bool qm_exist = (Globals->TRANSPORT & GameDefs::ALLOW_TRANSPORT);
if (qm_exist) {
/* Make sure the S_QUARTERMASTER skill is enabled */
if (SkillDefs[S_QUARTERMASTER].flags & SkillType::DISABLED)
qm_exist = false;
}
bool found_qm_building = false;
bool has_sacrifice = false;
for (int i = 0; i < NOBJECTS; i++) {
if (ObjectDefs[i].flags & ObjectType::DISABLED) continue;
// for QM we need at least one building with the TRANSPORT flag
if (ObjectDefs[i].flags & ObjectType::TRANSPORT) {
found_qm_building = true;
}
// for SACRIFICE we need at least one building with the SACRIFICE flag
if (ObjectDefs[i].flags & ObjectType::SACRIFICE) {
has_sacrifice = true;
}
}
if (qm_exist && !found_qm_building) qm_exist = false;
if (app_exist) {
found = false;
/* Make sure we have a skill with the APPRENTICE flag */
for (int i = 0; i < NSKILLS; i++) {
if (SkillDefs[i].flags & SkillType::DISABLED) continue;
if (SkillDefs[i].flags & SkillType::APPRENTICE) {
found = true;
break;
}
}
app_exist = found;
}
if (!move_over_water) {
for (int i = 0; i < NITEMS; i++) {
if (ItemDefs[i].flags & ItemType::DISABLED) continue;
if (ItemDefs[i].swim > 0) move_over_water = true;
}
}
f << indent::wrap(78, 70, 0);
f << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
<< endl;
f << enclose("html", true);
f << enclose("head", true);
f << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
f << "<link type=\"text/css\" rel=\"stylesheet\" href=\"" << css << "\">\n";
f << enclose("title", true) << Globals->RULESET_NAME << " "
<< ATL_VER_STR(Globals->RULESET_VERSION) << " Rules\n" << enclose("title", false);
f << enclose("head", false);
f << enclose("body", true);
f << enclose("center", true);
f << enclose("h1", true) << "Rules for " << Globals->RULESET_NAME << " "
<< ATL_VER_STR(Globals->RULESET_VERSION) << '\n' << enclose("h1", false);
f << enclose("h1", true) << "Based on Atlantis v" << ATL_VER_STR(CURRENT_ATL_VER) << '\n' << enclose("h1", false);
f << enclose("h2", true) << "Copyright 1996 by Geoff Dunbar\n" << enclose("h2", false);
f << enclose("h2", true) << "Based on Russell Wallace's Draft Rules\n" << enclose("h2", false);
f << enclose("h2", true) << "Copyright 1993 by Russell Wallace\n" << enclose("h2", false);
auto t = time(nullptr);
auto tm = *localtime(&t);
f << enclose("h3", true) << "Last Change: " << put_time(&tm, "%B %d, %Y") << '\n' << enclose("h3", false);
f << enclose("center", false);
f << enclose(class_tag("div", "rule"), true) << '\n' << enclose("div", false);
f << enclose("p", true) << "Note: This document is subject to change, as errors are found and corrected, and "
<< "rules sometimes change. Be sure you have the latest available copy.\n" << enclose("p", false);
f << anchor("table_of_contents") << '\n';
f << enclose(class_tag("div", "rule"), true) << '\n' << enclose("div", false);
f << enclose("h2", true) << "Table of Contents\n" << enclose("h2", false);
f << enclose("p", true) << "Thanks to " << url("mailto:[email protected]", "Kenneth Casey")
<< " for putting together this table of contents.\n" << enclose("p", false);
f << enclose("p", true) << '\n' << enclose("p", false);
f << enclose("ul", true);
f << enclose("li", true) << url("#intro", "Introduction") << '\n' << enclose("li", false);
f << enclose("li", true);
f << url("#playing", "Playing Atlantis") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#playing_factions", "Factions") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#playing_units", "Units") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#playing_turns", "Turns") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#world", "The World") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#world_regions", "Regions") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#region_resources", "Region Resources") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#world_structures", "Structures") << '\n' << enclose("li", false);
if (Globals->NEXUS_EXISTS) {
f << enclose("li", true) << url("#world_nexus", "Atlantis Nexus") << '\n' << enclose("li", false);
}
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#movement", "Movement") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#movement_normal", "Normal Movement") << '\n' << enclose("li", false);
if (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED))
f << enclose("li", true) << url("#movement_sailing", "Sailing") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#movement_order", "Order of Movement") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#skills", "Skills") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#skills_limitations", "Limitations") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#skills_studying", "Studying") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#skills_teaching", "Teaching") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#skills_skillreports", "Skill Reports") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#economy", "The Economy") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#economy_maintenance", "Maintenance Costs") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#economy_recruiting", "Recruiting") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#economy_items", "Items") << '\n' << enclose("li", false);
if (Globals->TOWNS_EXIST)
f << enclose("li", true) << url("#economy_towns", "Villages, Towns, Cities") << '\n' << enclose("li", false);
f << enclose("li", true)
<< url("#economy_buildings", "Buildings and Trade Structures") << '\n'
<< enclose("li", false);
if (!(ObjectDefs[O_ROADN].flags & ObjectType::DISABLED))
f << enclose("li", true) << url("#economy_roads", "Roads") << '\n' << enclose("li", false);
if (Globals->DECAY)
f << enclose("li", true) << url("#economy_builddecay", "Building Decay") << '\n' << enclose("li", false);
if (may_sail)
f << enclose("li", true) << url("#economy_ships", "Ships") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#economy_advanceditems", "Advanced Items") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#economy_income", "Income") << '\n' << enclose("li", false);
if (!(SkillDefs[S_ENTERTAINMENT].flags & SkillType::DISABLED))
f << enclose("li", true) << url("#economy_entertainment", "Entertainment") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#economy_taxingpillaging", "Taxing/Pillaging") << '\n' << enclose("li", false);
if (qm_exist)
f << enclose("li", true) << url("#economy_transport", "Transporting goods") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#com", "Combat") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#com_attitudes", "Attitudes") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#com_attacking", "Attacking") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#com_muster", "The Muster") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#com_thebattle", "The Battle") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#com_victory", "Victory!") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
if (has_stea || has_obse) {
f << enclose("li", true);
f << url("#stealthobs", has_stea ? (has_obse ? "Stealth and Observation" : "Stealth") : "Observation") + '\n';
if (has_stea) {
f << enclose("ul", true);
f << enclose("li", true) << url("#stealthobs_stealing", "Stealing") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#stealthobs_assassination", "Assassination") << '\n'
<< enclose("li", false);
f << enclose("ul", false);
}
f << enclose("li", false);
}
f << enclose("li", true);
f << url("#magic", "Magic") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#magic_skills", "Magic Skills") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#magic_foundations", "Foundations") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#magic_furtherstudy", "Further Magic Study") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#magic_usingmagic", "Using Magic") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#magic_incombat", "Mages In Combat") << '\n' << enclose("li", false);
if (app_exist) {
string ref = "#magic_" + string(Globals->APPRENTICE_NAME) + "s";
string text = string(Globals->APPRENTICE_NAME) + "s";
text[0] = toupper(text[0]);
f << enclose("li", true) << url(ref, text) << '\n' << enclose("li", false);
}
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#nonplayers", "Non-Player Units") << '\n';
f << enclose("ul", true);
if (Globals->TOWNS_EXIST && Globals->CITY_MONSTERS_EXIST) {
f << enclose("li", true) << url("#nonplayers_guards", "City and Town Guardsmen") << '\n'
<< enclose("li", false);
}
if (Globals->WANDERING_MONSTERS_EXIST) {
f << enclose("li", true) << url("#nonplayers_monsters", "Wandering Monsters") << '\n'
<< enclose("li", false);
}
f << enclose("li", true) << url("#nonplayers_controlled", "Controlled Monsters") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#orders", "Orders") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#orders_abbreviations", "Abbreviations") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true);
f << url("#ordersummary", "Order Summary") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#address", "address") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#advance", "advance") << '\n' << enclose("li", false);
if (has_annihilate)
f << enclose("li", true) << url("#annihilate", "annihilate") << '\n' << enclose("li", false);
if (Globals->USE_WEAPON_ARMOR_COMMAND)
f << enclose("li", true) << url("#armor", "armor") << '\n' << enclose("li", false);
if (has_stea)
f << enclose("li", true) << url("#assassinate", "assassinate") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#attack", "attack") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#autotax", "autotax") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#avoid", "avoid") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#behind", "behind") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#build", "build") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#buy", "buy") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#cast", "cast") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#claim", "claim") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#combat", "combat") << '\n' << enclose("li", false);
if (Globals->FOOD_ITEMS_EXIST)
f << enclose("li", true) << url("#consume", "consume") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#declare", "declare") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#describe", "describe") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#destroy", "destroy") << '\n' << enclose("li", false);
if (qm_exist)
f << enclose("li", true) << url("#distribute", "distribute") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#enter", "enter") << '\n' << enclose("li", false);
if (!(SkillDefs[S_ENTERTAINMENT].flags & SkillType::DISABLED))
f << enclose("li", true) << url("#entertain", "entertain") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#evict", "evict") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#exchange", "exchange") << '\n' << enclose("li", false);
if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_FACTION_TYPES)
f << enclose("li", true) << url("#faction", "faction") << '\n' << enclose("li", false);
if (Globals->HAVE_EMAIL_SPECIAL_COMMANDS)
f << enclose("li", true) << url("#find", "find") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#forget", "forget") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#form", "form") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#give", "give") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#guard", "guard") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#hold", "hold") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#join", "join") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#leave", "leave") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#move", "move") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#name", "name") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#noaid", "noaid") << '\n' << enclose("li", false);
if (move_over_water)
f << enclose("li", true) << url("#nocross", "nocross") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#option", "option") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#password", "password") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#pillage", "pillage") << '\n' << enclose("li", false);
if (Globals->USE_PREPARE_COMMAND)
f << enclose("li", true) << url("#prepare", "prepare") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#produce", "produce") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#promote", "promote") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#quit", "quit") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#restart", "restart") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#reveal", "reveal") << '\n' << enclose("li", false);
if (has_sacrifice)
f << enclose("li", true) << url("#sacrifice", "sacrifice") << '\n' << enclose("li", false);
if (may_sail)
f << enclose("li", true) << url("#sail", "sail") << '\n' << enclose("li", false);
if (Globals->TOWNS_EXIST)
f << enclose("li", true) << url("#sell", "sell") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#share", "share") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#show", "show") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#spoils", "spoils") << '\n' << enclose("li", false);
if (has_stea)
f << enclose("li", true) << url("#steal", "steal") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#study", "study") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#take", "take") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#tax", "tax") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#teach", "teach") << '\n' << enclose("li", false);
if (qm_exist)
f << enclose("li", true) << url("#transport", "transport") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#turn", "turn") << '\n' << enclose("li", false);
if (Globals->USE_WEAPON_ARMOR_COMMAND)
f << enclose("li", true) << url("#weapon", "weapon") << '\n' << enclose("li", false);
if (Globals->ALLOW_WITHDRAW)
f << enclose("li", true) << url("#withdraw", "withdraw") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#work", "work") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
f << enclose("li", true) << url("#sequenceofevents", "Sequence of Events") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#reportformat", "Report Format") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#hintsfornew", "Hints for New Players") << '\n' << enclose("li", false);
if (Globals->HAVE_EMAIL_SPECIAL_COMMANDS) {
f << enclose("li", true);
f << url("#specialcommands", "Special Commands") << '\n';
f << enclose("ul", true);
f << enclose("li", true) << url("#_create", "#Create") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#_resend", "#Resend") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#_times", "#Times") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#_rumor", "#Rumor") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#_remind", "#Remind") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#_email", "#Email") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("li", false);
}
f << enclose("li", true) << url("#credits", "Credits") << '\n' << enclose("li", false);
f << enclose("ul", false);
f << enclose("p", true) << "Index of Tables\n" << enclose("p", false);
f << enclose("p", true) << '\n' << enclose("p", false);
f << enclose("ul", true);
if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_FACTION_TYPES)
f << enclose("li", true) << url("#tablefactionpoints", "Table of Faction Points") << '\n'
<< enclose("li", false);
f << enclose("li", true) << url("#tableitemweights", "Table of Item Weights") << '\n' << enclose("li", false);
if (may_sail)
f << enclose("li", true) << url("#tableshipcapacities", "Table of Ship Capacities") << '\n'
<< enclose("li", false);
if (Globals->RACES_EXIST)
f << enclose("li", true) << url("#tableraces", "Table of Races") << '\n' << enclose("li", false);
if (Globals->REQUIRED_EXPERIENCE)
f << enclose("li", true) << url("#studyprogress", "Table of Study Progress") << '\n'
<< enclose("li", false);
f << enclose("li", true) << url("#tableiteminfo", "Table of Item Information") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#tablebuildings", "Table of Buildings") << '\n' << enclose("li", false);
f << enclose("li", true) << url("#tabletradestructures", "Table of Trade Structures") << '\n'
<< enclose("li", false);
if (!(ObjectDefs[O_ROADN].flags & ObjectType::DISABLED))
f << enclose("li", true) << url("#tableroadstructures", "Table of Road Structures") << '\n'
<< enclose("li", false);
if (may_sail)
f << enclose("li", true) << url("#tableshipinfo", "Table of Ship Information") << '\n'
<< enclose("li", false);
if (Globals->LIMITED_MAGES_PER_BUILDING)
f << enclose("li", true) << url("#tablemagebuildings", "Table of Mages/Building") << '\n'
<< enclose("li", false);
f << enclose("ul", false);
f << anchor("intro") << '\n';
f << enclose(class_tag("div", "rule"), true) << '\n' << enclose("div", false);
f << enclose("h2", true) << "Introduction\n" << enclose("h2", false);
while (!introf.eof()) {
string in;
getline(introf >> ws, in);
f << in << '\n';
}
f << anchor("playing") << '\n';
f << enclose(class_tag("div", "rule"), true) << '\n' << enclose("div", false);
f << enclose("h2", true) << "Playing Atlantis\n" << enclose("h2", false);
f << enclose("p", true) << "Atlantis (as you undoubtedly already know) is a play by email game. When you "
<< "sign up for Atlantis, you will be sent a turn report (via email). Your report completely details "
<< "your position in the game. After going over this report, and possibly communicating with other players "
<< "in the game, you determine your course of action, and create a file of \"orders\", which you then send "
<< "back to the Atlantis server. Then, at a regular interval (often one week), Atlantis collects all the "
<< "orders, runs another turn (covering one month in game time), and sends all the players another report.\n"
<< enclose("p", false);
f << anchor("playing_factions") << '\n';
f << enclose("h3", true) << "Factions:\n" << enclose("h3", false);
f << enclose("p", true) << "A player's position is called a \"faction\". Each faction has a name and a "
<< "number (the number is assigned by the computer, and used for entering orders). Each player is allowed "
<< "to play one and ONLY one faction at any given time. Each faction is composed of a number of \"units\", "
<< "each unit being a group of one or more people loyal to the faction. You start the game with a single "
<< "unit consisting of one character, plus a sum of money. More people can be hired during the course of "
<< "the game, and formed into more units. (In these rules, the word \"character\" generally refers either "
<< "to a unit consisting of only one person, or to a person within a larger unit.)\n"
<< enclose("p", false);
f << enclose("p", true) << "A faction is considered destroyed, and the player knocked out of the game, if ever "
<< "all its people are killed or disbanded (i.e. the faction has no units left). The program does not "
<< "consider your starting character to be special; if your starting character gets killed, you will probably "
<< "have been thinking of that character as the leader of your faction, so some other character can be "
<< "regarded as having taken the dead leader's place (assuming of course that you have at least one surviving "
<< "unit!). As far as the computer is concerned, as long as any unit of the faction survives, the faction is "
<< "not wiped out. (If your faction is wiped out, you can rejoin the game with a new starting character.)\n"
<< enclose("p", false);
if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_MAGE_COUNT) {
f << enclose("p", true) << "A faction has one pre-set limit; it may not contain more than ";
f << AllowedMages(&fac) << " mages";
if (app_exist) {
f << " and " << AllowedApprentices(&fac) << ' ' << Globals->APPRENTICE_NAME << 's';
}
f << ". Magic is a rare art, and only a few in the world can master it. Aside from that, there is no limit "
<< "to the number of units a faction may contain, nor to how many items can be produced or regions taxed.\n"
<< enclose("p", false);
} else if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_FACTION_TYPES) {
f << enclose("p", true) << "Each faction has a type which is decided by the player, and determines what the "
<< "faction may do. The faction has " << Globals->FACTION_POINTS << " Faction Points, which may be spent on "
<< "the Faction Areas of "
<< (Globals->FACTION_ACTIVITY == FactionActivityRules::DEFAULT ? "War, Trade, and Magic" : "Martial and Magic")
<< ". The faction type may be changed at the beginning of each turn, so a faction can change and adapt to "
<< "the conditions around it. Faction Points spent on "
<< (Globals->FACTION_ACTIVITY == FactionActivityRules::DEFAULT ? "War" : "Martial")
<< " determine the number of regions in which factions can obtain income by taxing or pillaging";
if (Globals->TACTICS_NEEDS_WAR) {
f << ", and also determines the number of level 5 tactics leaders (tacticians) that a faction can train";
}
f << ". Faction Points spent on "
<< (Globals->FACTION_ACTIVITY == FactionActivityRules::DEFAULT ? "Trade" : "Martial also") << " determine "
<< "the number of regions in which a faction may conduct trade activity. Trade activity includes "
<< "producing goods and materials";
if (!Globals->TRANSPORT_NO_TRADE && qm_exist) {
f << (!Globals->BUILD_NO_TRADE ? ", " : " and ") << " transporting items";
}
if (!Globals->BUILD_NO_TRADE) {
f << (!Globals->TRANSPORT_NO_TRADE && qm_exist ? ", and " : " and ") << "constructing ships and buildings";
}
f << '.';
if (qm_exist) {
f << " Faction points spent on "
<< (Globals->FACTION_ACTIVITY == FactionActivityRules::DEFAULT ? "Trade" : "Martial") << " also "
<< "determine the number of quartermaster units a faction can have.";
}
if (Globals->FACTION_ACTIVITY == FactionActivityRules::MARTIAL) {
f << " It is important to remember that taxing/pillaging in a region and conducting trade activity "
<< "in the same region would use up two of the faction's allowed Martial regions.";
}
f << " Faction Points spent on Magic determine the number of mages";
if (app_exist) {
f << " and " << Globals->APPRENTICE_NAME << 's';
}
f << " the faction may have (more information on all of the faction activities is in further sections of the "
<< "rules). Here is a chart detailing the limits on factions by Faction Points:\n"
<< enclose("p", false);
f << anchor("tablefactionpoints") << '\n';
f << enclose("center", true);
f << enclose("table border=\"1\"", true);
f << enclose("tr", true);
f << enclose("th", true) << "Faction Points\n" << enclose("th", false);
for (auto &fp : *FactionTypes) {
if (fp == F_WAR) {
f << enclose("th", true)
<< "War (max tax regions"
<< (Globals->TACTICS_NEEDS_WAR ? " / tacticians" : "")
<< ")\n"
<< enclose("th", false);
}
if (fp == F_TRADE) {
f << enclose("th", true)
<< "Trade (max trade regions"
<< (qm_exist ? " / quartermasters" : "")
<< ")\n"
<< enclose("th", false);
}
if (fp == F_MARTIAL) {
f << enclose("th", true)
<< "Martial (max tax "
<< (Globals->FACTION_ACTIVITY == FactionActivityRules::MARTIAL_MERGED ? "and" : "or")
<< " trade regions"
<< (qm_exist ? " / quartermasters" : "")
<< (Globals->TACTICS_NEEDS_WAR ? " / tacticians" : "")
<< ")\n"
<< enclose("th", false);
}
if (fp == F_MAGIC) {
f << enclose("th", true)
<< "Magic (max mages"
<< (app_exist ? " / " + string(Globals->APPRENTICE_NAME) + "s" : "")
<< ")\n"
<< enclose("th", false);
}
}
f << enclose("tr", false);
for (auto i = 0; i <= Globals->FACTION_POINTS; i++) {
for (auto &fp : *FactionTypes) {
fac.type[fp] = i;
}
f << enclose("tr", true);
f << enclose("td align=\"center\" nowrap", true) << i << '\n' << enclose("td", false);
for (auto &fp : *FactionTypes) {
if (fp == F_WAR) {
f << enclose("td align=\"center\" nowrap", true) << to_string(AllowedTaxes(&fac))
<< (Globals->TACTICS_NEEDS_WAR ? " / " + to_string(AllowedTacticians(&fac)) : "")
<< '\n' << enclose("td", false);
}
if (fp == F_TRADE) {
f << enclose("td align=\"center\" nowrap", true) << to_string(AllowedTrades(&fac))
<< (qm_exist ? " / " + to_string(AllowedQuarterMasters(&fac)) : "")
<< '\n' << enclose("td", false);
}
if (fp == F_MARTIAL) {
f << enclose("td align=\"center\" nowrap", true) << to_string(AllowedMartial(&fac))
<< (qm_exist ? " / " + to_string(AllowedQuarterMasters(&fac)) : "")
<< (Globals->TACTICS_NEEDS_WAR ? " / " + to_string(AllowedTacticians(&fac)) : "")
<< '\n' << enclose("td", false);
}
if (fp == F_MAGIC) {
f << enclose("td align=\"center\" nowrap", true) << to_string(AllowedMages(&fac))
<< (app_exist ? " / " + to_string(AllowedApprentices(&fac)) : "")
<< '\n' << enclose("td", false);
}
}
f << enclose("tr", false);
}
f << enclose("table", false);
f << enclose("center", false);
f << "<P></P>\n";
std::ostringstream buffer;
int count = FactionTypes->size();
int singleValue = Globals->FACTION_POINTS / count;
int reminder = Globals->FACTION_POINTS % count;
for (auto &fp : *FactionTypes) {
int value = singleValue;
if (reminder > 0) {
value += 1;
reminder--;
}
fac.type[fp] = value;
}
f << enclose("p", true) << "For example, a well rounded faction might spend " << faction_point_usage(fac)
<< ". This faction's type would appear as \"" << faction_point_usage(fac, false)
<< "\", and would be able to " << FactionTypeDescription(fac) << ".\n"
<< enclose("p", false);
if (Globals->FACTION_ACTIVITY == FactionActivityRules::DEFAULT) {
fac.type[F_WAR] = Globals->FACTION_POINTS;
fac.type[F_TRADE] = 0;
} else {
fac.type[F_MARTIAL] = Globals->FACTION_POINTS;
}
fac.type[F_MAGIC] = 0;
f << enclose("p", true) << "As another example, a specialized faction might spend all "
<< faction_point_usage(fac) << ". This faction's type would appear as \""
<< faction_point_usage(fac, false) << "\", and would be able to " << FactionTypeDescription(fac) << ".\n"
<< enclose("p", false);
if (Globals->FACTION_POINTS>3) {
int rem = Globals->FACTION_POINTS - 3;
f << enclose("p", true) << "Note that it is possible to have a faction type with less than "
<< Globals->FACTION_POINTS << " points spent. In fact, a starting faction has one point spent "
<< "on each of ";
for (auto &fp : *FactionTypes) f << fp + ", ";
f << "leaving " << rem << " "
<< plural(rem, "point", "points") << " unspent.\n"
<< enclose("p", false);
}
}
f << enclose("p", true) << "When a faction starts the game, it is given a one-man unit and "
<< Globals->START_MONEY << " silver in unclaimed money. Unclaimed money is cash that your "
<< "whole faction has access to, but cannot be taken away in battle (silver in a unit's possessions can be "
<< "taken in battle). This allows a faction to get started without presenting an enticing target for other "
<< "factions. Units in your faction may use the " << url("#claim", "CLAIM") << " order to take this silver, "
<< "and use it to buy goods or recruit men";
if (Globals->ALLOW_WITHDRAW)
f << ", or use the " << url("#withdraw", "WITHDRAW") << " order to withdraw goods directly";
f << ".\n" << enclose("p", false);
f << enclose("p", true) << "An example faction is shown below, consisting of a starting character, Merlin the "
<< "Magician, who has formed two more units, Merlin's Guards and Merlin's Workers. Each unit is assigned a "
<< "unit number by the computer (completely independent of the faction number); this is used for entering "
<< "orders. Here, the player has chosen to give his faction the same name (\"Merlin the Magician\") as his "
<< "starting character. Alternatively, you can call your faction something like \"The Great Northern Mining "
<< "Company\" or whatever.\n" << enclose("p", false);
f << enclose("p", true) << "\n" << enclose("p", false);
f << pre(true);
if (Globals->LEADERS_EXIST) {
f << "* Merlin the Magician (17), Merlin (27), leader [LEAD]. Skills: none.\n";
} else {
f << "* Merlin the Magician (17), Merlin (27), man [MAN]. Skills: none.\n";
}
if (Globals->RACES_EXIST) {
f << "* Merlin's Guards (33), Merlin (27), 20 vikings [VIKI], 20 swords [SWOR]. Skills: none.\n";
f << "* Merlin's Workers (34), Merlin (27), 50 vikings [VIKI]. Skills: none.\n";
} else {
f << "* Merlin's Guards (33), Merlin (27), 20 men [MAN], 20 swords [SWOR]. Skills: none.\n";
f << "* Merlin's Workers (34), Merlin (27), 50 men [MAN]. Skills: none.\n";
}
f << pre(false);
f << anchor("playing_units") << '\n';
f << enclose("h3", true) << "Units:\n" << enclose("h3", false);
f << enclose("p", true) << "A unit is a grouping together of people, all loyal to the same faction. The people in "
<< "a unit share skills and possessions, and execute the same orders each month. The reason for having units of "
<< "many people, rather than keeping track of individuals, is to simplify the game play. The computer does "
<< "not keep track of individual names, possessions, or skills for people in the same unit, and all the people "
<< "in a particular unit must be in the same place at all times. If you want to send people in the same unit "
<< "to different places, you must split up the unit. Apart from this, there is little difference between "
<< "having one unit of 50 people, or 50 units of one person each, except that the former is very much easier "
<< "to handle.\n" << enclose("p", false);
f << enclose("p", true);
if (Globals->RACES_EXIST) {
f << "There are different races that make up the population of Atlantis. (See the section on skills for "
<< "a list of these.)";
if (Globals->LEADERS_EXIST) {
f << " In addition, there are \"leaders\", who are presumed to be of one of the other races, but are "
<< "all the same in game terms.";
}
} else {
f << "Units are made up of ordinary people" << (Globals->LEADERS_EXIST ? "as well as leaders" : "") << ".";
}
if (Globals->LEADERS_EXIST && Globals->SKILL_LIMIT_NONLEADERS) {