-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
religion.cc
4705 lines (4052 loc) · 136 KB
/
religion.cc
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
/**
* @file
* @brief Misc religion related functions.
**/
#include "AppHdr.h"
#include "religion.h"
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <sstream>
#include "ability.h"
#include "acquire.h"
#include "act-iter.h"
#include "areas.h"
#include "attitude-change.h"
#include "branch.h"
#include "chardump.h"
#include "coordit.h"
#include "dactions.h"
#include "database.h"
#include "decks.h"
#include "delay.h"
#include "describe-god.h"
#include "dgnevent.h"
#include "dlua.h"
#include "english.h"
#include "env.h"
#include "exercise.h"
#include "godabil.h"
#include "godcompanions.h"
#include "godconduct.h"
#include "goditem.h"
#include "godpassive.h"
#include "godprayer.h"
#include "godwrath.h"
#include "hints.h"
#include "hiscores.h"
#include "invent.h"
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
#include "libutil.h"
#include "makeitem.h"
#include "message.h"
#include "misc.h"
#include "mon-place.h"
#include "mutation.h"
#include "notes.h"
#include "output.h"
#include "player-stats.h"
#include "prompt.h"
#include "shopping.h"
#include "skills.h"
#include "spl-book.h"
#include "spl-miscast.h"
#include "sprint.h"
#include "state.h"
#include "stringutil.h"
#include "terrain.h"
#include "transform.h"
#include "view.h"
#ifdef DEBUG_RELIGION
# define DEBUG_DIAGNOSTICS
# define DEBUG_GIFTS
# define DEBUG_SACRIFICE
# define DEBUG_PIETY
#endif
#define PIETY_HYSTERESIS_LIMIT 1
// Item offering messages for the gods:
// & is replaced by "is" or "are" as appropriate for the item.
// % is replaced by "s" or "" as appropriate.
// Text between [] only appears if the item already glows.
// First message is if there's no piety gain; second is if piety gain is
// one; third is if piety gain is more than one.
static const char *_Sacrifice_Messages[NUM_GODS][NUM_PIETY_GAIN] =
{
// No god
{
" & eaten by a bored swarm of bugs.",
" & eaten by a swarm of bugs.",
" & eaten by a ravening swarm of bugs."
},
// Zin
{
" barely glow% and disappear%.",
" glow% silver and disappear%.",
" glow% blindingly silver and disappear%.",
},
// TSO
{
" glow% a dingy golden colour and disappear%.",
" glow% a golden colour and disappear%.",
" glow% a brilliant golden colour and disappear%.",
},
// Kikubaaqudgha
{
" convulse% and rot% away.",
" convulse% madly and rot% away.",
" convulse% furiously and rot% away.",
},
// Yredelemnul
{
" slowly crumble% to dust.",
" crumble% to dust.",
" turn% to dust in an instant.",
},
// Xom (no sacrifices)
{
" & eaten by a bored bug.",
" & eaten by a bug.",
" & eaten by a greedy bug.",
},
// Vehumet
{
" fade% into nothingness.",
" burn% into nothingness.",
" explode% into nothingness.",
},
// Okawaru
{
" slowly burn% to ash.",
" & consumed by flame.",
" & consumed in a burst of flame.",
},
// Makhleb
{
" disappear% without a sign.",
" flare% red and disappear%.",
" flare% blood-red and disappear%.",
},
// Sif Muna
{
" & gone without a[dditional] glow.",
" glow% slightly [brighter ]for a moment, and & gone.",
" glow% [brighter ]for a moment, and & gone.",
},
// Trog
{
" & slowly consumed by flames.",
" & consumed in a column of flame.",
" & consumed in a roaring column of flame.",
},
// Nemelex (no sacrifices)
{
" & eaten by a bored swarm of bugs.",
" & eaten by a swarm of bugs.",
" & eaten by a ravening swarm of bugs."
},
// Elyvilon
{
" barely shimmer% and break% into pieces.",
" shimmer% and break% into pieces.",
" shimmer% wildly and break% into pieces.",
},
// Lugonu
{
" disappear% into the void.",
" & consumed by the void.",
" & voraciously consumed by the void.",
},
// Beogh
{
" slowly crumble% into the ground.",
" crumble% into the ground.",
" disintegrate% into the ground.",
},
// Jiyva
{
" slowly dissolve% into ooze.",
" dissolve% into ooze.",
" disappear% with a satisfied slurp.",
},
// Fedhas
{
" & slowly absorbed by the ecosystem.",
" & absorbed by the ecosystem.",
" & instantly absorbed by the ecosystem.",
},
// Cheibriados (slow god, so better sacrifices are slower)
{
" freeze% in place and instantly disappear%.",
" freeze% in place and disappear%.",
" freeze% in place and slowly fade%.",
},
// Ashenzari
{
" flicker% black.",
" pulsate% black.", // unused
" strongly pulsate% black.", // unused
},
// Dithmenos
{
" slowly dissolves into the shadows.",
" dissolves into the shadows.",
" rapidly dissolves into the shadows.",
},
// Gozag
{
" softly glitters and disappears.",
" glitters and disappears.",
" brightly glitters and disappears.",
},
// Qazlal
{
" slowly dissolves into the earth.",
" is consumed by the earth.",
" is consumed by a violent tear in the earth.",
},
// Ru
{
" disappears in a small burst of power.",
" disappears in a burst of power",
" disappears in an immense burst of power",
},
// Pakellas
{
" slowly breaks apart.",
" falls apart.",
" is torn apart in a burst of bright light.",
},
};
const vector<god_power> god_powers[NUM_GODS] =
{
// no god
{ },
// Zin
{ { 1, ABIL_ZIN_RECITE, "recite Zin's Axioms of Law" },
{ 2, ABIL_ZIN_VITALISATION, "call upon Zin for vitalisation" },
{ 3, ABIL_ZIN_IMPRISON, "call upon Zin to imprison the lawless" },
{ 5, ABIL_ZIN_SANCTUARY, "call upon Zin to create a sanctuary" },
{-1, ABIL_ZIN_DONATE_GOLD, "donate money to Zin" },
{ 7, ABIL_ZIN_CURE_ALL_MUTATIONS,
"Zin will cure all your mutations... once.",
"Zin is no longer ready to cure all your mutations." },
},
// TSO
{ { 1, "You and your allies can gain power from killing the unholy and evil.",
"You and your allies can no longer gain power from killing the unholy and evil." },
{ 2, ABIL_TSO_DIVINE_SHIELD, "call upon the Shining One for a divine shield" },
{ 4, ABIL_TSO_CLEANSING_FLAME, "channel blasts of cleansing flame", },
{ 5, ABIL_TSO_SUMMON_DIVINE_WARRIOR, "summon a divine warrior" },
{ 7, ABIL_TSO_BLESS_WEAPON,
"The Shining One will bless your weapon with holy wrath... once.",
"The Shining One is no longer ready to bless your weapon." },
},
// Kikubaaqudgha
{ { 1, ABIL_KIKU_RECEIVE_CORPSES, "receive cadavers from Kikubaaqudgha" },
{ 2, "Kikubaaqudgha is protecting you from necromantic miscasts and death curses.",
"Kikubaaqudgha no longer protects you from necromantic miscasts or death curses." },
{ 4, "Kikubaaqudgha is protecting you from unholy torment.",
"Kikubaaqudgha will no longer protect you from unholy torment." },
{ 5, ABIL_KIKU_TORMENT, "invoke torment by sacrificing a corpse" },
{ 7, ABIL_KIKU_BLESS_WEAPON,
"Kikubaaqudgha will grant you a Necronomicon or bloody your weapon with pain... once.",
"Kikubaaqudgha is no longer ready to enhance your necromancy." },
{ 7, ABIL_KIKU_GIFT_NECRONOMICON,
"Kikubaaqudgha will grant you a Necronomicon.",
"Kikubaaqudgha is no longer ready to enhance your necromancy." },
},
// Yredelemnul
{ { 1, ABIL_YRED_ANIMATE_REMAINS, "animate remains" },
{ 2, ABIL_YRED_RECALL_UNDEAD_SLAVES, "recall your undead slaves" },
{ 2, ABIL_YRED_INJURY_MIRROR, "mirror injuries on your foes" },
{ 3, ABIL_YRED_ANIMATE_DEAD, "animate legions of the dead" },
{ 4, ABIL_YRED_DRAIN_LIFE, "drain ambient lifeforce" },
{ 5, ABIL_YRED_ENSLAVE_SOUL, "enslave living souls" },
},
// Xom
{ },
// Vehumet
{ { 1, "gain magical power from killing" },
{ 3, "Vehumet is aiding your destructive magics.",
"Vehumet will no longer aid your destructive magics." },
{ 4, "Vehumet is extending the range of your destructive magics.",
"Vehumet will no longer extend the range of your destructive magics." },
},
// Okawaru
{ { 1, ABIL_OKAWARU_HEROISM, "gain great but temporary skills" },
{ 5, ABIL_OKAWARU_FINESSE, "speed up your combat" },
},
// Makhleb
{ { 1, "gain health from killing" },
{ 2, ABIL_MAKHLEB_MINOR_DESTRUCTION, "harness Makhleb's destructive might" },
{ 3, ABIL_MAKHLEB_LESSER_SERVANT_OF_MAKHLEB, "summon a lesser servant of Makhleb" },
{ 4, ABIL_MAKHLEB_MAJOR_DESTRUCTION, "hurl Makhleb's greater destruction" },
{ 5, ABIL_MAKHLEB_GREATER_SERVANT_OF_MAKHLEB, "summon a greater servant of Makhleb" },
},
// Sif Muna
{ { 1, ABIL_SIF_MUNA_CHANNEL_ENERGY, "tap ambient magical fields" },
{ 2, ABIL_SIF_MUNA_FORGET_SPELL, "freely open your mind to new spells",
"forget spells at will" },
{ 4, "Sif Muna is protecting you from the effects of miscast magic.",
"Sif Muna no longer protects you from the effects of miscast magic." },
},
// Trog
{
{ 1, ABIL_TROG_BERSERK, "go berserk at will" },
{ 2, ABIL_TROG_REGEN_MR, "call upon Trog for regeneration and protection "
"from hostile enchantments" },
{ 4, ABIL_TROG_BROTHERS_IN_ARMS, "call in reinforcements" },
{-1, ABIL_TROG_BURN_SPELLBOOKS, "call upon Trog to burn spellbooks in your surroundings" },
},
// Nemelex
{ { 3, ABIL_NEMELEX_TRIPLE_DRAW, "choose one out of three cards" },
{ 4, ABIL_NEMELEX_DEAL_FOUR, "deal four cards at a time" },
{ 5, ABIL_NEMELEX_STACK_FIVE, "order the top five cards of a deck, losing the rest",
"stack decks" },
},
// Elyvilon
{ { 1, ABIL_ELYVILON_LESSER_HEALING, "provide lesser healing for yourself" },
{ 2, ABIL_ELYVILON_HEAL_OTHER, "heal and attempt to pacify others" },
{ 3, ABIL_ELYVILON_PURIFICATION, "purify yourself" },
{ 4, ABIL_ELYVILON_GREATER_HEALING, "provide greater healing for yourself" },
{ 5, ABIL_ELYVILON_DIVINE_VIGOUR, "call upon Elyvilon for divine vigour" },
{ 1, ABIL_ELYVILON_LIFESAVING, "call on Elyvilon to save your life" },
},
// Lugonu
{ { 1, ABIL_LUGONU_ABYSS_EXIT, "depart the Abyss", "depart the Abyss at will" },
{ 2, ABIL_LUGONU_BEND_SPACE, "bend space around yourself" },
{ 3, ABIL_LUGONU_BANISH, "banish your foes" },
{ 4, ABIL_LUGONU_CORRUPT, "corrupt the fabric of space" },
{ 5, ABIL_LUGONU_ABYSS_ENTER, "gate yourself to the Abyss" },
{ 7, ABIL_LUGONU_BLESS_WEAPON, "Lugonu will corrupt your weapon with distortion... once.",
"Lugonu is no longer ready to corrupt your weapon." },
},
// Beogh
{ { 1, "Beogh aids your use of armour.",
"Beogh no longer aids your use of armour." },
{ 2, ABIL_BEOGH_SMITING, "smite your foes" },
{ 3, "gain orcish followers" },
{ 4, ABIL_BEOGH_RECALL_ORCISH_FOLLOWERS, "recall your orcish followers" },
{ 5, "walk on water" },
{ 5, ABIL_BEOGH_GIFT_ITEM, "give items to your followers" },
},
// Jiyva
{ { 1, ABIL_JIYVA_CALL_JELLY, "request a jelly" },
{ 2, ABIL_JIYVA_JELLY_PARALYSE, "temporarily halt your jellies' item consumption" },
{ 4, ABIL_JIYVA_SLIMIFY, "turn your foes to slime" },
{ 5, ABIL_JIYVA_CURE_BAD_MUTATION, "call upon Jiyva to remove your harmful mutations" },
},
// Fedhas
{
{ 0, "pray to speed up the decay of corpses" },
{ 1, ABIL_FEDHAS_EVOLUTION, "induce evolution" },
{ 2, ABIL_FEDHAS_SUNLIGHT, "call sunshine" },
{ 3, ABIL_FEDHAS_PLANT_RING, "cause a ring of plants to grow" },
{ 4, ABIL_FEDHAS_SPAWN_SPORES, "spawn explosive spores" },
{ 5, ABIL_FEDHAS_RAIN, "control the weather" },
},
// Cheibriados
{ { 0, ABIL_CHEIBRIADOS_TIME_BEND, "bend time to slow others" },
{ 1, "Cheibriados slows and strengthens your metabolism.",
"Cheibriados no longer slows and strengthens your metabolism." },
{ 3, ABIL_CHEIBRIADOS_DISTORTION, "warp the flow of time around you" },
{ 4, ABIL_CHEIBRIADOS_SLOUCH, "inflict damage on those overly hasty" },
{ 5, ABIL_CHEIBRIADOS_TIME_STEP, "step out of the time flow" },
},
// Ashenzari
{ { 1, ABIL_ASHENZARI_SCRYING, "scry through walls" },
{ 2, "The more cursed you are, the more Ashenzari supports your skills.",
"Ashenzari no longer supports your skills." },
{ 3, "Ashenzari reveals the unseen.",
"Ashenzari no longer reveals the unseen." },
{ 4, "Ashenzari keeps your mind clear.",
"Ashenzari no longer keeps your mind clear." },
{ 5, ABIL_ASHENZARI_TRANSFER_KNOWLEDGE,
"Ashenzari helps you to reconsider your skills.",
"Ashenzari no longer helps you to reconsider your skills." },
},
// Dithmenos
{ { 2, ABIL_DITHMENOS_SHADOW_STEP, "step into the shadows of nearby creatures" },
{ 3, "You now sometimes bleed smoke when heavily injured by enemies.",
"You no longer bleed smoke." },
{ 4, "Your shadow now sometimes tangibly mimics your actions.",
"Your shadow no longer tangibly mimics your actions." },
{ 5, ABIL_DITHMENOS_SHADOW_FORM, "transform into a swirling mass of shadows" },
},
// Gozag
{ { 0, ABIL_GOZAG_POTION_PETITION, "petition Gozag for potion effects" },
{ 0, ABIL_GOZAG_CALL_MERCHANT, "fund merchants seeking to open stores in the dungeon" },
{ 0, ABIL_GOZAG_BRIBE_BRANCH, "bribe branches to halt enemies' attacks and recruit allies" },
},
// Qazlal
{
{ 0, "Qazlal grants you immunity to your own clouds." },
{ 1, "You are surrounded by a storm.", "Your storm dissipates completely." },
{ 2, ABIL_QAZLAL_UPHEAVAL, "call upon nature to destroy your foes" },
{ 3, ABIL_QAZLAL_ELEMENTAL_FORCE, "give life to nearby clouds" },
{ 4, "The storm surrounding you is powerful enough to repel missilies.",
"The storm surrounding you is now too weak to repel missiles." },
{ 4, "You adapt resistances upon receiving elemental damage.",
"You no longer adapt resistances upon receiving elemental damage." },
{ 5, ABIL_QAZLAL_DISASTER_AREA, "call upon nature's wrath in a wide area around you" },
},
// Ru
{ { 1, "You exude an aura of power that intimidates your foes.",
"You no longer exude an aura of power that intimidates your foes." },
{ 2, "Your aura of power can strike those that harm you.",
"Your aura of power no longer strikes those that harm you." },
{ 3, ABIL_RU_DRAW_OUT_POWER, "heal your body and restore your magic" },
{ 4, ABIL_RU_POWER_LEAP, "gather your power into a mighty leap" },
{ 5, ABIL_RU_APOCALYPSE, "wreak a terrible wrath on your foes" },
},
// Pakellas
{
{ 1, ABIL_PAKELLAS_QUICK_CHARGE,
"spend your magic to charge your devices" },
{ 3, ABIL_PAKELLAS_DEVICE_SURGE,
"spend magic to empower your devices" },
{ 7, ABIL_PAKELLAS_SUPERCHARGE,
"Pakellas will now supercharge a wand or rod... once.",
"Pakellas is no longer ready to supercharge a wand or rod." },
}
};
vector<god_power> get_god_powers(god_type god)
{
vector<god_power> ret;
for (const auto& power : god_powers[god])
{
if (!(power.abil != ABIL_NON_ABILITY
&& fixup_ability(power.abil) == ABIL_NON_ABILITY))
{
ret.push_back(power);
}
}
return ret;
}
/**
* Print a description of getting/losing this power.
*
* @param gaining If true, use this->gain; otherwise, use this->loss.
* @param fmt A string containing "%s" that will be used as a format
* string with our string as parameter; it is not used if
* our string begins with a capital letter. IF THIS DOES
* NOT CONTAIN "%s", OR CONTAINS OTHER FORMAT SPECIFIERS,
* BEHAVIOUR IS UNDEFINED.
* @return a string suitable for being read by the user.
*/
void god_power::display(bool gaining, const char* fmt) const
{
// hack: don't mention the necronomicon alone unless it wasn't
// already mentioned by the other message
if (abil == ABIL_KIKU_GIFT_NECRONOMICON
&& you.species != SP_FELID)
{
return;
}
const char* str = gaining ? gain : loss;
if (isupper(str[0]))
god_speaks(you.religion, str);
else
god_speaks(you.religion, make_stringf(fmt, str).c_str());
}
static void _place_delayed_monsters();
bool is_evil_god(god_type god)
{
return god == GOD_KIKUBAAQUDGHA
|| god == GOD_MAKHLEB
|| god == GOD_YREDELEMNUL
|| god == GOD_BEOGH
|| god == GOD_LUGONU;
}
bool is_good_god(god_type god)
{
return god == GOD_ZIN
|| god == GOD_SHINING_ONE
|| god == GOD_ELYVILON;
}
bool is_chaotic_god(god_type god)
{
return god == GOD_XOM
|| god == GOD_MAKHLEB
|| god == GOD_LUGONU
|| god == GOD_JIYVA;
}
bool is_unknown_god(god_type god)
{
return god == GOD_NAMELESS;
}
bool is_unavailable_god(god_type god)
{
return god == GOD_JIYVA && jiyva_is_dead();
}
god_type random_god()
{
god_type god;
do
{
god = static_cast<god_type>(random2(NUM_GODS - 1) + 1);
}
while (is_unavailable_god(god));
return god;
}
string get_god_likes(god_type which_god, bool verbose)
{
if (which_god == GOD_NO_GOD || which_god == GOD_XOM)
return "";
string text = uppercase_first(god_name(which_god));
vector<string> likes;
vector<string> really_likes;
// Unique/unusual piety gain methods first.
switch (which_god)
{
case GOD_SIF_MUNA:
likes.emplace_back("you train your various spell casting skills");
break;
case GOD_FEDHAS:
{
string like = "you promote the decay of nearby corpses";
if (verbose)
like += " by <w>p</w>raying";
likes.push_back(like);
break;
}
case GOD_TROG:
{
string like = "you destroy spellbooks";
if (verbose)
like += " via the <w>a</w> command";
likes.push_back(like);
break;
}
case GOD_ELYVILON:
likes.emplace_back("you explore the world");
break;
case GOD_JIYVA:
{
string like = "you sacrifice items";
if (verbose)
like += " by allowing slimes to consume them";
likes.push_back(like);
break;
}
case GOD_CHEIBRIADOS:
{
string like = "you kill fast things";
if (verbose)
like += ", relative to your speed";
likes.push_back(like);
break;
}
case GOD_ASHENZARI:
likes.emplace_back("you explore the world (preferably while bound by "
"curses)");
break;
case GOD_SHINING_ONE:
likes.emplace_back("you meet creatures to determine whether they need "
"to be eradicated");
break;
case GOD_LUGONU:
likes.emplace_back("you banish creatures to the Abyss");
break;
case GOD_GOZAG:
likes.emplace_back("you collect gold");
break;
case GOD_RU:
likes.emplace_back("you make personal sacrifices");
break;
default:
break;
}
switch (which_god)
{
case GOD_ZIN:
{
string like = "you donate money";
likes.push_back(like);
break;
}
case GOD_BEOGH:
{
string like = "you bless dead orcs";
if (verbose)
like += " (by standing over their remains and <w>p</w>raying)";
likes.push_back(like);
break;
}
case GOD_NEMELEX_XOBEH:
likes.emplace_back("you explore the world");
break;
default:
break;
}
switch (which_god)
{
case GOD_MAKHLEB:
case GOD_LUGONU:
case GOD_QAZLAL:
case GOD_PAKELLAS:
likes.emplace_back("you or your allies kill living beings");
break;
case GOD_TROG:
likes.emplace_back("you or your god-given allies kill living beings");
break;
case GOD_YREDELEMNUL:
case GOD_KIKUBAAQUDGHA:
likes.emplace_back("you or your undead slaves kill living beings");
break;
case GOD_BEOGH:
likes.emplace_back("you or your allied orcs kill living beings");
break;
case GOD_OKAWARU:
case GOD_VEHUMET:
case GOD_DITHMENOS:
likes.emplace_back("you kill living beings");
break;
default:
break;
}
switch (which_god)
{
case GOD_ZIN:
likes.emplace_back("you or your allies kill unclean or chaotic beings");
break;
case GOD_SHINING_ONE:
likes.emplace_back("you or your allies kill living unholy or evil beings");
break;
default:
break;
}
switch (which_god)
{
case GOD_SHINING_ONE:
case GOD_MAKHLEB:
case GOD_LUGONU:
case GOD_QAZLAL:
case GOD_PAKELLAS:
likes.emplace_back("you or your allies kill the undead");
break;
case GOD_BEOGH:
likes.emplace_back("you or your allied orcs kill the undead");
break;
case GOD_OKAWARU:
case GOD_VEHUMET:
case GOD_DITHMENOS:
likes.emplace_back("you kill the undead");
break;
default:
break;
}
switch (which_god)
{
case GOD_SHINING_ONE:
case GOD_MAKHLEB:
case GOD_LUGONU:
case GOD_QAZLAL:
case GOD_PAKELLAS:
likes.emplace_back("you or your allies kill demons");
break;
case GOD_TROG:
likes.emplace_back("you or your god-given allies kill demons");
break;
case GOD_KIKUBAAQUDGHA:
likes.emplace_back("you or your undead slaves kill demons");
break;
case GOD_BEOGH:
likes.emplace_back("you or your allied orcs kill demons");
break;
case GOD_OKAWARU:
case GOD_VEHUMET:
case GOD_DITHMENOS:
likes.emplace_back("you kill demons");
break;
default:
break;
}
switch (which_god)
{
case GOD_YREDELEMNUL:
likes.emplace_back("you or your undead slaves kill artificial beings");
break;
default:
break;
}
switch (which_god)
{
case GOD_MAKHLEB:
case GOD_LUGONU:
case GOD_QAZLAL:
case GOD_PAKELLAS:
likes.emplace_back("you or your allies kill holy beings");
break;
case GOD_TROG:
likes.emplace_back("you or your god-given allies kill holy beings");
break;
case GOD_YREDELEMNUL:
likes.emplace_back("your undead slaves kill holy beings");
break;
case GOD_KIKUBAAQUDGHA:
likes.emplace_back("you or your undead slaves kill holy beings");
break;
case GOD_BEOGH:
likes.emplace_back("you or your allied orcs kill holy beings");
break;
case GOD_OKAWARU:
case GOD_VEHUMET:
case GOD_DITHMENOS:
likes.emplace_back("you kill holy beings");
break;
default:
break;
}
// Especially appreciated kills.
switch (which_god)
{
case GOD_YREDELEMNUL:
really_likes.emplace_back("you kill holy beings");
break;
case GOD_BEOGH:
really_likes.emplace_back("you kill the priests of other religions");
break;
case GOD_TROG:
really_likes.emplace_back("you kill wizards and other users of magic");
break;
case GOD_DITHMENOS:
really_likes.emplace_back("you kill beings that bring fire to the "
"dungeon");
break;
default:
break;
}
if (likes.empty() && really_likes.empty())
text += " doesn't like anything? This is a bug; please report it.";
else
{
text += " likes it when ";
text += comma_separated_line(likes.begin(), likes.end());
text += ".";
if (!really_likes.empty())
{
text += " ";
text += uppercase_first(god_name(which_god));
text += " especially likes it when ";
text += comma_separated_line(really_likes.begin(),
really_likes.end());
text += ".";
}
}
return text;
}
string get_god_dislikes(god_type which_god, bool /*verbose*/)
{
// Return early for the special cases.
if (which_god == GOD_NO_GOD || which_god == GOD_XOM)
return "";
string text;
vector<string> dislikes; // Piety loss
vector<string> really_dislikes; // Penance
if (god_hates_cannibalism(which_god))
really_dislikes.emplace_back("you perform cannibalism");
if (is_good_god(which_god))
{
really_dislikes.emplace_back("you desecrate holy remains");
if (which_god == GOD_SHINING_ONE)
really_dislikes.emplace_back("you drink blood");
else
dislikes.emplace_back("you drink blood");
really_dislikes.emplace_back("you use necromancy");
really_dislikes.emplace_back("you use unholy magic or items");
really_dislikes.emplace_back("you attack non-hostile holy beings");
really_dislikes.emplace_back("you or your allies kill non-hostile holy beings");
if (which_god == GOD_ZIN)
dislikes.emplace_back("you attack neutral beings");
else
really_dislikes.emplace_back("you attack neutral beings");
}
switch (which_god)
{
case GOD_ZIN: case GOD_SHINING_ONE: case GOD_ELYVILON:
case GOD_OKAWARU:
really_dislikes.emplace_back("you attack allies");
break;
case GOD_BEOGH:
really_dislikes.emplace_back("you attack allied orcs");
break;
case GOD_JIYVA:
really_dislikes.emplace_back("you attack fellow slimes");
break;
case GOD_FEDHAS:
dislikes.emplace_back("you or your allies destroy plants");
dislikes.emplace_back("allied flora die");
really_dislikes.emplace_back("you use necromancy on corpses, chunks or skeletons");
break;
case GOD_SIF_MUNA:
really_dislikes.emplace_back("you destroy spellbooks");
break;
case GOD_DITHMENOS:
dislikes.emplace_back("you use fiery magic or items");
break;
default:
break;
}
switch (which_god)
{
case GOD_ELYVILON:
dislikes.emplace_back("you allow allies to die");
break;
default:
break;
}
switch (which_god)
{
case GOD_ZIN:
dislikes.emplace_back("you deliberately mutate yourself");
really_dislikes.emplace_back("you transform yourself");
really_dislikes.emplace_back("you polymorph monsters");
really_dislikes.emplace_back("you use unclean or chaotic magic or items");
really_dislikes.emplace_back("you butcher sentient beings");
dislikes.emplace_back("you or your allies attack monsters in a "
"sanctuary");
break;
case GOD_SHINING_ONE:
really_dislikes.emplace_back("you poison monsters");
really_dislikes.emplace_back("you attack intelligent monsters in an "
"unchivalric manner");
break;
case GOD_ELYVILON:
really_dislikes.emplace_back("you kill living things while asking for "
"your life to be spared");
break;
case GOD_YREDELEMNUL:
really_dislikes.emplace_back("you use holy magic or items");
break;
case GOD_PAKELLAS:
really_dislikes.emplace_back("you channel magical energy");
break;
case GOD_TROG:
really_dislikes.emplace_back("you memorise spells");
really_dislikes.emplace_back("you attempt to cast spells");
really_dislikes.emplace_back("you train magic skills");
break;
case GOD_BEOGH:
really_dislikes.emplace_back("you desecrate orcish remains");
really_dislikes.emplace_back("you destroy orcish idols");
break;
case GOD_JIYVA:
really_dislikes.emplace_back("you kill slimes");
break;
case GOD_CHEIBRIADOS:
really_dislikes.emplace_back("you hasten yourself or others");
really_dislikes.emplace_back("use unnaturally quick items");
break;
default:
break;
}
if (dislikes.empty() && really_dislikes.empty())
return "";
if (!dislikes.empty())
{
text += uppercase_first(god_name(which_god));
text += " dislikes it when ";
text += comma_separated_line(dislikes.begin(), dislikes.end(),
" or ", ", ");
text += ".";
if (!really_dislikes.empty())
text += " ";
}
if (!really_dislikes.empty())
{
text += uppercase_first(god_name(which_god));
text += " strongly dislikes it when ";
text += comma_separated_line(really_dislikes.begin(),
really_dislikes.end(),
" or ", ", ");
text += ".";
}
return text;
}
bool active_penance(god_type god)
{
// Ashenzari's penance isn't active; Nemelex's penance is only active