LCOV - code coverage report
Current view: top level - omega-rpg-0.90-pa9 - mtalk.c (source / functions) Hit Total Coverage
Test: lcov.info Lines: 52 538 9.7 %
Date: 2017-08-31 19:31:11 Functions: 5 34 14.7 %
Branches: 21 219 9.6 %

           Branch data     Line data    Source code
       1                 :            : /* omega copyright (c) 1987,1988,1989 by Laurence Raphael Brothers */
       2                 :            : /* mtalk.c */
       3                 :            : /* monster talk functions */
       4                 :            : 
       5                 :            : #include "glob.h"
       6                 :            : 
       7                 :            : 
       8                 :            : /* The druid's altar is in the northern forest */
       9                 :          0 : void m_talk_druid(pmt m)
      10                 :            : {
      11                 :            :   int i;
      12                 :            :   pml curr;
      13                 :            : 
      14         [ #  # ]:          0 :   if (! m_statusp(m,HOSTILE)) {
      15                 :          0 :     print1("The Archdruid raises a hand in greeting.");
      16         [ #  # ]:          0 :     if (! gamestatusp(SPOKE_TO_DRUID)) {
      17                 :          0 :       setgamestatus(SPOKE_TO_DRUID);
      18                 :          0 :       morewait();
      19                 :          0 :       print1("The Archdruid congratulates you on reaching his sanctum.");
      20                 :          0 :       print2("You feel competent.");
      21                 :            :       /* DAG gain_experience starts with a morewait as well... */
      22                 :            :       /* morewait(); */
      23                 :          0 :       gain_experience(300);
      24         [ #  # ]:          0 :       if (Player.patron == DRUID) {
      25                 :          0 :         print1("The Archdruid conveys to you the wisdom of nature....");
      26                 :          0 :         print2("You feel like a sage.");
      27                 :          0 :         morewait();
      28         [ #  # ]:          0 :         for(i=0;i<NUMRANKS;i++) {
      29         [ #  # ]:          0 :           if (Player.guildxp[i] > 0)
      30                 :          0 :             Player.guildxp[i] += 300;
      31                 :            :         }
      32                 :            :       }
      33                 :            :     }
      34                 :          0 :     mprint("Do you request a ritual of neutralization? [yn] ");
      35         [ #  # ]:          0 :     if (ynq() == 'y') {
      36 [ #  # ][ #  # ]:          0 :       if (Phase/2 == 6 || Phase/2 == 0) {       /* full or new moon */
      37                 :          0 :         mprint("\"Unfortunately, I cannot perform a ritual of balance on");
      38         [ #  # ]:          0 :         if (Phase/2 == 6)
      39                 :          0 :           mprint("this lawful day.\"");
      40                 :            :         else
      41                 :          0 :           mprint("this chaotic day.\"");
      42                 :            :       }
      43 [ #  # ][ #  # ]:          0 :       else if (Phase/2 == 3 || Phase/2 == 9) {  /* half moon */
      44                 :          0 :         mprint("You take part in today's holy celebration of balance...");
      45                 :          0 :         Player.alignment = 0;
      46                 :          0 :         Player.mana = calcmana();
      47         [ #  # ]:          0 :         if (Player.patron == DRUID)
      48                 :          0 :           gain_experience(200); /* if a druid wants to spend 2 days */
      49                 :          0 :         Time+=60;               /* celebrating for 1600 xp, why not? */
      50                 :          0 :         hourly_check();
      51                 :          0 :         Time+=60;
      52                 :          0 :         hourly_check();
      53                 :          0 :         Time+=60;
      54                 :          0 :         hourly_check();
      55                 :          0 :         Time+=60;
      56                 :          0 :         hourly_check();
      57                 :          0 :         Time+=60;
      58                 :          0 :         hourly_check();
      59                 :          0 :         Time+=60;
      60                 :          0 :         hourly_check();
      61                 :            :       }
      62                 :            :       else {
      63                 :          0 :         mprint("The ArchDruid conducts a sacred rite of balance...");
      64         [ #  # ]:          0 :         if (Player.patron == DRUID) {
      65                 :          0 :           Player.alignment = 0;
      66                 :          0 :           Player.mana = calcmana();
      67                 :            :         }
      68                 :            :         else
      69                 :          0 :           Player.alignment -= Player.alignment*max(0, 10 - Player.level)/10;
      70                 :            :           /* the higher level the character is, the more set in his/her ways */
      71                 :          0 :         Time+=60;
      72                 :          0 :         hourly_check();
      73                 :            :       }
      74                 :          0 :       dataprint();
      75                 :            :     }
      76                 :            :   }
      77                 :            :   else {
      78                 :          0 :     mprint("The ArchDruid looks at you and cries: 'Unclean! Unclean!'");
      79                 :          0 :     disrupt(Player.x,Player.y,100);
      80                 :          0 :     mprint("This seems to have satiated his desire for vengeance.");
      81                 :          0 :     mprint("'Have you learned your lesson?' The ArchDruid asks. [yn] ");
      82                 :            :     /* WDT: this didn't used to have a 'y'.  I'm not sure what was
      83                 :            :      * intended. */
      84         [ #  # ]:          0 :     if (ynq() != 'n') {
      85                 :          0 :       mprint("'I certainly hope so!' says the ArchDruid.");
      86         [ #  # ]:          0 :       for (curr = Level->mlist; curr; curr = curr->next)
      87                 :          0 :         m_status_reset(curr->m, HOSTILE);
      88                 :          0 :       m_vanish(m);
      89                 :            :     }
      90                 :            :     else {
      91                 :          0 :       mprint("'Idiot.' mutters the ArchDruid.");
      92                 :          0 :       p_damage(500,UNSTOPPABLE,"the ArchDruid's Vengeance");
      93                 :            :     }
      94                 :            :   }
      95                 :          0 : }
      96                 :            : 
      97                 :            : 
      98                 :          0 : void m_talk_silent(pmt m)
      99                 :            : {
     100                 :            : #ifdef NEW_QUOTES
     101                 :          0 :   int reply = random_range(8);
     102                 :            : #else
     103                 :            :   int reply = random_range(4);
     104                 :            : #endif  
     105         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     106                 :          0 :     strcpy(Str2,"The ");
     107                 :          0 :     strcat(Str2,m->monstring);
     108                 :            :   }
     109                 :          0 :   else strcpy(Str2,m->monstring);
     110   [ #  #  #  #  :          0 :   switch (reply) {
             #  #  #  #  
                      # ]
     111                 :          0 :     case 0:strcat(Str2," does not reply. "); break;
     112                 :          0 :     case 1:strcat(Str2," shrugs silently. "); break;
     113                 :          0 :     case 2:strcat(Str2," holds a finger to his mouth. "); break;
     114                 :          0 :     case 3:strcat(Str2," glares at you but says nothing. "); break;
     115                 :          0 :     case 4:strcat(Str2," is not going to answer you. "); break;
     116                 :          0 :     case 5:strcat(Str2," has taken a vow of silence. "); break;
     117                 :          0 :     case 6:strcat(Str2," attempts sign language. "); break;
     118                 :          0 :     case 7:strcat(Str2," fails to respond."); break;
     119                 :            :   }      
     120                 :          0 :   mprint(Str2);
     121                 :          0 : }
     122                 :            : 
     123                 :          0 : void m_talk_stupid(pmt m)
     124                 :            : {
     125                 :            : 
     126                 :          0 :   int reply = random_range(4);
     127         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     128                 :          0 :     strcpy(Str2,"The ");
     129                 :          0 :     strcat(Str2,m->monstring);
     130                 :            :   }
     131                 :          0 :   else strcpy(Str2,m->monstring);
     132   [ #  #  #  #  :          0 :   switch (reply) {
                      # ]
     133                 :          0 :     case 0:strcat(Str2," looks at you with mute incomprehension."); break;
     134                 :          0 :     case 1:strcat(Str2," growls menacingly and ignores you."); break;
     135                 :          0 :     case 2:strcat(Str2," does not seem to have heard you."); break;
     136                 :          0 :     case 3:strcat(Str2," tries to pretend it didn't hear you."); break;
     137                 :            :   }      
     138                 :          0 :   mprint(Str2);
     139                 :          0 : }
     140                 :            : 
     141                 :          0 : void m_talk_greedy(pmt m)
     142                 :            : {
     143                 :            : 
     144                 :          0 :   int reply = random_range(4);
     145         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     146                 :          0 :     strcpy(Str2,"The ");
     147                 :          0 :     strcat(Str2,m->monstring);
     148                 :            :   }
     149                 :          0 :   else strcpy(Str2,m->monstring);
     150   [ #  #  #  #  :          0 :   switch (reply) {
                      # ]
     151                 :          0 :     case 0:strcat(Str2," says: Give me a treasure.... ");break;
     152                 :          0 :     case 1:strcat(Str2," says: Stand and deliver, knave! "); break;
     153                 :          0 :     case 2:strcat(Str2," says: Your money or your life! "); break;
     154                 :          0 :     case 3:strcat(Str2," says: Yield or Die! "); break;
     155                 :            :   }      
     156                 :          0 :   mprint(Str2);
     157                 :          0 : }
     158                 :            : 
     159                 :          0 : void m_talk_hungry(pmt m)
     160                 :            : {
     161                 :            : 
     162                 :          0 :   int reply = random_range(4);
     163         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     164                 :          0 :     strcpy(Str2,"The ");
     165                 :          0 :     strcat(Str2,m->monstring);
     166                 :            :   }
     167                 :          0 :   else strcpy(Str2,m->monstring);
     168   [ #  #  #  #  :          0 :   switch (reply) {
                      # ]
     169                 :          0 :     case 0:strcat(Str2," says: I hunger, foolish adventurer! "); break;
     170                 :          0 :     case 1:strcat(Str2," drools menacingly at you. "); break;
     171                 :          0 :     case 2:strcat(Str2," says: You're invited to be lunch! "); break;
     172                 :          0 :     case 3:strcat(Str2," says: Feeed Meee! "); break;
     173                 :            :   }      
     174                 :          0 :   mprint(Str2);
     175                 :          0 : }
     176                 :            : 
     177                 :            : 
     178                 :          5 : void m_talk_guard(pmt m)
     179                 :            : {
     180         [ -  + ]:          5 :   if (m_statusp(m,HOSTILE)) {
     181                 :          0 :     print1("'Surrender in the name of the Law!'");
     182                 :          0 :     print2("Do it? [yn] ");
     183         [ #  # ]:          0 :     if (ynq2()=='y') {
     184                 :          0 :       Player.alignment++;
     185         [ #  # ]:          0 :       if (Current_Environment == E_CITY) {
     186                 :          0 :         print1("Go directly to jail. Do not pass go, do not collect 200Au.");
     187                 :          0 :         print2("You are taken to the city gaol.");
     188                 :          0 :         morewait();
     189                 :          0 :         send_to_jail();
     190                 :          0 :         drawvision(Player.x,Player.y);
     191                 :            :       }
     192                 :            :       else {
     193                 :          0 :         clearmsg();
     194                 :          0 :         print1("Mollified, the guard disarms you and sends you away.");
     195                 :          0 :         dispose_lost_objects(1,Player.possessions[O_WEAPON_HAND]);
     196                 :          0 :         pacify_guards();
     197                 :            :       }
     198                 :            :     }
     199                 :            :     else {
     200                 :          0 :       clearmsg();
     201                 :          0 :       print1("All right, you criminal scum, you asked for it!");
     202                 :            :     }
     203                 :            :   }
     204                 :            :   else /* not hostile */
     205                 :            :   { 
     206 [ -  + ][ #  # ]:          5 :     if ( (!CitySiteList[L_TOURIST-CITYSITEBASE][0]) &&
     207                 :          0 :          (Current_Environment == E_CITY) )
     208                 :            :     {
     209                 :          0 :       print1("You should visit the tourist information booth and get their guidebook.");
     210                 :          0 :       print2("The booth is located near the entrance to the city.");
     211                 :          0 :       morewait();
     212                 :          0 :       CitySiteList[L_TOURIST-CITYSITEBASE][0] = TRUE;
     213                 :            :     } 
     214                 :            :     else
     215         [ -  + ]:          5 :       if (Player.rank[ORDER]>0) 
     216                 :          0 :         print1("'Greetings comrade! May you always tread the paths of Law.'");
     217                 :            : #ifdef NEW_QUOTES
     218                 :            :       else {
     219         [ +  + ]:          5 :         if (random_range(2))
     220                 :          3 :           print1("Move it right along, stranger!");
     221                 :          2 :         else print1("Nothing to see here.");
     222                 :            :       }
     223                 :            : #else
     224                 :            :       else print1("Move it right along, stranger!");
     225                 :            : #endif
     226                 :            :   }
     227                 :          5 : }
     228                 :            : 
     229                 :            : 
     230                 :          2 : void m_talk_mp(pmt m)
     231                 :            : {
     232                 :          2 :   mprint("The mendicant priest asks you to spare some treasure for the needy");
     233                 :          2 : }
     234                 :            : 
     235                 :            : 
     236                 :          0 : void m_talk_titter(pmt m)
     237                 :            : {
     238                 :            : 
     239         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     240                 :          0 :     strcpy(Str2,"The ");
     241                 :          0 :     strcat(Str2,m->monstring);
     242                 :            :   }
     243                 :          0 :   else strcpy(Str2,m->monstring);
     244                 :          0 :   strcat(Str2," titters obscenely at you.");
     245                 :          0 :   mprint(Str2);
     246                 :          0 : }
     247                 :            : 
     248                 :            : 
     249                 :          0 : void m_talk_ninja(pmt m)
     250                 :            : {
     251                 :          0 :   mprint("The black-garbed figure says apologetically:");
     252                 :          0 :   mprint("'Situree simasita, wakarimasen.'");
     253                 :          0 : }
     254                 :            : 
     255                 :            : 
     256                 :            : 
     257                 :            : 
     258                 :          0 : void m_talk_thief(pmt m)
     259                 :            : {
     260         [ #  # ]:          0 :   if (Player.rank[THIEVES]) {
     261         [ #  # ]:          0 :     if (m->level == 2) 
     262                 :          0 :       m->monstring = "sneak thief";
     263                 :          0 :     else m->monstring = "master thief";
     264                 :          0 :     print1("The cloaked figure makes a gesture which you recognize...");
     265                 :          0 :     print2("...the thieves' guild recognition signal!");
     266                 :          0 :     print3("'Sorry, mate, thought you were a mark....'");
     267                 :          0 :     morewait();
     268                 :          0 :     m_vanish(m);
     269                 :            :   }
     270                 :          0 :   else m_talk_man(m);
     271                 :            : 
     272                 :          0 : }
     273                 :            : 
     274                 :            : 
     275                 :            : 
     276                 :          0 : void m_talk_assassin(pmt m)
     277                 :            : {
     278                 :          0 :   m->monstring = "master assassin";
     279                 :          0 :   print1("The ominous figure does not reply, but hands you an embossed card:");
     280                 :          0 :   print2("'Guild of Assassins Ops are forbidden to converse with targets.'");
     281                 :          0 : }
     282                 :            :     
     283                 :            : 
     284                 :          0 : void m_talk_im(pmt m)
     285                 :            : {
     286                 :            :   pol tmp;
     287                 :            : 
     288         [ #  # ]:          0 :   if (strcmp(m->monstring,"itinerant merchant") != 0) {
     289                 :          0 :     m->monstring = "itinerant merchant";
     290                 :            :   }
     291         [ #  # ]:          0 :   if (m->possessions == NULL)
     292                 :          0 :     mprint("The merchant says: Alas! I have nothing to sell!");
     293                 :            :   else {
     294                 :          0 :     m->possessions->thing->known = 2;
     295                 :          0 :     clearmsg();
     296                 :          0 :     mprint("I have a fine");
     297                 :          0 :     mprint(itemid(m->possessions->thing));
     298                 :          0 :     mprint("for only");
     299         [ #  # ]:          0 :     mlongprint(max(10,4*true_item_value(m->possessions->thing)));
     300                 :          0 :     mprint("Au.");
     301                 :          0 :     mprint("Want it? [yn] ");
     302         [ #  # ]:          0 :     if (ynq()=='y') {
     303 [ #  # ][ #  # ]:          0 :       if (Player.cash < (max(10,4*true_item_value(m->possessions->thing)))) {
     304         [ #  # ]:          0 :         if (Player.alignment > 10) {
     305                 :          0 :           mprint("Well, I'll let you have it for what you've got.");
     306                 :          0 :           Player.cash = 0;
     307                 :          0 :           gain_item(m->possessions->thing);
     308                 :            :         }
     309                 :          0 :         else mprint("Beat it, you deadbeat!");
     310                 :            :       }
     311                 :            :       else {
     312                 :          0 :         mprint("Here you are. Have a good day.");
     313         [ #  # ]:          0 :         Player.cash -= max(10,(4*item_value(m->possessions->thing)));
     314                 :          0 :         gain_item(m->possessions->thing);
     315                 :            :       }
     316                 :            :     }
     317                 :            :     else 
     318                 :            :     {
     319                 :          0 :       mprint("Sorry I couldn't help you.");
     320                 :          0 :       free_obj( m->possessions->thing, TRUE );
     321                 :            :     }
     322                 :          0 :     tmp = m->possessions;
     323                 :          0 :     m->possessions = tmp->next;
     324                 :          0 :     free( tmp );
     325         [ #  # ]:          0 :     if (NULL != m->possessions) 
     326                 :            :     {
     327                 :          0 :       mprint("Well then, I must be off. Good day.");
     328                 :          0 :       m_vanish(m);
     329                 :            :     }
     330                 :            :   }
     331                 :          0 : }
     332                 :            : 
     333                 :          6 : void m_talk_man(pmt m)
     334                 :            : {
     335                 :            : 
     336         [ +  - ]:          6 :   if (m->uniqueness == COMMON) {
     337                 :          6 :     strcpy(Str2,"The ");
     338                 :          6 :     strcat(Str2,m->monstring);
     339                 :            :   }
     340                 :          0 :   else strcpy(Str2,m->monstring);
     341   [ +  +  -  +  :          6 :   switch (random_range(5)) {
                   -  - ]
     342                 :          1 :     case 0:strcat(Str2," asks you for the way home."); break;
     343                 :          4 :     case 1:strcat(Str2," wishes you a pleasant day."); break;
     344                 :          0 :     case 2:strcat(Str2," sneers at you contemptuously."); break;
     345                 :          1 :     case 3:strcat(Str2," smiles and nods."); break;
     346                 :          0 :     case 4:strcat(Str2," tells you a joke."); break;
     347                 :            :   }
     348                 :          6 :   mprint(Str2);
     349                 :          6 : }
     350                 :            : 
     351                 :            : 
     352                 :          0 : void m_talk_evil(pmt m)
     353                 :            : {
     354                 :            : 
     355         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     356                 :          0 :     strcpy(Str2,"The ");
     357                 :          0 :     strcat(Str2,m->monstring);
     358                 :            :   }
     359                 :          0 :   else strcpy(Str2,m->monstring);
     360   [ #  #  #  #  :          0 :   switch (random_range(14)) {
          #  #  #  #  #  
          #  #  #  #  #  
                      # ]
     361                 :          0 :     case 0:strcat(Str2," says: 'THERE CAN BE ONLY ONE!'"); break;
     362                 :          0 :     case 1:strcat(Str2," says: 'Prepare to die, Buckwheat!'"); break;
     363                 :          0 :     case 2:strcat(Str2," says: 'Time to die!'"); break;
     364                 :          0 :     case 3:strcat(Str2," says: 'There will be no mercy.'"); break;
     365                 :          0 :     case 4:strcat(Str2," insults your mother-in-law."); break;
     366                 :          0 :     case 5:strcat(Str2," says: 'Kurav tu ando mul!'"); break;
     367                 :          0 :     case 6:strcat(Str2," says: '!va al infierno!'"); break;
     368                 :          0 :     case 7:strcat(Str2," says: 'dame desu, nee.'"); break;
     369                 :          0 :     case 8:strcat(Str2," spits on your rug and calls your cat a bastard."); 
     370                 :          0 :       break;
     371                 :          0 :     case 9:strcat(Str2," snickers malevolently and draws a weapon."); break;
     372                 :          0 :     case 10:strcat(Str2," sends 'rm -r *' to your shell!"); break;
     373                 :          0 :     case 11:strcat(Str2," tweaks your nose and cackles evilly."); break;
     374                 :          0 :     case 12:strcat(Str2," thumbs you in the eyes."); break;
     375                 :          0 :     case 13:strcat(Str2," kicks you in the groin."); break;
     376                 :            :   }
     377                 :          0 :   mprint(Str2);
     378                 :          0 : }
     379                 :            : 
     380                 :            : 
     381                 :          0 : void m_talk_robot(pmt m)
     382                 :            : {
     383         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     384                 :          0 :     strcpy(Str2,"The ");
     385                 :          0 :     strcat(Str2,m->monstring);
     386                 :            :   }
     387                 :          0 :   else strcpy(Str2,m->monstring);
     388   [ #  #  #  #  :          0 :   switch (random_range(4)) {
                      # ]
     389                 :          0 :     case 0:strcat(Str2," says: 'exterminate...Exterminate...EXTERMINATE!!!'");
     390                 :          0 :       break;
     391                 :          0 :     case 1:strcat(Str2," says: 'Kill ... Crush ... Destroy'");
     392                 :          0 :       break;
     393                 :          0 :     case 2:strcat(Str2," says: 'Danger -- Danger'");
     394                 :          0 :       break;
     395                 :          0 :     case 3:strcat(Str2," says: 'Yo Mama -- core dumped.'");
     396                 :          0 :       break;
     397                 :            :   }
     398                 :          0 :   mprint(Str2);
     399                 :          0 : }
     400                 :            : 
     401                 :          0 : void m_talk_slithy(pmt m)
     402                 :            : {
     403                 :          0 :   mprint("It can't talk -- it's too slithy!");
     404                 :          0 : }
     405                 :            : 
     406                 :            : 
     407                 :          0 : void m_talk_mimsy(pmt m)
     408                 :            : {
     409                 :          0 :   mprint("It can't talk -- it's too mimsy!");
     410                 :          0 : }
     411                 :            : 
     412                 :            : 
     413                 :            : 
     414                 :          0 : void m_talk_burble(pmt m)
     415                 :            : {
     416                 :            : 
     417         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     418                 :          0 :     strcpy(Str2,"The ");
     419                 :          0 :     strcat(Str2,m->monstring);
     420                 :            :   }
     421                 :          0 :   else strcpy(Str2,m->monstring);
     422                 :          0 :   strcat(Str2," burbles hatefully at you.");
     423                 :          0 :   mprint(Str2);
     424                 :          0 : }
     425                 :            : 
     426                 :            : 
     427                 :          0 : void m_talk_beg(pmt m)
     428                 :            : {
     429         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     430                 :          0 :     strcpy(Str2,"The ");
     431                 :          0 :     strcat(Str2,m->monstring);
     432                 :            :   }
     433                 :          0 :   else strcpy(Str2,m->monstring);
     434                 :          0 :   strcat(Str2," asks you for alms.");
     435                 :          0 :   mprint(Str2);
     436                 :          0 : }
     437                 :            : 
     438                 :            : 
     439                 :          0 : void m_talk_hint(pmt m)
     440                 :            : {
     441         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     442                 :          0 :     strcpy(Str2,"The ");
     443                 :          0 :     strcat(Str2,m->monstring);
     444                 :            :   }
     445                 :          0 :   else strcpy(Str2,m->monstring);
     446         [ #  # ]:          0 :   if (m_statusp(m,HOSTILE)) {
     447                 :          0 :     strcat(Str2," only sneers at you. ");
     448                 :          0 :     mprint(Str2);
     449                 :            :   }
     450                 :            :   else {
     451                 :          0 :     strcat(Str2," whispers in your ear: ");
     452                 :          0 :     mprint(Str2);
     453                 :          0 :     hint();
     454                 :          0 :     m->talkf = M_TALK_SILENT;
     455                 :            :   }
     456                 :          0 : }
     457                 :            : 
     458                 :          0 : void m_talk_gf(pmt m)
     459                 :            : {
     460                 :          0 :   mprint("The good fairy glints: Would you like a wish?");
     461         [ #  # ]:          0 :   if (ynq()=='y') {
     462                 :          0 :     mprint("The good fairy glows: Are you sure?");
     463         [ #  # ]:          0 :     if (ynq()=='y') {
     464                 :          0 :       mprint("The good fairy radiates: Really really sure?");
     465         [ #  # ]:          0 :       if (ynq()=='y') {
     466                 :          0 :         mprint("The good fairy beams: I mean, like, sure as sure can be?");
     467         [ #  # ]:          0 :         if (ynq()=='y') {
     468                 :          0 :           mprint("The good fairy dazzles: You don't want a wish, right?");
     469         [ #  # ]:          0 :           if (ynq()=='y') mprint("The good fairy laughs: I thought not.");
     470                 :          0 :           else wish(0);
     471                 :            :         }
     472                 :            :       }
     473                 :            :     }
     474                 :            :   }
     475                 :          0 :   mprint("In a flash of sweet-smelling light, the fairy vanishes....");
     476                 :          0 :   Player.hp = max(Player.hp,Player.maxhp);
     477         [ #  # ]:          0 :   Player.mana = max(Player.mana,calcmana());
     478                 :          0 :   mprint("You feel mellow.");
     479                 :          0 :   m_vanish(m);
     480                 :          0 : }
     481                 :            : 
     482                 :          0 : void m_talk_ef(pmt m)
     483                 :            : {
     484                 :          0 :   mprint("The evil fairy roils: Eat my pixie dust!");
     485                 :          0 :   mprint("She waves her black-glowing wand, which screams thinly....");
     486                 :          0 :   m->movef=M_MOVE_SMART;
     487                 :          0 :   m->meleef=M_MELEE_POISON;
     488                 :          0 :   m->specialf=M_SP_THIEF;
     489                 :          0 :   m_status_set(m,HOSTILE);
     490                 :          0 :   acquire(-1);
     491                 :          0 :   bless(-1);
     492                 :          0 :   sleep_player(m->level/2);
     493                 :          0 :   summon(-1,-1);
     494                 :          0 :   summon(-1,-1);
     495                 :          0 :   summon(-1,-1);
     496                 :          0 :   summon(-1,-1);
     497                 :          0 : }
     498                 :            : 
     499                 :            : 
     500                 :          0 : void m_talk_seductor(pmt m)
     501                 :            : {
     502         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     503                 :          0 :     strcpy(Str2,"The ");
     504                 :          0 :     strcat(Str2,m->monstring);
     505                 :            :   }
     506                 :          0 :   else strcpy(Str2,m->monstring);
     507         [ #  # ]:          0 :   if (Player.preference == 'n')
     508                 :            :   {
     509                 :          0 :     strcat(Str2, " notices your disinterest and leaves with a pout.");
     510                 :          0 :     mprint(Str2);
     511                 :            :   }
     512                 :            :   else
     513                 :            :   {
     514                 :          0 :     strcat(Str2," beckons seductively...");
     515                 :          0 :     mprint(Str2);
     516                 :          0 :     mprint("Flee? [yn] ");
     517         [ #  # ]:          0 :     if (ynq()=='y') {
     518                 :          0 :       mprint("You feel stupid.");
     519                 :            :     }
     520                 :            :     else {
     521                 :          0 :       strcpy(Str2,"The ");
     522                 :          0 :       strcat(Str2,m->monstring);
     523                 :          0 :       strcat(Str2," shows you a good time....");
     524                 :          0 :       mprint(Str2);
     525                 :          0 :       gain_experience(500);
     526                 :          0 :       Player.con++;
     527                 :            :     }
     528                 :            :   }
     529                 :          0 :   m_vanish(m);
     530                 :          0 : }
     531                 :            : 
     532                 :            : 
     533                 :          0 : void m_talk_demonlover(pmt m)
     534                 :            : {
     535         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     536                 :          0 :     strcpy(Str2,"The ");
     537                 :          0 :     strcat(Str2,m->monstring);
     538                 :            :   }
     539                 :          0 :   else strcpy(Str2,m->monstring);
     540         [ #  # ]:          0 :   if (Player.preference == 'n')
     541                 :            :   {
     542                 :          0 :     strcat(Str2, " notices your disinterest and changes with a snarl...");
     543                 :          0 :     mprint(Str2);
     544                 :          0 :     morewait();
     545                 :            :   }
     546                 :            :   else
     547                 :            :   {
     548                 :          0 :     strcat(Str2," beckons seductively...");
     549                 :          0 :     mprint(Str2);
     550                 :          0 :     mprint("Flee? [yn] ");
     551         [ #  # ]:          0 :     if (ynq()=='y') 
     552                 :          0 :       mprint("You feel fortunate....");
     553                 :            :     else {
     554         [ #  # ]:          0 :       if (m->uniqueness == COMMON) {
     555                 :          0 :         strcpy(Str2,"The ");
     556                 :          0 :         strcat(Str2,m->monstring);
     557                 :            :       }
     558                 :          0 :       else strcpy(Str2,m->monstring);
     559                 :          0 :       strcat(Str2," shows you a good time....");
     560                 :          0 :       mprint(Str2);
     561                 :          0 :       morewait();
     562                 :          0 :       mprint("You feel your life energies draining...");
     563                 :          0 :       level_drain(random_range(3)+1,"a demon's kiss");
     564                 :          0 :       morewait();
     565                 :            :     }
     566                 :            :   }
     567                 :          0 :   m->talkf = M_TALK_EVIL;
     568                 :          0 :   m->meleef = M_MELEE_SPIRIT;
     569                 :          0 :   m->specialf = M_SP_DEMON;
     570                 :          0 :   m_status_reset(m,NEEDY);
     571                 :          0 :   m_status_set(m,HOSTILE);
     572                 :            : 
     573         [ #  # ]:          0 :   if ((m->monchar&0xff) == 's') {
     574                 :          0 :     m->monchar = 'I'|CLR(RED);
     575                 :          0 :     m->monstring = "incubus";
     576                 :            :   }
     577                 :            :   else {
     578                 :          0 :     m->monchar = 'S'|CLR(RED);
     579                 :          0 :     m->monstring = "succubus";
     580                 :            :   }
     581         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     582                 :          0 :     strcpy(Str2,"The ");
     583                 :          0 :     strcat(Str2,m->monstring);
     584                 :            :   }
     585                 :          0 :   else strcpy(Str2,m->monstring);
     586                 :          0 :   strcat(Str2," laughs insanely.");
     587                 :          0 :   mprint(Str2);
     588                 :          0 :   mprint("You now notice the fangs, claws, batwings...");
     589                 :          0 : }
     590                 :            : 
     591                 :            : 
     592                 :          7 : void m_talk_horse(pmt m)
     593                 :            : {
     594         [ -  + ]:          7 :   if (m_statusp(m,HOSTILE)) 
     595                 :          0 :     mprint("The horse neighs angrily at you.");
     596         [ +  + ]:          7 :   else if (m_statusp(m,HUNGRY))
     597                 :          5 :     mprint("The horse noses curiously at your pack.");
     598         [ -  + ]:          2 :   else if (gamestatusp(MOUNTED))
     599                 :          0 :     mprint("The horse and your steed don't seem to get along.");
     600         [ -  + ]:          2 :   else if (Current_Environment == Current_Dungeon)
     601                 :          0 :     mprint("The horse shies; maybe he doesn't like the dungeon air....");
     602                 :            :   else {
     603                 :          2 :     mprint("The horse lets you pat his nose. Want to ride him? [yn] ");
     604         [ +  - ]:          2 :     if (ynq()=='y') {
     605                 :          2 :       m_remove(m);
     606                 :          2 :       setgamestatus(MOUNTED);
     607                 :          2 :       calc_melee();
     608                 :          2 :       mprint("You are now equitating!");
     609                 :            :     }
     610                 :            :   }
     611                 :          7 : }
     612                 :            : 
     613                 :          0 : void m_talk_hyena(pmt m)
     614                 :            : {
     615                 :          0 :   mprint("The hyena only laughs at you...");
     616                 :          0 : }
     617                 :            : 
     618                 :          0 : void m_talk_parrot(pmt m)
     619                 :            : {
     620                 :          0 :   mprint("Polly wanna cracker?");
     621                 :          0 : }
     622                 :            : 
     623                 :            : 
     624                 :          0 : void m_talk_servant(pmt m)
     625                 :            : {
     626                 :          0 :   int target,x=Player.x,y=Player.y;
     627         [ #  # ]:          0 :   if (m->id == SERV_LAW) {
     628                 :          0 :     target = SERV_CHAOS;
     629                 :          0 :     mprint("The Servant of Law pauses in thought for a moment.");
     630                 :          0 :     mprint("You are asked: Are there any Servants of Chaos hereabouts? [yn] ");
     631                 :            :   }
     632                 :            :   else {
     633                 :          0 :     target = SERV_LAW;
     634                 :          0 :     mprint("The Servant of Chaos grins mischievously at you.");
     635                 :          0 :     mprint("You are asked: Are there any Servants of Law hereabouts? [yn] ");
     636                 :            :   }
     637         [ #  # ]:          0 :   if (ynq()=='y') {
     638                 :          0 :     print1("Show me.");
     639                 :          0 :     show_screen();
     640                 :          0 :     drawmonsters(TRUE);
     641                 :          0 :     setspot(&x,&y);
     642         [ #  # ]:          0 :     if (Level->site[x][y].creature != NULL) {
     643         [ #  # ]:          0 :       if (Level->site[x][y].creature->id == target) {
     644                 :          0 :         mprint("The Servant launches itself towards its enemy.");
     645                 :          0 :         mprint("In a blaze of combat, the Servants annihilate each other!");
     646                 :          0 :         gain_experience(m->xpv);
     647                 :          0 :         m_death(Level->site[x][y].creature);
     648                 :          0 :         Level->site[m->x][m->y].creature = NULL;
     649                 :          0 :         m->x = x;
     650                 :          0 :         m->y = y;
     651                 :          0 :         Level->site[x][y].creature = m;
     652                 :          0 :         m_death(Level->site[x][y].creature);
     653                 :            :       }
     654                 :          0 :       else mprint("Right. Tell me about it. Idiot!");
     655                 :            :     }
     656                 :          0 :     else mprint("Right. Tell me about it. Idiot!");
     657                 :            :   }
     658                 :          0 :   else mprint("The servant shrugs and turns away.");
     659                 :          0 : }
     660                 :            : 
     661                 :            : 
     662                 :          0 : void m_talk_animal(pmt m)
     663                 :            : {
     664         [ #  # ]:          0 :   if (m->uniqueness == COMMON) {
     665                 :          0 :     strcpy(Str2,"The ");
     666                 :          0 :     strcat(Str2,m->monstring);
     667                 :            :   }
     668                 :          0 :   else strcpy(Str2,m->monstring);
     669                 :          0 :   mprint(Str2);
     670                 :          0 :   mprint("shows you a scholarly paper by Dolittle, D. Vet.");
     671                 :          0 :   mprint("which demonstrates that animals don't have speech centers");
     672                 :          0 :   mprint("complex enough to communicate in higher languages.");
     673                 :          0 :   mprint("It giggles softly to itself and takes back the paper.");
     674                 :          0 : }
     675                 :            : 
     676                 :            : 
     677                 :          0 : void m_talk_scream(pmt m)
     678                 :            : {
     679                 :          0 :   mprint("A thinly echoing scream reaches your ears....");
     680                 :          0 :   morewait();
     681                 :          0 :   mprint("You feel doomed....");
     682                 :          0 :   morewait();
     683                 :          0 :   mprint("A bird appears and flies three times widdershins around your head.");
     684                 :          0 :   summon(-1,QUAIL);
     685                 :          0 :   m->talkf = M_TALK_EVIL;
     686                 :          0 : }
     687                 :            : 
     688                 :            : 
     689                 :          0 : void m_talk_archmage(pmt m)
     690                 :            : {
     691         [ #  # ]:          0 :   if (m_statusp(m,HOSTILE)) {
     692                 :          0 :     mprint("The Archmage ignores your attempt at conversation");
     693                 :          0 :     mprint("and concentrates on his spellcasting....");
     694                 :            :   }
     695         [ #  # ]:          0 :   else if (Current_Environment == E_COURT) {
     696                 :          0 :     mprint("The Archmage congratulates you on getting this far.");
     697                 :          0 :     mprint("He invites you to attempt the Throne of High Magic");
     698                 :          0 :     mprint("but warns you that it is important to wield the Sceptre");
     699                 :          0 :     mprint("before sitting on the throne.");
     700         [ #  # ]:          0 :     if (Level->site[m->x][m->y].p_locf == L_THRONE) {
     701                 :          0 :       mprint("The Archmage smiles and makes an arcane gesture....");
     702                 :          0 :       m_vanish(m);
     703                 :            :     }
     704                 :            :   }
     705                 :            :   else {
     706                 :          0 :     mprint("The Archmage tells you to find him again in his");
     707                 :          0 :     mprint("Magical Court at the base of his castle in the mountains");
     708                 :          0 :     mprint("of the far North-East; if you do he will give you some");
     709                 :          0 :     mprint("important information.");
     710                 :            :   }
     711                 :          0 : }
     712                 :            : 
     713                 :          0 : void m_talk_maharaja(pmt m)
     714                 :            : {
     715         [ #  # ]:          0 :   if (m_statusp(m,HOSTILE)) {
     716   [ #  #  #  #  :          0 :     switch (random_range(4)) {
                      # ]
     717                 :          0 :     case 0: mprint("The Maharaja says: 'So Mote it be!'");
     718                 :          0 :       break;
     719                 :          0 :     case 1: mprint("The Maharaja says: 'Let it be written!'");
     720                 :          0 :       break;
     721                 :          0 :     case 2: mprint("The Maharaja says: 'Let it be done!'");
     722                 :          0 :       break;
     723                 :          0 :     case 3: mprint("The Maharaja offers you goat-eyeball soup.'");
     724                 :          0 :       break;
     725                 :            :     }
     726                 :            :   }
     727         [ #  # ]:          0 :   else if (Current_Environment == E_PALACE) {
     728                 :          0 :     mprint("The Maharaja insists that you leave. Or die.");
     729                 :            :   }
     730                 :            :   else {
     731                 :          0 :     mprint("Where did I put those dungeons?");
     732                 :            :   }
     733                 :          0 : }
     734                 :            : 
     735                 :            : 
     736                 :          3 : void m_talk_merchant(pmt m)
     737                 :            : {
     738         [ +  - ]:          3 :   if (! m_statusp(m,HOSTILE)) {
     739         [ +  + ]:          3 :     if (Current_Environment == E_VILLAGE) {
     740                 :          2 :       mprint("The merchant asks you if you want to buy a horse for 250GP.");
     741                 :          2 :       mprint("Pay the merchant? [yn] ");
     742         [ +  + ]:          2 :       if (ynq()=='y') {
     743         [ -  + ]:          1 :         if (Player.cash < 250) 
     744                 :          0 :           mprint("The merchant says: 'Come back when you've got the cash!'");
     745                 :            :         else {
     746                 :          1 :           Player.cash -= 250;
     747                 :          1 :           mprint("The merchant takes your money and tells you to select");
     748                 :          1 :           mprint("any horse you want in the stables.");
     749                 :          1 :           mprint("He says: 'You'll want to get to know him before trying to");
     750                 :          1 :           mprint("ride him. By the way, food for the horse is not included.'");
     751                 :          1 :           mprint("The merchant runs off toward the bank, cackling gleefully.");
     752                 :          1 :           m_vanish(m);
     753                 :            :         }
     754                 :            :       }
     755                 :          2 :       else mprint("The merchant tells you to stop wasting his time.");
     756                 :            :     }
     757                 :            :     else {
     758                 :          1 :       mprint("The merchant tells you to visit his stables at his village");
     759                 :          3 :       mprint("for a great deal on a horse.");
     760                 :            :     }
     761                 :            :   }
     762                 :            :   else {
     763                 :          0 :     mprint("The merchant ignores you and screams:");
     764                 :          0 :     mprint("'Help! Help! I'm being oppressed!'");
     765                 :            :   }
     766                 :          3 : }
     767                 :            :   
     768                 :            : 
     769                 :          0 : void m_talk_prime(pmt m)
     770                 :            : {
     771         [ #  # ]:          0 :   if (!m_statusp(m,HOSTILE)) {
     772         [ #  # ]:          0 :     if (Current_Environment == E_CIRCLE) {
     773                 :          0 :       print1("The Prime nods brusquely at you, removes a gem from his");
     774                 :          0 :       print2("sleeve, places it on the floor, and vanishes wordlessly.");
     775                 :          0 :       morewait();
     776                 :          0 :       m_dropstuff(m);
     777                 :          0 :       m_vanish(m);
     778                 :            :     }
     779                 :            :     else {
     780                 :          0 :       print1("The Prime makes an intricate gesture, which leaves behind");
     781                 :          0 :       print2("glowing blue sparks... He winks mischievously at you....");
     782         [ #  # ]:          0 :       if (Player.rank[CIRCLE] > 0) {
     783                 :          0 :         morewait();
     784                 :          0 :         print1("The blue sparks strike you! You feel enhanced!");
     785                 :          0 :         print2("You feel more experienced....");
     786                 :          0 :         Player.pow+=Player.rank[CIRCLE];
     787                 :          0 :         Player.mana += calcmana();
     788                 :          0 :         gain_experience(1000);
     789                 :          0 :         m_vanish(m);
     790                 :            :       }
     791                 :            :     }
     792                 :            :   }
     793                 :          0 :   else m_talk_evil(m);
     794                 :          0 : }

Generated by: LCOV version 1.11