+ RSPEAK(HINT_COST);
+ game.hinted[hint]=YES(cmdin,WANT_HINT,HINTS[hint][4],OK_MAN);
+ if (game.hinted[hint] && game.limit > WARNTIME)
+ game.limit += WARNTIME*HINTS[hint][2];
+ }
+ }
+ }
+}
+
+bool spotted_by_pirate(int i)
+{
+ if (i != PIRATE)
+ return false;
+
+ /* The pirate's spotted him. He leaves him alone once we've
+ * found chest. K counts if a treasure is here. If not, and
+ * tally=1 for an unseen chest, let the pirate be spotted. Note
+ * that game.place[CHEST] = NOWHERE might mean that he's thrown
+ * it to the troll, but in that case he's seen the chest
+ * (game.prop=0). */
+ if (game.loc == game.chloc || game.prop[CHEST] >= 0)
+ return true;
+ int snarfed=0;
+ bool movechest = false, robplayer = false;
+ for (int treasure=MINTRS; treasure<=MAXTRS; treasure++) {
+ /* Pirate won't take pyramid from plover room or dark
+ * room (too easy!). */
+ if (treasure==PYRAM && (game.loc==PLAC[PYRAM] || game.loc==PLAC[EMRALD])) {
+ continue;
+ }
+ if (TOTING(treasure) || HERE(treasure))
+ ++snarfed;
+ if (TOTING(treasure)) {
+ movechest = true;
+ robplayer = true;
+ }
+ }
+ /* Force chest placement before player finds last treasure */
+ if (game.tally == 1 && snarfed == 0 && game.place[CHEST] == NOWHERE && HERE(LAMP) && game.prop[LAMP] == 1) {
+ RSPEAK(PIRATE_SPOTTED);
+ movechest = true;
+ }
+ /* Do things in this order (chest move before robbery) so chest is listed
+ * last at the maze location. */
+ if (movechest) {
+ MOVE(CHEST,game.chloc);
+ MOVE(MESSAG,game.chloc2);
+ game.dloc[PIRATE]=game.chloc;
+ game.odloc[PIRATE]=game.chloc;
+ game.dseen[PIRATE]=false;
+ } else {
+ /* You might get a hint of the pirate's presence even if the
+ * chest doesn't move... */
+ if (game.odloc[PIRATE] != game.dloc[PIRATE] && PCT(20))
+ RSPEAK(PIRATE_RUSTLES);
+ }
+ if (robplayer) {
+ RSPEAK(PIRATE_POUNCES);
+ for (int treasure=MINTRS; treasure<=MAXTRS; treasure++) {
+ if (!(treasure == PYRAM && (game.loc == PLAC[PYRAM] || game.loc == PLAC[EMRALD]))) {
+ if (AT(treasure) && game.fixed[treasure] == 0)
+ CARRY(treasure,game.loc);
+ if (TOTING(treasure))
+ DROP(treasure,game.chloc);