]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - battlestar/com5.c
Use defined constant FINAL instead of hardcoded 275. From OpenBSD.
[bsdgames-darwin.git] / battlestar / com5.c
index b3cde513e0fc99687e84136b54b59de146f54442..3c2f791afa3696b9256619c6abe38aa2db69a685 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: com5.c,v 1.10 1999/07/14 17:42:13 hubertf Exp $        */
+/*     $NetBSD: com5.c,v 1.16 2000/09/24 14:20:23 jsm Exp $    */
 
 /*
  * Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)com5.c     8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: com5.c,v 1.10 1999/07/14 17:42:13 hubertf Exp $");
+__RCSID("$NetBSD: com5.c,v 1.16 2000/09/24 14:20:23 jsm Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -47,40 +47,50 @@ __RCSID("$NetBSD: com5.c,v 1.10 1999/07/14 17:42:13 hubertf Exp $");
 void
 kiss()
 {
-       while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount);
-       if (wordtype[wordnumber] == NOUNS &&
-           testbit(location[position].objects, wordvalue[wordnumber])) {
-               pleasure++;
-               printf("Kissed.\n");
-               switch (wordvalue[wordnumber]) {
-               case NORMGOD:
-                       switch (godready++) {
-                       case 0:
-                               puts("She squirms and avoids your advances.");
+       while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount)
+               continue;
+       /* The goddess must be "taken" first if bathing. */
+       if (wordtype[wordnumber] == NOUNS && wordvalue[wordnumber] == NORMGOD
+           && testbit(location[position].objects, BATHGOD)) {
+               wordvalue[--wordnumber] = TAKE;
+               cypher();
+               return;
+       }
+       if (wordtype[wordnumber] == NOUNS) {
+               if (testbit(location[position].objects, wordvalue[wordnumber])) {
+                       pleasure++;
+                       printf("Kissed.\n");
+                       switch (wordvalue[wordnumber]) {
+                       case NORMGOD:
+                               switch (godready++) {
+                               case 0:
+                                       puts("She squirms and avoids your advances.");
+                                       break;
+                               case 1:
+                                       puts("She is coming around; she didn't fight it as much.");
+                                       break;
+                               case 2:
+                                       puts("She's beginning to like it.");
+                                       break;
+                               default:
+                                       puts("She's gone limp.");
+
+                               }
                                break;
-                       case 1:
-                               puts("She is coming around; she didn't fight it as much.");
+                       case NATIVE:
+                               puts("Her lips are warm and her body robust.  She pulls you down to the ground.");
                                break;
-                       case 2:
-                               puts("She's begining to like it.");
+                       case TIMER:
+                               puts("The old man blushes.");
+                               break;
+                       case MAN:
+                               puts("The dwarf punches you in the kneecap.");
                                break;
                        default:
-                               puts("She's gone limp.");
-
+                               pleasure--;
                        }
-                       break;
-               case NATIVE:
-                       puts("The lips are warm and her body robust.  She pulls you down to the ground.");
-                       break;
-               case TIMER:
-                       puts("The old man blushes.");
-                       break;
-               case MAN:
-                       puts("The dwarf punches you in the kneecap.");
-                       break;
-               default:
-                       pleasure--;
-               }
+               } else
+                       puts("I see nothing like that here.");
        } else
                puts("I'd prefer not to.");
 }
