]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - battlestar/com7.c
Allow for the bathing goddess in ravage(). From OpenBSD.
[bsdgames-darwin.git] / battlestar / com7.c
index bc0ab4db9f9d44c8239f2e8f56f110f9ceee1131..1cc85f19cf6e66c436c17047f0073622037b56fc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: com7.c,v 1.6 1997/10/11 02:07:10 lukem Exp $   */
+/*     $NetBSD: com7.c,v 1.9 2000/09/17 23:04:17 jsm Exp $     */
 
 /*
  * Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)com7.c     8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: com7.c,v 1.6 1997/10/11 02:07:10 lukem Exp $");
+__RCSID("$NetBSD: com7.c,v 1.9 2000/09/17 23:04:17 jsm Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -77,14 +77,12 @@ fighton:
        case SMITE:
                if (testbit(inven, TWO_HANDED))
                        hurt = rnd(70) - 2 * card(injuries, NUMOFINJURIES) - ucard(wear) - exhaustion;
+               else if (testbit(inven, SWORD) || testbit(inven, BROAD))
+                       hurt = rnd(50) % (WEIGHT - carrying) - card(injuries, NUMOFINJURIES) - encumber - exhaustion;
+               else if (testbit(inven, KNIFE) || testbit(inven, MALLET) || testbit(inven, CHAIN) || testbit(inven, MACE) || testbit(inven, HALBERD))
+                       hurt = rnd(15) - card(injuries, NUMOFINJURIES) - exhaustion;
                else
-                       if (testbit(inven, SWORD) || testbit(inven, BROAD))
-                               hurt = rnd(50) % (WEIGHT - carrying) - card(injuries, NUMOFINJURIES) - encumber - exhaustion;
-                       else
-                               if (testbit(inven, KNIFE) || testbit(inven, MALLET) || testbit(inven, CHAIN) || testbit(inven, MACE) || testbit(inven, HALBERD))
-                                       hurt = rnd(15) - card(injuries, NUMOFINJURIES) - exhaustion;
-                               else
-                                       hurt = rnd(7) - encumber;
+                       hurt = rnd(7) - encumber;
                if (hurt < 5)
                        switch (rnd(3)) {
 
@@ -98,82 +96,78 @@ fighton:
                                puts("His filthy tunic hangs by one less thread.");
                                break;
                        }
-               else
-                       if (hurt < 10) {
-                               switch (rnd(3)) {
-                               case 0:
-                                       puts("He's bleeding.");
-                                       break;
-                               case 1:
-                                       puts("A trickle of blood runs down his face.");
-                                       break;
-                               case 2:
-                                       puts("A huge purple bruise is forming on the side of his face.");
-                                       break;
-                               }
-                               lifeline++;
-                       } else
-                               if (hurt < 20) {
-                                       switch (rnd(3)) {
-                                       case 0:
-                                               puts("He staggers back quavering.");
-                                               break;
-                                       case 1:
-                                               puts("He jumps back with his hand over the wound.");
-                                               break;
-                                       case 2:
-                                               puts("His shirt falls open with a swath across the chest.");
-                                               break;
-                                       }
-                                       lifeline += 5;
-                               } else
-                                       if (hurt < 30) {
-                                               switch (rnd(3)) {
-                                               case 0:
-                                                       printf("A bloody gash opens up on his %s side.\n", (rnd(2) ? "left" : "right"));
-                                                       break;
-                                               case 1:
-                                                       puts("The steel bites home and scrapes along his ribs.");
-                                                       break;
-                                               case 2:
-                                                       puts("You pierce him, and his breath hisses through clenched teeth.");
-                                                       break;
-                                               }
-                                               lifeline += 10;
-                                       } else
-                                               if (hurt < 40) {
-                                                       switch (rnd(3)) {
-                                                       case 0:
-                                                               puts("You smite him to the ground.");
-                                                               if (strength - lifeline > 20)
-                                                                       puts("But in a flurry of steel he regains his feet!");
-                                                               break;
-                                                       case 1:
-                                                               puts("The force of your blow sends him to his knees.");
-                                                               puts("His arm swings lifeless at his side.");
-                                                               break;
-                                                       case 2:
-                                                               puts("Clutching his blood drenched shirt, he collapses stunned.");
-                                                               break;
-                                                       }
-                                                       lifeline += 20;
-                                               } else {
-                                                       switch (rnd(3)) {
-                                                       case 0:
-                                                               puts("His ribs crack under your powerful swing, flooding his lungs with blood.");
-                                                               break;
-                                                       case 1:
-                                                               puts("You shatter his upheld arm in a spray of blood.  The blade continues deep");
-                                                               puts("into his back, severing the spinal cord.");
-                                                               lifeline += 25;
-                                                               break;
-                                                       case 2:
-                                                               puts("With a mighty lunge the steel slides in, and gasping, he falls to the ground.");
-                                                               lifeline += 25;
-                                                               break;
-                                                       }
-                                                       lifeline += 30;
-                                               }
+               else if (hurt < 10) {
+                       switch (rnd(3)) {
+                       case 0:
+                               puts("He's bleeding.");
+                               break;
+                       case 1:
+                               puts("A trickle of blood runs down his face.");
+                               break;
+                       case 2:
+                               puts("A huge purple bruise is forming on the side of his face.");
+                               break;
+                       }
+                       lifeline++;
+               } else if (hurt < 20) {
+                       switch (rnd(3)) {
+                       case 0:
+                               puts("He staggers back quavering.");
+                               break;
+                       case 1:
+                               puts("He jumps back with his hand over the wound.");
+                               break;
+                       case 2:
+                               puts("His shirt falls open with a swath across the chest.");
+                               break;
+                       }
+                       lifeline += 5;
+               } else if (hurt < 30) {
+                       switch (rnd(3)) {
+                       case 0:
+                               printf("A bloody gash opens up on his %s side.\n", (rnd(2) ? "left" : "right"));
+                               break;
+                       case 1:
+                               puts("The steel bites home and scrapes along his ribs.");
+                               break;
+                       case 2:
+                               puts("You pierce him, and his breath hisses through clenched teeth.");
+                               break;
+                       }
+                       lifeline += 10;
+               } else if (hurt < 40) {
+                       switch (rnd(3)) {
+                       case 0:
+                               puts("You smite him to the ground.");
+                               if (strength - lifeline > 20)
+                                       puts("But in a flurry of steel he regains his feet!");
+                               break;
+                       case 1:
+                               puts("The force of your blow sends him to his knees.");
+                               puts("His arm swings lifeless at his side.");
+                               break;
+                       case 2:
+                               puts("Clutching his blood drenched shirt, he collapses stunned.");
+                               break;
+                       }
+                       lifeline += 20;
+               } else {
+                       switch (rnd(3)) {
+                       case 0:
+                               puts("His ribs crack under your powerful swing, flooding his lungs with blood.");
+                               break;
+                       case 1:
+                               puts("You shatter his upheld arm in a spray of blood.  The blade continues deep");
+                               puts("into his back, severing the spinal cord.");
+                               lifeline += 25;
+                               break;
+                       case 2:
+                               puts("With a mighty lunge the steel slides in, and gasping, he falls to the ground.");
+                               lifeline += 25;
+                               break;
+                       }
+                       lifeline += 30;
+               }
                break;
 
        case BACK:
@@ -206,18 +200,15 @@ fighton:
                        puts("You escape stunned and disoriented from the fight.");
                        puts("A victorious bellow echoes from the battlescene.");
                        if (back && position != back)
-                               move(back, BACK);
+                               moveplayer(back, BACK);
+                       else if (ahead && position != ahead)
+                               moveplayer(ahead, AHEAD);
+                       else if (left && position != left)
+                               moveplayer(left, LEFT);
+                       else if (right && position != right)
+                               moveplayer(right, RIGHT);
                        else
-                               if (ahead && position != ahead)
-                                       move(ahead, AHEAD);
-                               else
-                                       if (left && position != left)
-                                               move(left, LEFT);
-                                       else
-                                               if (right && position != right)
-                                                       move(right, RIGHT);
-                                               else
-                                                       move(location[position].down, AHEAD);
+                               moveplayer(location[position].down, AHEAD);
                        return (0);
                }
 
@@ -244,7 +235,7 @@ fighton:
                break;
 
        default:
-               puts("You don't have a chance, he is too quick.");
+               puts("You don't have a chance; he is too quick.");
                break;
 
        }
@@ -258,7 +249,7 @@ fighton:
                return (0);
        }
        puts("He attacks...");
-       /* some embellisments */
+       /* Some embellishments. */
        hurt = rnd(NUMOFINJURIES) - (testbit(inven, SHIELD) != 0) - (testbit(wear, MAIL) != 0) - (testbit(wear, HELM) != 0);
        hurt += (testbit(wear, AMULET) != 0) + (testbit(wear, MEDALION) != 0) + (testbit(wear, TALISMAN) != 0);
        hurt = hurt < 0 ? 0 : hurt;