forked from nedbrek/Atlantis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskillshows.cpp
More file actions
1587 lines (1534 loc) · 57.4 KB
/
skillshows.cpp
File metadata and controls
1587 lines (1534 loc) · 57.4 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 "skills.h"
#include "faction.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)
//----------------------------------------------------------------------------
ShowSkill::ShowSkill(int s, int l)
: skill(s)
, level(l)
{
}
AString* ShowSkill::Report(Faction *f)
{
if (SkillDefs[skill].flags & SkillType::DISABLED)
return NULL;
AString *str = new AString;
int val;
RangeType *range = NULL;
// 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;
*str += "This skill deals with all aspects of extracting raw "
"metals and gems from the earth. Metals and gems tend to be "
"found more often in mountainous regions, but may be found "
"elsewhere as well.";
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_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 20 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;
*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_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:
if(level > 1) break;
*str += "A unit with this skill is able to heal units hurt in "
"battle.";
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:
/* XXX -- This should be cleaner somehow. */
if(level == 1) {
*str += "This skill enables the mage to magically heal units "
"after battle. A mage at this level can heal up to 10 "
"casualties, with a 50 percent rate of success. No order "
"is necessary to use this spell, it will be used "
"automatically when the mage is involved in battle.";
} else if(level == 3) {
*str += "A mage at this level of skill can work greater "
"wonders of healing with his new found powers; he may "
"heal up to 25 casualties, with a success rate of 75 "
"percent.";
} else if(level == 5) {
*str += "A mage at this skill level can bring soldiers back "
"from near death; he may heal up to 100 casualties, with "
"a 90 percent rate of success.";
}
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 "
"numbered in order, but 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 35 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 carry 150 "
"weight units through a Gate when doing a random jump.";
} else if(level == 3) {
*str += "A mage with Gate Lore skill 3 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 3, the "
"mage may carry 15 weight units through the Gate "
"(including the mage). Also, a level 3 or higher mage "
"doing a random gate jump may carry 1000 weight units "
"through the Gate.";
} else if(level == 4) {
*str += "A mage with Gate Lore skill 4 may carry 100 weight "
"units through a Gate.";
} else if(level == 5) {
*str += "A mage with Gate Lore skill 5 may carry 1000 weight "
"units through a 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, 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 50 weight units "
"times his skill level, to the target mage's region. ";
val = SkillDefs[skill].rangeIndex;
if(val != -1) range = &RangeDefs[val];
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.";
val = SkillDefs[skill].rangeIndex;
if(val != -1) range = &RangeDefs[val];
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 > 0) {
*str += " The <z> coordinate for the surface is '1' "
"and the <z>-coordinate for the start of 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 == 3) {
*str += "A mage with Mind Reading skill 3 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 == 5) {
*str += "A mage with Mind Reading skill 5 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 15 weight units per skill level.";
val = SkillDefs[skill].rangeIndex;
if(val != -1) range = &RangeDefs[val];
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 > 0) {
*str += " The <z> coordinate for the surface is '1' "
"and the <z>-coordinate for the start of 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.";
val = SkillDefs[skill].rangeIndex;
if(val != -1) range = &RangeDefs[val];
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 > 0) {
*str += " The <z> coordinate for the surface is '1' "
"and the <z>-coordinate for the start of 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:
/* XXX -- This should be cleaner somehow. */
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(OBJECT_ENABLED(O_LONGBOAT)) {
*str += " At level 1, if the mage is in a Longboat, that "
"ship will get 2 extra movement points.";
}
*str += " If the mage is flying, he will receive 2 extra "
"movement points.";
} else if (level == 2) {
if(OBJECT_DISABLED(O_CLIPPER)) break;
*str += "With level 2 Summon Wind, any ship of Clipper size "
"or smaller that the mage is inside will receive a "
"2 movement point bonus.";
} else if (level == 3) {
*str += "At level 3 of Summon Wind, any ship the mage is in "
"will receive a 2 movement point bonus. Note that "
"study of Summon Wind beyond level 3 does not "
"yield any further powers.";
}
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).";
val = SkillDefs[skill].rangeIndex;
if(val != -1) range = &RangeDefs[val];
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 > 0) {
*str += " The <z> coordinate for the surface is "
"'1' and the <z>-coordinate for the "
"start of 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 equal to 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, hill 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 a number of eagles "
"equal to his skill level minus 2, squared; the eagles "
"will appear in his inventory. To summon an eagle, issue "
"the order CAST Bird_Lore EAGLE.";
}
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 a single dragon "
"to join him, to aid in battle, and provide flying "
"transportation. A mage's chance to summon a dragon is "
"4 times the caster's skill level squared."
" 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 10 percent "
"chance of decaying each turn. A mage can summon skeletons "
"at an average rate of 40 percent times his level squared. "
"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 10 percent chance of "
"decaying each turn. A mage can summon undead at an average "
"rate of 10 percent times his level squared. 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 10 percent chance of "
"decaying each turn. A mage has a 2 percent times his level "
"squared 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 one "
"imp per skill level; however, the imps have a chance of "
"breaking free of the mage's control at the end of each "
"turn. This chance is based on the number of imps in the "
"mage's control; if the mage has his skill level squared "
"times 4 imps, the chance is 5 percent; this chance goes "
"up or down quickly if the mage controls more or fewer imps. "
"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 "
"one demon each turn; however, the demons have a chance of "
"breaking free of the mage's control at the end of each "
"turn. This chance is based on the number of demons in the "
"mage's control; if the mage has a number of demons equal "
"to his skill level squared, the chance is 5 percent; this "
"chance goes up or down quickly if the mage controls more or "
"fewer demons. To use this spell, the mage should issue the "
"order CAST Summon_Demon.";
break;
case S_SUMMON_BALROG:
/* XXX -- This should be cleaner somehow. */
if(level > 1) break;
if(ITEM_DISABLED(I_BALROG)) break;
*str += "A mage with the Summon Balrog skill may summon a balrog "
"into his inventory, to aid him in combat. A mage has a 20 "
"percent times his skill level chance of summoning a balrog, "
"but may only summon a balrog if one is not already under "
"his control. As with other demons, the balrog has a chance "
"of breaking free of the mage's control at the end of each "
"turn. This chance is equal to 1 over 4 times the mage's "
"skill level to the fourth power (or, from 1 over 4 at "
"level 1, to 1 over 2500 at level 5). To use this spell, "
"the mage should issue the order CAST Summon_Balrog.";
break;
case S_BANISH_DEMONS:
if(level > 1) break;
break;
case S_ILLUSION:
if(level > 1) break;
*str += "Illusion is the magic of creating images of things that "
"do not actually exist. The Illusion skill does not have any "
"direct applications, but is required for further study of "
"Illusionary magic. A mage with knowledge of the Illusion "
"skill will detect the use of Illusion by any other mage in "
"the same region.";
break;
case S_PHANTASMAL_ENTERTAINMENT:
/* XXX -- This should be cleaner somehow */
if(level > 1) break;
*str += "A mage with the Phantasmal Entertainment skill may use "
"his powers of Illusion to earn money by creating "
"illusionary fireworks, puppet shows, etc. In effect, "
"Phantasmal Entertainment grants the mage Entertainment "
"skill equal to five times his Phantasmal Entertainment "
"level. To use this skill, use the ENTERTAIN order.";
break;
case S_CREATE_PHANTASMAL_BEASTS:
/* XXX -- This should be cleaner somehow. */
if(level == 1) {
*str += "A mage with Create Phantasmal Beasts may summon "
"illusionary beasts that appear in the mage's inventory. "
"These beasts will fight in combat, but do not attack, "
"and are killed whenever they are attacked.";
if(ITEM_ENABLED(I_IWOLF)) {
*str += " Create Phantasmal Beasts at level 1 allows the "
"mage to summon illusionary wolves; the number the "
"mage can summon, or have in his inventory at one "
"time is equal to the mage's skill squared times 4. "
"To use this spell, the mage should CAST "
"Create_Phantasmal_Beasts WOLF <number>, where "
"<number> is the number of wolves that the mage "
"wishes to have appear in his inventory.";
}
*str += " Note: illusionary beasts will appear on reports as "
"if they were normal items, except on the owner's "
"report, where they are marked as illusionary. To "
"reference these items in orders, you must prepend an "
"'i' to the normal string. (For example: to reference "
"an illusionary wolf, you would use 'iwolf').";
} else if (level == 3) {
if(ITEM_DISABLED(I_IEAGLE)) break;
*str += "Create Phantasmal Beasts at level 3 allows the mage "
"to summon illusionary eagles into his inventory. To "
"summon illusionary eagles, the mage should CAST "
"Create_Phantasmal_Beasts EAGLE <number>, where <number> "
"is the number of eagles that the mage wishes to have "
"appear in his inventory. The number of eagles that a "
"mage may have in his inventory is equal to his skill "
"level, minus 2, squared.";
} else if(level == 5) {
if(ITEM_DISABLED(I_IDRAGON)) break;
*str += "Create Phantasmal Beasts at level 5 allows the "
"mage to summon an illusionary dragon into his "
"inventory. To summon an illusionary dragon, the mage "
"should CAST Create_Phantasmal_Beasts DRAGON; the mage "
"can only have one illusionary dragon in his inventory "
"at one time.";
}
break;
case S_CREATE_PHANTASMAL_UNDEAD:
/* XXX -- This should be cleaner somehow. */
if(level == 1) {
*str += "A mage with Create Phantasmal Undead may summon "
"illusionary undead that appear in the mage's inventory. "
"These undead will fight in combat, but do not attack, "
"and are killed whenever they are attacked.";
if(ITEM_ENABLED(I_ISKELETON)) {
*str += " Create Phantasmal Undead at level 1 allows the "
"mage to summon illusionary skeletons; the number "
"the mage can summon, or have in his inventory at "
"one time is equal to the mage's skill squared times "
"4. To use this spell, the mage should CAST "
"Create_Phantasmal_Undead SKELETON <number>, where "
"<number> is the number of skeletons that the mage "
"wishes to have appear in his inventory.";
}
*str += " Note: illusionary undead will appear on reports as "
"if they were normal items, except on the owner's "
"report, where they are marked as illusionary. To "
"reference these items in orders, you must prepend an "
"'i' to the normal string. (Example: to reference an "
"illusionary skeleton, you would use 'iskeleton').";
} else if(level == 3) {
if(ITEM_DISABLED(I_IUNDEAD)) break;
*str += "Create Phantasmal Undead at level 3 allows the mage "
"to summon illusionary undead into his inventory. To "
"summon illusionary undead, the mage should CAST "
"Create_Phantasmal_Undead UNDEAD <number>, where <number> "
"is the number of undead that the mage wishes to have "
"appear in his inventory. The number of undead that a "
"mage may have in his inventory is equal to his skill "
"level, minus 2, squared.";
} else if (level == 5) {
if(ITEM_DISABLED(I_ILICH)) break;
*str += "Create Phantasmal Undead at level 5 allows the mage "
"to summon an illusionary lich into his inventory. To "
"summon an illusionary lich, the mage should CAST "
"Create_Phantasmal_Undead LICH; the mage can only have "
"one illusionary lich in his inventory at one time.";
}
break;
case S_CREATE_PHANTASMAL_DEMONS:
/* XXX -- This should be cleaner somehow. */
if(level == 1) {
*str += "A mage with Create Phantasmal Demons may summon "
"illusionary demons that appear in the mage's "
"inventory. These demons will fight in combat, but "
"do not attack, and are killed whenever they are "
"attacked.";
if(ITEM_ENABLED(I_IIMP)) {
*str += " Create Phantasmal Demons at level 1 allows the "
"mage to summon illusionary imps; the number the "
"mage can summon, or have in his inventory at one "
"time is equal to the mage's skill squared times 4. "
"To use this spell, the mage should CAST "
"Create_Phantasmal_Demons IMP <number>, where "
"<number> is the number of imps that the mage wishes "
"to have appear in his inventory.";
}
*str += " Note: illusionary demons will appear on reports as "
"if they were normal items, except on the owner's "
"report, where they are marked as illusionary. To "
"reference these items in orders, you must prepend an "
"'i' to the normal string. (Example: to reference an "
"illusionary imp, you would use 'iimp').";
} else if (level == 3) {
if(ITEM_DISABLED(I_IDEMON)) break;
*str += "Create Phantasmal Demons at level 3 allows the mage "
"to summon illusionary demons into his inventory. To "
"summon illusionary demons, the mage should CAST "
"Create_Phantasmal_Demons DEMON <number>, where <number> "
"is the number of demons that the mage wishes to have "
"appear in his inventory. The number of demons that a "
"mage may have in his inventory is equal to his skill "
"level, minus 2, squared.";
} else if (level == 5) {
if(ITEM_DISABLED(I_IBALROG)) break;
*str += "Create Phantasmal Demons at level 5 allows the mage "
"to summon an illusionary balrog into his inventory. To "
"summon an illusionary balrog, the mage should CAST "
"Create_Phantasmal_Demons BALROG; the mage can only have "
"one illusionary balrog in his inventory at one time.";
}
break;
case S_INVISIBILITY:
/* XXX -- This should be cleaner somehow. */
if(level > 1) break;
*str += "The Invisibility skill allows a mage to render other "
"units nearly invisible to other factions, giving them a +3 "
"bonus to Stealth. This invisibility will last until the "
"next Magic round. To cast this spell, use the order CAST "
"Invisibility UNITS <unit> ..., where <unit> is a list of "
"the units that the mage wishes to render invisible. A mage "
"may render invisible a number of men or creatures equal to "
"his skill level squared.";
break;
case S_TRUE_SEEING:
if(level > 1) break;
*str += "A mage with the True Seeing spell can see illusions "
"for what they really are. Whether or not the mage can see "
"through the illusion depends on his True Seeing skill "
"being higher that the Illusion skill of the mage casting "
"the illusion. This spell does not require any order to "
"use; it is used automatically.";
if(SKILL_ENABLED(S_OBSERVATION)) {
*str += "In addition, a mage with the True Seeing skill "
"receives a bonus to his Observation skill equal to his "
"True Seeing skill divided by 2, rounded up.";
}
break;
case S_DISPEL_ILLUSIONS:
if(level > 1) break;
break;
case S_ARTIFACT_LORE:
if(level > 1) break;
*str += "Artifact Lore is one of the most advanced forms of "
"magic; in general, creation of an artifact requires both "
"Artifact Lore, and the appropriate skill for the item being "
"created. A mage with knowledge of the Artifact Lore skill "
"will detect the use of Artifact Lore by any other mage in "
"the region.";
break;
case S_CREATE_RING_OF_INVISIBILITY: