after = FALSE;\r
else\r
flirt(delta.y, delta.x);\r
+ when 'g':\r
+ if (!get_dir())\r
+ after = FALSE;\r
+ else\r
+ gift(delta.y, delta.x);\r
+ when 'E':\r
+ embrace();\r
when '>' : after = FALSE; d_level();\r
when '<' : after = FALSE; u_level();\r
when '?' : after = FALSE; help();\r
'B', " run down & left",\r
'N', " run down & right",\r
't', "<dir> throw something",\r
- 'f', "<dir> flirt with someone",\r
'p', "<dir> zap a wand in a direction",\r
'z', " zap a wand or staff",\r
'>', " go down a staircase",\r
'R', " remove ring",\r
'd', " drop object",\r
'c', " call object",\r
+ 'f', "<dir> flirt with someone",\r
+ 'g', "<dir> give an item as a gift",\r
+ 'E', " embrace",\r
'o', " examine/set options",\r
CTRL('L'), " redraw screen",\r
CTRL('R'), " repeat last message",\r
ESCAPE, " cancel command",\r
'v', " print program version number",\r
- '!', " shell escape",\r
'S', " save game",\r
'Q', " quit",\r
0, 0\r
#define otherwise break;default\r
#define until(expr) while(!(expr))\r
#define ce(a, b) ((a).x == (b).x && (a).y == (b).y)\r
-#define draw(window) (wrefresh(window),usleep(50000))\r
+#define draw(window) (wrefresh(window),usleep(20000))\r
#define hero player.t_pos\r
#define pstats player.t_stats\r
#define pack player.t_pack\r
#define newgrp() ++group\r
#define o_charges o_ac\r
#define ISMULT(type) (type == POTION || type == SCROLL || type == FOOD)\r
+#define rndchoice(a) (a[rnd(sizeof(a)/sizeof((a)[0]))])\r
\r
/*\r
* Things that appear on the screens\r
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()
+{
}