X-Git-Url: https://git.yukkurigames.com/?p=rogue-pphs.git;a=blobdiff_plain;f=romance.c;h=3c5c2e1b79724c5838d49652bfc3739cfee55f2e;hp=bff5588b35342186141c7842794ea77b598b36a8;hb=b65543a78471f80b4836a78b1c776a5c6c71974e;hpb=efb1335002efedd46b532a3e1daf6f390a20cce7 diff --git a/romance.c b/romance.c index bff5588..3c5c2e1 100644 --- a/romance.c +++ b/romance.c @@ -53,8 +53,8 @@ int ydelta, xdelta; else { register struct thing *tp = (struct thing *) ldata(mob); - int attr = count_bits_set(tp->t_stats.s_ont & player.t_stats.s_ont); - attr += tp->t_stats.s_int - 1; + int attr = count_bits_set(tp->t_stats.s_ont ^ player.t_stats.s_ont); + attr += tp->t_stats.s_int - 2; if (rnd(NUM_FEATURES) < attr) { tp->t_stats.s_int++; @@ -95,7 +95,7 @@ int ydelta, xdelta; register struct linked_list *mob; register struct object *op; register struct thing *tp; - register bool did_hit = TRUE; + register int liking; if ((mob = find_mons(hero.y + ydelta, hero.x + xdelta)) == NULL) { @@ -109,6 +109,42 @@ int ydelta, xdelta; op = (struct object *) ldata(obj); if (!dropcheck(op)) return; + + liking = count_bits_set( + hash((op->o_type << 4) ^ op->o_which) & tp->t_stats.s_ont) - 1; + if (liking == 0 + || liking > 0 && tp->t_stats.s_int <= MAYBE_INTERESTED) + { + const char *msgs[] = { + "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)); + return; + } + else if (liking > 0) + { + const char *msgs[] = { + "The %s accepts %s.", + "The %s takes %s.", + }; + msg(rndchoice(msgs), monsters[tp->t_type - 'A'].m_name, + inv_name(op, TRUE)); + tp->t_stats.s_int += liking * 10; + } + else if (liking < 0) + { + 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)); + tp->t_stats.s_int -= liking * 2; + } + /* * Take it out of the pack */ @@ -130,4 +166,14 @@ int ydelta, xdelta; embrace() { + // Figure out if the player is near something w/ enough interest. + // Otherwise, hug something random, and make things worse. + if (amulet) + { + total_winner('K'); + } + else + { + mostly_winner('K'); + } }