Hugging angers monsters that don't like you enough. Fix some bugs that were preventin...
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 7 Apr 2013 09:44:06 +0000 (11:44 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 7 Apr 2013 09:44:06 +0000 (11:44 +0200)
rip.c
rogue.h
romance.c

diff --git a/rip.c b/rip.c
index 7d3962116d885c92ed98eef0db236413e7bf06a6..e7c8edb4cdf52c7ec961f19c0cc4de5a1129ee8c 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
@@ -103,7 +101,7 @@ char monst;
        "killed",\r
        "quit",\r
        "A total loner",\r
-       "left for a date",\r
+       "left for a cuddle",\r
        "got the amulet and left"\r
     };\r
     char scoreline[100];\r
@@ -118,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
@@ -211,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
@@ -233,15 +240,6 @@ char monst;
                    scp--;\r
                }\r
            }\r
-           else if (prflags >= 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
            else\r
                printf(".\n");\r
        }\r
@@ -268,10 +266,9 @@ total_loner(monster)
 char monster;\r
 {\r
     clear();\r
-    standout();\r
     addstr("                                                               \n");\r
     addstr("           You escaped from the caverns, but alone.            \n");\r
-    standend();\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
@@ -283,10 +280,11 @@ total_winner(monster)
 char monster;\r
 {\r
     clear();\r
-    standout();\r
     addstr("                                                               \n");\r
     addstr("             You got the amulet and a hot date.                \n");\r
-    standend();\r
+    addstr("                                                               \n");\r
+    addstr("                          @ <3 ");\r
+    addch(monster);\r
     total_something(4, monster);\r
 }\r
 \r
@@ -294,10 +292,11 @@ mostly_winner(monster)
 char monster;\r
 {\r
     clear();\r
-    standout();\r
     addstr("                                                               \n");\r
     addstr("                      You got a hot date.                      \n");\r
-    standend();\r
+    addstr("                                                               \n");\r
+    addstr("                             @ <3 ");\r
+    addch(monster);\r
     total_something(3, monster);\r
 }\r
 \r
diff --git a/rogue.h b/rogue.h
index 674be7317a8c560dad2fcb2e7d89253e5c79b3ae..b433321f791ca88af43f84abd23c9987a07c0b37 100644 (file)
--- a/rogue.h
+++ b/rogue.h
@@ -73,6 +73,7 @@
 #define ISMULT(type) (type == POTION || type == SCROLL || type == FOOD)\r
 #define rndchoice(a) (a[rnd(sizeof(a)/sizeof((a)[0]))])\r
 #define hash(i) ((unsigned)(i)*2654435761u)\r
+\r
 /*\r
  * Things that appear on the screens\r
  */\r
@@ -516,6 +517,7 @@ char *ctime(), *num(), *ring_num();
 int readchar(WINDOW *win);\r
 int md_readchar(WINDOW *win);\r
 int wait_for(WINDOW *win, register char ch);\r
+char *killname(register char monst);\r
 \r
 struct room *roomin();\r
 \r
index 3c5c2e1b79724c5838d49652bfc3739cfee55f2e..7d92edc26a6e76038bf4ae074668d495dc5573bb 100644 (file)
--- a/romance.c
+++ b/romance.c
@@ -63,7 +63,7 @@ int ydelta, xdelta;
                 "You catch the %s staring at you out of the corner of eir eye.",
                 "The %s blushes and waves cautiously.",
             };
-            msg(rndchoice(msgs), monsters[tp->t_type - 'A'].m_name);
+            msg(rndchoice(msgs), killname(tp->t_type));
         }
         else if (attr <= 0)
         {
@@ -73,7 +73,7 @@ int ydelta, xdelta;
                 "The %s tells you to stop it.",
                 "The %s is sick of your crap.",
             };
-            msg(rndchoice(msgs), monsters[tp->t_type - 'A'].m_name);
+            msg(rndchoice(msgs), killname(tp->t_type));
         }
         else
         {
@@ -83,7 +83,7 @@ int ydelta, xdelta;
                 "The %s acts like it can't hear you.",
                 "The %s doesn't care.",
             };
-            msg(rndchoice(msgs), monsters[tp->t_type - 'A'].m_name);
+            msg(rndchoice(msgs), killname(tp->t_type));
         }
     }
 }
@@ -119,8 +119,7 @@ int ydelta, xdelta;
             "The %s ignores %s",
             "The %s isn't interested in %s",
         };
-        msg(rndchoice(msgs), monsters[tp->t_type - 'A'].m_name,
-            inv_name(op, TRUE));
+        msg(rndchoice(msgs), killname(tp->t_type), inv_name(op, TRUE));
         return;
     }    
     else if (liking > 0)
@@ -129,8 +128,7 @@ int ydelta, xdelta;
             "The %s accepts %s.",
             "The %s takes %s.",
         };
-        msg(rndchoice(msgs), monsters[tp->t_type - 'A'].m_name,
-            inv_name(op, TRUE));
+        msg(rndchoice(msgs), killname(tp->t_type), inv_name(op, TRUE));
         tp->t_stats.s_int += liking * 10;
     }
     else if (liking < 0)
@@ -140,8 +138,7 @@ int ydelta, xdelta;
             "The %s breaks %s.",
             "The %s hates %s.",
         };
-        msg(rndchoice(msgs), monsters[tp->t_type - 'A'].m_name,
-            inv_name(op, TRUE));
+        msg(rndchoice(msgs), killname(tp->t_type), inv_name(op, TRUE));
         tp->t_stats.s_int -= liking * 2;
     }
     
@@ -166,14 +163,46 @@ int ydelta, xdelta;
 
 embrace()
 {
-    // Figure out if the player is near something w/ enough interest.
-    // Otherwise, hug something random, and make things worse.
+    register struct thing *tp = NULL;
+    register int liking;
+    register int dx, dy;
+
+    for (dx = -1; dx <= 1; ++dx)
+    {
+        for (dy = -1; dy <= 1; ++dy)
+        {
+            register struct linked_list *mob;
+            if ((mob = find_mons(hero.y + dy, hero.x + dx)))
+            {
+                register struct thing *atp = (struct thing *)ldata(mob);
+                if (!tp || atp->t_stats.s_int > tp->t_stats.s_int)
+                    tp = atp;
+            }
+        }
+    }
+
+
+    if (tp == NULL)
+    {
+        msg("You wrap your arms around yourself.");
+       return;
+    }
+    else if (tp->t_stats.s_int < INTERESTED)
+    {
+        if (tp->t_stats.s_int > 0)
+            tp->t_stats.s_int /= 2;
+        else
+            tp->t_stats.s_int--;
+        msg("The %s dodges out of the way.", killname(tp->t_type));
+        return;
+    }
+
     if (amulet)
     {
-        total_winner('K');
+        total_winner(tp->t_type);
     }
     else
     {
-        mostly_winner('K');
+        mostly_winner(tp->t_type);
     }
 }