Esempio n. 1
0
/* use a magic key*/
void i_key(pob o)
{
    int dir;
    int ox,oy;
    o->used = FALSE;
    mprint("Unlock door: ");
    dir = getdir();
    if (dir == ABORT)
        resetgamestatus(SKIP_MONSTERS);
    else {
        ox = Player.x + Dirs[0][dir];
        oy = Player.y + Dirs[1][dir];
        if ((Level->site[ox][oy].locchar != CLOSED_DOOR) ||
                loc_statusp(ox,oy,SECRET)) {
            mprint("You can't unlock that!");
            resetgamestatus(SKIP_MONSTERS);
        }
        else if (Level->site[ox][oy].aux == LOCKED) {
            mprint("The lock clicks open!");
            Level->site[ox][oy].aux = UNLOCKED;
            lset(ox, oy, CHANGED);
            o->blessing--;
            if ((o->blessing<0)||(Level->depth == MaxDungeonLevels-1)) {
                mprint("The key disintegrates!");
                conform_lost_objects(1,o);
            }
            else
                mprint("Your key glows faintly.");
        }
        else mprint("That door is already unlocked!");
    }
}
Esempio n. 2
0
/* try to drop a weapon (from fumbling) */
void drop_weapon(void)
{
  if (Player.possessions[O_WEAPON_HAND] != NULL) {
    strcpy(Str1,"You dropped your ");
    strcat(Str1,Player.possessions[O_WEAPON_HAND]->objstr);
    mprint(Str1);
    morewait();
    p_drop_at(Player.x,Player.y,1,Player.possessions[O_WEAPON_HAND]);
    conform_lost_objects(1,Player.possessions[O_WEAPON_HAND]);
  }
  else mprint("You feel fortunate.");
}
Esempio n. 3
0
void i_raise_portcullis(pob o)
{
    l_raise_portcullis();
    mprint("The box beeps once and explodes in your hands!");
    conform_lost_objects(1,o);
}