-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathskillshows.cpp
1889 lines (1868 loc) · 67.3 KB
/
skillshows.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
// MODIFICATIONS
// Date Person Comments
// ---- ------ --------
// 2001/Feb/23 Joseph Traub Made skill texts runtime generated
//
#include "skills.h"
#include "items.h"
#include "object.h"
#include "gamedata.h"
#include "astring.h"
#define ITEM_ENABLED(X) (!(ItemDefs[(X)].flags & ItemType::DISABLED))
#define ITEM_DISABLED(X) (ItemDefs[(X)].flags & ItemType::DISABLED)
#define SKILL_ENABLED(X) (!(SkillDefs[(X)].flags & SkillType::DISABLED))
#define SKILL_DISABLED(X) (SkillDefs[(X)].flags & SkillType::DISABLED)
#define OBJECT_ENABLED(X) (!(ObjectDefs[(X)].flags & ObjectType::DISABLED))
#define OBJECT_DISABLED(X) (ObjectDefs[(X)].flags & ObjectType::DISABLED)
static void DescribeEscapeParameters(AString *desc, int item)
{
if (item < 0 || item >= NITEMS || !ItemDefs[item].escape)
return;
if (ItemDefs[item].escape & ItemType::LOSS_CHANCE) {
}
else if (ItemDefs[item].escape & ItemType::HAS_SKILL) {
}
else
{
*desc += "Each ";
*desc += ItemDefs[item].name;
*desc += " has a chance to escape equal to ";
if (ItemDefs[item].escape & ItemType::ESC_NUM_SQUARE) {
*desc += "the total number of ";
*desc += ItemDefs[item].names;
*desc += " under the mage's control";
}
else
*desc += "1";
*desc += " in ";
if (ItemDefs[item].esc_val > 1) {
*desc += ItemDefs[item].esc_val;
*desc += " times ";
}
*desc += "the mage's skill level";
if (ItemDefs[item].escape & ItemType::ESC_LEV_LINEAR)
;
else if (ItemDefs[item].escape & ItemType::ESC_LEV_SQUARE)
*desc += " squared";
else if (ItemDefs[item].escape & ItemType::ESC_LEV_CUBE)
*desc += " cubed";
else if (ItemDefs[item].escape & ItemType::ESC_LEV_QUAD)
*desc += " to the fourth power";
}
if (ItemDefs[item].escape & ItemType::LOSE_LINKED)
*desc += ". If any one does escape, its first action will be "
"to release its companions";
*desc += ". ";
return;
}
AString *ShowSkill::Report(Faction *f) const
{
if (SkillDefs[skill].flags & SkillType::DISABLED) return new AString("");
AString *str = new AString;
RangeType *range = NULL;
int max;
// Here we pick apart the skill
switch (skill) {
case S_FARMING:
if (level > 1) break;
*str += "This skill deals with all aspects of grain production.";
break;
case S_RANCHING:
if (level > 1) break;
*str += "This skill deals with all aspects of livestock "
"production.";
break;
case S_MINING:
if (level > 1) break;
if (ITEM_ENABLED(I_IRON) ||
ITEM_ENABLED(I_MITHRIL) ||
ITEM_ENABLED(I_ADMANTIUM) ||
ITEM_ENABLED(I_GEMS)) {
*str += "This skill deals with all aspects of extracting raw ";
if (ITEM_ENABLED(I_IRON) ||
ITEM_ENABLED(I_MITHRIL) ||
ITEM_ENABLED(I_ADMANTIUM)) {
*str += "metals";
if (ITEM_ENABLED(I_GEMS)) {
*str += " and gems";
}
} else {
*str += "gems";
}
*str += " from the earth. They tend to be found more often "
"in mountainous regions, but may be found "
"elsewhere as well.";
} else {
*str += "The mining skill is overrated.";
}
break;
case S_LUMBERJACK:
if (level > 1) break;
*str += "This skill deals with all aspects of various wood "
"production. Wood is most often found in forests, but "
"may also be found elsewhere.";
break;
case S_QUARTERMASTER:
if (level > 1) break;
if (!(Globals->TRANSPORT & GameDefs::ALLOW_TRANSPORT))
break;
*str += "This skill deals with transporting and "
"distributing goods between non-local units "
"and transport structures.";
if (Globals->SHIPPING_COST > 0) {
*str += " The cost of shipping one weight unit from one "
"transport structure to another transport structure is ";
if (Globals->TRANSPORT & GameDefs::QM_AFFECT_COST)
*str += AString("4-((level+1)/2) * ");
*str += AString(Globals->SHIPPING_COST) + " silver.";
if (Globals->FRACTIONAL_WEIGHT) {
*str += " Items with a normal weight of 0 are "
"treated as if ";
*str += Globals->FRACTIONAL_WEIGHT;
*str += " of the item in question weigh one weight unit.";
}
}
if (Globals->NONLOCAL_TRANSPORT > 0) {
*str += " Items may be shipped between two transport "
"structures which are up to ";
*str += Globals->NONLOCAL_TRANSPORT;
if (Globals->TRANSPORT & GameDefs::QM_AFFECT_DIST)
*str += " plus (level+1)/3 ";
*str += (Globals->NONLOCAL_TRANSPORT != 1) ? "hexes" : "hex";
*str += " distant from each other.";
} else if (Globals->NONLOCAL_TRANSPORT == 0) {
*str += " Items may be instantaneously "
"shipped between any two transport "
"structures.";
}
if (Globals->LOCAL_TRANSPORT > 0) {
*str += " Items may be distributed from a transport "
"structure to any unit or transported to a transport "
"structure by any unit located within ";
*str += Globals->LOCAL_TRANSPORT;
*str += (Globals->LOCAL_TRANSPORT != 1) ? " hexes" : " hex";
*str += " of the transport structure.";
}
break;
case S_QUARRYING:
if (level > 1) break;
*str += "This skill deals with all aspects of various stone "
"production. Mountains are the main producers of stone, but "
"it may be found in other regions as well.";
break;
case S_HUNTING:
if (level > 1) break;
*str += "This skill deals with all aspects of animal hide "
"production.";
break;
case S_FISHING:
if (level > 1) break;
*str += "This skill deals with all aspects of fish production.";
break;
case S_HERBLORE:
if (level > 1) break;
*str += "This skill deals with all aspects of herb production.";
break;
case S_HORSETRAINING:
if (level > 1) break;
*str += "This skill deals with all aspects of horse production.";
break;
case S_WEAPONSMITH:
if (level > 1) break;
*str += "This skill deals with all aspects of weapon "
"construction and production.";
break;
case S_ARMORER:
if (level > 1) break;
*str += "This skill deals with all aspects of armor construction "
"and production.";
break;
case S_CARPENTER:
if (level > 1) break;
*str += "This skill deals with all aspects of wood based item "
"production other than for use as weapons.";
break;
case S_BUILDING:
if (level > 1) break;
*str += "This skill deals with the construction of "
"fortifications, roads and other buildings, except for "
"most trade structures.";
break;
case S_SHIPBUILDING:
if (level > 1) break;
*str += "This skill deals with the constructions of all types "
"of ships.";
break;
case S_ENTERTAINMENT:
if (level > 1) break;
*str += "A unit with this skill may use the ENTERTAIN order "
"to generate funds. The amount of silver gained will "
"be ";
*str += Globals->ENTERTAIN_INCOME;
*str += " per man, times the level of the entertainers. "
"This amount is limited by the region that the unit is in.";
break;
case S_TACTICS:
if (level > 1) break;
if (Globals->ADVANCED_TACTICS) {
*str += "Tactics allows the unit, and all allies, to gain a "
"bonus to their attack and defense during first battle "
"round. Bonus equals to the difference in skills but can be "
"+3 at most. The army with the highest level tactician "
"in a battle will receive this bonus; if the highest "
"levels are equal, no bonus is awarded.";
} else {
*str += "Tactics allows the unit, and all allies, to gain a "
"free round of attacks during battle. The army with the "
"highest level tactician in a battle will receive this free "
"round; if the highest levels are equal, no free round is "
"awarded. Only one free round total will be awarded for any "
"reason.";
}
break;
case S_COMBAT:
if (level > 1) break;
*str += "This skill gives the unit a bonus in hand to hand "
"combat. Also, a unit with this skill may TAX or PILLAGE.";
break;
case S_ENDURANCE:
if (level == 1) {
*str += "A unit with this skill has begun the process of building "
"on their combat experience to learn how to survive wounds "
"that would lay low a less grizzled warrior. This is an "
"arduous process, and doesn't yet provide any advantage "
"at this skill level.";
} else if (level == 3) {
*str += "The process of building up combat endurance is starting "
"to yield results. At this level the men in the unit can "
"survive one extra hit in combat before being overcome.";
} else if (level == 5) {
*str += "The men of this unit are now hardened veterans, and can "
"survive three hits in combat before falling.";
}
break;
case S_RIDING:
if (level > 1) break;
*str += "A unit with this skill, if possessing a mount, may "
"gain a bonus in combat, if the battle is in a location "
"where that mount may be utilized and if the skill of the "
"rider is sufficient to control that mount. The bonus "
"gained can vary with the mount, the riders skill, and the "
"terrain.";
break;
case S_CROSSBOW:
if (level > 1) break;
*str += "A unit with this skill may use a crossbow or other bow "
"derived from one, either in battle, or to TAX or PILLAGE a "
"region.";
break;
case S_LONGBOW:
if (level > 1) break;
*str += "A unit with this skill may use a longbow or other bow "
"derived from one, either in battle, or to TAX or PILLAGE a "
"region.";
break;
case S_STEALTH:
if (level > 1) break;
*str += "A unit with this skill is concealed from being seen";
if (SKILL_ENABLED(S_OBSERVATION)) {
*str += ", except by units with an Observation skill greater "
"than or equal to the stealthy unit's Stealth level";
}
*str += ".";
break;
case S_OBSERVATION:
if (level > 1) break;
*str += "A unit with this skill can see stealthy units or "
"monsters whose stealth rating is less than or equal to "
"the observing unit's Observation level. The unit can "
"also determine the faction owning a unit, provided its "
"Observation level is higher than the other unit's Stealth "
"level.";
break;
case S_HEALING:
*str += "A unit with this skill is able to use herbs [HERB] to "
"heal units hurt in battle.";
if (HealDefs[level].num != HealDefs[level - 1].num ||
HealDefs[level].rate != HealDefs[level - 1].rate) {
*str += " A unit at this level of skill can ";
*str += "bring soldiers back from near death, healing";
*str += " up to ";
*str += HealDefs[level].num * Globals->HEALS_PER_MAN;
*str += " casualties, with a ";
*str += HealDefs[level].rate;
*str += " percent success rate.";
}
break;
case S_SAILING:
if (level > 1) break;
*str += "A unit with this skill may use the SAIL order to sail "
"ships.";
break;
case S_FORCE:
if (level > 1) break;
*str += "The Force skill is not directly useful to a mage, but "
"is rather one of the Foundation skills on which other "
"magical skills are based. The Force skill determines the "
"power of the magical energy that a mage is able to use. "
"Note that a Force skill level of 0 does not indicate that "
"a mage cannot use magical energy, but rather can only "
"perform magical acts that do not require great amounts of "
"power.";
break;
case S_PATTERN:
if (level > 1) break;
*str += "The Pattern skill is not directly useful to a mage, but "
"is rather one of the Foundation skills on which other "
"magical skills are based. A mage's Pattern skill indicates "
"the ability to handle complex magical patterns, and is "
"important for complicated tasks such as healing and "
"controlling nature.";
break;
case S_SPIRIT:
if (level > 1) break;
*str += "The Spirit skill is not directly useful to a mage, but "
"is rather one of the Foundation skills on which other "
"magical skills are based. Spirit skill indicates the mage's "
"ability to control and affect magic and other powers beyond "
"the material world.";
break;
case S_FIRE:
if (level > 1) break;
break;
case S_EARTHQUAKE:
if (level > 1) break;
break;
case S_FORCE_SHIELD:
if (level > 1) break;
break;
case S_ENERGY_SHIELD:
if (level > 1) break;
break;
case S_SPIRIT_SHIELD:
if (level > 1) break;
break;
case S_MAGICAL_HEALING:
if (level == 1) {
*str += "This skill enables the mage to magically heal units "
"after battle. No order is necessary to use this spell; "
"it will be used automatically when the mage is involved "
"in a battle. ";
}
if (MagicHealDefs[level].num != MagicHealDefs[level - 1].num ||
MagicHealDefs[level].rate != MagicHealDefs[level - 1].rate) {
*str += "A mage at this level of skill can ";
if (level > 4) {
*str += "bring soldiers back from near death, healing";
} else if (level > 2) {
*str += "work wonders of healing with his new-found powers; he may heal";
} else {
*str += "heal";
}
*str += " up to ";
*str += MagicHealDefs[level].num;
*str += " casualties, with a ";
*str += MagicHealDefs[level].rate;
*str += " percent success rate.";
}
break;
case S_GATE_LORE:
/* XXX -- This should be cleaner somehow. */
if (level == 1) {
*str += "Gate Lore is the art of detecting and using magical "
"Gates, which are spread through the world. The Gates are ";
if (!Globals->DISPERSE_GATE_NUMBERS)
*str += "numbered in order, but ";
*str += "spread out randomly, so there is "
"no correlation between the Gate number and the Gate's "
"location. A mage with skill 1 in Gate Lore can see a "
"Gate if one exists in the same region as the mage. This "
"detection is automatic; the Gate will appear in the "
"region report. A mage with skill 1 in Gate Lore may "
"also jump through a Gate into another region on the same "
"level containing a gate, selected at random. To use "
"Gate Lore in this manner, use the syntax CAST Gate_Lore "
"RANDOM UNITS <unit> ... UNITS is followed by a list "
"of units to follow the mage through the Gate (the mage "
"always jumps through the Gate). At level 1, the mage "
"may carry 15 weight units through the Gate (including "
"the weight of the mage).";
} else if (level == 2) {
*str += "A mage with Gate Lore skill 2 can detect Gates in "
"adjacent regions. The mage should use the syntax CAST "
"Gate_Lore DETECT in order to detect these nearby Gates. "
"Also at level 2 Gate Lore, the mage may perform a "
"random gate jump without being restricted to the same "
"level; use CAST Gate_Lore RANDOM LEVEL UNITS <unit> ... "
"to use this option; when calculating weight for multi "
"level jump, skill level is reduced by 1. The mage may "
"also now carry 500 weight units through a Gate when doing "
"a random jump. "
"A mage with Gate Lore skill 2 and higher can step "
"through a Gate into another region containing a specific "
"Gate. To use this spell, use the syntax CAST Gate_Lore "
"GATE <number> UNITS <unit> ... <number> specifies the "
"Gate that the mage will jump to. UNITS is followed by a "
"list of units to follow the mage through the gate (the "
"mage always jumps through the gate). At level 2, the "
"mage may carry 15 weight units through the specific Gate "
"(including the mage).";
} else if (level == 3) {
*str += "A mage with Gate Lore skill 3 may carry 500 weight "
"units through a Gate. Also, a level 3 mage doing a random "
"gate jump may carry 1500 weight units through the Gate.";
} else if (level == 4) {
*str += "A mage with Gate Lore skill 4 may carry 1500 weight "
"units through a Gate. Also, a level 4 mage doing a random "
"gate jump may carry 3000 weight units through the Gate.";
} else if (level == 5) {
*str += "A mage with Gate Lore skill 5 may carry 3000 weight "
"units through a Gate. Also, a level 5 mage doing a random "
"gate jump may carry 6000 weight units through the Gate.";
}
break;
case S_PORTAL_LORE:
if (level > 1) break;
/* XXX -- This should be cleaner somehow. */
if (ITEM_DISABLED(I_PORTAL)) break;
*str += "A mage with the Portal Lore skill may, with the aid of "
"another mage";
if (Globals->APPRENTICES_EXIST) {
*str += " or ";
*str += Globals->APPRENTICE_NAME;
}
*str += ", make a temporary Gate between two regions, and "
"send units from one region to another. In order to do this, "
"both mages (the caster, and the target mage) must have "
"Portals, and the caster must be trained in Portal Lore. The "
"caster may teleport units weighing up to 800 weight units "
"times his skill level, to the target mage's region. ";
range = FindRange(SkillDefs[skill].range);
if (range) {
*str += " The target region must be within ";
*str += range->rangeMult;
switch(range->rangeClass) {
case RangeType::RNG_LEVEL:
*str += " times the caster's skill level ";
break;
case RangeType::RNG_LEVEL2:
*str += " times the caster's skill level squared ";
break;
case RangeType::RNG_LEVEL3:
*str += " times the caster's skill level cubed ";
break;
default:
case RangeType::RNG_ABSOLUTE:
break;
}
*str += "regions of the caster. ";
}
*str += "To use this skill, CAST Portal_Lore <target> UNITS "
"<unit> ..., where <target> is the unit number of the "
"target mage, and <unit> is a list of units to be "
"teleported (the casting mage may teleport himself, if "
"he so desires).";
break;
case S_FARSIGHT:
if (level > 1) break;
*str += "A mage with this skill may obtain region reports on "
"distant regions. The report will be as if the mage was in "
"the distant region himself.";
range = FindRange(SkillDefs[skill].range);
if (range) {
if (range->flags & RangeType::RNG_SURFACE_ONLY) {
*str += " This skill only works on the surface of the "
"world.";
}
*str += " The target region must be within ";
*str += range->rangeMult;
switch(range->rangeClass) {
case RangeType::RNG_LEVEL:
*str += " times the caster's skill level ";
break;
case RangeType::RNG_LEVEL2:
*str += " times the caster's skill level squared ";
break;
case RangeType::RNG_LEVEL3:
*str += " times the caster's skill level cubed ";
break;
default:
case RangeType::RNG_ABSOLUTE:
break;
}
*str += "regions of the caster. ";
if (range->flags & RangeType::RNG_CROSS_LEVELS) {
*str += "Coordinates of locations not on the surface are "
"scaled to the surface coordinates for this "
"calculation. Attempting to view across different "
"levels increases the distance by ";
*str += range->crossLevelPenalty;
*str += " per level difference. ";
*str += "To use this skill, CAST Farsight REGION <x> <y> "
"<z> where <x>, <y>, and <z> are the coordinates of "
"the region that you wish to view. If you omit the "
"<z> coordinate, the <z> coordinate of the caster's "
"current region will be used.";
if (Globals->UNDERWORLD_LEVELS +
Globals->UNDERDEEP_LEVELS == 1) {
*str += " The <z> coordinate for the surface is '1' "
"and the <z>-coordinate for the underworld is "
"'2'.";
}
*str += " Note that Farsight cannot be used either into "
"or out of the Nexus.";
} else {
*str += "To use this skill, CAST Farsight REGION <x> "
"<y>, where <x> and <y> are the coordinates of the "
"region that you wish to view.";
}
}
if (Globals->IMPROVED_FARSIGHT) {
*str += " Any other skills which the mage has which give "
"region information will be used when farsight is used.";
} else {
*str += " Note that Farsight does not work in conjunction "
"with other skills or spells; the mage can only rely on "
"his normal facilities while casting Farsight.";
}
break;
case S_MIND_READING:
/* XXX -- This should be cleaner somehow. */
if (level == 1) {
*str += "A mage with Mind Reading skill 1 may cast the spell "
"and determine the faction affiliation of any unit he can "
"see. To use the spell in this manner, CAST Mind_Reading "
"<unit>, where <unit> is the target unit.";
} else if (level == 2) {
*str += "A mage with Mind Reading skill 2 will automatically "
"determine the faction affiliation of any unit he can "
"see. Usage of this skill is automatic, and no order is "
"needed to use it.";
} else if (level == 3) {
*str += "A mage with Mind Reading skill 3 can get a full "
"unit report on any unit he can see. To use this skill, "
"CAST Mind_Reading <unit> where <unit> is the target "
"unit.";
}
break;
case S_TELEPORTATION:
if (level > 1) break;
/* XXX -- This should be cleaner somehow. */
*str += "A mage with this skill may teleport himself across "
"great distances, even without the use of a gate. The mage "
"may teleport up to 50 weight units per skill level.";
range = FindRange(SkillDefs[skill].range);
if (range) {
if (range->flags & RangeType::RNG_SURFACE_ONLY) {
*str += " This skill only works on the surface of the "
"world.";
}
*str += " The target region must be within ";
*str += range->rangeMult;
switch(range->rangeClass) {
case RangeType::RNG_LEVEL:
*str += " times the caster's skill level ";
break;
case RangeType::RNG_LEVEL2:
*str += " times the caster's skill level squared ";
break;
case RangeType::RNG_LEVEL3:
*str += " times the caster's skill level cubed ";
break;
default:
case RangeType::RNG_ABSOLUTE:
break;
}
*str += "regions of the caster. ";
if (range->flags & RangeType::RNG_CROSS_LEVELS) {
*str += "Coordinates of locations not on the surface are "
"scaled to the surface coordinates for this "
"calculation. Attempting to view across different "
"levels increases the distance by ";
*str += range->crossLevelPenalty;
*str += " per level difference. ";
*str += "To use this skill, CAST Teleportation REGION "
"<x> <y> <z> where <x>, <y>, and <z> are the "
"coordinates of the region that you wish to "
"teleport to. If you omit the <z> coordinate, the "
"<z> coordinate of the caster's current region will "
"be used.";
if (Globals->UNDERWORLD_LEVELS +
Globals->UNDERDEEP_LEVELS == 1) {
*str += " The <z> coordinate for the surface is '1' "
"and the <z>-coordinate for the underworld is "
"'2'.";
}
*str += " Note that Teleportation cannot be used either "
"into or out of the Nexus.";
} else {
*str += "To use this skill, CAST Teleportation REGION "
"<x> <y>, where <x> and <y> are the coordinates of "
"the region that you wish to teleport to.";
}
}
break;
case S_WEATHER_LORE:
if (level > 1) break;
/* XXX -- This should be templated */
*str += "Weather Lore is the magic of the weather; a mage with "
"this skill can predict the weather in nearby regions. "
"Weather Lore also allows further study into more powerful "
"areas of magic. The weather may be predicted for 3 months "
"at level 1, 6 months at level 3 and a full year at level "
"5.";
range = FindRange(SkillDefs[skill].range);
if (range) {
if (range->flags & RangeType::RNG_SURFACE_ONLY) {
*str += " This skill only works on the surface of the "
"world.";
}
*str += " The target region must be within ";
*str += range->rangeMult;
switch(range->rangeClass) {
case RangeType::RNG_LEVEL:
*str += " times the caster's skill level ";
break;
case RangeType::RNG_LEVEL2:
*str += " times the caster's skill level squared ";
break;
case RangeType::RNG_LEVEL3:
*str += " times the caster's skill level cubed ";
break;
default:
case RangeType::RNG_ABSOLUTE:
break;
}
*str += "regions of the caster. ";
if (range->flags & RangeType::RNG_CROSS_LEVELS) {
*str += "Coordinates of locations not on the surface are "
"scaled to the surface coordinates for this "
"calculation. Attempting to view across different "
"levels increases the distance by ";
*str += range->crossLevelPenalty;
*str += " per level difference. ";
*str += "To use this skill, CAST Weather_Lore REGION "
"<x> <y> <z> where <x>, <y>, and <z> are the "
"coordinates of the region where you wish to "
"predict the weather. If you omit the <z> "
"coordinate, the <z> coordinate of the caster's "
"current region will be used.";
if (Globals->UNDERWORLD_LEVELS +
Globals->UNDERDEEP_LEVELS == 1) {
*str += " The <z> coordinate for the surface is '1' "
"and the <z>-coordinate for the underworld is "
"'2'.";
}
*str += " Note that Weather Lore cannot be used either "
"into or out of the Nexus.";
} else {
*str += "To use this skill, CAST Weather_Lore REGION "
"<x> <y>, where <x> and <y> are the coordinates of "
"the region where you wish to predict the weather.";
}
}
*str += " A mage with Weather Lore skill will perceive the use "
"of Weather Lore by any other mage in the same region.";
break;
case S_SUMMON_WIND:
if (level == 1) {
*str += "A mage with knowledge of Summon Wind can summon "
"up the powers of the wind to aid him in sea or "
"air travel. Usage of this spell is automatic. ";
if (Globals->FLEET_WIND_BOOST > 0) {
*str += "A mage with this skill will add ";
*str += Globals->FLEET_WIND_BOOST;
*str += " movement points to ships requiring up to "
"12 sailing skill points per skill level "
"of Summon Wind. ";
}
/*
*str += " If the mage is flying, he will receive 2 extra "
"movement points.";
*/
*str += "The effects of all such mages in a fleet are cumulative. ";
}
break;
case S_SUMMON_STORM:
if (level > 1) break;
break;
case S_SUMMON_TORNADO:
if (level > 1) break;
break;
case S_CALL_LIGHTNING:
if (level > 1) break;
break;
case S_CLEAR_SKIES:
/* XXX -- this range stuff needs cleaning up */
if (level > 1) break;
if (SkillDefs[skill].flags & SkillType::CAST) {
*str += "When cast using the CAST order, it causes the "
"region to have good weather for the entire month; "
"movement is at the normal rate (even if it is winter) "
"and the economic production of the region is improved "
"for a month (this improvement of the economy will "
"actually take effect during the turn after the spell "
"is cast).";
range = FindRange(SkillDefs[skill].range);
if (range) {
if (range->flags & RangeType::RNG_SURFACE_ONLY) {
*str += " This skill only works on the surface of "
"the world.";
}
*str += " The target region must be within ";
*str += range->rangeMult;
switch(range->rangeClass) {
case RangeType::RNG_LEVEL:
*str += " times the caster's skill level ";
break;
case RangeType::RNG_LEVEL2:
*str += " times the caster's skill level squared ";
break;
case RangeType::RNG_LEVEL3:
*str += " times the caster's skill level cubed ";
break;
default:
case RangeType::RNG_ABSOLUTE:
break;
}
*str += "regions of the caster. ";
if (range->flags & RangeType::RNG_CROSS_LEVELS) {
*str += "Coordinates of locations not on the surface "
"are scaled to the surface coordinates for this "
"calculation. Attempting to view across "
"different levels increases the distance by ";
*str += range->crossLevelPenalty;
*str += " per level difference. ";
*str += "To use this skill, CAST Clear_Skies REGION "
"<x> <y> <z> where <x>, <y>, and <z> are the "
"coordinates of the region where you wish to "
"improve the weather. If you omit the <z> "
"coordinate, the <z> coordinate of the caster's "
"current region will be used.";
if (Globals->UNDERWORLD_LEVELS +
Globals->UNDERDEEP_LEVELS == 1) {
*str += " The <z> coordinate for the surface is "
"'1' and the <z>-coordinate for the "
"underworld is '2'.";
}
*str += " Note that Clear Skies cannot be used "
"either into or out of the Nexus.";
} else {
*str += "To use this skill, CAST Clear_Skies REGION "
"<x> <y>, where <x> and <y> are the coordinates "
"of the region where you wish to improve the "
"weather.";
}
} else {
*str += " To use the spell in this fashion, CAST "
"Clear_Skies; no arguments are necessary.";
}
}
break;
case S_EARTH_LORE:
if (level > 1) break;
*str += "Earth Lore is the study of nature, plants, and animals. "
"A mage with knowledge of Earth Lore can use his knowledge "
"of nature to aid local farmers, raising money for himself, "
"and aiding the production of grain or livestock in the "
"region. To use the spell, CAST Earth_Lore; the mage will "
"receive an amount of money based on his level, and the "
"economy of the region. Also, a mage with knowledge of Earth "
"Lore will detect the use of Earth Lore by any other mage in "
"the same region.";
break;
case S_WOLF_LORE:
/* XXX -- This should be cleaner somehow. */
if (level > 1) break;
if (ITEM_DISABLED(I_WOLF)) break;
*str += "A mage with Wolf Lore skill may summon wolves, who will "
"fight for him in combat. A mage may summon a number of "
"wolves averaging ";
*str += ItemDefs[I_WOLF].mOut;
*str += " percent times his skill level, and control a total number "
"of his skill level squared times 4 wolves; the wolves will "
"be placed in the mages inventory. To "
"summon wolves, the mage should issue the order CAST "
"Wolf_Lore.";
// *str += " percent times his skill level, and control a total number "
// "of his skill level squared times 4 wolves; the wolves will "
// "be placed in the mages inventory. Note, however, that wolves "
// "may only be summoned in mountain and forest regions. To "
// "summon wolves, the mage should issue the order CAST "
// "Wolf_Lore.";
break;
case S_BIRD_LORE:
/* XXX -- This should be cleaner somehow. */
if (level == 1) {
*str += "A mage with Bird Lore may control the birds of the "
"sky. At skill level 1, the mage can control small "
"birds, sending them to an adjacent region to obtain a "
"report on that region. (This skill only works on the "
"surface of the world, as there are no birds elsewhere)."
" To use this skill, CAST Bird_Lore DIRECTION <dir>, "
"where <dir> is the direction the mage wishes the birds "
"to report on.";
} else if (level == 3) {
if (ITEM_DISABLED(I_EAGLE)) break;
*str += "A mage with Bird Lore 3 can summon eagles to join "
"him, who will aid him in combat, and provide for flying "
"transportation. A mage may summon ";
if (ItemDefs[I_EAGLE].mOut > 0) {
*str += "an average of ";
*str += ItemDefs[I_EAGLE].mOut;
*str += " percent times his skill level minus 2 eagles";
}
else
*str += "one eagle";
*str += " per month, and may control a number equal to "
"his skill level minus 2, squared, times two. "
"To summon an eagle, issue the order CAST "
"Bird_Lore EAGLE; the eagles will appear in his inventory.";
}
break;
case S_DRAGON_LORE:
/* XXX -- This should be cleaner somehow. */
if (level > 1) break;
if (ITEM_DISABLED(I_DRAGON)) break;
*str += "A mage with Dragon Lore skill can summon dragons to "
"join him, to aid in battle, and provide flying "
"transportation. ";
if (ItemDefs[I_DRAGON].mOut > 0) {
*str += "A mage has a ";
*str += ItemDefs[I_DRAGON].mOut;
*str += "% times his skill level chance to summon a dragon";
}
else
*str += "A mage at level 1 has a low chance of "
"successfully summoning a dragon, gradually increasing "
"until at level 5 he may summon one dragon per turn";
*str += "; the total number of dragons that a mage may control at one "
"time is equal to his skill level. To attempt to summon a "
"dragon, CAST Dragon_Lore.";
break;
case S_NECROMANCY:
if (level > 1) break;
*str += "Necromancy is the magic of death; a mage versed in "
"Necromancy may raise and control the dead, and turn the "
"powers of death to his own nefarious purposes. The "
"Necromancy skill does not have any direct application, but "
"is required to study the more powerful Necromantic skills. "
"A mage with knowledge of Necromancy will detect the use of "
"Necromancy by any other mage in the same region.";
break;
case S_SUMMON_SKELETONS:
/* XXX -- This should be cleaner somehow. */
if (level > 1) break;
if (ITEM_DISABLED(I_SKELETON)) break;
*str += "A mage with the Summon Skeletons skill may summon "
"skeletons into his inventory, to aid him in battle. "
"Skeletons may be given to other units, as they follow "
"instructions mindlessly; however, they have a 8 percent "
"chance of decaying each turn. A mage can summon skeletons "
"at an average rate of ";
if (ItemDefs[I_SKELETON].mOut > 0) {
*str += ItemDefs[I_SKELETON].mOut;
*str += " percent times his skill level.";
}
else
*str += "40 percent times his level squared.";
*str += " To use the spell, use the order CAST Summon_Skeletons, "
"and the mage will summon as many skeletons as he is able.";
break;
case S_RAISE_UNDEAD:
/* XXX -- This should be cleaner somehow. */
if (level > 1) break;
if (ITEM_DISABLED(I_UNDEAD)) break;
*str += "A mage with the Raise Undead skill may summon undead "
"into his inventory, to aid him in battle. Undead may be "
"given to other units, as they follow instructions "
"mindlessly; however, they have a 8 percent chance of "
"decaying each turn. A mage can summon undead at an average "
"rate of ";
if (ItemDefs[I_UNDEAD].mOut > 0) {
*str += ItemDefs[I_UNDEAD].mOut;
*str += " percent times his skill level.";
}
else
*str += "10 percent times his level squared.";
*str += " To use the spell, use the order CAST Raise_Undead and the "
"mage will summon as many undead as he is able.";
break;
case S_SUMMON_LICH:
/* XXX -- This should be cleaner somehow. */
if (level > 1) break;
if (ITEM_DISABLED(I_LICH)) break;
*str += "A mage with the Summon Lich skill may summon a lich "
"into his inventory, to aid him in battle. Liches may be "
"given to other units, as they follow instructions "
"mindlessly; however, they have a 8 percent chance of "
"decaying each turn. A mage has a ";
if (ItemDefs[I_LICH].mOut > 0) {
*str += ItemDefs[I_LICH].mOut;
*str += " percent times his skill level";
}
else
*str += "2 percent times his level squared";
*str += " chance of summoning a lich; to summon a lich, use "
"the order CAST Summon_Lich.";
break;
case S_CREATE_AURA_OF_FEAR:
if (level > 1) break;
break;
case S_SUMMON_BLACK_WIND:
if (level > 1) break;
break;
case S_BANISH_UNDEAD:
if (level > 1) break;
break;
case S_DEMON_LORE:
if (level > 1) break;
*str += "Demon Lore is the art of summoning and controlling "
"demons. The Demon Lore skill does not give the mage any "
"direct skills, but is required to study further into the "
"Demonic arts. A mage with knowledge of Demon Lore will "
"detect the use of Demon Lore by any other mage in the same "
"region.";
break;
case S_SUMMON_IMPS:
/* XXX -- This should be cleaner somehow. */
if (level > 1) break;
if (ITEM_DISABLED(I_IMP)) break;
*str += "A mage with the Summon Imps skill may summon imps into "
"his inventory, to aid him in combat. A mage may summon ";
if (ItemDefs[I_IMP].mOut > 0) {
*str += ItemDefs[I_IMP].mOut;
*str += " percent times his skill level imps";
}
else
*str += "one imp per skill level";
*str += "; however, the imps have a chance of "
"breaking free of the mage's control at the end of each "
"turn. ";
DescribeEscapeParameters(str, I_IMP);
*str += "To use this spell, the mage should issue the order CAST "
"Summon_Imps, and the mage will summon as many imps as he "
"is able.";
break;
case S_SUMMON_DEMON:
/* XXX -- This should be cleaner somehow. */
if (level > 1) break;
if (ITEM_DISABLED(I_DEMON)) break;
*str += "A mage with the Summon Demon skill may summon demons "
"into his inventory, to aid him in combat. A mage may summon ";
if (ItemDefs[I_DEMON].mOut > 0) {
*str += ItemDefs[I_DEMON].mOut;
*str += " percent times his skill level demons";
}
else
*str += "one demon";
*str += " each turn; however, the demons have a chance of "
"breaking free of the mage's control at the end of each "
"turn. ";
DescribeEscapeParameters(str, I_DEMON);
*str += "To use this spell, the mage should issue the "
"order CAST Summon_Demon.";
break;
case S_SUMMON_BALROG:
/* XXX -- This should be cleaner somehow. */