X-Git-Url: https://git.yukkurigames.com/?p=rogue-pphs.git;a=blobdiff_plain;f=romance.c;fp=romance.c;h=a47b89788ee684f7f257725a76b770b7552d0c02;hp=70a06a1aa179f9f756426cafb8e9562e03706607;hb=9c3c378b5c998e689cefd9cad3e2deb863cbcefa;hpb=d2304f95be17b49e9c594615e83fff6e9ca5d08b diff --git a/romance.c b/romance.c index 70a06a1..a47b897 100644 --- a/romance.c +++ b/romance.c @@ -23,11 +23,65 @@ flirt(ydelta, xdelta) int ydelta, xdelta; { - register struct linked_list *item, *nitem; - struct object obj; + register struct linked_list *item; + struct object obj = {}; obj.o_pos = hero; obj.o_type = '~'; do_motion(&obj, ydelta, xdelta); mvwaddch(cw, hero.y, hero.x, PLAYER); + if ((item = find_mons(obj.o_pos.y, obj.o_pos.x)) == NULL) + { + const char *msgs[] = { + "You wink at nothing in particular.", + "You smile suggestively at the wall.", + "Unprompted, you suddenly blush.", + }; + msg(rndchoice(msgs)); + return; + } +} + +gift(ydelta, xdelta) +int ydelta, xdelta; +{ + register struct linked_list *obj, *nobj; + register struct linked_list *mob; + register struct object *op; + register struct thing *tp; + register bool did_hit = TRUE; + + if ((mob = find_mons(hero.y + ydelta, hero.x + xdelta)) == NULL) + { + msg("There's no-one around here."); + return(0); + } + tp = (struct thing *) ldata(mob); + + if ((obj = get_item("give", 0)) == NULL) + return; + op = (struct object *) ldata(obj); + if (!dropcheck(op)) + return; + /* + * Take it out of the pack + */ + if (op->o_count >= 2 && op->o_type != WEAPON) + { + nobj = new_item(sizeof *op); + op->o_count--; + op = (struct object *) ldata(nobj); + *op = *((struct object *) ldata(obj)); + op->o_count = 1; + obj = nobj; + if (op->o_group != 0) + inpack++; + } + else + detach(pack, obj); + inpack--; +} + +embrace() +{ }