forked from artyomtrityak/Atlantis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenrules.cpp
More file actions
6286 lines (6166 loc) · 245 KB
/
genrules.cpp
File metadata and controls
6286 lines (6166 loc) · 245 KB
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 <time.h>
#include "game.h"
#include "gamedata.h"
#include "fileio.h"
AString NumToWord(int n)
{
if (n > 20) return AString(n);
switch(n) {
case 0: return AString("zero");
case 1: return AString("one");
case 2: return AString("two");
case 3: return AString("three");
case 4: return AString("four");
case 5: return AString("five");
case 6: return AString("six");
case 7: return AString("seven");
case 8: return AString("eight");
case 9: return AString("nine");
case 10: return AString("ten");
case 11: return AString("eleven");
case 12: return AString("twelve");
case 13: return AString("thirteen");
case 14: return AString("fourteen");
case 15: return AString("fifteen");
case 16: return AString("sixteen");
case 17: return AString("seventeen");
case 18: return AString("eighteen");
case 19: return AString("nineteen");
case 20: return AString("twenty");
}
return AString("error");
}
int StudyRate(int days, int exp)
{
SkillList *sl = new SkillList;
sl->SetDays(1,days);
sl->SetExp(1,exp);
int rate = sl->GetStudyRate(1, 1);
delete sl;
return rate;
}
// LLS - converted HTML tags to lowercase
int Game::GenRules(const AString &rules, const AString &css,
const AString &intro)
{
Ainfile introf;
Arules f;
AString temp, temp2;
int cap;
int i, j, k, l;
int last = -1;
AString skname;
SkillType *pS;
if (f.OpenByName(rules) == -1) {
return 0;
}
if (introf.OpenByName(intro) == -1) {
return 0;
}
int 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 = 0;
}
int found = 0;
if (qm_exist) {
/* Make there is an enabled building with transport set */
for (i = 0; i < NOBJECTS; i++) {
if (ObjectDefs[i].flags & ObjectType::DISABLED) continue;
if (ObjectDefs[i].flags & ObjectType::TRANSPORT) {
found = 1;
break;
}
}
if (!found) qm_exist = 0;
}
f.PutStr("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 "
"Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
f.Enclose(1, "html");
f.Enclose(1, "head");
f.PutStr("<meta http-equiv=\"Content-Type\" content=\"text/html; "
"charset=utf-8\">");
f.PutStr(AString("<link type=\"text/css\" rel=\"stylesheet\" href=\"")+
css + "\">");
temp = AString(Globals->RULESET_NAME) + " " +
ATL_VER_STR(Globals->RULESET_VERSION);
temp2 = temp + " Rules";
f.TagText("title", temp2);
f.Enclose(0, "head");
f.Enclose(1, "body");
f.Enclose(1, "center");
f.TagText("h1", AString("Rules for ") + temp);
f.TagText("h1", AString("Based on Atlantis v") +
ATL_VER_STR(CURRENT_ATL_VER));
f.TagText("h2", AString("Copyright 1996 by Geoff Dunbar"));
f.TagText("h2", AString("Based on Russell Wallace's Draft Rules"));
f.TagText("h2", AString("Copyright 1993 by Russell Wallace"));
char buf[500];
time_t tval = time(NULL);
struct tm *ltval = localtime(&tval);
strftime(buf, 500, "%B %d, %Y", ltval);
f.TagText("h3", AString("Last Change: ")+buf);
f.Enclose(0, "center");
f.ClassTagText("div", "rule", "");
temp = "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.";
f.Paragraph(temp);
f.LinkRef("table_of_contents");
f.ClassTagText("div", "rule", "");
f.TagText("h2", "Table of Contents");
temp = AString("Thanks to ") +
f.Link("mailto:ken@satori.gso.uri.edu","Kenneth Casey")+
" for putting together this table of contents.";
f.Paragraph(temp);
f.Paragraph("");
f.Enclose(1, "ul");
f.TagText("li", f.Link("#intro", "Introduction"));
f.Enclose(1, "li");
f.PutStr(f.Link("#playing", "Playing Atlantis"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#playing_factions", "Factions"));
f.TagText("li", f.Link("#playing_units", "Units"));
f.TagText("li", f.Link("#playing_turns", "Turns"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#world", "The World"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#world_regions", "Regions"));
f.TagText("li", f.Link("#world_structures", "Structures"));
if (Globals->NEXUS_EXISTS) {
temp = "Atlantis Nexus";
f.TagText("li", f.Link("#world_nexus", temp));
}
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#movement", "Movement"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#movement_normal", "Normal Movement"));
if (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED))
f.TagText("li", f.Link("#movement_sailing", "Sailing"));
f.TagText("li", f.Link("#movement_order", "Order of Movement"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#skills", "Skills"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#skills_limitations", "Limitations"));
f.TagText("li", f.Link("#skills_studying", "Studying"));
f.TagText("li", f.Link("#skills_teaching", "Teaching"));
f.TagText("li", f.Link("#skills_skillreports", "Skill Reports"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#economy", "The Economy"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#economy_maintenance", "Maintenance Costs"));
f.TagText("li", f.Link("#economy_recruiting", "Recruiting"));
f.TagText("li", f.Link("#economy_items", "Items"));
if (Globals->TOWNS_EXIST)
f.TagText("li", f.Link("#economy_towns", "Villages, Towns, Cities"));
f.TagText("li", f.Link("#economy_buildings",
"Buildings and Trade Structures"));
if (!(ObjectDefs[O_ROADN].flags & ObjectType::DISABLED))
f.TagText("li", f.Link("#economy_roads", "Roads"));
if (Globals->DECAY)
f.TagText("li", f.Link("#economy_builddecay", "Building Decay"));
int may_sail = (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED)) &&
(!(SkillDefs[S_SHIPBUILDING].flags & SkillType::DISABLED));
if (may_sail)
f.TagText("li", f.Link("#economy_ships", "Ships"));
f.TagText("li", f.Link("#economy_advanceditems", "Advanced Items"));
f.TagText("li", f.Link("#economy_income", "Income"));
if (!(SkillDefs[S_ENTERTAINMENT].flags & SkillType::DISABLED))
f.TagText("li", f.Link("#economy_entertainment", "Entertainment"));
f.TagText("li", f.Link("#economy_taxingpillaging", "Taxing/Pillaging"));
if (qm_exist)
f.TagText("li", f.Link("#economy_transport", "Transporting goods"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#com", "Combat"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#com_attitudes", "Attitudes"));
f.TagText("li", f.Link("#com_attacking", "Attacking"));
f.TagText("li", f.Link("#com_muster", "The Muster"));
f.TagText("li", f.Link("#com_thebattle", "The Battle"));
f.TagText("li", f.Link("#com_victory", "Victory!"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
int has_stea = !(SkillDefs[S_STEALTH].flags & SkillType::DISABLED);
int has_obse = !(SkillDefs[S_OBSERVATION].flags & SkillType::DISABLED);
int app_exist = (Globals->APPRENTICES_EXIST);
if (app_exist) {
found = 0;
/* Make sure we have a skill with the APPRENTICE flag */
for (i = 0; i < NSKILLS; i++) {
if (SkillDefs[i].flags & SkillType::DISABLED) continue;
if (SkillDefs[i].flags & SkillType::APPRENTICE) {
found = 1;
break;
}
}
if (!found) app_exist = 0;
}
if (has_stea || has_obse) {
if (has_stea) temp = "Stealth";
else temp = "";
if (has_obse) {
if (has_stea) temp += " and ";
temp += "Observation";
}
f.Enclose(1, "li");
f.PutStr(f.Link("#stealthobs", temp));
if (has_stea) {
f.Enclose(1, "ul");
f.TagText("li", f.Link("#stealthobs_stealing", "Stealing"));
f.TagText("li", f.Link("#stealthobs_assassination",
"Assassination"));
f.Enclose(0, "ul");
}
f.Enclose(0, "li");
}
f.Enclose(1, "li");
f.PutStr(f.Link("#magic", "Magic"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#magic_skills", "Magic Skills"));
f.TagText("li", f.Link("#magic_foundations", "Foundations"));
f.TagText("li", f.Link("#magic_furtherstudy", "Further Magic Study"));
f.TagText("li", f.Link("#magic_usingmagic", "Using Magic"));
f.TagText("li", f.Link("#magic_incombat", "Mages In Combat"));
if (app_exist) {
temp = "#magic_";
temp += Globals->APPRENTICE_NAME;
temp += "s";
temp2 = (char) toupper(Globals->APPRENTICE_NAME[0]);
temp2 += Globals->APPRENTICE_NAME + 1;
temp2 += "s";
f.TagText("li", f.Link(temp, temp2));
}
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#nonplayers", "Non-Player Units"));
f.Enclose(1, "ul");
if (Globals->TOWNS_EXIST && Globals->CITY_MONSTERS_EXIST) {
f.TagText("li", f.Link("#nonplayers_guards",
"City and Town Guardsmen"));
}
if (Globals->WANDERING_MONSTERS_EXIST) {
f.TagText("li", f.Link("#nonplayers_monsters", "Wandering Monsters"));
}
f.TagText("li", f.Link("#nonplayers_controlled", "Controlled Monsters"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#orders", "Orders"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#orders_abbreviations", "Abbreviations"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.Enclose(1, "li");
f.PutStr(f.Link("#ordersummary", "Order Summary"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#address", "address"));
f.TagText("li", f.Link("#advance", "advance"));
if (Globals->USE_WEAPON_ARMOR_COMMAND)
f.TagText("li", f.Link("#armor", "armor"));
if (has_stea)
f.TagText("li", f.Link("#assassinate", "assassinate"));
f.TagText("li", f.Link("#attack", "attack"));
f.TagText("li", f.Link("#autotax", "autotax"));
f.TagText("li", f.Link("#avoid", "avoid"));
f.TagText("li", f.Link("#behind", "behind"));
f.TagText("li", f.Link("#build", "build"));
f.TagText("li", f.Link("#buy", "buy"));
f.TagText("li", f.Link("#cast", "cast"));
f.TagText("li", f.Link("#claim", "claim"));
f.TagText("li", f.Link("#combat", "combat"));
if (Globals->FOOD_ITEMS_EXIST)
f.TagText("li", f.Link("#consume", "consume"));
f.TagText("li", f.Link("#declare", "declare"));
f.TagText("li", f.Link("#describe", "describe"));
f.TagText("li", f.Link("#destroy", "destroy"));
if (qm_exist)
f.TagText("li", f.Link("#distribute", "distribute"));
f.TagText("li", f.Link("#enter", "enter"));
if (!(SkillDefs[S_ENTERTAINMENT].flags & SkillType::DISABLED))
f.TagText("li", f.Link("#entertain", "entertain"));
f.TagText("li", f.Link("#evict", "evict"));
f.TagText("li", f.Link("#exchange", "exchange"));
if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_FACTION_TYPES)
f.TagText("li", f.Link("#faction", "faction"));
f.TagText("li", f.Link("#find", "find"));
f.TagText("li", f.Link("#forget", "forget"));
f.TagText("li", f.Link("#form", "form"));
f.TagText("li", f.Link("#give", "give"));
f.TagText("li", f.Link("#guard", "guard"));
f.TagText("li", f.Link("#hold", "hold"));
f.TagText("li", f.Link("#join", "join"));
f.TagText("li", f.Link("#leave", "leave"));
f.TagText("li", f.Link("#move", "move"));
f.TagText("li", f.Link("#name", "name"));
f.TagText("li", f.Link("#noaid", "noaid"));
int move_over_water = 0;
if (Globals->FLIGHT_OVER_WATER != GameDefs::WFLIGHT_NONE)
move_over_water = 1;
if (!move_over_water) {
for (i = 0; i < NITEMS; i++) {
if (ItemDefs[i].flags & ItemType::DISABLED) continue;
if (ItemDefs[i].swim > 0) move_over_water = 1;
}
}
if (move_over_water)
f.TagText("li", f.Link("#nocross", "nocross"));
f.TagText("li", f.Link("#option", "option"));
f.TagText("li", f.Link("#password", "password"));
f.TagText("li", f.Link("#pillage", "pillage"));
if (Globals->USE_PREPARE_COMMAND)
f.TagText("li", f.Link("#prepare", "prepare"));
f.TagText("li", f.Link("#produce", "produce"));
f.TagText("li", f.Link("#promote", "promote"));
f.TagText("li", f.Link("#quit", "quit"));
f.TagText("li", f.Link("#restart", "restart"));
f.TagText("li", f.Link("#reveal", "reveal"));
if (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED))
f.TagText("li", f.Link("#sail", "sail"));
if (Globals->TOWNS_EXIST)
f.TagText("li", f.Link("#sell", "sell"));
f.TagText("li", f.Link("#share", "share"));
f.TagText("li", f.Link("#show", "show"));
f.TagText("li", f.Link("#spoils", "spoils"));
if (has_stea)
f.TagText("li", f.Link("#steal", "steal"));
f.TagText("li", f.Link("#study", "study"));
f.TagText("li", f.Link("#take", "take"));
f.TagText("li", f.Link("#tax", "tax"));
f.TagText("li", f.Link("#teach", "teach"));
if (qm_exist)
f.TagText("li", f.Link("#transport", "transport"));
f.TagText("li", f.Link("#turn", "turn"));
if (Globals->USE_WEAPON_ARMOR_COMMAND)
f.TagText("li", f.Link("#weapon", "weapon"));
if (Globals->ALLOW_WITHDRAW)
f.TagText("li", f.Link("#withdraw", "withdraw"));
f.TagText("li", f.Link("#work", "work"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
f.TagText("li", f.Link("#sequenceofevents", "Sequence of Events"));
f.TagText("li", f.Link("#reportformat", "Report Format"));
f.TagText("li", f.Link("#hintsfornew", "Hints for New Players"));
if (Globals->HAVE_EMAIL_SPECIAL_COMMANDS) {
f.Enclose(1, "li");
f.PutStr(f.Link("#specialcommands", "Special Commands"));
f.Enclose(1, "ul");
f.TagText("li", f.Link("#_create", "#Create"));
f.TagText("li", f.Link("#_resend", "#Resend"));
f.TagText("li", f.Link("#_times", "#Times"));
f.TagText("li", f.Link("#_rumor", "#Rumor"));
f.TagText("li", f.Link("#_remind", "#Remind"));
f.TagText("li", f.Link("#_email", "#Email"));
f.Enclose(0, "ul");
f.Enclose(0, "li");
}
f.TagText("li", f.Link("#credits", "Credits"));
f.Enclose(0, "ul");
f.Paragraph("Index of Tables");
f.Paragraph("");
f.Enclose(1, "ul");
if (Globals->FACTION_LIMIT_TYPE==GameDefs::FACLIM_FACTION_TYPES)
f.TagText("li", f.Link("#tablefactionpoints",
"Table of Faction Points"));
f.TagText("li", f.Link("#tableitemweights", "Table of Item Weights"));
if (may_sail)
f.TagText("li", f.Link("#tableshipcapacities",
"Table of Ship Capacities"));
if (Globals->RACES_EXIST)
f.TagText("li", f.Link("#tableraces", "Table of Races"));
if (Globals->REQUIRED_EXPERIENCE)
f.TagText("li", f.Link("#studyprogress", "Table of Study Progress"));
f.TagText("li", f.Link("#tableiteminfo", "Table of Item Information"));
f.TagText("li", f.Link("#tablebuildings", "Table of Buildings"));
f.TagText("li", f.Link("#tabletradestructures",
"Table of Trade Structures"));
if (!(ObjectDefs[O_ROADN].flags & ObjectType::DISABLED))
f.TagText("li", f.Link("#tableroadstructures",
"Table of Road Structures"));
if (may_sail)
f.TagText("li", f.Link("#tableshipinfo", "Table of Ship Information"));
if (Globals->LIMITED_MAGES_PER_BUILDING) {
f.TagText("li",
f.Link("#tablemagebuildings", "Table of Mages/Building"));
}
f.Enclose(0, "ul");
f.LinkRef("intro");
f.ClassTagText("div", "rule", "");
f.TagText("h2", "Introduction");
AString *in;
while((in = introf.GetStr()) != NULL) {
f.PutStr(*in);
delete in;
}
f.LinkRef("playing");
f.ClassTagText("div", "rule", "");
f.TagText("h2", "Playing Atlantis");
temp = "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.";
f.Paragraph(temp);
f.LinkRef("playing_factions");
f.TagText("h3", "Factions:");
temp = "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.)";
f.Paragraph(temp);
temp = "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.)";
f.Paragraph(temp);
Faction fac;
if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_MAGE_COUNT) {
temp = "A faction has one pre-set limit; it may not contain more than ";
temp += AString(AllowedMages(&fac)) + " mages";
if (app_exist) {
temp += AString("and ") + AllowedApprentices(&fac)
+ " " + Globals->APPRENTICE_NAME + "s";
}
temp += ". 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.";
f.Paragraph(temp);
} else if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_FACTION_TYPES) {
temp = "Each faction has a type; this is decided by the player, "
"and determines what the faction may do. The faction has ";
temp += Globals->FACTION_POINTS;
temp += " Faction Points, which may be spent on any of the 3 "
"Faction Areas, War, Trade, 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 War determine the number of regions in which factions "
"can obtain income by taxing or pillaging";
if (Globals->TACTICS_NEEDS_WAR) {
temp += ", and also determines the number of level 5 tactics "
"leaders (tacticians) that a faction can train";
}
temp += ". Faction Points spent "
"on Trade determine the number of regions in which a faction "
"may conduct trade activity. Trade activity includes producing "
"goods, building ships and buildings, and buying trade items. ";
if (qm_exist) {
temp += "Faction points spent on Trade also determine the "
"of quartermaster units a trade faction can have. ";
}
temp += "Faction Points spent on Magic determine the number of mages ";
if (app_exist) {
temp += "and ";
temp += Globals->APPRENTICE_NAME;
temp += "s ";
}
temp += "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:";
f.Paragraph(temp);
f.LinkRef("tablefactionpoints");
f.Enclose(1, "center");
f.Enclose(1, "table border=\"1\"");
f.Enclose(1, "tr");
f.TagText("th", "Faction Points");
temp = "War (max tax regions";
if (Globals->TACTICS_NEEDS_WAR)
temp += " / tacticians";
temp += ")";
f.TagText("th", temp);
temp = "Trade (max trade regions";
if (qm_exist)
temp += " / quartermasters";
temp += ")";
f.TagText("th", temp);
temp = "Magic (max mages";
if (app_exist) {
temp += " / ";
temp += Globals->APPRENTICE_NAME;
temp += "s";
}
temp += ")";
f.TagText("th", temp);
f.Enclose(0, "tr");
int i;
for (i = 0; i <= Globals->FACTION_POINTS; i++) {
fac.type[F_WAR]=i;
fac.type[F_TRADE]=i;
fac.type[F_MAGIC]=i;
f.Enclose(1, "tr");
f.Enclose(1, "td align=\"center\" nowrap");
f.PutStr(i);
f.Enclose(0, "td");
f.Enclose(1, "td align=\"center\" nowrap");
temp = AllowedTaxes(&fac);
if (Globals->TACTICS_NEEDS_WAR)
temp+= AString(" / ") + AllowedTacticians(&fac);
f.PutStr(temp);
f.Enclose(0, "td");
f.Enclose(1, "td align=\"center\" nowrap");
temp = AllowedTrades(&fac);
if (qm_exist)
temp += AString(" / ") + AllowedQuarterMasters(&fac);
f.PutStr(temp);
f.Enclose(0, "td");
f.Enclose(1, "td align=\"center\" nowrap");
temp = AllowedMages(&fac);
if (app_exist)
temp += AString(" / ") + AllowedApprentices(&fac);
f.PutStr(temp);
f.Enclose(0, "td");
f.Enclose(0, "tr");
}
f.Enclose(0, "table");
f.Enclose(0, "center");
f.PutStr("<P></P>");
int m,w,t;
fac.type[F_WAR] = w = (Globals->FACTION_POINTS+1)/3;
fac.type[F_TRADE] = t = Globals->FACTION_POINTS/3;
fac.type[F_MAGIC] = m = (Globals->FACTION_POINTS+2)/3;
int nm, na, nw, nt, nq;
nm = AllowedMages(&fac);
na = AllowedApprentices(&fac);
nq = AllowedQuarterMasters(&fac);
nt = AllowedTrades(&fac);
nw = AllowedTaxes(&fac);
temp = "For example, a well rounded faction might spend ";
temp += AString(w) + " point" + (w==1?"":"s") + " on War, ";
temp += AString(t) + " point" + (t==1?"":"s") + " on Trade, and ";
temp += AString(m) + " point" + (m==1?"":"s") + " on Magic. ";
temp += "This faction's type would appear as \"War ";
temp += AString(w) + " Trade " + t + " Magic " + m;
temp += "\", and would be able to tax ";
temp += AString(nw) + " region" + (nw==1?"":"s") + ", ";
temp += "perform trade in ";
temp += AString(nt) + " region" + (nt==1?"":"s") + ", and have ";
temp += AString(nm) + " mage" + (nm==1?"":"s");
if (app_exist) {
temp += " as well as ";
temp += AString(na) + " " + Globals->APPRENTICE_NAME
+ (na==1?"":"s");
}
if (qm_exist) {
temp += " and ";
temp += AString(nq) + " quartermaster" + (nq==1?"":"s");
}
temp += ".";
f.Paragraph(temp);
fac.type[F_WAR] = w = Globals->FACTION_POINTS;
fac.type[F_MAGIC] = m = 0;
fac.type[F_TRADE] = t = 0;
nw = AllowedTaxes(&fac);
nq = AllowedQuarterMasters(&fac);
nt = AllowedTrades(&fac);
nm = AllowedMages(&fac);
na = AllowedApprentices(&fac);
temp = "As another example, a specialized faction might spend all ";
temp += AString(w) + " point" + (w==1?"":"s") + " on War. ";
temp += "This faction's type would appear as \"War ";
temp += AString(w) + "\", and it would be able to tax " + nw;
temp += AString(" region") + (nw==1?"":"s") + ", but could ";
if (nt == 0)
temp += "not perform trade in any regions";
else
temp += AString("only perform trade in ") + nt + " region" +
(nt == 1?"":"s");
temp += ", ";
if (!app_exist)
temp += "and ";
if (nm == 0)
temp += "could not possess any mages";
else
temp += AString("could only possess ") + nm + " mage" +
(nm == 1?"":"s");
if (app_exist) {
temp += ", and ";
if (na == 0) {
temp += "could not possess any ";
temp += Globals->APPRENTICE_NAME;
temp += "s";
} else {
temp += AString("could only possess ") + na
+ " " + Globals->APPRENTICE_NAME +
(na == 1?"":"s");
}
}
if (qm_exist) {
temp += ", and ";
if (nq == 0)
temp += "could not possess any quartermasters";
else
temp += AString("could only possess ") + nq +
"quartermaster" + (nq == 1?"":"s");
}
temp += ".";
f.Paragraph(temp);
if (Globals->FACTION_POINTS>3) {
int rem=Globals->FACTION_POINTS-3;
temp = "Note that it is possible to have a faction type with "
"less than ";
temp += Globals->FACTION_POINTS;
temp += " points spent. In fact, a starting faction has one "
"point spent on each of War, Trade, and Magic, leaving ";
temp += AString(rem) + " point" + (rem==1?"":"s") + " unspent.";
f.Paragraph(temp);
}
}
temp = "When a faction starts the game, it is given a one-man unit and ";
temp += Globals->START_MONEY;
temp += " 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 ";
temp += f.Link("#claim", "CLAIM") + " order to take this silver, and use "
"it to buy goods or recruit men";
if (Globals->ALLOW_WITHDRAW) {
temp += ", or use the ";
temp += f.Link("#withdraw", "WITHDRAW");
temp += " order to withdraw goods directly";
}
temp += ".";
f.Paragraph(temp);
temp = "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.";
f.Paragraph(temp);
f.Paragraph("");
f.Enclose(1, "pre");
f.ClearWrapTab();
if (Globals->LEADERS_EXIST) {
f.WrapStr("* Merlin the Magician (17), Merlin (27), leader [LEAD]. "
"Skills: none.");
} else {
f.WrapStr("* Merlin the Magician (17), Merlin (27), man [MAN]. "
"Skills: none.");
}
if (Globals->RACES_EXIST) {
f.WrapStr("* Merlin's Guards (33), Merlin (27), 20 vikings [VIKI], "
"20 swords [SWOR]. Skills: none.");
f.WrapStr("* Merlin's Workers (34), Merlin (27), 50 vikings "
"[VIKI]. Skills: none.");
} else {
f.WrapStr("* Merlin's Guards (33), Merlin (27), 20 men [MAN], "
"20 swords [SWOR]. Skills: none.");
f.WrapStr("* Merlin's Workers (34), Merlin (27), 50 men [MAN]. "
"Skills: none.");
}
f.Enclose(0, "pre");
f.LinkRef("playing_units");
f.TagText("h3", "Units:");
temp = "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.";
f.Paragraph(temp);
if (Globals->RACES_EXIST) {
temp = "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) {
temp += " 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 {
temp = "Units are made of of ordinary people";
if (Globals->LEADERS_EXIST) {
temp += "as well as leaders";
}
temp += ".";
}
if (Globals->LEADERS_EXIST&&Globals->SKILL_LIMIT_NONLEADERS) {
temp += " Units made up of normal people may only know one skill, "
"and cannot teach other units. Units made up of leaders "
"may know as many skills as desired, and may teach other "
"units to speed the learning process.";
}
if (Globals->LEADERS_EXIST) {
temp += " Leaders and normal people may not be mixed in the same "
"unit. However, leaders are more expensive to recruit and "
"maintain (more information is in the section on skills).";
}
if (Globals->RACES_EXIST) {
temp += " A unit is treated as the least common denominator of "
"the people within it, so a unit made up of two races with "
"different strengths and weaknesses will have all the "
"weaknesses, and none of the strengths of either race.";
}
f.Paragraph(temp);
f.LinkRef("playing_turns");
f.TagText("h3", "Turns:");
temp = "Each turn, the Atlantis server takes the orders file that "
"you mailed to it, and assigns the orders to the respective units. "
"All units in your faction are completely loyal to you, and will "
"execute the orders to the best of their ability. If the unit does "
"something unintended, it is generally because of incorrect orders; "
"a unit will not purposefully betray you.";
f.Paragraph(temp);
temp = "A turn is equal to one game month. A unit can do many actions "
"at the start of the month, that only take a matter of hours, such "
"as buying and selling commodities, or fighting an opposing "
"faction. Each unit can also do exactly one action that takes up "
"the entire month, such as harvesting resources or moving from one "
"region to another. The orders which take an entire month are ";
temp += f.Link("#advance", "ADVANCE") + ", ";
temp += f.Link("#build", "BUILD") + ", ";
if (!(SkillDefs[S_ENTERTAINMENT].flags & SkillType::DISABLED))
temp += f.Link("#entertain", "ENTERTAIN") + ", ";
temp += f.Link("#move", "MOVE") + ", ";
if (Globals->TAX_PILLAGE_MONTH_LONG)
temp += f.Link("#pillage", "PILLAGE") + ", ";
temp += f.Link("#produce", "PRODUCE") + ", ";
if (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED))
temp += f.Link("#sail", "SAIL") + ", ";
temp += f.Link("#study", "STUDY") + ", ";
if (Globals->TAX_PILLAGE_MONTH_LONG)
temp += f.Link("#tax", "TAX") + ", ";
temp += f.Link("#teach", "TEACH") + " and ";
temp += f.Link("#work", "WORK") + ".";
f.Paragraph(temp);
f.LinkRef("world");
f.ClassTagText("div", "rule", "");
f.TagText("h2", "The World");
temp = "The Atlantis world is divided for game purposes into "
"hexagonal regions. Each region has a name, and one of the "
"following terrain types: Ocean, Plain, Forest, Mountain, ";
temp += "Swamp, Jungle, Desert, or Tundra ";
temp += "(there may be other types of terrain to be discovered as the "
"game progresses). Regions can contain units belonging to "
"players; they can also contain structures such as buildings";
if (may_sail)
temp += " and fleets";
temp += ". Two units in the same region can normally interact, unless "
"one of them is concealed in some way. Two units in different "
"regions cannot normally interact. NOTE: Combat is an exception "
"to this.";
f.Paragraph(temp);
f.LinkRef("world_regions");
f.TagText("h3", "Regions:");
temp = "Here is a sample region, as it might appear on your turn report:";
f.Paragraph(temp);
f.Paragraph("");
int manidx = -1;
int leadidx = -1;
for (i = 0; i < NITEMS; i++) {
if (!(ItemDefs[i].type & IT_MAN)) continue;
if (ItemDefs[i].type & IT_LEADER) {
if (leadidx == -1) leadidx = i;
} else {
if (manidx == -1) manidx = i;
}
}
f.Enclose(1, "pre");
f.ClearWrapTab();
temp = "plain (172,110) in Turia, 500 peasants";
if (Globals->RACES_EXIST)
temp += AString(" (") + ItemDefs[manidx].names + ")";
int money = (500 * (15 - Globals->MAINTENANCE_COST));
temp += AString(", $") + money + ".";
f.WrapStr(temp);
f.WrapStr("------------------------------------------------------");
f.AddWrapTab();
if (Globals->WEATHER_EXISTS)
f.WrapStr("The weather was clear last month; it will be clear next "
"month.");
temp = AString("Wages: $15 (Max: $") + (money/Globals->WORK_FRACTION) +
").";
f.WrapStr(temp);
f.WrapStr("Wanted: none.");
temp = "For Sale: 50 ";
temp += AString(ItemDefs[manidx].names) + " [" + ItemDefs[manidx].abr + "]";
temp += " at $";
float ratio = ItemDefs[(Globals->RACES_EXIST?I_NOMAD:I_MAN)].baseprice/
(float)Globals->BASE_MAN_COST;
temp += (int)(60*ratio);
if (Globals->LEADERS_EXIST) {
ratio = ItemDefs[leadidx].baseprice/(float)Globals->BASE_MAN_COST;
temp += AString(", 10 ") + ItemDefs[leadidx].names + " [" +
ItemDefs[leadidx].abr + "] at $";
temp += (int)(60*ratio);
}
temp += ".";
f.WrapStr(temp);
temp = AString("Entertainment available: $") +
(money/Globals->ENTERTAIN_FRACTION) + ".";
f.WrapStr(temp);
temp = "Products: ";
if (Globals->FOOD_ITEMS_EXIST)
temp += "23 grain [GRAI], ";
temp += "37 horses [HORS].";
f.WrapStr(temp);
f.PutNoFormat("");
f.PutNoFormat("Exits:");
f.WrapStr("North : ocean (172,108) in Atlantis Ocean.");
f.WrapStr("Northeast : ocean (173,109) in Atlantis Ocean.");
f.WrapStr("Southeast : ocean (173,111) in Atlantis Ocean.");
f.WrapStr("South : plain (172,112) in Turia.");
f.WrapStr("Southwest : plain (171,111) in Turia.");
f.WrapStr("Northwest : plain (171,109) in Turia.");
f.PutNoFormat("");
f.DropWrapTab();
temp = "* Hans Shadowspawn (15), Merry Pranksters (14), ";
if (Globals->LEADERS_EXIST)
temp2 = "leader [LEAD]";
else if (Globals->RACES_EXIST)
temp2 = "nomad [NOMA]";
else
temp2 = "man [MAN]";
temp += temp2 + ", 500 silver [SILV]. Skills: none.";
f.WrapStr(temp);
temp = AString("- Vox Populi (13), ") + temp2 + ".";
f.WrapStr(temp);
f.Enclose(0, "pre");
temp = "This report gives all of the available information on this "
"region. The region type is plain, the name of the surrounding area "
"is Turia, and the coordinates of this region are (172,110). The "
"population of this region is 500 ";
if (Globals->RACES_EXIST)
temp += "nomads";
else
temp += "peasants";
temp += AString(", and there is $") + money + " of taxable income ";
temp += "currently in this region. Then, under the dashed line, are "
"various details about items for sale, wages, etc. Finally, "
"there is a list of all visible units. Units that belong to your "
"faction will be so denoted by a '*', whereas other faction's "
"units are preceded by a '-'.";
f.Paragraph(temp);
temp = "Since Atlantis is made up of hexagonal regions, the coordinate "
"system is not always exactly intuitive. Here is the layout of "
"Atlantis regions:";
f.Paragraph(temp);
f.Paragraph("");
f.Enclose(1, "pre");
f.PutNoFormat(" ____ ____");
f.PutNoFormat(" / \\ / \\");
f.PutNoFormat(" /(0,0) \\____/(2,0) \\____/");
f.PutNoFormat(" \\ / \\ / \\ N");
f.PutNoFormat(" \\____/(1,1) \\____/(3,1) \\_ |");
f.PutNoFormat(" / \\ / \\ / |");
f.PutNoFormat(" /(0,2) \\____/(2,2) \\____/ |");
f.PutNoFormat(" \\ / \\ / \\ W-O-E");
f.PutNoFormat(" \\____/(1,3) \\____/(3,3) \\_ |");
f.PutNoFormat(" / \\ / \\ / S");
f.PutNoFormat(" /(0,4) \\____/(2,4) \\____/");
f.PutNoFormat(" \\ / \\ / \\");
f.PutNoFormat(" \\____/ \\____/");
f.PutNoFormat(" / \\ / \\");
f.Enclose(0, "pre");
temp = "Note that the are \"holes\" in the coordinate system; there "
"is no region (1,2), for instance. This is due to the hexagonal "
"system of regions.";
f.Paragraph(temp);
temp = "Most regions are similar to the region shown above, but the "
"are certain exceptions. Oceans, not surprisingly, have no "
"population.";
if (Globals->TOWNS_EXIST)
temp += " Some regions will contain villages, towns, and cities. "
"More information on these is available in the section on the "
"economy.";
f.Paragraph(temp);
if (Globals->ICOSAHEDRAL_WORLD) {
temp = "A further complication is that the world of ";
temp += Globals->WORLD_NAME;
temp += " is not, as many primitive folk assume, flat, "
"but is actually approximately spherical. "
"However, rendering the surface of a three "
"dimensional object in two dimensions is a long "
"standing cartographical problem. Here is an example "
"of rendering a different spherical world in two "
"dimensional form:";
f.Paragraph(temp);
temp = "<img src=\"Goode_homolosine_projection.jpg\" "
"alt=\"Goode Homolosine Projection\">";
f.Paragraph(temp);
temp = "Observe that the map appears to have triangular "
"chunks cut out at the poles, and that areas near "
"the poles are spread apart from each other despite "
"being close together in reality. These same "
"effects are observed in the maps we have of ";
temp += Globals->WORLD_NAME;
temp += ". So some regions will have exits that appear to "
"be rather distant; this is an indicator that the "
"region is on the edge of one of these triangular "
"chunks. The intervening regions are not missing, "
"but are the result of folding a three dimensional "
"object into two dimensions.";
f.Paragraph(temp);
temp = "These apparant spacial warps are actually just "
"relics of a two dimensional coordinate system "
"being applied to a three dimensional surface. "
"Should a unit travel over one of these edges, "
"there will be a path back to their starting region, "
"although the path back might not be the direction "
"you expect it to be, as \"north\" changes relative "
"direction when you travel around the pole in the "
"polar regions, so each time you cross one of these "
"edges, you are effectively turning 60 degrees as "
"well as moving.";
f.Paragraph(temp);
}
f.LinkRef("world_structures");
f.TagText("h3", "Structures:");
temp = "Regions may also contain structures, such as buildings";
if (may_sail)
temp += " or fleets";
temp += ". These will appear directly below the list of units. Here is "
"a sample structure:";
f.Paragraph(temp);
f.Paragraph("");
f.Enclose(1, "pre");
f.ClearWrapTab();
f.WrapStr("+ Temple of Agrik [3] : Tower.");
f.AddWrapTab();
temp = "- High Priest Chafin (9), ";
temp += temp2 + ", sword [SWOR]";