X-Git-Url: https://git.yukkurigames.com/?p=rogue-pphs.git;a=blobdiff_plain;f=romance.c;fp=romance.c;h=7d92edc26a6e76038bf4ae074668d495dc5573bb;hp=3c5c2e1b79724c5838d49652bfc3739cfee55f2e;hb=e72b287ac5cdb287c541bdc052d13823afe4930d;hpb=b65543a78471f80b4836a78b1c776a5c6c71974e diff --git a/romance.c b/romance.c index 3c5c2e1..7d92edc 100644 --- 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); } }