LCOV - code coverage report
Current view: top level - omega-rpg-0.90-pa9 - etc.c (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 264 0.0 %
Date: 2017-09-18 20:02:26 Functions: 0 5 0.0 %
Branches: 0 226 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
       2                 :            : /* etc.c */
       3                 :            : /* grab bag of random functions used in random places */
       4                 :            : 
       5                 :            : #include "glob.h"
       6                 :            : 
       7                 :            : /* there are various ways for the player to receive one of these hints */
       8                 :          0 : void hint(void)
       9                 :            : {
      10   [ #  #  #  #  :          0 :   switch(random_range(97)) {
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
             #  #  #  # ]
      11                 :          0 :   case 0:mprint("There is an entrance to the sewers in the Garden.");break;
      12                 :          0 :   case 1:mprint("Statues can be dangerous.");break;
      13                 :          0 :   case 2:mprint("Unidentified Artifacts can be dangerous.");break;
      14                 :          0 :   case 3:mprint("The higher form of mercury is desirable.");break;
      15                 :          0 :   case 4:mprint("A sense of unease is a good thing to have.");break;
      16                 :          0 :   case 5:mprint("If you dig too much, you might cause a cave-in!");break;
      17                 :          0 :   case 6:mprint("Be Lawful: Live and Let Live.");break;
      18                 :          0 :   case 7:mprint("Be Chaotic: Live and Let Die."); break;
      19                 :          0 :   case 8:mprint("The world doesn't slow down; you speed up.");break;
      20                 :          0 :   case 9:mprint("Security is a sense of dislocation.");break;
      21                 :          0 :   case 10:mprint("Tullimore Dew is a panacea.");break;
      22                 :          0 :   case 11:mprint("Thieves hide behind closed doors.");break;
      23                 :          0 :   case 12:mprint("`No jail is escapeproof' -- John Dillinger.");break;
      24                 :          0 :   case 13:mprint("Oh, to have an apartment of your own!");break;
      25                 :          0 :   case 14:mprint("Some homes have money and treasure.");break;
      26                 :          0 :   case 15:mprint("Some homes are defended.");break;
      27                 :          0 :   case 16:mprint("Sometimes you could just wish for Death."); break;
      28                 :          0 :   case 17:mprint("A cursed wish can be fatal.");break;
      29                 :          0 :   case 18:mprint("The way you play, you should wish for Skill."); break;
      30                 :          0 :   case 19:mprint("A druid might wish for Balance."); break;
      31                 :          0 :   case 20:mprint("Mages always wish for Knowledge.");break;
      32                 :          0 :   case 21:mprint("Some fairies are good.");break;
      33                 :          0 :   case 22:mprint("An affair with a demon can be heartbreaking."); break;
      34                 :          0 :   case 23:mprint("The Explorer's Club knows a useful spell."); break;
      35                 :          0 :   case 24:mprint("They say some famous people live in mansions."); break;
      36                 :          0 :   case 25:mprint("Magic pools are totally random."); break;
      37                 :          0 :   case 26:mprint("There are five elements, including Void."); break;
      38                 :          0 :   case 27:mprint("Humans can be good or evil, lawful or chaotic."); break;
      39                 :          0 :   case 28:mprint("There are many kinds of wishes. Case counts, you know.");
      40                 :          0 :     break;
      41                 :          0 :   case 29:mprint("There are caves due south of Rampart"); break;
      42                 :          0 :   case 30:mprint("Donaldson's Giants can withstand lava.");break;
      43                 :          0 :   case 31:mprint("Ritual magic can have many different effects.");break;
      44                 :          0 :   case 32:mprint("The Mercenaries are the best equipped fighters."); break;
      45                 :          0 :   case 33:mprint("The Gladiators are the most skilled fighters."); break;
      46                 :          0 :   case 34:mprint("Rent a flat and lose any bad stati you may have."); break;
      47                 :          0 :   case 35:mprint("Some junk may be worth a fortune if identified."); break;
      48                 :          0 :   case 36:mprint("Identify humans by talking to them."); break;
      49                 :          0 :   case 37:mprint("They say the Duke has a treasure trove."); break;
      50                 :          0 :   case 38:mprint("If you yield, your opponent will gain experience."); break;
      51                 :          0 :   case 39:mprint("The Dragon Lord lives in the Waste of Time."); break;
      52                 :          0 :   case 40:mprint("A full moon bodes well for the followers of Law."); break;
      53                 :          0 :   case 41:mprint("A new moon omens evil for the Law-abiding."); break;
      54                 :          0 :   case 42:mprint("Druids revere the half-moon."); break;
      55                 :          0 :   case 43:mprint("Most grot is useless."); break;
      56                 :          0 :   case 44:mprint("Cash can sometimes be found in the walls."); break;
      57                 :          0 :   case 45:mprint("Pointy weapons break often but dig better."); break;
      58                 :          0 :   case 46:mprint("The DREADED AQUAE MORTIS is invulnerable."); break;
      59                 :          0 :   case 47:mprint("There must be *some* reason to worship Destiny!"); break;
      60                 :          0 :   case 48:mprint("Kill a trifid? A puzzle! Try a saline solution!"); break;
      61                 :          0 :   case 49:mprint("Beware! The Eater of Souls inhabits the abyss!"); break;
      62                 :          0 :   case 50:mprint("They say there's a red-light district in town."); break;
      63                 :          0 :   case 51:mprint("The House of the Eclipse is behind a closed door."); break;
      64                 :          0 :   case 52:mprint("The Orbs may be encountered on the Astral Plane."); break;
      65                 :          0 :   case 53:mprint("The Champion should never refuse a challenge."); break;
      66                 :          0 :   case 54:mprint("They say that the autoteller program is buggy."); break;
      67                 :          0 :   case 55:mprint("It's better not to sleep on the ground."); break;
      68                 :          0 :   case 56:mprint("Try ritual magic in different kinds of rooms."); break;
      69                 :          0 :   case 57:mprint("Breaking down a wall by bashing it is a bad idea!"); break;
      70                 :          0 :   case 58:mprint("Follow the Oracle's advice; she is all-wise."); break;
      71                 :          0 :   case 59:mprint("The ArchDruid lives in the northern forest.");break;
      72                 :          0 :   case 60:mprint("A search of the mountains may reveal a secret pass.");break;
      73                 :          0 :   case 61:mprint("Star Peak is to the far North-East."); break;
      74                 :          0 :   case 62:mprint("The Archmage lives in the far North-West beyond a pass.");
      75                 :          0 :     break;
      76                 :          0 :   case 63:mprint("There is a volcano in the southern marshes."); break;
      77                 :          0 :   case 64:mprint("The Demon Emperor resides in the Volcano."); break;
      78                 :          0 :   case 65:mprint("The Lawgiver can be found at Star Peak."); break;
      79                 :          0 :   case 66:mprint("The Temple of Athena is to the North-East."); break;
      80                 :          0 :   case 67:mprint("The Temple of Set can be found in a desert.");break;
      81                 :          0 :   case 68:mprint("The Temple of Hecate is in the swamp."); break;
      82                 :          0 :   case 69:mprint("The Temple of Odin is to the South in some mountains.");
      83                 :          0 :     break;
      84                 :          0 :   case 70:mprint("There is a curious island off a promontory of the swamp.");
      85                 :          0 :     break;
      86                 :          0 :   case 71:mprint("The Eater of Magic can be found on an island.");break;
      87                 :          0 :   case 72:mprint("The Temple of Destiny is practically inaccessible.");break;
      88                 :          0 :   case 73:mprint("Each sect has its own main temple outside the city.");break;
      89                 :          0 :   case 74:mprint("The aligned temples are dangerous to unbelievers.");break;
      90                 :          0 :   case 75:mprint("If you are poor, maybe you should wish for Wealth.");break;
      91                 :          0 :   case 76:mprint("Need mana? Wish for Power.");break;
      92                 :          0 :   case 77:mprint("Wishing for Law, Balance, or Chaos alters alignment.");break;
      93                 :          0 :   case 78:mprint("Feeling out of sorts? Wish for Health.");break;
      94                 :          0 :   case 79:mprint("Challenge the abyss at the Temple of Destiny.");break;
      95                 :          0 :   case 80:mprint("The Circle of Sorcerors has an Astral HQ");break;
      96                 :          0 :   case 81:mprint("The Star Gem is the only way back from the Astral Plane.");
      97                 :          0 :     break;
      98                 :          0 :   case 82:mprint("The Star Gem is guarded by the Circle of Sorcerors.");break;
      99                 :          0 :   case 83:mprint("The Star Gem is rightfully the property of the LawBringer.");
     100                 :          0 :     break;
     101                 :          0 :   case 84:mprint("They say the Demon Emperor owns the Amulet of the Planes.");
     102                 :          0 :     break;
     103                 :          0 :   case 85:mprint("An Amulet might get you to the Temple of Destiny.");break;
     104                 :          0 :   case 86:mprint("A wish for Location might help you become Adept.");break;
     105                 :          0 :   case 87:mprint("Some Artifacts may be used only once per day.");break;
     106                 :          0 :   case 88:mprint("Overusing Artifacts can be a bad move."); break;
     107                 :          0 :   case 89:mprint("You might starve in the Swamp or the Mountains!");break;
     108                 :          0 :   case 90:mprint("You would have to be very chaotic to attack a guard!");break;
     109                 :          0 :   case 91:mprint("You would have to be very foolhardy to attack a guard!");
     110                 :          0 :     break;
     111                 :          0 :   case 92:mprint("Only a master of chaos would kill all the city guards!");
     112                 :          0 :     break;
     113                 :          0 :   case 93:mprint("The Order depends on the force of the LawGiver.");break;
     114                 :          0 :   case 94:mprint("City Guards are employees of the Order.");break;
     115                 :          0 :   case 95:mprint("Disenchanted Artifacts can be restored."); break;
     116                 :          0 :   case 96:mprint("They say blessings can really change an item's attitude."); break;
     117                 :            :   }
     118                 :          0 : }
     119                 :            : 
     120                 :            : /* for when a deity teaches spells to a devotee */
     121                 :          0 : void learnclericalspells(int deity, int level)
     122                 :            : {
     123                 :          0 :   mprint("With your new clerical rank comes knowledge of magic...");
     124                 :          0 :   Player.pow+=level;
     125                 :          0 :   Player.maxpow+=level;
     126   [ #  #  #  #  :          0 :   switch(level) {
                   #  # ]
     127                 :            :     case LAY: 
     128         [ #  # ]:          0 :       if (deity==ODIN) 
     129                 :          0 :         Spells[S_MISSILE].known = TRUE;
     130         [ #  # ]:          0 :       else if (deity==SET)
     131                 :          0 :         Spells[S_INVISIBLE].known = TRUE;
     132         [ #  # ]:          0 :       else if (deity==ATHENA)
     133                 :          0 :         Spells[S_IDENTIFY].known = TRUE;
     134         [ #  # ]:          0 :       else if (deity==HECATE)
     135                 :          0 :         Spells[S_DRAIN].known = TRUE;
     136         [ #  # ]:          0 :       else if (deity==DRUID) {
     137                 :          0 :         Spells[S_KNOWLEDGE].known = TRUE;
     138                 :          0 :         Spells[S_MON_DET].known = TRUE;
     139                 :            :       }
     140                 :          0 :       break;
     141                 :            :     case ACOLYTE: 
     142         [ #  # ]:          0 :       if (deity==ODIN) {
     143                 :          0 :         Spells[S_LBALL].known = TRUE;
     144                 :          0 :         Spells[S_TRUESIGHT].known = TRUE;
     145                 :            :       }
     146         [ #  # ]:          0 :       else if (deity==SET) {
     147                 :          0 :         Spells[S_SUMMON].known = TRUE;
     148                 :          0 :         Spells[S_FIREBOLT].known = TRUE;
     149                 :            :       }
     150         [ #  # ]:          0 :       else if (deity==ATHENA) {
     151                 :          0 :         Spells[S_HEAL].known = TRUE;
     152                 :          0 :         Spells[S_SANCTUARY].known = TRUE;
     153                 :            :       }
     154         [ #  # ]:          0 :       else if (deity==HECATE) {
     155                 :          0 :         Spells[S_SLEEP].known = TRUE;
     156                 :          0 :         Spells[S_DISPEL].known = TRUE;
     157                 :            :       }
     158         [ #  # ]:          0 :       else if (deity==DRUID) {
     159                 :          0 :         Spells[S_HEAL].known = TRUE;
     160                 :          0 :         Spells[S_CURE].known = TRUE;
     161                 :            :       }
     162         [ #  # ]:          0 :       else if (deity==DESTINY)
     163                 :          0 :         mprint("An acolyte of the Lords of Destiny. Gee whiz.");
     164                 :          0 :       break;
     165                 :            :     case PRIEST: 
     166                 :          0 :       Spells[S_SANCTIFY].known = TRUE;
     167         [ #  # ]:          0 :       if (deity==ODIN) {
     168                 :          0 :         Spells[S_HERO].known = TRUE;
     169                 :          0 :         Spells[S_HEAL].known = TRUE;
     170                 :            :       }
     171         [ #  # ]:          0 :       else if (deity==SET) {
     172                 :          0 :         Spells[S_INVISIBLE].known = TRUE;
     173                 :          0 :         Spells[S_DISPEL].known = TRUE;
     174                 :            :       }
     175         [ #  # ]:          0 :       else if (deity==ATHENA) {
     176                 :          0 :         Spells[S_REGENERATE].known = TRUE;
     177                 :          0 :         Spells[S_ACCURACY].known = TRUE;
     178                 :            :       }
     179         [ #  # ]:          0 :       else if (deity==HECATE) {
     180                 :          0 :         Spells[S_SHADOWFORM].known = TRUE;
     181                 :          0 :         Spells[S_CURE].known = TRUE;
     182                 :            :       }
     183         [ #  # ]:          0 :       else if (deity==DRUID) {
     184                 :          0 :         Spells[S_DISRUPT].known = TRUE;
     185                 :          0 :         Spells[S_ALERT].known = TRUE;
     186                 :          0 :         Spells[S_CLAIRVOYANCE].known = TRUE;
     187                 :            :       }
     188         [ #  # ]:          0 :       else if (deity==DESTINY)
     189                 :          0 :         mprint("How useless, a new priest of the Lords of Destiny.");
     190                 :          0 :       break;
     191                 :            :     case SPRIEST:
     192                 :          0 :       Spells[S_BLESS].known = TRUE;
     193         [ #  # ]:          0 :       if (deity == ODIN) 
     194                 :          0 :         Spells[S_ACCURACY].known = TRUE;
     195         [ #  # ]:          0 :       else if (deity == SET)
     196                 :          0 :         Spells[S_SHADOWFORM].known = TRUE;
     197         [ #  # ]:          0 :       else if (deity == ATHENA)
     198                 :          0 :         Spells[S_HERO].known = TRUE;
     199         [ #  # ]:          0 :       else if (deity == HECATE)
     200                 :          0 :         Spells[S_POLYMORPH].known = TRUE;
     201         [ #  # ]:          0 :       else if (deity == DRUID) {
     202                 :          0 :         Spells[S_POLYMORPH].known = TRUE;       
     203                 :          0 :         Spells[S_LEVITATE].known = TRUE;
     204                 :            :       }
     205         [ #  # ]:          0 :       else if (deity == DESTINY)
     206                 :          0 :         mprint("Wow, a new senior priest of the Lords of Destiny.");
     207                 :          0 :       break;
     208                 :            :     case HIGHPRIEST:
     209         [ #  # ]:          0 :       if (deity == ODIN)
     210                 :          0 :         Spells[S_RESTORE].known = TRUE;
     211         [ #  # ]:          0 :       else if (deity == SET)
     212                 :          0 :         Spells[S_HELLFIRE].known = TRUE;
     213         [ #  # ]:          0 :       else if (deity == ATHENA)
     214                 :          0 :         Spells[S_HELLFIRE].known = TRUE;
     215         [ #  # ]:          0 :       else if (deity == HECATE)
     216                 :          0 :         Spells[S_DESECRATE].known = TRUE;
     217         [ #  # ]:          0 :       else if (deity == DRUID) {
     218                 :          0 :         Spells[S_DISINTEGRATE].known = TRUE;
     219                 :          0 :         Spells[S_HERO].known = TRUE;
     220                 :            :       }
     221         [ #  # ]:          0 :       else if (deity == DESTINY) {
     222                 :          0 :         mprint("So you're now the high priest of the Lords of Destiny.");
     223                 :          0 :         mprint("You didn't think you were going to get anything, did you?");
     224                 :            :       }
     225                 :            :     }
     226                 :          0 : }
     227                 :            : 
     228                 :            : /* for the use of the casino slot machine */
     229                 :          0 : char *slotstr(int num)
     230                 :            : {
     231   [ #  #  #  #  :          0 :   switch(num) {
          #  #  #  #  #  
                   #  # ]
     232                 :            :   case 0:
     233                 :          0 :     return("<Slime Mold>");
     234                 :            :   case 1:
     235                 :          0 :     return("<Lemon>");
     236                 :            :   case 2:
     237                 :          0 :     return("<Copper>");
     238                 :            :   case 3:
     239                 :          0 :     return("<Nymph>");
     240                 :            :   case 4:
     241                 :          0 :     return("<Sword>");
     242                 :            :   case 5:
     243                 :          0 :     return("<Shield>");
     244                 :            :   case 6:
     245                 :          0 :     return("<Chest>");
     246                 :            :   case 7:
     247                 :          0 :     return("<Bar>");
     248                 :            :   case 8:
     249                 :          0 :     return("<Orb>");
     250                 :            :   case 9:
     251                 :          0 :     return("<Mithril Nugget>");
     252                 :            :   }
     253                 :          0 :   return "Error - you should never see this...";
     254                 :            : }
     255                 :            : 
     256                 :            : /* random names for various uses */
     257                 :          0 : char *nameprint(void)
     258                 :            : {
     259   [ #  #  #  #  :          0 :   switch(random_range(40)) {
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                   #  # ]
     260                 :          0 :   case 0:strcpy(Str3,"Orion Splash");break;
     261                 :          0 :   case 1:strcpy(Str3,"Gorgar");break;
     262                 :          0 :   case 2:strcpy(Str3,"Hieronymous");break;
     263                 :          0 :   case 3:strcpy(Str3,"Quantifor Quotron");break;
     264                 :          0 :   case 4:strcpy(Str3,"Leon");break;
     265                 :          0 :   case 5:strcpy(Str3,"Joyce");break;
     266                 :          0 :   case 6:strcpy(Str3,"Leticia Smiley");break;
     267                 :          0 :   case 7:strcpy(Str3,"Ogilvy the Grim");break;
     268                 :          0 :   case 8:strcpy(Str3,"Salara Storn");break;
     269                 :          0 :   case 9:strcpy(Str3,"Murgo");break;
     270                 :          0 :   case 10:strcpy(Str3,"Jonathan Atwilder");break;
     271                 :          0 :   case 11:strcpy(Str3,"Xylos the Tan");break;
     272                 :          0 :   case 12:strcpy(Str3,"Terence");break;
     273                 :          0 :   case 13:strcpy(Str3,"Toronado");break;
     274                 :          0 :   case 14:strcpy(Str3,"Kelly");break;
     275                 :          0 :   case 15:strcpy(Str3,"Cantinflas");break;
     276                 :          0 :   case 16:strcpy(Str3,"Ixel");break;
     277                 :          0 :   case 17:strcpy(Str3,"Toto");break;
     278                 :          0 :   case 18:strcpy(Str3,"Frost");break;
     279                 :          0 :   case 19:strcpy(Str3,"Aliera Erinyes");break;
     280                 :          0 :   case 20:strcpy(Str3,"Godel");break;
     281                 :          0 :   case 21:strcpy(Str3,"Kerst Blackblade");break;
     282                 :          0 :   case 22:strcpy(Str3,"Ebenezer");break;
     283                 :          0 :   case 23:strcpy(Str3,"Jeremiah");break;
     284                 :          0 :   case 24:strcpy(Str3,"Triskelion Shadow");break;
     285                 :          0 :   case 25:strcpy(Str3,"Eleskir Eremar");break;
     286                 :          0 :   case 26:strcpy(Str3,"Tyron");break;
     287                 :          0 :   case 27:strcpy(Str3,"Morgon");break;
     288                 :          0 :   case 28:strcpy(Str3,"Achmed");break;
     289                 :          0 :   case 29:strcpy(Str3,"Chin");break;
     290                 :          0 :   case 30:strcpy(Str3,"Fujimoto");break;
     291                 :          0 :   case 31:strcpy(Str3,"Dos Santos");break;
     292                 :          0 :   case 32:strcpy(Str3,"Federico");break;
     293                 :          0 :   case 33:strcpy(Str3,"Jaime");break;
     294                 :          0 :   case 34:strcpy(Str3,"Siobhan");break;
     295                 :          0 :   case 35:strcpy(Str3,"Hans");break;
     296                 :          0 :   case 36:strcpy(Str3,"Gurkov");break;
     297                 :          0 :   case 37:strcpy(Str3,"Krilos the Slayer");break;
     298                 :          0 :   case 38:strcpy(Str3,"Oxxblud");break;
     299                 :          0 :   case 39:strcpy(Str3,"Dorian");break;
     300                 :            :   }
     301                 :          0 :   return(Str3);
     302                 :            : }
     303                 :            : 
     304                 :            : 
     305                 :            : /* returns english string equivalent of number */
     306                 :          0 : char *wordnum(int num)
     307                 :            : {
     308   [ #  #  #  #  :          0 :   switch(num) {
          #  #  #  #  #  
                #  #  # ]
     309                 :          0 :   case 0: return("zero ");
     310                 :          0 :   case 1: return("one ");
     311                 :          0 :   case 2: return("two ");
     312                 :          0 :   case 3: return("three ");
     313                 :          0 :   case 4: return("four ");
     314                 :          0 :   case 5: return("five ");
     315                 :          0 :   case 6: return("six ");
     316                 :          0 :   case 7: return("seven ");
     317                 :          0 :   case 8: return("eight ");
     318                 :          0 :   case 9: return("nine ");
     319                 :          0 :   case 10: return("ten ");
     320                 :          0 :   default: return("");
     321                 :            :   }
     322                 :            : }

Generated by: LCOV version 1.11