a47b89788ee684f7f257725a76b770b7552d0c02
[rogue-pphs.git] / romance.c
1 /*
2 * Functions for dealing with problems of the heart
3 *
4 * @(#)romance.c 3.2 (Berkeley) 6/15/81
5 *
6 * Rogue: Exploring the Dungeons of Doom
7 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
8 * All rights reserved.
9 *
10 * See the file LICENSE.TXT for full copyright and licensing information.
11 */
12
13 #include "curses.h"
14 #include <ctype.h>
15 #include <string.h>
16 #include "rogue.h"
17
18 /*
19 * flirt:
20 * Make eyes in the given direction
21 */
22
23 flirt(ydelta, xdelta)
24 int ydelta, xdelta;
25 {
26 register struct linked_list *item;
27 struct object obj = {};
28
29 obj.o_pos = hero;
30 obj.o_type = '~';
31 do_motion(&obj, ydelta, xdelta);
32 mvwaddch(cw, hero.y, hero.x, PLAYER);
33 if ((item = find_mons(obj.o_pos.y, obj.o_pos.x)) == NULL)
34 {
35 const char *msgs[] = {
36 "You wink at nothing in particular.",
37 "You smile suggestively at the wall.",
38 "Unprompted, you suddenly blush.",
39 };
40 msg(rndchoice(msgs));
41 return;
42 }
43 }
44
45 gift(ydelta, xdelta)
46 int ydelta, xdelta;
47 {
48 register struct linked_list *obj, *nobj;
49 register struct linked_list *mob;
50 register struct object *op;
51 register struct thing *tp;
52 register bool did_hit = TRUE;
53
54 if ((mob = find_mons(hero.y + ydelta, hero.x + xdelta)) == NULL)
55 {
56 msg("There's no-one around here.");
57 return(0);
58 }
59 tp = (struct thing *) ldata(mob);
60
61 if ((obj = get_item("give", 0)) == NULL)
62 return;
63 op = (struct object *) ldata(obj);
64 if (!dropcheck(op))
65 return;
66 /*
67 * Take it out of the pack
68 */
69 if (op->o_count >= 2 && op->o_type != WEAPON)
70 {
71 nobj = new_item(sizeof *op);
72 op->o_count--;
73 op = (struct object *) ldata(nobj);
74 *op = *((struct object *) ldata(obj));
75 op->o_count = 1;
76 obj = nobj;
77 if (op->o_group != 0)
78 inpack++;
79 }
80 else
81 detach(pack, obj);
82 inpack--;
83 }
84
85 embrace()
86 {
87 }