Add README.
[rogue-pphs.git] / romance.c
index 3c5c2e1..f1daa06 100644 (file)
--- a/romance.c
+++ b/romance.c
@@ -3,7 +3,7 @@
  *
  * @(#)romance.c       3.2 (Berkeley) 6/15/81
  *
- * Rogue: Exploring the Dungeons of Doom
+ * Rogue: Exploring the Cavern of Cuties
  * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
  * All rights reserved.
  *
@@ -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,8 @@ 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));
+            wake_monster(tp->t_pos.y, tp->t_pos.x);
         }
         else
         {
@@ -83,7 +84,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));
         }
     }
 }
@@ -111,38 +112,37 @@ int ydelta, xdelta;
        return;
 
     liking = count_bits_set(
-        hash((op->o_type << 4) ^ op->o_which) & tp->t_stats.s_ont) - 1;
-    if (liking == 0
+        hash(op->o_type * op->o_which) & tp->t_stats.s_ont) - 1;
+    if ((liking == 0 || liking == -1)
         || liking > 0 && tp->t_stats.s_int <= MAYBE_INTERESTED)
     {
         const char *msgs[] = {
             "The %s ignores %s",
+            "The %s doesn't care for %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)
     {
         const char *msgs[] = {
             "The %s accepts %s.",
-            "The %s takes %s.",
+            "The %s smiles and 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)
+    else
     {
         const char *msgs[] = {
             "The %s throws away %s.",
             "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;
+        wake_monster(tp->t_pos.y, tp->t_pos.x);
     }
     
     /*
@@ -166,14 +166,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 < READY)
+    {
+        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);
     }
 }