@@ -90,9 +100,12 @@ love()
 {
        int     n;
 
-       while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount);
-       if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects, wordvalue[wordnumber])) {
-               if (wordvalue[wordnumber] == NORMGOD && !loved) {
+       while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount)
+               continue;
+       if (wordtype[wordnumber] == NOUNS) {
+               if ((testbit(location[position].objects, BATHGOD) ||
+                   testbit(location[position].objects, NORMGOD)) &&
+                   wordvalue[wordnumber] == NORMGOD && !loved) {
                        if (godready >= 2) {
                                puts("She cuddles up to you, and her mouth starts to work:\n'That was my sister's amulet.  The lovely goddess, Purl, was she.  The Empire\ncaptured her just after the Darkness came.  My other sister, Vert, was killed\nby the Dark Lord himself.  He took her amulet and warped its power.\nYour quest was foretold by my father before he died, but to get the Dark Lord's\namulet you must use cunning and skill.  I will leave you my amulet,");
                                puts("which you may use as you wish.  As for me, I am the last goddess of the\nwaters.  My father was the Island King, and the rule is rightfully mine.'\n\nShe pulls the throne out into a large bed.");
@@ -111,21 +124,30 @@ love()
                                        setbit(location[position].objects, MEDALION);
                                loved = 1;
                                ourtime += 10;
+                               printf("Loved.\n");
                                zzz();
                        } else {
                                puts("You wish!");
                                return;
                        }
                }
-               if (wordvalue[wordnumber] == NATIVE) {
-                       puts("The girl is easy prey.  She peels off her sarong and indulges you.");
-                       power++;
-                       pleasure += 5;
-                       printf("Girl:\n");
-                       ourtime += 10;
-                       zzz();
-               }
-               printf("Loved.\n");
+               if (testbit(location[position].objects, wordvalue[wordnumber])) {
+                       if (wordvalue[wordnumber] == NATIVE) {
+                               puts("The girl is easy prey.  She peels off her sarong and indulges you.");
+                               power++;
+                               pleasure += 5;
+                               printf("Girl:\n");
+                               ourtime += 10;
+                               printf("Loved.\n");
+                               zzz();
+                       }
+                       if (wordvalue[wordnumber] == MAN ||
+                           wordvalue[wordnumber] == BODY ||
+                           wordvalue[wordnumber] == ELF ||
+                           wordvalue[wordnumber] == TIMER)
+                               puts("Kinky!");
+               } else
+                       puts("Where's your lover?");
        } else
                puts("It doesn't seem to work.");
 }
@@ -189,7 +211,7 @@ chime()
 {
        if ((ourtime / CYCLE + 1) % 2 && OUTSIDE)
                switch ((ourtime % CYCLE) / (CYCLE / 7)) {
-                       case 0:
+               case 0:
                        puts("It is just after sunrise.");
                        break;
                case 1:
@@ -211,33 +233,32 @@ chime()
                        puts("It is near sunset.");
                        break;
                }
+       else if (OUTSIDE)
+               switch ((ourtime % CYCLE) / (CYCLE / 7)) {
+               case 0:
+                       puts("It is just after sunset.");
+                       break;
+               case 1:
+                       puts("It is early evening.");
+                       break;
+               case 2:
+                       puts("The evening is getting old.");
+                       break;
+               case 3:
+                       puts("It is near midnight.");
+                       break;
+               case 4:
+                       puts("These are the wee hours of the morning.");
+                       break;
+               case 5:
+                       puts("The night is waning.");
+                       break;
+               case 6:
+                       puts("It is almost morning.");
+                       break;
+               }
        else
-               if (OUTSIDE)
-                       switch ((ourtime % CYCLE) / (CYCLE / 7)) {
-                       case 0:
-                               puts("It is just after sunset.");
-                               break;
-                       case 1:
-                               puts("It is early evening.");
-                               break;
-                       case 2:
-                               puts("The evening is getting old.");
-                               break;
-                       case 3:
-                               puts("It is near midnight.");
-                               break;
-                       case 4:
-                               puts("These are the wee hours of the morning.");
-                               break;
-                       case 5:
-                               puts("The night is waning.");
-                               break;
-                       case 6:
-                               puts("It is almost morning.");
-                               break;
-                       }
-               else
-                       puts("I can't tell the time in here.");
+               puts("I can't tell the time in here.");
 }
 
 int
@@ -247,7 +268,8 @@ give()
 
        last1 = last2 = 0;
        firstnumber = wordnumber;
-       while (wordtype[++wordnumber] != OBJECT && wordvalue[wordnumber] != AMULET && wordvalue[wordnumber] != MEDALION && wordvalue[wordnumber] != TALISMAN && wordnumber <= wordcount);
+       while (wordtype[++wordnumber] != OBJECT && wordvalue[wordnumber] != AMULET && wordvalue[wordnumber] != MEDALION && wordvalue[wordnumber] != TALISMAN && wordnumber <= wordcount)
+               continue;
        if (wordnumber <= wordcount) {
                obj = wordvalue[wordnumber];
                if (obj == EVERYTHING)
@@ -274,12 +296,12 @@ give()
         * that's no worse than what other commands than give do in
         * the same place.  */
        wordnumber = last1 - 1;
-       if (person && testbit(location[position].objects, person))
+       if (person && testbit(location[position].objects, person)) {
                if (person == NORMGOD && godready < 2 && !(obj == RING || obj == BRACELET))
                        puts("The goddess won't look at you.");
                else
                        result = drop("Given");
-       else {
+       else {
                puts("I don't think that is possible.");
                wordnumber = max(last1, last2) + 1;
                return (0);