Beispiel #1
0
/*
  pirate stuff
*/
void dopirate()
{
    int j;
    boolean k;

    if (g.newloc == g.chloc || g.prop[CHEST] >= 0)
        return;
    k = FALSE;
    /* Pirate won't take pyramid from plover room or dark room  (too
       easy! ) */
    for (j = 1; j < MAXOBJ; ++j)
        if (treasr(j) && !(j == CASK && liq(CASK) == WINE)
                && !(j == PYRAMID && (g.newloc == g.place[PYRAMID]
                                      || g.newloc == g.place[EMERALD]))) {
            if (toting(j) && athand(j))
                goto stealit;
            if (here(j))
                k = TRUE;
        }
    if (g.tally == g.tally2 + 1 && k == FALSE && g.place[CHEST] == 0 &&
            athand(LAMP) && g.prop[LAMP] == 1) {
        rspeak(186);
        move(CHEST, g.chloc);
        move(MESSAGE, g.chloc2);
        g.dloc[DWARFMAX] = g.chloc;
        g.odloc[DWARFMAX] = g.chloc;
        g.dseen[DWARFMAX] = 0;
        return;
    }
    if (g.odloc[DWARFMAX] != g.dloc[DWARFMAX] && pct(30))
        rspeak(127);
    return;

stealit:

    rspeak(128);
    /* don't steal chest back from troll! */
    if (g.place[MESSAGE] == 0)
        move(CHEST, g.chloc);
    move(MESSAGE, g.chloc2);
    for (j = 1; j < MAXOBJ; ++j) {
        if (!treasr(j) || !athand(j)
                || (j == PYRAMID &&
                    (g.newloc == plac[PYRAMID] || g.newloc == plac[EMERALD]))
                || (j == CASK && (liq(CASK) != WINE)))
            continue;
        if (enclosed(j))
            extract(j);
        if (wearng(j)) {
            g.prop[j] = 0;
            bitoff(j, WEARBT);
        }
        insert(j, CHEST);
    }
    g.dloc[DWARFMAX] = g.chloc;
    g.odloc[DWARFMAX] = g.chloc;
    g.dseen[DWARFMAX] = FALSE;
    return;
}
/*
  INVENTORY
*/
void inventory()
{
    int i, msg;
    boolean init_msg;

    init_msg = TRUE;
    msg = 98;
    for (i = 1; i < MAXOBJ; i++) {
	if (!holding(i) || wearng(i) || i == BEAR || i == BOAT)
	    continue;
	if (init_msg)
	    rspeak(99);
	pspeak(i, -1);
	init_msg = FALSE;
	msg = 0;
	lookin(i);
    }

    /* Tell him what he is wearing */
    init_msg = TRUE;
    for (i = 1; i < MAXOBJ; i++) {
	if (wearng(i)) {
	    if (init_msg)
		fprintf(stdout, "\nYou are wearing:\n");
	    fprintf(stdout, "     ");
	    pspeak(i, -1);
	    msg = 0;
	    init_msg = FALSE;
	}
    }

    if (holding(BOAT)) {
	rspeak(221);
	lookin(BOAT);
    }
    if (holding(BEAR))
	msg = 141;

    if (msg)
	rspeak(msg);
    return;
}
Beispiel #3
0
/*
  Routine to handle the passing on of one
  of the player's incarnations...
*/
void death()
{
    int yea, j;

    if (!g.closing) {
        if (g.limit < 0) {
            rspeak(185);
            normend();
            return;
        }
        yea = yes(81 + g.numdie * 2, 82 + g.numdie * 2, 54);
        if (++g.numdie >= MAXDIE || !yea)
            normend();
        if (g.chase) {
            g.chase = FALSE;
            g.prop[WUMPUS] = 0;
            move(WUMPUS, 174);
        }
        if (toting(LAMP))
            g.prop[LAMP] = 0;
        for (j = 1; j < MAXOBJ; ++j) {
            if (toting(j))
                drop(j, j == LAMP ? 1 : g.oldloc2);
            if (wearng(j)) {
                g.prop[j] = 0;
                bitoff(j, WEARBT);
            }
        }
        g.newloc = 3;
        g.oldloc = g.loc;
        g.health = 100;
        return;
    }
    /* Closing -- no resurrection... */
    rspeak(131);
    ++g.numdie;
    normend();
    return;
}