LCOV - code coverage report
Current view: top level - omega-rpg-0.90-pa9 - priest.c (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 380 0.0 %
Date: 2017-08-31 19:31:11 Functions: 0 7 0.0 %
Branches: 0 190 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
       2                 :            : /* priest.c */
       3                 :            : /* functions for clerics. */
       4                 :            : 
       5                 :            : #include "glob.h"
       6                 :            : 
       7                 :            : /* prayer occurs at altars, hence name of function */
       8                 :          0 : void l_altar(void)
       9                 :            : {
      10                 :            :   int i,deity;
      11                 :            :   char response;
      12                 :            : 
      13         [ #  # ]:          0 :   if (Current_Environment == E_COUNTRYSIDE) deity = DRUID;
      14                 :          0 :   else deity = Level->site[Player.x][Player.y].aux;
      15                 :            : 
      16   [ #  #  #  #  :          0 :   switch(deity) {
                #  #  # ]
      17                 :            :     default:
      18                 :          0 :       print1("This rude altar has no markings.");
      19                 :          0 :       break;
      20                 :            :     case ODIN:
      21                 :          0 :       print1("This granite altar is graven with a gallows.");
      22                 :          0 :       break;
      23                 :            :     case SET:
      24                 :          0 :       print1("This sandstone altar has a black hand drawn on it.");
      25                 :          0 :       break;
      26                 :            :     case HECATE:
      27                 :          0 :       print1("This silver altar is inlaid with a black crescent moon.");
      28                 :          0 :       break;
      29                 :            :     case ATHENA:
      30                 :          0 :       print1("This golden altar is inscribed with an owl.");
      31                 :          0 :       break;
      32                 :            :     case DESTINY:
      33                 :          0 :       print1("This crystal altar is in the form of an omega.");
      34                 :          0 :       break;
      35                 :            :     case DRUID:
      36                 :          0 :       print1("This oaken altar is ornately engraved with leaves.");
      37                 :          0 :       break;
      38                 :            :   }
      39                 :          0 :   print2("Worship at this altar? [yn] ");
      40         [ #  # ]:          0 :   if (ynq2() == 'y') {
      41                 :            : 
      42                 :            : #ifdef INCLUDE_MONKS
      43         [ #  # ]:          0 :     if (Player.rank[MONKS] > 0)
      44                 :          0 :         print2("A monk seeks truth within.");
      45                 :            :     else
      46                 :            : #endif
      47         [ #  # ]:          0 :     if (Player.rank[PRIESTHOOD] == 0)
      48                 :          0 :       increase_priest_rank(deity);
      49         [ #  # ]:          0 :     else if (! check_sacrilege(deity)) {
      50         [ #  # ]:          0 :       if (Blessing) print1("You have a sense of immanence.");
      51                 :          0 :       print2("Request a Blessing, Sacrifice an item, or just Pray [b,s,p] ");
      52                 :          0 :       do response = (char) mcigetc();
      53         [ #  # ]:          0 :       while ((response != 'b') && 
      54         [ #  # ]:          0 :              (response != 's') && 
      55         [ #  # ]:          0 :              (response != 'p') && 
      56         [ #  # ]:          0 :              (response != ESCAPE));
      57         [ #  # ]:          0 :       if (response == 'b') {
      58                 :          0 :         print1("You beg a heavenly benefice.");
      59                 :          0 :         print2("You hear a gong resonating throughout eternity....");
      60                 :          0 :         morewait();
      61         [ #  # ]:          0 :         if (Blessing) {
      62                 :          0 :           print1("A shaft of lucent radiance lances down from the heavens!");
      63                 :          0 :           print2("You feel uplifted....");
      64                 :          0 :           morewait();
      65                 :          0 :           gain_experience(Player.rank[PRIESTHOOD]*Player.rank[PRIESTHOOD]*50);
      66                 :          0 :           cleanse(1);
      67                 :          0 :           heal(10);
      68                 :          0 :           bless(1);
      69                 :          0 :           Blessing = FALSE;
      70                 :          0 :           increase_priest_rank(deity);
      71                 :            :         }
      72                 :            :         else {
      73                 :          0 :           print1("Your ardent plea is ignored.");
      74                 :          0 :           print2("You feel ashamed.");
      75                 :          0 :           Player.xp -= (Player.xp/4);
      76                 :            :         }
      77                 :          0 :         calc_melee();
      78                 :            :       }
      79         [ #  # ]:          0 :       else if (response == 's') {
      80                 :          0 :         i = getitem_prompt("Sacrifice what? ", NULL_ITEM);
      81         [ #  # ]:          0 :         if (i==ABORT) i = 0;
      82         [ #  # ]:          0 :         if (Player.possessions[i] == NULL) {
      83                 :          0 :           print1("You have insulted your deity!");
      84                 :          0 :           print2("Not a good idea, as it turns out...");
      85                 :          0 :           dispel(-1);
      86                 :          0 :           p_damage(Player.hp-1,UNSTOPPABLE,"a god's pique");
      87                 :            :         }
      88         [ #  # ]:          0 :         else if (true_item_value(Player.possessions[i]) >
      89                 :          0 :                  (long) (Player.rank[PRIESTHOOD] *
      90                 :          0 :                   Player.rank[PRIESTHOOD] *
      91                 :          0 :                   Player.rank[PRIESTHOOD] * 50)) {
      92                 :          0 :           print1("With a burst of blue flame, your offering vanishes!");
      93                 :          0 :           dispose_lost_objects(1,Player.possessions[i]);
      94                 :          0 :           print2("A violet nimbus settles around your head and slowly fades.");
      95                 :          0 :           morewait();
      96                 :          0 :           Blessing = TRUE;
      97                 :            :         }
      98                 :            :         else {
      99                 :          0 :           print1("A darkling glow envelopes your offering!");
     100                 :          0 :           print2("The glow slowly fades....");
     101                 :          0 :           morewait();
     102                 :          0 :           setgamestatus(SUPPRESS_PRINTING);
     103         [ #  # ]:          0 :           if (Player.possessions[i]->used) {
     104                 :          0 :             Player.possessions[i]->used = FALSE;
     105                 :          0 :             item_use(Player.possessions[i]);
     106                 :          0 :             Player.possessions[i]->blessing =
     107                 :          0 :               -1 - abs(Player.possessions[i]->blessing);
     108                 :          0 :             Player.possessions[i]->used = TRUE;
     109                 :          0 :             item_use(Player.possessions[i]);
     110                 :            :           }
     111                 :          0 :           else Player.possessions[i]->blessing =
     112                 :          0 :             -1 - abs(Player.possessions[i]->blessing);
     113                 :          0 :           resetgamestatus(SUPPRESS_PRINTING);
     114                 :            :         }
     115                 :            :       }
     116         [ #  # ]:          0 :       else if (response == 'p') {
     117         [ #  # ]:          0 :         if (deity != Player.patron) 
     118                 :          0 :           print1("Nothing seems to happen.");
     119         [ #  # ]:          0 :         else if (!increase_priest_rank(deity))
     120                 :          0 :           answer_prayer();
     121                 :            :       }
     122                 :            :     }
     123                 :            :   }
     124                 :          0 : }
     125                 :            : 
     126                 :            : 
     127                 :          0 : int check_sacrilege(int deity)
     128                 :            : {
     129                 :          0 :   int i,sacrilege=FALSE;
     130 [ #  # ][ #  # ]:          0 :   if ((Player.patron != deity) && (Player.patron > 0)) {
     131                 :          0 :     sacrilege=TRUE;
     132                 :          0 :     Player.pow--;
     133                 :          0 :     Player.maxpow--;
     134   [ #  #  #  #  :          0 :     switch(Player.patron) {
                #  #  # ]
     135                 :            :     case ODIN:
     136                 :          0 :       print1("Odin notices your lack of faith! ");
     137                 :          0 :       morewait();
     138         [ #  # ]:          0 :       if (deity == ATHENA) {
     139                 :          0 :         print2("However, Athena intercedes on your behalf.");
     140                 :          0 :         sacrilege = FALSE;
     141                 :            :       }
     142                 :            :       else {
     143                 :          0 :         print2("You are struck by a thunderbolt!");
     144                 :          0 :         p_damage(Player.level*5,UNSTOPPABLE,"Odin's wrath");
     145         [ #  # ]:          0 :         if (Player.hp > 0) {
     146                 :          0 :           morewait();
     147                 :          0 :           print2("The bolt warps your feeble frame....");
     148                 :          0 :           Player.maxcon = Player.maxcon/2;
     149                 :          0 :           Player.con = min(Player.con,Player.maxcon);
     150                 :          0 :           Player.maxstr = Player.maxstr/2;
     151                 :          0 :           Player.con = min(Player.str,Player.maxstr);
     152                 :            :         }
     153                 :            :       }
     154                 :          0 :       morewait();
     155                 :          0 :       break;
     156                 :            :     case SET:
     157                 :          0 :       print1("Set notices your lack of faith! ");
     158                 :          0 :       morewait();
     159         [ #  # ]:          0 :       if (deity == HECATE) {
     160                 :          0 :         print1("But since you pray to a friendly deity,");
     161                 :          0 :         print2("Set decides not to punish you.");
     162                 :          0 :         sacrilege = FALSE;
     163                 :            :       }
     164                 :            :       else {
     165                 :          0 :         print2("You are blasted by a shaft of black fire!");
     166                 :          0 :         p_damage(Player.level*5,UNSTOPPABLE,"Set's anger");
     167         [ #  # ]:          0 :         if (Player.hp > 0) {
     168                 :          0 :           morewait();
     169                 :          0 :           print1("You are wreathed in clouds of smoke.");
     170         [ #  # ]:          0 :           for(i=0;i<MAXITEMS;i++) 
     171 [ #  # ][ #  # ]:          0 :             if ((Player.possessions[i] != NULL) &&
     172                 :          0 :                 (Player.possessions[i]->blessing > -1))
     173                 :          0 :               conform_lost_object(Player.possessions[i]);
     174                 :          0 :           morewait();
     175                 :          0 :           print2("You feel Set's Black Hand on your heart....");
     176                 :          0 :           Player.con = Player.maxcon = Player.maxcon / 4;
     177                 :            :         }
     178                 :            :       }
     179                 :          0 :       morewait();
     180                 :          0 :       break;
     181                 :            :     case HECATE:
     182                 :          0 :       print1("Hecate notices your lack of faith! ");
     183                 :          0 :       morewait();
     184         [ #  # ]:          0 :       if (deity == SET) {
     185                 :          0 :         print1("But ignores the affront since she likes Set.");
     186                 :          0 :         sacrilege = FALSE;
     187                 :            :       }
     188                 :            :       else {
     189                 :          0 :         print1("You are zapped by dark moonbeams!");
     190                 :          0 :         p_damage(Player.level*5,UNSTOPPABLE,"Hecate's malice");
     191         [ #  # ]:          0 :         if (Player.hp > 0) {
     192                 :          0 :           print2("The beams leach you of magical power!");
     193                 :          0 :           Player.maxpow = Player.maxpow/5;
     194                 :          0 :           Player.pow = min(Player.pow,Player.maxpow);
     195         [ #  # ]:          0 :           for(i=0;i<NUMSPELLS;i++) 
     196                 :          0 :             Spells[i].known = FALSE;
     197                 :            :         }
     198                 :            :       }
     199                 :          0 :       morewait();
     200                 :          0 :       break;
     201                 :            :     case ATHENA:
     202                 :          0 :       print1("Athena notices your lack of faith! ");
     203                 :          0 :       morewait();
     204         [ #  # ]:          0 :       if (deity == ODIN) {
     205                 :          0 :         print2("But lets you off this time since Odin is also Lawful.");
     206                 :          0 :         sacrilege = FALSE;
     207                 :            :       }
     208                 :            :       else {
     209                 :          0 :         print2("You are zorched by godsfire!");
     210         [ #  # ]:          0 :         if (Player.hp > 0) {
     211                 :          0 :           morewait();
     212                 :          0 :           print1("The fire burns away your worldly experience!");
     213                 :          0 :                 Player.level = 0;
     214                 :          0 :           Player.xp = 0;
     215                 :          0 :           Player.maxhp = Player.hp = Player.con;
     216                 :          0 :           print2("Your power is reduced by the blast!!!");
     217                 :          0 :           Player.pow = Player.maxpow = Player.maxpow/3;
     218         [ #  # ]:          0 :           Player.mana = min(Player.mana,calcmana());
     219                 :            :         }
     220                 :            :       }
     221                 :          0 :       morewait();
     222                 :          0 :       break;
     223                 :            :     case DESTINY:
     224                 :          0 :       print2("The Lords of Destiny ignore your lack of faith.");
     225                 :          0 :       sacrilege = FALSE;
     226                 :          0 :       morewait();
     227                 :          0 :       break;
     228                 :            :     case DRUID:
     229                 :          0 :       print2("Your treachery to the ArchDruid has been noted.");
     230         [ #  # ]:          0 :       if (random_range(2) == 1)
     231                 :          0 :         Player.alignment += 40;
     232                 :          0 :       else Player.alignment -= 40;
     233                 :          0 :       morewait();
     234                 :          0 :       break;
     235                 :            :     }
     236         [ #  # ]:          0 :     if (sacrilege) {
     237                 :          0 :       Player.patron = 0;
     238                 :          0 :       Player.rank[PRIESTHOOD] = 0;
     239                 :            :     }
     240                 :            :   }
     241                 :          0 :   return(sacrilege);
     242                 :            : }
     243                 :            : 
     244                 :          0 : int increase_priest_rank(int deity)
     245                 :            : {
     246 [ #  # ][ #  #  :          0 :   if (Player.rank[PRIESTHOOD] == 0) switch(deity) {
             #  #  #  #  
                      # ]
     247                 :            :   default:
     248                 :          0 :     print2("Some nameless god blesses you....");
     249                 :          0 :     Player.hp = max(Player.hp, Player.maxhp);
     250                 :          0 :     morewait();
     251                 :          0 :     print2("The altar crumbles to dust and blows away.");
     252                 :          0 :     Level->site[Player.x][Player.y].locchar = FLOOR;
     253                 :          0 :     Level->site[Player.x][Player.y].p_locf = L_NO_OP;
     254                 :          0 :     lset(Player.x, Player.y, CHANGED);
     255                 :          0 :     break;
     256                 :            :   case ODIN:
     257         [ #  # ]:          0 :     if (Player.alignment > 0) {
     258                 :          0 :       print1("Odin hears your prayer!");
     259                 :          0 :       print2(Priest[ODIN]);
     260                 :          0 :       nprint2(" personally blesses you.");
     261                 :          0 :       nprint2(" You are now a lay devotee of Odin.");
     262                 :          0 :       Player.patron = ODIN;
     263                 :          0 :       Player.rank[PRIESTHOOD] = LAY;
     264                 :          0 :       Player.guildxp[PRIESTHOOD] = 1;
     265                 :            :       /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     266                 :            :       /* morewait(); */
     267                 :          0 :       learnclericalspells(ODIN,LAY);
     268                 :            :     }
     269                 :          0 :     else print1("Odin ignores you.");
     270                 :          0 :     break;
     271                 :            :   case SET:
     272         [ #  # ]:          0 :     if (Player.alignment < 0) {
     273                 :          0 :       print1("Set hears your prayer!");
     274                 :          0 :       print2(Priest[SET]);
     275                 :          0 :       nprint2(" personally blesses you. ");
     276                 :          0 :       nprint2(" You are now a lay devotee of Set.");
     277                 :          0 :       Player.patron = SET;
     278                 :          0 :       Player.rank[PRIESTHOOD] = LAY;
     279                 :          0 :       Player.guildxp[PRIESTHOOD] = 1;
     280                 :            :       /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     281                 :            :       /* morewait(); */
     282                 :          0 :       learnclericalspells(SET,LAY);
     283                 :            :     }
     284                 :          0 :     else print1("Set ignores you.");
     285                 :          0 :     break;
     286                 :            :   case ATHENA:
     287         [ #  # ]:          0 :     if (Player.alignment > 0) {
     288                 :          0 :       print1("Athena hears your prayer!");
     289                 :          0 :       print2(Priest[ATHENA]);
     290                 :          0 :       nprint2(" personally blesses you.");
     291                 :          0 :       nprint2(" You are now a lay devotee of Athena.");
     292                 :          0 :       Player.patron = ATHENA;
     293                 :          0 :       Player.rank[PRIESTHOOD] = LAY;
     294                 :          0 :       Player.guildxp[PRIESTHOOD] = 1;
     295                 :            :       /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     296                 :            :       /* morewait(); */
     297                 :          0 :       learnclericalspells(ATHENA,LAY);
     298                 :            :     }
     299                 :          0 :     else print1("Athena ignores you.");
     300                 :          0 :     break;
     301                 :            :   case HECATE:
     302         [ #  # ]:          0 :     if (Player.alignment < 0) {
     303                 :          0 :       print1("Hecate hears your prayer!");
     304                 :          0 :       print2(Priest[HECATE]);
     305                 :          0 :       nprint2(" personally blesses you.");
     306                 :          0 :       nprint2(" You are now a lay devotee of Hecate.");
     307                 :          0 :       Player.patron = HECATE;
     308                 :          0 :       Player.rank[PRIESTHOOD] = LAY;
     309                 :          0 :       Player.guildxp[PRIESTHOOD] = 1;
     310                 :            :       /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     311                 :            :       /* morewait(); */
     312                 :          0 :       learnclericalspells(HECATE,LAY);
     313                 :            :     }
     314                 :          0 :     else print1("Hecate ignores you.");
     315                 :          0 :     break;
     316                 :            :   case DRUID:
     317 [ #  # ][ #  # ]:          0 :     if (abs(Player.alignment) < 10) {
     318                 :          0 :       print1(Priest[DRUID]);
     319                 :          0 :       nprint1(" personally blesses you.");
     320                 :          0 :       print2("You are now a lay devotee of the Druids.");
     321                 :          0 :       Player.patron = DRUID;
     322                 :          0 :       Player.rank[PRIESTHOOD] = LAY;
     323                 :          0 :       Player.guildxp[PRIESTHOOD] = 1;
     324                 :            :       /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     325                 :            :       /* morewait(); */
     326                 :          0 :       learnclericalspells(DRUID,LAY);
     327                 :            :     }
     328                 :            :     else {
     329                 :          0 :       print1("You hear a voice....");
     330                 :          0 :       morewait();
     331                 :          0 :       print2("'Only those who embody the Balance may become Druids.'");
     332                 :            :     }
     333                 :          0 :     break;
     334                 :            :   case DESTINY:
     335                 :          0 :     print1("The Lords of Destiny could hardly care less.");
     336                 :          0 :     print2("But you can consider yourself now to be a lay devotee.");
     337                 :          0 :     Player.patron = DESTINY;
     338                 :          0 :     Player.rank[PRIESTHOOD] = LAY;
     339                 :          0 :       Player.guildxp[PRIESTHOOD] = 1;
     340                 :          0 :     break;
     341                 :            :   }
     342         [ #  # ]:          0 :   else if (deity == Player.patron) {
     343 [ #  # ][ #  # ]:          0 :     if ((((deity == ODIN) || (deity == ATHENA)) && 
                 [ #  # ]
     344         [ #  # ]:          0 :          (Player.alignment < 1)) ||
     345 [ #  # ][ #  # ]:          0 :         (((deity == SET) || (deity == HECATE)) && 
     346         [ #  # ]:          0 :          (Player.alignment > 1)) ||
     347         [ #  # ]:          0 :         ((deity == DRUID) && (abs(Player.alignment) > 10))) {
     348                 :          0 :       print1("You have swerved from the One True Path!");
     349                 :          0 :       print2("Your deity is greatly displeased...");
     350                 :          0 :       Player.xp -= Player.level*Player.level;
     351                 :          0 :       Player.xp = max(0,Player.xp);
     352                 :            :     }
     353         [ #  # ]:          0 :     else if (Player.rank[PRIESTHOOD]== HIGHPRIEST) return 0;
     354         [ #  # ]:          0 :     else if (Player.rank[PRIESTHOOD]== SPRIEST) {
     355         [ #  # ]:          0 :       if (Player.level > Priestlevel[deity])
     356                 :          0 :         hp_req_test();
     357                 :          0 :       else return 0;
     358                 :            :     }
     359         [ #  # ]:          0 :     else if (Player.rank[PRIESTHOOD]==PRIEST) {
     360         [ #  # ]:          0 :       if (Player.guildxp[PRIESTHOOD] >= 4000) {
     361                 :          0 :         print1("An heavenly fanfare surrounds you!");
     362                 :          0 :         print2("Your deity raises you to the post of Senior Priest.");
     363                 :          0 :         hp_req_print();
     364                 :          0 :         Player.rank[PRIESTHOOD] = SPRIEST;
     365                 :            :         /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     366                 :            :         /* morewait(); */
     367                 :          0 :         learnclericalspells(deity,SPRIEST);
     368                 :            :       }
     369                 :          0 :       else return 0;
     370                 :            :     }
     371         [ #  # ]:          0 :     else if (Player.rank[PRIESTHOOD]==ACOLYTE) {
     372         [ #  # ]:          0 :       if (Player.guildxp[PRIESTHOOD] >= 1500) {
     373                 :          0 :         print1("A trumpet sounds in the distance.");
     374                 :          0 :         print2("Your deity raises you to the post of Priest.");
     375                 :          0 :         Player.rank[PRIESTHOOD] = PRIEST;
     376                 :            :         /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     377                 :            :         /* morewait(); */
     378                 :          0 :         learnclericalspells(deity,PRIEST);
     379                 :            :       }
     380                 :          0 :       else return 0;
     381                 :            :     }
     382         [ #  # ]:          0 :     else if (Player.rank[PRIESTHOOD]==LAY) {
     383         [ #  # ]:          0 :       if (Player.guildxp[PRIESTHOOD] >= 400) {
     384                 :          0 :         print1("A mellifluous chime sounds from above the altar.");
     385                 :          0 :         print2("Your deity raises you to the post of Acolyte.");
     386                 :          0 :         Player.rank[PRIESTHOOD] = ACOLYTE;
     387                 :            :         /* DAG learnclericalspells() starts with mprint() so don't need morewait */
     388                 :            :         /* morewait(); */
     389                 :          0 :         learnclericalspells(deity,ACOLYTE);
     390                 :            :       }
     391                 :          0 :       else return 0;
     392                 :            :     }
     393                 :            :   }
     394                 :          0 :   return 1;
     395                 :            : }
     396                 :            : 
     397                 :            : 
     398                 :          0 : void answer_prayer(void)
     399                 :            : {
     400                 :          0 :   clearmsg();
     401   [ #  #  #  # ]:          0 :   switch(random_range(12)) {
     402                 :          0 :   case 0: print1("You have a revelation!"); break;
     403                 :          0 :   case 1: print1("You feel pious."); break;
     404                 :          0 :   case 2: print1("A feeling of sanctity comes over you."); break;
     405                 :          0 :   default: print1("Nothing unusual seems to happen."); break;
     406                 :            :   }
     407                 :          0 : }
     408                 :            : 
     409                 :            : 
     410                 :          0 : void hp_req_test(void)
     411                 :            : {
     412                 :            :   pob o;
     413   [ #  #  #  #  :          0 :   switch  (Player.patron) {
                #  #  # ]
     414                 :            :   case ODIN:
     415         [ #  # ]:          0 :     if (find_item(&o,OB_SYMBOL_SET,-1))
     416                 :          0 :       make_hp(o);
     417                 :          0 :     else hp_req_print();
     418                 :          0 :     break;
     419                 :            :   case SET:
     420         [ #  # ]:          0 :     if (find_item(&o,OB_SYMBOL_ODIN,-1))
     421                 :          0 :       make_hp(o);
     422                 :          0 :     else hp_req_print();
     423                 :          0 :     break;
     424                 :            :   case ATHENA:
     425         [ #  # ]:          0 :     if (find_item(&o,OB_SYMBOL_HECATE,-1))
     426                 :          0 :       make_hp(o);
     427                 :          0 :     else hp_req_print();
     428                 :          0 :     break;
     429                 :            :   case HECATE:
     430         [ #  # ]:          0 :     if (find_item(&o,OB_SYMBOL_ATHENA,-1))
     431                 :          0 :       make_hp(o);
     432                 :          0 :     else hp_req_print();
     433                 :          0 :     break;
     434                 :            :   case DRUID:
     435         [ #  # ]:          0 :     if (find_item(&o,OB_SYMBOL_ODIN,-1))
     436                 :          0 :       make_hp(o);
     437         [ #  # ]:          0 :     else if (find_item(&o,OB_SYMBOL_SET,-1))
     438                 :          0 :       make_hp(o);
     439         [ #  # ]:          0 :     else if (find_item(&o,OB_SYMBOL_ATHENA,-1))
     440                 :          0 :       make_hp(o);
     441         [ #  # ]:          0 :     else if (find_item(&o,OB_SYMBOL_HECATE,-1))
     442                 :          0 :       make_hp(o);
     443                 :          0 :     else hp_req_print();
     444                 :          0 :     break;
     445                 :            :   case DESTINY:
     446         [ #  # ]:          0 :     if (find_item(&o,OB_SYMBOL_DESTINY,-1))
     447                 :          0 :       make_hp(o);
     448                 :          0 :     else hp_req_print();
     449                 :          0 :     break;
     450                 :            :   }
     451                 :          0 : }
     452                 :            : 
     453                 :            : 
     454                 :          0 : void hp_req_print(void)
     455                 :            : {
     456                 :          0 :   morewait();
     457                 :          0 :   print1("To advance further, you must obtain the Holy Symbol of ");
     458   [ #  #  #  #  :          0 :   switch(Player.patron) {
                #  #  # ]
     459                 :            :   case ODIN:
     460                 :          0 :     nprint1(Priest[SET]);
     461                 :          0 :     print2("who may be found in the main Temple of Set.");
     462                 :          0 :     break;
     463                 :            :   case SET:
     464                 :          0 :     nprint1(Priest[ODIN]);
     465                 :          0 :     print2("who may be found in the main Temple of Odin.");
     466                 :          0 :     break;
     467                 :            :   case ATHENA:
     468                 :          0 :     nprint1(Priest[HECATE]);
     469                 :          0 :     print2("who may be found in the main Temple of Hecate.");
     470                 :          0 :     break;
     471                 :            :   case HECATE:
     472                 :          0 :     nprint1(Priest[ATHENA]);
     473                 :          0 :     print2("who may be found in the main Temple of Athena.");
     474                 :          0 :     break;
     475                 :            :   case DRUID:
     476                 :          0 :     print2("any of the aligned priests who may be found in their main Temples.");
     477                 :          0 :     break;
     478                 :            :   case DESTINY:
     479                 :          0 :     nprint1(Priest[DESTINY]);
     480                 :          0 :     print2("who may be found in the main Temple of Destiny.");
     481                 :          0 :     break;
     482                 :            :   }
     483                 :          0 : }
     484                 :            : 
     485                 :          0 : void make_hp(pob o)
     486                 :            : {
     487                 :          0 :   print1("A full-scale heavenly choir chants 'Hallelujah' all around you!");
     488                 :          0 :   print2("You notice a change in the symbol you carry....");
     489   [ #  #  #  #  :          0 :   switch(Player.patron) {
                #  #  # ]
     490                 :            :   case ODIN:
     491                 :          0 :     *o = Objects[OB_SYMBOL_ODIN];
     492                 :          0 :     break;
     493                 :            :   case SET:
     494                 :          0 :     *o = Objects[OB_SYMBOL_SET];
     495                 :          0 :     break;
     496                 :            :   case ATHENA:
     497                 :          0 :     *o = Objects[OB_SYMBOL_ATHENA];
     498                 :          0 :     break;
     499                 :            :   case HECATE:
     500                 :          0 :     *o = Objects[OB_SYMBOL_HECATE];
     501                 :          0 :     break;
     502                 :            :   case DRUID:
     503                 :          0 :     *o = Objects[OB_SYMBOL_DRUID];
     504                 :          0 :     break;
     505                 :            :   case DESTINY:
     506                 :          0 :     *o = Objects[OB_SYMBOL_DESTINY];
     507                 :          0 :     break;
     508                 :            :   }
     509                 :          0 :   o->known = 2;
     510                 :          0 :   o->charge = 17; /* random hack to convey bit that symbol is functional */
     511                 :          0 :   morewait();
     512         [ #  # ]:          0 :   if (Player.patron == DRUID)
     513                 :          0 :     print1("Your deity raises you to the post of ArchDruid!");
     514                 :          0 :   else print1("Your deity raises you to the post of High Priest!");
     515                 :          0 :   print2("You feel holy.");
     516                 :          0 :   strcpy(Priest[Player.patron],Player.name);
     517                 :          0 :   Priestlevel[Player.patron] = Player.level;
     518                 :          0 :   Player.rank[PRIESTHOOD] = HIGHPRIEST;
     519                 :          0 :   morewait();
     520                 :          0 :   Priestbehavior[Player.patron] = fixnpc(4);
     521                 :          0 :   save_hiscore_npc(Player.patron);
     522                 :          0 :   learnclericalspells(Player.patron,HIGHPRIEST);
     523                 :          0 : }

Generated by: LCOV version 1.11