forked from Atlantis-PBEM/Atlantis
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgenrules.cpp
6153 lines (5773 loc) · 224 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 "faction.h"
#include "items.h"
#include "skills.h"
#include "gamedata.h"
#include "fileio.h"
#include "object.h"
#include "astring.h"
#include "gameio.h"
#include <time.h>
// local to this file
namespace
{
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");
}
AString genHdr(Arules &f, const AString &css)
{
// scratch strings
AString temp, temp2;
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");
return temp;
}
void genToc(Arules &f, const bool move_over_water)
{
// scratch strings
AString temp, temp2;
const bool has_stea = !(SkillDefs[S_STEALTH].flags & SkillType::DISABLED);
const bool has_obse = !(SkillDefs[S_OBSERVATION].flags & SkillType::DISABLED);
const bool may_sail = (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED)) &&
(!(SkillDefs[S_SHIPBUILDING].flags & SkillType::DISABLED));
f.LinkRef("table_of_contents");
f.ClassTagText("DIV", "rule", "");
f.TagText("H2", "Table of Contents");
temp = AString("Thanks to ") +
f.Link("mailto:[email protected]","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("#armies_fleets", "Armies and Fleets"));
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));
}
if (Globals->CONQUEST_GAME) {
temp = "The World of Atlantis Conquest";
f.TagText("LI", f.Link("#world_conquest", 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"));
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"));
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");
if (has_stea || has_obse)
{
f.Enclose(1, "LI");
if (has_stea) temp = "Stealth";
else temp = "";
if (has_obse)
{
if (has_stea) temp += " and ";
temp += "Observation";
}
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"));
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"));
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"));
if (!Globals->DISABLE_FIND_EMAIL_COMMAND) {
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"));
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("#tax", "tax"));
f.TagText("LI", f.Link("#teach", "teach"));
f.TagText("LI", f.Link("#turn", "turn"));
if (Globals->USE_WEAPON_ARMOR_COMMAND)
f.TagText("LI", f.Link("#weapon", "weapon"));
if (Globals->ALLOW_WITHDRAW || Globals->WITHDRAW_LEADERS || Globals->WITHDRAW_FLEADERS)
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"); // table of contents
f.Paragraph("Index of Tables");
{
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"));
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");
}
}
void genOrders(Arules &f, const bool move_over_water)
{
// scratch strings
AString temp, temp2;
const bool has_stea = !(SkillDefs[S_STEALTH].flags & SkillType::DISABLED);
const bool may_sail = (!(SkillDefs[S_SAILING].flags & SkillType::DISABLED)) &&
(!(SkillDefs[S_SHIPBUILDING].flags & SkillType::DISABLED));
f.LinkRef("orders");
f.ClassTagText("DIV", "rule", "");
f.TagText("H2", "Orders");
temp = "To enter orders for Atlantis, you should send a mail message "
"to the Atlantis server, containing the following:";
f.Paragraph(temp);
f.Paragraph("");
f.Enclose(1, "PRE");
f.ClearWrapTab();
f.WrapStr("#ATLANTIS faction-no <password>");
f.PutNoFormat("");
f.WrapStr("UNIT unit-no");
f.WrapStr("...orders...");
f.PutNoFormat("");
f.WrapStr("UNIT unit-no");
f.WrapStr("...orders...");
f.PutNoFormat("");
f.WrapStr("#END");
f.Enclose(0, "PRE");
temp = "For example, if your faction number (shown at the top of your "
"report) is 27, your password if \"foobar\", and you have two "
"units numbered 5 and 17:";
f.Paragraph(temp);
f.Paragraph("");
f.Enclose(1, "PRE");
f.WrapStr("#ATLANTIS 27 \"foobar\"");
f.PutNoFormat("");
f.WrapStr("UNIT 5");
f.WrapStr("...orders...");
f.PutNoFormat("");
f.WrapStr("UNIT 17");
f.WrapStr("...orders...");
f.PutNoFormat("");
f.WrapStr("#END");
f.Enclose(0, "PRE");
temp = "Thus, orders for each unit are given separately, and indicated "
"with the UNIT keyword. (In the case of an order, such as the "
"command to rename your faction, that is not really for any "
"particular unit, it does not matter which unit issues the command; "
"but some particular unit must still issue it.)";
f.Paragraph(temp);
temp = "IMPORTANT: You MUST use the correct #ATLANTIS line or else your "
"orders will be ignored.";
f.Paragraph(temp);
temp = "If you have a password set, you must specify it on you "
"#atlantis line, or the game will reject your orders. See the ";
temp += f.Link("#password", "PASSWORD") + " order for more details.";
f.Paragraph(temp);
temp = "Each type of order is designated by giving a keyword as the "
"first non-blank item on a line. Parameters are given after this, "
"separated by spaces or tabs. Blank lines are permitted, as are "
"comments; anything after a semicolon is treated as a comment "
"(provided the semicolon is not in the middle of a word).";
f.Paragraph(temp);
temp = "The parser is not case sensitive, so all commands may be given "
"in upper case, lower case or a mixture of the two. However, when "
"supplying names containing spaces, the name must be surrounded "
"by double quotes, or else underscore characters must be used in "
"place of spaces in the name. (These things apply to the #ATLANTIS "
"and #END lines as well as to order lines.)";
f.Paragraph(temp);
temp = "You may precede orders with the at sign (@), in which case they "
"will appear in the Template at the bottom of your report. This is "
"useful for orders which your units repeat for several months in a "
"row.";
f.Paragraph(temp);
f.LinkRef("orders_abbreviations");
f.TagText("H3", "Abbreviations:");
temp = "All common items and skills have abbreviations that can be used "
"when giving orders, for brevity. Any time you see the item on your "
"report, it will be followed by the abbreviation. Please be careful "
"using these, as they can easily be confused.";
f.Paragraph(temp);
f.LinkRef("ordersummary");
f.ClassTagText("DIV", "rule", "");
f.TagText("H2", "Order Summary");
temp = "To specify a [unit], use the unit number. If specifying a "
"unit that will be created this turn, use the form \"NEW #\" if "
"the unit belongs to your faction, or \"FACTION # NEW #\" if the "
"unit belongs to a different faction. See the ";
temp += f.Link("#form", "FORM");
temp += " order for a more complete description. [faction] means that "
"a faction number is required; [object] means that an object "
"number (generally the number of a building or ship) is required. "
"[item] means an item (like wood or longbow) that a unit can have "
"in its possession. [flag] is an argument taken by several orders, "
"that sets or unsets a flag for a unit. A [flag] value must be "
"either 1 (set the flag) or 0 (unset the flag). Other parameters "
"are generally numbers or names.";
f.Paragraph(temp);
temp = "IMPORTANT: Remember that names containing spaces (e.g., "
"\"Plate Armor\"), must be surrounded by double quotes, or the "
"spaces must be replaced with underscores \"_\" (e.g., Plate_Armor).";
f.Paragraph(temp);
temp = "Also remember that anything used in an example is just that, "
"an example and makes no gaurentee that such an item, structure, "
"or skill actually exists within the game.";
f.Paragraph(temp);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("address");
f.TagText("H4", "ADDRESS [new address]");
f.Paragraph("Change the email address to which your reports are sent.");
f.Paragraph("Example:");
temp = "Change your faction's email address to [email protected].";
temp2 = "ADDRESS [email protected]";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("advance");
f.TagText("H4", "ADVANCE [dir] ...");
temp = "This is the same as the ";
temp += f.Link("#move", "MOVE");
temp += " order, except that it implies attacks on units which attempt "
"to forbid access. See the ";
temp += f.Link("#move", "MOVE") + " order for details.";
f.Paragraph(temp);
f.Paragraph("Examples:");
temp = "Move north, then northwest, attacking any units that forbid "
"access to the regions.";
temp2 = "ADVANCE N NW";
f.CommandExample(temp, temp2);
temp = "In order, move north, then enter structure number 1, move "
"through an inner route, and finally move southeast. Will attack "
"any units that forbid access to any of these locations.";
temp2 = "ADVANCE N 1 IN SE";
f.CommandExample(temp, temp2);
if (Globals->USE_WEAPON_ARMOR_COMMAND)
{
f.ClassTagText("DIV", "rule", "");
f.LinkRef("armor");
f.TagText("H4", "ARMOR [item1] [item2] [item3] [item4]");
f.TagText("H4", "ARMOR");
temp = "This command allows you to set a list of preferred armor "
"for a unit. After searching for armor on the preferred "
"list, the standard armor precedence takes effect if an armor "
"hasn't been set. The second form clears the preferred armor "
"list.";
f.Paragraph(temp);
f.Paragraph("Examples");
temp = "Set the unit to select chain armor before plate armor.";
temp2 = "ARMOR CARM PARM";
f.CommandExample(temp, temp2);
temp = "Clear the preferred armor list.";
temp2 = "ARMOR";
f.CommandExample(temp, temp2);
}
if (has_stea)
{
f.ClassTagText("DIV", "rule", "");
f.LinkRef("assassinate");
f.TagText("H4", "ASSASSINATE [unit]");
temp = "Attempt to assassinate the specified unit, or one of the "
"unit's people if the unit contains more than one person. The "
"order may only be issued by a one-man unit.";
f.Paragraph(temp);
temp = "A unit may only attempt to assassinate a unit which is able "
"to be seen.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Assassinate unit number 177.";
temp2 = "ASSASSINATE 177";
f.CommandExample(temp, temp2);
}
f.ClassTagText("DIV", "rule", "");
f.LinkRef("attack");
f.TagText("H4", "ATTACK [unit] ... ");
temp = "Attack a target unit. If multiple ATTACK orders are given, "
"all of the targets will be attacked.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "To attack units 17, 431, and 985:";
temp2 = "ATTACK 17\nATTACK 431 985";
f.CommandExample(temp, temp2);
temp = "or:";
temp2 = "ATTACK 17 431 985";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("autotax");
f.TagText("H4", "AUTOTAX [flag]");
temp = "AUTOTAX 1 causes the unit to attempt to tax every turn "
"(without requiring the TAX order) until the flag is unset. "
"AUTOTAX 0 unsets the flag.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "To cause the unit to attempt to tax every turn.";
temp2 = "AUTOTAX 1";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("avoid");
f.TagText("H4", "AVOID [flag]");
temp = "AVOID 1 instructs the unit to avoid combat wherever possible. "
"The unit will not enter combat unless it issues an ATTACK order, "
"or the unit's faction is attacked in the unit's hex. AVOID 0 "
"cancels this.";
f.Paragraph(temp);
temp = "The Guard and Avoid Combat flags are mutually exclusive; "
"setting one automatically cancels the other.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Set the unit to avoid combat when possible.";
temp2 = "AVOID 1";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("behind");
f.TagText("H4", "BEHIND [flag]");
temp = "BEHIND 1 sets the unit to be behind other units in combat. "
"BEHIND 0 cancels this.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Set the unit to be in front in combat.";
temp2 = "BEHIND 0";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("build");
f.TagText("H4", "BUILD");
f.TagText("H4", "BUILD [object type]");
f.TagText("H4", "BUILD HELP [unit]");
temp = "BUILD given with no parameters causes the unit to perform work "
"on the object that it is currently inside. BUILD given with an "
"[object type] (such as \"Tower\" or \"Galleon\") instructs the unit "
"to begin work on a new object of the type given. The final form "
"instructs the unit to enter the same building as [unit] and to "
"assist in building that structure, even if it is a structure which "
"was begun that same turn. This help will be rejected if the unit "
"you are helping does not consider you to be friendly.";
f.Paragraph(temp);
f.Paragraph("Examples:");
temp = "To build a new tower.";
temp2 = "BUILD Tower";
f.CommandExample(temp, temp2);
temp = "To help unit 5789 build a structure.";
temp2 = "BUILD HELP 5789";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("buy");
f.TagText("H4", "BUY [quantity] [item]");
f.TagText("H4", "BUY ALL [item]");
temp = "Attempt to buy a number of the given item from a city or town "
"marketplace, or to buy new people in any region where people are "
"available for recruiting. If the unit can't afford as many as "
"[quantity], it will attempt to buy as many as it can. If the "
"demand for the item (from all units in the region) is greater "
"than the number available, the available items will be split "
"among the buyers in proportion to the amount each buyer attempted "
"to buy. ";
if (Globals->RACES_EXIST) {
temp += "When buying people, specify the race of the people as the "
"[item]. ";
}
temp += "If the second form is specified, the unit will attempt to buy "
"as many as it can afford.";
f.Paragraph(temp);
f.Paragraph(AString("Example") + (Globals->RACES_EXIST?"s":"") + ":");
temp = "Buy one plate armor from the city market.";
temp2 = "BUY 1 \"Plate Armor\"";
f.CommandExample(temp, temp2);
if (Globals->RACES_EXIST) {
temp = "Recruit 5 barbarians into the current unit. (This will "
"dilute the skills that the unit has.)";
temp2 = "BUY 5 barbarians";
f.CommandExample(temp, temp2);
}
f.ClassTagText("DIV", "rule", "");
f.LinkRef("cast");
f.TagText("H4", "CAST [skill] [arguments]");
temp = "Cast the given spell. Note that most spell names contain "
"spaces; be sure to enclose the name in quotes! [arguments] "
"depends on which spell you are casting; when you are able to cast "
"a spell, the skill description will tell you the syntax.";
f.Paragraph(temp);
f.Paragraph("Examples:");
temp = "Cast the spell called \"Super Spell\".";
temp2 = "CAST \"Super Spell\"";
f.CommandExample(temp, temp2);
temp = "Cast the fourth-level spell in the \"Super Magic\" skill.";
temp2 = "CAST Super_Magic 4";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("claim");
f.TagText("H4", "CLAIM [amount]");
temp = "Claim an amount of the faction's unclaimed silver, and give it "
"to the unit issuing the order. The claiming unit may then spend "
"the silver or give it to another unit.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Claim 100 silver.";
temp2 = "CLAIM 100";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("combat");
f.TagText("H4", "COMBAT [spell]");
temp = "Set the given spell as the spell that the unit will cast in "
"combat. This order may only be given if the unit can cast the "
"spell in question.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Instruct the unit to use the spell \"Super Spell\", when the "
"unit is involved in a battle.";
temp2 = "COMBAT \"Super Spell\"";
f.CommandExample(temp, temp2);
if (Globals->FOOD_ITEMS_EXIST) {
f.ClassTagText("DIV", "rule", "");
f.LinkRef("consume");
f.TagText("H4", "CONSUME UNIT");
f.TagText("H4", "CONSUME FACTION");
f.TagText("H4", "CONSUME");
temp = "The CONSUME order instructs the unit to use food items in "
"preference to silver for maintenance costs. CONSUME UNIT tells "
"the unit to use food items that are in that unit's possession "
"before using silver. CONSUME FACTION tells the unit to use any "
"food items that the faction owns (in the same region as the "
"unit) before using silver. CONSUME tells the unit to use "
"silver before food items (this is the default).";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Tell a unit to use food items in the unit's possession for "
"maintenance costs.";
temp2 = "CONSUME UNIT";
f.CommandExample(temp, temp2);
}
f.ClassTagText("DIV", "rule", "");
f.LinkRef("declare");
f.TagText("H4", "DECLARE [faction] [attitude]");
f.TagText("H4", "DECLARE [faction]");
f.TagText("H4", "DECLARE DEFAULT [attitude]");
f.TagText("H4", "DECLARE ALIGNMENT [good|evil]");
temp = "The first form of the DECLARE order sets the attitude of your "
"faction towards the given faction. The second form cancels any "
"attitude towards the given faction (so your faction's attitude "
"towards that faction will be its default attitude). The third "
"form sets your faction's default attitude.";
f.Paragraph(temp);
temp = "The fourth form forces your alignment to the given state. This is "
"necessary before you buy men of that particular alignment. Once set, "
"it cannot be changed.";
f.Paragraph(temp);
f.Paragraph("Examples:");
temp = "Declare your faction to be hostile to faction 15.";
temp2 = "DECLARE 15 hostile";
f.CommandExample(temp, temp2);
temp = "Set your faction's attitude to faction 15 to its default "
"attitude.";
temp2 = "DECLARE 15";
f.CommandExample(temp, temp2);
temp = "Set your faction's default attitude to friendly.";
temp2 = "DECLARE DEFAULT friendly";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("describe");
f.TagText("H4", "DESCRIBE UNIT [new description]");
f.TagText("H4", "DESCRIBE SHIP [new description]");
f.TagText("H4", "DESCRIBE BUILDING [new description]");
f.TagText("H4", "DESCRIBE OBJECT [new description]");
f.TagText("H4", "DESCRIBE STRUCTURE [new description]");
temp = "Change the description of the unit, or of the object the unit "
"is in (of which the unit must be the owner). Descriptions can be "
"of any length, up to the line length your mailer can handle. If "
"no description is given, the description will be cleared out. The "
"last four are completely identical and serve to modify the "
"description of the object you are currently in.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Set the unit,s description to read \"Merlin's helper\".";
temp2 = "DESCRIBE UNIT \"Merlin's helper\"";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("destroy");
f.TagText("H4", "DESTROY");
temp = "Destroy the object you are in (of which you must be the owner). "
"The order cannot be used at sea.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Destroy the current object";
temp2 = "DESTROY";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("enter");
f.TagText("H4", "ENTER [object]");
temp = "Attempt to enter the specified object. If issued from inside "
"another object, the unit will first leave the object it is "
"currently in. The order will only work if the target object is "
"unoccupied, or is owned by a unit in your faction, or is owned by "
"a unit which has declared you Friendly.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Enter ship number 114.";
temp2 = "ENTER 114";
f.CommandExample(temp, temp2);
if (!(SkillDefs[S_ENTERTAINMENT].flags & SkillType::DISABLED)) {
f.ClassTagText("DIV", "rule", "");
f.LinkRef("entertain");
f.TagText("H4", "ENTERTAIN");
temp = "Spend the month entertaining the populace to earn money.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Entertain for money.";
temp2 = "ENTERTAIN";
f.CommandExample(temp, temp2);
}
f.ClassTagText("DIV", "rule", "");
f.LinkRef("evict");
f.TagText("H4", "EVICT [unit] ...");
temp = "Evict the specified unit from the object of which you are "
"currently the owner. If multiple EVICT orders are given, all "
"of the units will be evicted.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Evict units 415 and 698 from an object that this unit owns.";
temp2 = "EVICT 415 698";
f.CommandExample(temp, temp2);
temp = "or";
temp2 = "EVICT 415\nEVICT 698";
f.CommandExample(temp, temp2);
f.ClassTagText("DIV", "rule", "");
f.LinkRef("exchange");
f.TagText("H4", "EXCHANGE [unit] [quantity given] [item given] "
"[quantity expected] [item expected]");
temp = "This order allows any two units that can see each other, to "
"trade items regardless of faction stances. The orders given by "
"the two units must be complementary. If either unit involved does "
"not have the items it is offering, or if the exchange orders given "
"are not complementary, the exchange is aborted. Men may not be "
"exchanged.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Exchange 10 LBOW for 10 SWOR with unit 1310";
temp2 = "EXCHANGE 1310 10 LBOW 10 SWOR";
f.CommandExample(temp, temp2);
temp = "Unit 1310 would issue (assuming the other unit is 3453)";
temp2 = "EXCHANGE 3453 10 SWOR 10 LBOW";
f.CommandExample(temp, temp2);
if (Globals->FACTION_LIMIT_TYPE == GameDefs::FACLIM_FACTION_TYPES)
{
f.ClassTagText("DIV", "rule", "");
f.LinkRef("faction");
f.TagText("H4", "FACTION [type] [points] ...");
temp = "Attempt to change your faction's type. In the order, you "
"can specify up to three faction types (WAR, TRADE, and MAGIC) "
"and the number of faction points to assign to each type; if "
"you are assigning points to only one or two types, you may "
"omit the types that will not have any points.";
f.Paragraph(temp);
temp = "Changing the number of faction points assigned to MAGIC may "
"be tricky. Increasing the MAGIC points will always succeed, but "
"if you decrease the number of points assigned to MAGIC, you "
"must make sure that you have only the number of magic-skilled "
"leaders allowed by the new number of MAGIC points BEFORE you "
"change your point distribution. For example, if you have 3 "
"mages (3 points assigned to MAGIC), but want to use one of "
"those points for WAR or TRADE (change to MAGIC 2), you must "
"first get rid of one of your mages by either giving it to "
"another faction or ordering it to ";
temp += f.Link("#forget", "FORGET") + " all its magic skills. ";
temp += "If you have too many mages for the number of points you "
"try to assign to MAGIC, the FACTION order will fail.";
f.Paragraph(temp);
f.Paragraph("Examples:");
temp = "Assign 2 faction points to WAR, 2 to TRADE, and 1 to MAGIC.";
temp2 = "FACTION WAR 2 TRADE 2 MAGIC 1";
f.CommandExample(temp, temp2);
temp = "Become a pure magic faction (assign all points to magic).";
temp2 = "FACTION MAGIC ";
temp2 += Globals->FACTION_POINTS;
f.CommandExample(temp, temp2);
}
if (!Globals->DISABLE_FIND_EMAIL_COMMAND)
{
f.ClassTagText("DIV", "rule", "");
f.LinkRef("find");
f.TagText("H4", "FIND [faction]");
f.TagText("H4", "FIND ALL");
temp = "Find the email address of the specified faction or of all "
"factions.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Find the email address of faction 4.";
temp2 = "FIND 4";
f.CommandExample(temp, temp2);
}
f.ClassTagText("DIV", "rule", "");
f.LinkRef("forget");
f.TagText("H4", "FORGET [skill]");
temp = "Forget the given skill. This order is useful for normal units "
"who wish to learn a new skill, but already know a different skill.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "Forget knowledge of Mining.";
temp2 = "FORGET Mining";
f.CommandExample(temp, temp2);
//-----
f.ClassTagText("DIV", "rule", "");
f.LinkRef("form");
f.TagText("H4", "FORM [alias]");
temp = "Form a new unit. The newly created unit will be in your "
"faction, in the same region as the unit which formed it, and in "
"the same structure if any. It will start off, however, with no "
"people or items; you should, in the same month, issue orders to "
"transfer people into the new unit, or have it recruit members. The "
"new unit will inherit its flags from the unit that forms it, such "
"as avoiding, behind, and autotax.";
f.Paragraph(temp);
temp = "The FORM order is followed by a list of orders for the newly "
"created unit. This list is terminated by the END keyword, after "
"which orders for the original unit resume.";
f.Paragraph(temp);
temp = "The purpose of the \"alias\" parameter is so that you can refer "
"to the new unit. You will not know the new unit's number until "
"you receive the next turn report. To refer to the new unit in "
"this set of orders, pick an alias number (the only restriction on "
"this is that it must be at least 1, and you should not create two "
"units in the same region in the same month, with the same alias "
"numbers). The new unit can then be referred to as NEW <alias> in "
"place of the regular unit number.";
f.Paragraph(temp);
temp = AString("For recurring ") + f.Link("#teach", "TEACH") + " orders"
" (using '@'), you can use !NEW <alias> to get the new unit number."
" In other words, '@3 TEACH !NEW 1' will put '@2 TEACH 413' into"
" your orders template next turn.";
f.Paragraph(temp);
temp = "You can refer to newly created units belonging to other "
"factions, if you know what alias number they are, e.g. FACTION 15 "
"NEW 2 will refer to faction 15's newly created unit with alias 2.";
f.Paragraph(temp);
temp = "Note: If a unit moves out of the region in which it was formed "
"(by the ";
temp += f.Link("#move", "MOVE") + " order, or otherwise), the alias "
"will no longer work. This is to prevent conflicts with other units "
"that may have the same alias in other regions.";
f.Paragraph(temp);
temp = "If the demand for recruits in that region that month is much "
"higher than the supply, it may happen that the new unit does not "
"gain all the recruits you ordered it to buy, or it may not gain "
"any recruits at all. If the new units gains at least one recruit, "
"the unit will form possessing any unused silver and all the other "
"items it was given. If no recruits are gained at all, the empty "
"unit will be dissolved, and the silver and any other items it was "
"given will revert to the first unit you have in that region.";
f.Paragraph(temp);
f.Paragraph("Example:");
temp = "This set of orders for unit 17 would create two new units with "
"alias numbers 1 and 2, name them Merlin's Guards and Merlin's "
"Workers, set the description for Merlin's Workers, have both units "
"recruit men, and have Merlin's Guards study combat. Merlin's "
"Workers will have the default order ";
temp += f.Link("#work", "WORK") + ", as all newly created units do. The "
"unit that created these two then pays them enough money (using the "
"NEW keyword to refer to them by alias numbers) to cover the costs "
"of recruitment and the month's maintenance.";
temp2 = "UNIT 17\n";
temp2 += "FORM 1\n";
temp2 += " NAME UNIT \"Merlin's Guards\"\n";
if(Globals->RACES_EXIST)
temp2 += " BUY 5 Plainsmen\n";
else
temp2 += " BUY 5 men\n";
temp2 += " STUDY COMBAT\n";
temp2 += "END\n";
temp2 += "FORM 2\n";
temp2 += " NAME UNIT \"Merlin's Workers\"\n";
temp2 += " DESCRIBE UNIT \"wearing dirty overalls\"\n";
if(Globals->RACES_EXIST)
temp2 += " BUY 15 Plainsmen\n";
else
temp2 += " BUY 15 men\n";
temp2 += "END\n";
temp2 += "CLAIM 2500\n";
temp2 += "GIVE NEW 1 1000 silver\n";
temp2 += "GIVE NEW 2 2000 silver\n";
f.CommandExample(temp,temp2);
temp = "Create a new squad of men each turn for training:";