Hugging angers monsters that don't like you enough. Fix some bugs that were preventin...
[rogue-pphs.git] / rip.c
diff --git a/rip.c b/rip.c
index 352313d..e7c8edb 100644 (file)
--- a/rip.c
+++ b/rip.c
@@ -38,8 +38,6 @@ static char *rip[] = {
     0\r
 };\r
 \r
-char   *killname();\r
-\r
 /*\r
  * death:\r
  *     Do something really fun when he dies\r
@@ -71,6 +69,8 @@ register char monst;
     move(LINES-1, 0);\r
     draw(stdscr);\r
     score(purse, 0, monst);\r
+    getch();\r
+    endwin();\r
     exit(0);\r
 }\r
 \r
@@ -100,7 +100,9 @@ char monst;
     static char *reason[] = {\r
        "killed",\r
        "quit",\r
-       "A total winner",\r
+       "A total loner",\r
+       "left for a cuddle",\r
+       "got the amulet and left"\r
     };\r
     char scoreline[100];\r
     char score_file[PATH_MAX];\r
@@ -114,7 +116,7 @@ char monst;
     strcpy(score_file, md_getroguedir());\r
 \r
     if (*score_file)\r
-        strcat(score_file,"\\");\r
+        strcat(score_file,"/");\r
 \r
     strcat(score_file, "rogue36.scr");\r
 \r
@@ -180,7 +182,7 @@ char monst;
            scp->sc_score = amount;\r
            strcpy(scp->sc_name, whoami);\r
            scp->sc_flags = flags;\r
-           if (flags == 2)\r
+           if (flags >= 2)\r
                scp->sc_level = max_level;\r
            else\r
                scp->sc_level = level;\r
@@ -207,6 +209,15 @@ char monst;
                        putchar('n');\r
                printf(" %s", killer);\r
            }\r
+           else if (scp->sc_flags >= 3)\r
+           {\r
+                printf(" with a");\r
+               killer = killname(scp->sc_monster);\r
+               if (*killer == 'a' || *killer == 'e' || *killer == 'i' ||\r
+                   *killer == 'o' || *killer == 'u')\r
+                       putchar('n');\r
+               printf(" %s", killer);\r
+            }\r
            if (prflags == 1)\r
            {\r
                printf(" (%s)", scp->sc_login);\r
@@ -251,7 +262,47 @@ char monst;
     fclose(outf);\r
 }\r
 \r
-total_winner()\r
+total_loner(monster)\r
+char monster;\r
+{\r
+    clear();\r
+    addstr("                                                               \n");\r
+    addstr("           You escaped from the caverns, but alone.            \n");\r
+    addstr("                                                               \n");\r
+    addstr("\nYou have joined the elite ranks of those who have escaped the\n");\r
+    addstr("Cavern of Cuties alive, but failed to meet anyone while there.\n");\r
+    addstr("You journey home and sell all your loot at a great profit and\n");\r
+    addstr("continue your life alone.\n");\r
+    total_something(2, 0);\r
+}\r
+\r
+total_winner(monster)\r
+char monster;\r
+{\r
+    clear();\r
+    addstr("                                                               \n");\r
+    addstr("             You got the amulet and a hot date.                \n");\r
+    addstr("                                                               \n");\r
+    addstr("                          @ <3 ");\r
+    addch(monster);\r
+    total_something(4, monster);\r
+}\r
+\r
+mostly_winner(monster)\r
+char monster;\r
+{\r
+    clear();\r
+    addstr("                                                               \n");\r
+    addstr("                      You got a hot date.                      \n");\r
+    addstr("                                                               \n");\r
+    addstr("                             @ <3 ");\r
+    addch(monster);\r
+    total_something(3, monster);\r
+}\r
+\r
+total_something(flags, monster)\r
+int flags;\r
+char monster;\r
 {\r
     register struct linked_list *item;\r
     register struct object *obj;\r
@@ -259,25 +310,9 @@ total_winner()
     register char c;\r
     register int oldpurse;\r
 \r
-    clear();\r
-    standout();\r
-    addstr("                                                               \n");\r
-    addstr("  @   @               @   @           @          @@@  @     @  \n");\r
-    addstr("  @   @               @@ @@           @           @   @     @  \n");\r
-    addstr("  @   @  @@@  @   @   @ @ @  @@@   @@@@  @@@      @  @@@    @  \n");\r
-    addstr("   @@@@ @   @ @   @   @   @     @ @   @ @   @     @   @     @  \n");\r
-    addstr("      @ @   @ @   @   @   @  @@@@ @   @ @@@@@     @   @     @  \n");\r
-    addstr("  @   @ @   @ @  @@   @   @ @   @ @   @ @         @   @  @     \n");\r
-    addstr("   @@@   @@@   @@ @   @   @  @@@@  @@@@  @@@     @@@   @@   @  \n");\r
-    addstr("                                                               \n");\r
-    addstr("     Congratulations, you have made it to the light of day!    \n");\r
-    standend();\r
-    addstr("\nYou have joined the elite ranks of those who have escaped the\n");\r
-    addstr("Dungeons of Doom alive.  You journey home and sell all your loot at\n");\r
-    addstr("a great profit and are admitted to the fighters guild.\n");\r
     mvaddstr(LINES - 1, 0, "--Press space to continue--");\r
     refresh();\r
-    wait_for(' ');\r
+    wait_for(cw, ' ');\r
     clear();\r
     mvaddstr(0, 0, "   Worth  Item");\r
     oldpurse = purse;\r
@@ -354,7 +389,9 @@ total_winner()
     }\r
     mvprintw(c - 'a' + 1, 0,"   %5d  Gold Peices          ", oldpurse);\r
     refresh();\r
-    score(purse, 2, 0);\r
+    score(purse, flags, monster);\r
+    getch();\r
+    endwin();\r
     exit(0);\r
 }\r
 \r