示例#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!");
    }
}
示例#2
0
文件: move.c 项目: anylonen/omega
void l_arena_exit(void)
{
  resetgamestatus(ARENA_MODE);
#ifndef MSDOS_SUPPORTED_ANTIQUE
  free_level(Level);
#endif
  Level = NULL;
  change_environment(E_CITY);
}
示例#3
0
文件: move.c 项目: anylonen/omega
void l_fire(void)
{
  print1("You boldly stride through the curtain of fire...");
  if (gamestatusp(MOUNTED)) {
    print2("Your horse is fried and so are you...");
    resetgamestatus(MOUNTED);
  }
  p_damage(random_range(100),FLAME,"self-immolation");
}
示例#4
0
/* use a thieves pick */
void i_pick(pob o)
{
    int dir;
    int ox,oy;
    o->used = FALSE;
    if ((! o->known) && (! Player.rank[THIEVES]))
        mprint("You have no idea what do with a piece of twisted metal.");
    else {
        if (o->known < 1) o->known = 1;
        Objects[o->id].known = 1;
        mprint("Pick lock:");
        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) {
                if (Level->depth == MaxDungeonLevels-1)
                    mprint("The lock is too complicated for you!!!");
                else if (Level->depth*2 + random_range(50) <
                         Player.dex+Player.level+Player.rank[THIEVES]*10) {
                    mprint("You picked the lock!");
                    Level->site[ox][oy].aux = UNLOCKED;
                    lset(ox, oy, CHANGED);
                    gain_experience(max(3,Level->depth));
                }
                else mprint("You failed to pick the lock.");
            }
            else mprint("That door is already unlocked!");
        }
    }
}
示例#5
0
文件: move.c 项目: anylonen/omega
void l_lava(void)
{
  print1("Very clever -- walking into a pool of lava...");
  if (gamestatusp(MOUNTED)) {
    print2("Your horse is incinerated... You fall in too!");
    resetgamestatus(MOUNTED);
  }
  morewait();
  if (strcmp(Player.name,"Saltheart Foamfollower")==0) {
    print1("Strangely enough, you don't seem terribly affected.");
    p_damage(1,UNSTOPPABLE,"slow death in a pool of lava");
  }
  else {
    p_damage(random_range(75),FLAME,"incineration in a pool of lava");
    if (Player.hp> 0) p_drown();
    Player.status[IMMOBILE]+=2;
  }
}
示例#6
0
文件: move.c 项目: anylonen/omega
void l_chaos(void)
{
  if (gamestatusp(MOUNTED)) {
    print1("Your steed tries to swim in the raw Chaos, but seems to");
    print2("be having some difficulties...");
    morewait();
    print1("probably because it's just turned into a chaffinch.");
    morewait();
    resetgamestatus(MOUNTED);
  }
  if (! onewithchaos)
    print1("You are immersed in raw Chaos....");
  if (Player.rank[ADEPT]) {
    if (! onewithchaos)
    {
      onewithchaos = 1;
      print2("You achieve oneness of Chaos....");
    }
    Player.mana = max(Player.mana,calcmana());
    Player.hp = max(Player.hp, Player.maxhp);
  }
  else if (onewithchaos) /* adept that gets amnesia from chaos storm */
  {
    print2("The chaos sea doesn't seem to bother you at all.");
  }
  else if (Player.rank[PRIESTHOOD] && (! saved)) {
    print2("A mysterious force protects you from the Chaos!");
    print3("Wow.... You feel a bit smug.");
    gain_experience(500);
    saved = TRUE;
  }
  else {
    print2("Uh oh....");
    if (saved) nprint2("Nothing mysterious happens this time....");
    morewait();
    print1("Congratulations! You've achieved maximal entropy!");
    Player.alignment -= 50;
    gain_experience(1000);
    p_death("immersion in raw Chaos");
  }
}
示例#7
0
/* Prayer occurs at altars, hence the name of the function */
void l_altar()
{
    int i;
    int deity;
    char response;

    if(Current_Environment == E_COUNTRYSIDE) {
        deity = DRUID;
    }
    else {
        deity = Level->site[Player.x][Player.y].aux;
    }

    switch(deity) {
    case ODIN:
        print1("This granite altar is graven with a gallows.");

        break;
    case SET:
        print1("This sandstone altar has a black hand drawn on it.");

        break;
    case HECATE:
        print1("This silver altar is inlaid with a black cresent moon.");

        break;
    case ATHENA:
        print1("This golden altar is inscribed with an owl.");

        break;
    case DESTINY:
        print1("This crystal altar is in the form of an omega.");

        break;
    case DRUID:
        print1("This oaken altar is ornately engraved with leaves.");

        break;
    default:
        print1("This rude altar has no markings.");

        break;
    }

    print2("Worship at this altar? [yn] ");

    if(ynq2() == 'y') {
        if(Player.rank[PRIESTHOOD] == 0) {
            increase_priest_rank(deity);
        }
        else if(!check_sacrilege(deity)) {
            if(Blessing) {
                print1("You have a sense of immanence.");
            }

            print2("Request a Blessing, Sacrifice an item, or just Pray [b,s,p] ");
            response = mcigetc();

            while((response != 'b')
                  && (response != 's')
                  && (response != 'p')
                  && (response != ESCAPE)) {
                response = mcigetc();
            }

            if(response == 'b') {
                print1("You beg a heavenly benefice.");
                print2("You hear a gong resonating throughout eternity...");
                morewait();

                if(Blessing) {
                    print1("A shaft of lecent radiance lances dwon from the heavens!");
                    print2("You feel uplifted...");
                    morewait();
                    gain_experience(Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * 50);
                    cleanse(1);
                    heal(10);
                    bless(1);
                    Blessing = FALSE;
                    increase_priest_rank(deity);
                }
                else {
                    print1("Your ardent plea is ignored.");
                    print2("You feel ashamed.");
                    Player.xp -= (Player.xp / 4);
                }

                calc_melee();
            }
            else if(response == 's') {
                print1("Which item to Sacrifice?");
                i = getitem('\0');

                if(i == ABORT) {
                    i = 0;
                }

                if(Player.possessions[i] == NULL) {
                    print1("You have insulted your deity!");
                    print2("Not a good idea, as it turns out...");
                    dispel(-1);
                    p_damage(Player.hp - 1, UNSTOPPABLE, "a god's pique");
                }
                else if(true_item_value(Player.possessions[i]) > (Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * 50)) {
                    print1("With a burst of blue flame, your offering vanishes!");
                    dispose_lost_objects(1, Player.possessions[i]);
                    print2("A violet nimbus settles around your head and slowly fades.");
                    morewait();
                    Blessing = TRUE;
                }
                else {
                    print1("A darkling glow envelopes your offering!");
                    print2("The glow slowly fades...");
                    morewait();
                    setgamestatus(SUPPRESS_PRINTING);

                    if(Player.possessions[i]->used) {
                        Player.possessions[i]->used = FALSE;
                        item_use(Player.possessions[i]);
                        Player.possessions[i]->blessing = -1 - abs(Player.possessions[i]->blessing);
                        Player.possessions[i]->used = TRUE;
                        item_use(Player.possessions[i]);
                    }
                    else {
                        Player.possessions[i]->blessing = -1 - abs(Player.possessions[i]->blessing);
                    }

                    resetgamestatus(SUPPRESS_PRINTING);
                }
            }
            else if(response == 'p') {
                if(deity != Player.patron) {
                    print1("Nothing seems to happen.");
                }
                else {
                    increase_priest_rank(deity);
                }
            }
        }
    }
}
示例#8
0
/* enchant */
void enchant(int delta)
{
    int i,used = FALSE;
    long change_cash;

    if (delta < 0) {
        i = random_item();
        if (i == ABORT || Player.possessions[i]->usef == I_NOTHING ||
                Player.possessions[i]->usef == I_NO_OP ||
                Player.possessions[i]->usef == I_NORMAL_ARMOR ||
                Player.possessions[i]->usef == I_NORMAL_WEAPON ||
                Player.possessions[i]->usef == I_NORMAL_SHIELD ||
                Player.possessions[i]->objchar == FOOD ||
                Player.possessions[i]->objchar == MISSILEWEAPON) {
            print1("You feel fortunate.");
            morewait();
        }
        else if (Player.possessions[i]->blessing < 0 ||
                 (Player.possessions[i]->objchar == ARTIFACT && random_range(3))) {
            if (Player.possessions[i]->uniqueness == COMMON)
                print1("Your ");
            nprint1(itemid(Player.possessions[i]));
            nprint1(" glows, but the glow flickers out...");
            morewait();
        }
        else {
            used = (Player.possessions[i]->used);
            if (used) {
                Player.possessions[i]->used = FALSE;
                item_use(Player.possessions[i]);
            }
            if (Player.possessions[i]->uniqueness == COMMON)
                print1("Your ");
            nprint1(itemid(Player.possessions[i]));
            nprint1(" radiates an aura of mundanity!");
            morewait();
            Player.possessions[i]->plus = 0;
            Player.possessions[i]->charge = -1;
            Player.possessions[i]->usef = I_NOTHING;
            if (used) {
                Player.possessions[i]->used = TRUE;
                item_use(Player.possessions[i]);
            }
        }
    }
    else {
        i = getitem(CASH);
        if (i == ABORT) {
            print1("You feel unlucky.");
            morewait();
        }
        else if (i == CASHVALUE) {
            print1("You enchant your money.... What a concept!");
            change_cash = Player.cash*(random_range(7) - 3)/6;
            if (change_cash > 0) print2("Seems to have been a good idea!");
            else print2("Maybe it wasn't such a good idea....");
            Player.cash += change_cash;
            morewait();
        }
        else if (Player.possessions[i]->objchar == ARTIFACT) {
            if (Player.possessions[i]->usef !=
                    Objects[Player.possessions[i]->id].usef) {
                print1("It re-acquires its magical aura!");
                Player.possessions[i]->usef = Objects[Player.possessions[i]->id].usef;
            }
            else {
                print1("The enchantment spell enfolds the ");
                nprint1(itemid(Player.possessions[i]));
                print2("and the potent enchantment of the Artifact causes a backlash!");
                morewait();
                clearmsg();
                manastorm(Player.x,Player.y,Player.possessions[i]->level*5);
            }
        }
        else {
            if (Player.possessions[i]->plus > random_range(20)+1) {
                print1("Uh-oh, the force of the enchantment was too much!");
                print2("There is a loud explosion!");
                morewait();
                manastorm(Player.x,Player.y,Player.possessions[i]->plus*5);
                dispose_lost_objects(1,Player.possessions[i]);
            }
            else {
                used = (Player.possessions[i]->used);
                if (used) {
                    setgamestatus(SUPPRESS_PRINTING);
                    Player.possessions[i]->used = FALSE;
                    item_use(Player.possessions[i]);
                    resetgamestatus(SUPPRESS_PRINTING);
                }
                print1("The item shines!");
                morewait();
                Player.possessions[i]->plus += delta+1;
                if (Player.possessions[i]->charge > -1)
                    Player.possessions[i]->charge +=
                        ((delta+1) * (random_range(10) + 1));
                if (used) {
                    setgamestatus(SUPPRESS_PRINTING);
                    Player.possessions[i]->used = TRUE;
                    item_use(Player.possessions[i]);
                    resetgamestatus(SUPPRESS_PRINTING);
                }
            }
        }
        calc_melee();
    }
}
示例#9
0
/* bless */
void bless(int blessing)
{
    int index,used;

    if (blessing < 0) {
        index = random_item();
        if (index == ABORT) {
            print1("You feel fortunate.");
            morewait();
        }
        else {
            print1("A foul odor arises from ");
            if (Player.possessions[index]->uniqueness == COMMON)
                nprint1("your ");
            nprint1(itemid(Player.possessions[index]));
            morewait();
            used = (Player.possessions[index]->used);
            if (used) {
                setgamestatus(SUPPRESS_PRINTING);
                Player.possessions[index]->used = FALSE;
                item_use(Player.possessions[index]);
                resetgamestatus(SUPPRESS_PRINTING);
            }
            Player.possessions[index]->blessing -= 2;
            if (Player.possessions[index]->blessing < 0)
                Player.possessions[index]->plus =
                    abs(Player.possessions[index]->plus) - 1;
            if (used) {
                setgamestatus(SUPPRESS_PRINTING);
                Player.possessions[index]->used = TRUE;
                item_use(Player.possessions[index]);
                resetgamestatus(SUPPRESS_PRINTING);
            }
        }
    }
    else {
        index = getitem(NULL_ITEM);
        if (index == CASHVALUE) {
            print1("Blessing your money has no effect.");
            morewait();
        }
        else if (index != ABORT) {
            used = (Player.possessions[index]->used == TRUE);
            if (used) {
                setgamestatus(SUPPRESS_PRINTING);
                Player.possessions[index]->used = FALSE;
                item_use(Player.possessions[index]);
                resetgamestatus(SUPPRESS_PRINTING);
            }
            print1("A pure white light surrounds the item... ");
            if (Player.possessions[index]->blessing < 0-(blessing+1)) {
                print2("which is evil enough to resist the effect of the blessing!");
                morewait();
            }
            else if (Player.possessions[index]->blessing < -1) {
                print2("which disintegrates under the influence of the holy aura!");
                morewait();
                Player.itemweight -=  Player.possessions[index]->weight;
                dispose_lost_objects(1,Player.possessions[index]);
            }
            else if (Player.possessions[index]->blessing < blessing+1) {
                print2("which now seems affected by afflatus!");
                morewait();
                Player.possessions[index]->blessing++;
                Player.possessions[index]->plus =
                    abs(Player.possessions[index]->plus)+1;
            }
            else {
                print2("The hierolux fades without any appreciable effect....");
                morewait();
            }
            if (used && (Player.possessions[index] != NULL)) {
                setgamestatus(SUPPRESS_PRINTING);
                Player.possessions[index]->used = TRUE;
                item_use(Player.possessions[index]);
                resetgamestatus(SUPPRESS_PRINTING);
            }
        }
    }
    calc_melee();
}
示例#10
0
/* deal with a new player command in dungeon or city mode*/
void p_process(void)
{
    static int searchval=0;

    if (Player.status[BERSERK])
        if (goberserk()) {
            setgamestatus(SKIP_PLAYER);
            drawvision(Player.x,Player.y);
        }
    if (! gamestatusp(SKIP_PLAYER)) {
        if (searchval > 0) {
            searchval--;
            if (searchval == 0) resetgamestatus(FAST_MOVE);
        }
        drawvision(Player.x,Player.y);
        if (! gamestatusp(FAST_MOVE)) {
            searchval = 0;
            Cmd = mgetc();
            clear_if_necessary();
        }
        Command_Duration = 0;
        switch (Cmd) {
        case ' ':
        case 13:
            setgamestatus(SKIP_MONSTERS);
            break; /*no op on space or return*/
        case 6:
            abortshadowform();
            break; /* ^f */
        case 7:
            wizard();
            break; /* ^g */
        case 4:
            player_dump();
            break; /* ^d */
        case 9:
            display_pack();
            morewait();
            xredraw();
            break; /* ^i */
        case 11:
            if (gamestatusp(CHEATED)) frobgamestatus();
            break;
        case 12:
            xredraw();
            setgamestatus(SKIP_MONSTERS);
            break; /* ^l */
#if !defined(WIN32)
        case 16:
            bufferprint();
            setgamestatus(SKIP_MONSTERS);
            break; /* ^p */
#else
        case 15:
            bufferprint();
            setgamestatus(SKIP_MONSTERS);
            break; /* ^o */
#endif
        case 18:
            redraw();
            setgamestatus(SKIP_MONSTERS);
            break; /* ^r */
        case 23:
            if (gamestatusp(CHEATED)) drawscreen();
            break; /* ^w */
        case 24: /* ^x */
            if (gamestatusp(CHEATED) ||
                    Player.rank[ADEPT])
                wish(1);
            Command_Duration = 5;
            break;
        case 'a':
            zapwand();
            Command_Duration = Player.speed*8/5;
            break;
        case 'c':
            closedoor();
            Command_Duration = Player.speed*2/5;
            break;
        case 'd':
            drop();
            Command_Duration = Player.speed*5/5;
            break;
        case 'e':
            eat();
            Command_Duration = 30;
            break;
        case 'f':
            fire();
            Command_Duration = Player.speed*5/5;
            break;
        case 'g':
            pickup();
            Command_Duration = Player.speed*10/5;
            break;
        case 'i':
            do_inventory_control();
            break;
        case 'm':
            magic();
            Command_Duration = 12;
            break;
        case 'o':
            opendoor();
            Command_Duration = Player.speed*5/5;
            break;
        case 'p':
            pickpocket();
            Command_Duration = Player.speed*20/5;
            break;
        case 'q':
            quaff();
            Command_Duration = 10;
            break;
        case 'r':
            peruse();
            Command_Duration = 20;
            break;
        case 's':
            search(&searchval);
            Command_Duration = 20;
            break;
        case 't':
            talk();
            Command_Duration = 10;
            break;
        case 'v':
            vault();
            Command_Duration = Player.speed*10/5;
            break;
        case 'x':
            examine();
            Command_Duration = 1;
            break;
        case 'z':
            bash_location();
            Command_Duration = Player.speed*10/5;
            break;
        case 'A':
            activate();
            Command_Duration = 10;
            break;
        case 'C':
            callitem();
            break;
        case 'D':
            disarm();
            Command_Duration = 30;
            break;
        case 'E':
            dismount_steed();
            Command_Duration = Player.speed*10/5;
            break;
        case 'F':
            tacoptions();
            break;
        case 'G':
            give();
            Command_Duration = 10;
            break;
        case 'I':
            if (! optionp(TOPINV)) top_inventory_control();
            else {
                display_possessions();
                inventory_control();
            }
            break;
        case 'M':
            city_move();
            Command_Duration = 10;
            break;
        case 'O':
            setoptions();
#if defined(WIN32)
            show_screen();
            xredraw();
#endif
            break;
        case 'P':
            show_license();
            break; /* actually show_license is in file.c */
        case 'Q':
            quit();
            break;
        case 'R':
            rename_player();
            break;
        case 'S':
            save(FALSE);
            break;
        case 'T':
            tunnel();
            Command_Duration =  Player.speed*30/5;
            break;
        case 'V':
            version();
            break;
        case 'Z':
            bash_item();
            Command_Duration = Player.speed*10/5;
            break;
        case '.':
            rest();
            Command_Duration = 10;
            break;
        case ',':
            Command_Duration = 10;
            nap();
            break;
        case '>':
            downstairs();
            break;
        case '<':
            upstairs();
            break;
        case '@':
            p_movefunction(Level->site[Player.x][Player.y].p_locf);
            Command_Duration = 5;
            break;
        case '#':
            if (gamestatusp(CHEATED)) editstats();
            break; /* RAC - char editor */
        case '/':
            charid();
            setgamestatus(SKIP_MONSTERS);
            break;
        case '?':
            help();
            setgamestatus(SKIP_MONSTERS);
            break;
        case '4':
        case 'h':
            moveplayer(-1,0);
            Command_Duration = Player.speed*5/5;
            break;
        case '2':
        case 'j':
            moveplayer(0,1);
            Command_Duration = Player.speed*5/5;
            break;
        case '8':
        case 'k':
            moveplayer(0,-1);
            Command_Duration = Player.speed*5/5;
            break;
        case '6':
        case 'l':
            moveplayer(1,0);
            Command_Duration = Player.speed*5/5;
            break;
        case '1':
        case 'b':
            moveplayer(-1,1);
            Command_Duration = Player.speed*5/5;
            break;
        case '3':
        case 'n':
            moveplayer(1,1);
            Command_Duration = Player.speed*5/5;
            break;
        case '7':
        case 'y':
            moveplayer(-1,-1);
            Command_Duration = Player.speed*5/5;
            break;
        case '9':
        case 'u':
            moveplayer(1,-1);
            Command_Duration = Player.speed*5/5;
            break;
        case '5':
            setgamestatus(SKIP_MONSTERS); /* don't do anything; a dummy turn */
            Cmd = mgetc();
            while ((Cmd != ESCAPE) &&
                    ((Cmd < '1') || (Cmd > '9') || (Cmd=='5'))) {
                print3("Run in keypad direction [ESCAPE to abort]: ");
                Cmd = mgetc();
            }
            if (Cmd != ESCAPE) 
                setgamestatus(FAST_MOVE);
            else
                clearmsg3();
            break;
        case 'H':
            setgamestatus(FAST_MOVE);
            Cmd = 'h';
            moveplayer(-1,0);
            Command_Duration = Player.speed*4/5;
            break;
        case 'J':
            setgamestatus(FAST_MOVE);
            Cmd = 'j';
            moveplayer(0,1);
            Command_Duration = Player.speed*4/5;
            break;
        case 'K':
            setgamestatus(FAST_MOVE);
            Cmd = 'k';
            moveplayer(0,-1);
            Command_Duration = Player.speed*4/5;
            break;
        case 'L':
            setgamestatus(FAST_MOVE);
            Cmd = 'l';
            moveplayer(1,0);
            Command_Duration = Player.speed*4/5;
            break;
        case 'B':
            setgamestatus(FAST_MOVE);
            Cmd = 'b';
            moveplayer(-1,1);
            Command_Duration = Player.speed*4/5;
            break;
        case 'N':
            setgamestatus(FAST_MOVE);
            Cmd = 'n';
            moveplayer(1,1);
            Command_Duration = Player.speed*4/5;
            break;
        case 'Y':
            setgamestatus(FAST_MOVE);
            Cmd = 'y';
            moveplayer(-1,-1);
            Command_Duration = Player.speed*4/5;
            break;
        case 'U':
            setgamestatus(FAST_MOVE);
            Cmd = 'u';
            moveplayer(1,-1);
            Command_Duration = Player.speed*4/5;
            break;
        default:
            commanderror();
            setgamestatus(SKIP_MONSTERS);
            break;
        }
    }
    if (Current_Environment != E_COUNTRYSIDE) roomcheck();
    screencheck(Player.x,Player.y);
}
示例#11
0
/* Consider one monster's action */
void m_pulse(struct monster *m)
{
    int range = distance(m->x, m->y, Player.x, Player.y);

    if(Time % 10 == 0) {
        if(m->hp < Monsters[m->id].hp) {
            ++m->hp;
        }
    }

    if(!m_statusp(m, AWAKE) && (range <= m->wakeup)) {
        m_status_set(m, AWAKE);
        resetgamestatus(FAST_MOVE);
    }

    if(m_statusp(m, AWAKE)) {
        if(m_statusp(m, WANDERING)) {
            if(m_statusp(m, MOBILE)) {
                m_random_move(m);
            }

            if(range <= m->sense) {
                m_status_reset(m, WANDERING);
            }
        }
        else {
            /* Not wandering */
            if(m_statusp(m, HOSTILE)) {
                if((range > 2) && (range < m->sense) && (random_range(2) == 1)) {
                    if(los_p(m->x, m->y, Player.x, Player.y)
                       && (Player.status[INVISIBLE] == 0)) {
                        monster_strike(m);
                    }
                }
            }

            if((m_statusp(m, HOSTILE) || m_statusp(m, NEEDY))
               && (range > 1)
               && m_statusp(m, MOBILE)) {
                monster_move(m);

                /* If monster is greedy, picks up treasure it finds */
                if(m_statusp(m, GREEDY)) {
                    while(Level->site[m->x][m->y].things != NULL) {
                        m_pickup(m, Level->site[m->x][m->y].things->thing);
                        Level->site[m->x][m->y].things = Level->site[m->x][m->y].things->next;
                    }
                }
            }

            if(m_statusp(m, HOSTILE) && (range == 1)) {
                resetgamestatus(FAST_MOVE);
                tacmonster(m);
            }
        }

        /* Prevents monsters form casting spells from other side of dungeon */
        if(range < max(5, m->level)) {
            monster_special(m);
        }
    }
}
示例#12
0
文件: move.c 项目: anylonen/omega
void l_magic_pool(void)
{
  int possibilities=random_range(100);
  print1("This pool seems to be enchanted....");
  if (gamestatusp(MOUNTED)) {
    if (random_range(2)) {
      print2("Your horse is polymorphed into a fig newton.");
      resetgamestatus(MOUNTED);
    }
    else print2("Whatever it was, your horse enjoyed it....");
  }
  else  if (possibilities == 0) {
    print1("Oh no! You encounter the DREADED AQUAE MORTIS...");
    if (random_range(1000) < Player.level*Player.level*Player.level) {
      print2("The DREADED AQUAE MORTIS throttles you within inches....");
      print3("but for some reason chooses to let you escape.");
      gain_experience(500);
      Player.hp = 1;
    }
    else p_death("the DREADED AQUAE MORTIS!");
  }
  else if (possibilities < 25)
    augment(0);
  else if (possibilities < 30)
    augment(1);
  else if (possibilities < 60)
    augment(-1);
  else if (possibilities < 65)
    cleanse(1);
  else if (possibilities < 80) {
    if (Player.possessions[O_WEAPON_HAND] != NULL) {
      print1("You drop your weapon in the pool! It's gone forever!");
      dispose_lost_objects(1,Player.possessions[O_WEAPON_HAND]);
    }
    else print1("You feel fortunate.");
  }
  else if (possibilities < 90) {
    if (Player.possessions[O_WEAPON_HAND] != NULL) {
      print1("Your weapon leaves the pool with a new edge....");
      Player.possessions[O_WEAPON_HAND]->plus += random_range(10)+1;
      calc_melee();
    }
    else print1("You feel unfortunate.");
  }
  else if (possibilities < 95) {
    Player.hp += 10;
    print1("You feel healthier after the dip...");
  }
  else if (possibilities < 99) {
    print1("Oooh, a tainted pool...");
    p_poison(10);
  }
  else if (possibilities == 99) {
    print1("Wow! A pool of azoth!");
    heal(10);
    cleanse(1);
    Player.mana = calcmana()*3;
    Player.str = (Player.maxstr++)*3;
  }
  print2("The pool seems to have dried up.");
  Level->site[Player.x][Player.y].locchar = TRAP;
  Level->site[Player.x][Player.y].p_locf = L_TRAP_PIT;
  lset(Player.x, Player.y, CHANGED);
}
示例#13
0
void send_to_jail(void)
{
    if (Player.rank[ORDER] > 0) {
        print1("A member of the Order of Paladins sent to jail!");
        print2("It cannot be!");
        morewait();
        print1("You are immediately expelled permanently from the Order!");
        print2("Your name is expunged from the records....");
        Player.rank[ORDER] = -1;
    }
    else if (gamestatusp(DESTROYED_ORDER))
        print1("The destruction of the Order of Paladins has negated the law!");
    else if ((Current_Environment != E_CITY) &&
             (Last_Environment != E_CITY))
        print1("Fortunately, there is no jail around here, so you are freed!");
    else {
        pacify_guards();
        if (((Current_Environment == E_HOUSE) ||
                (Current_Environment == E_MANSION) ||
                (Current_Environment == E_HOVEL)) &&
                (Last_Environment == E_CITY))
        {
            setgamestatus(SUPPRESS_PRINTING);
            change_environment(E_CITY);
            resetgamestatus(SUPPRESS_PRINTING);
        }
        if (Current_Environment == E_CITY) {
            if (gamestatusp(UNDEAD_GUARDS)) {
                print1("You are taken to a weirdly deserted chamber where an undead");
                print2("Magistrate presides over a court of ghosts and haunts.");
                morewait();
                print1("'Mr. Foreman, what is the verdict?'");
                print2("'Guilty as charged, your lordship.'");
                morewait();
                clearmsg();
                print1("'Guilty...");
                morewait();
                nprint1("Guilty...");
                morewait();
                nprint1("Guilty...");
                morewait();
                nprint1("Guilty...'");
                clearmsg();
                print1("The members of the court close in around, fingers pointing.");
                print2("You feel insubstantial hands closing around your throat....");
                print3("You feel your life draining away!");
                while(Player.level > 0) {
                    Player.level--;
                    Player.xp /= 2;
                    Player.hp /= 2;
                    dataprint();
                }
                Player.maxhp = Player.maxcon;
                morewait();
                print1("You are finally released, a husk of your former self....");
                Player.x = 58;
                Player.y = 40;
                screencheck(Player.x,Player.y);
            }
            /* Hmm...  The sorcerors ought to be able to get you free, too,
             * although of course they should have their *own* price. */
            else if (Player.alignment + random_range(200) < 0) {
                print1("Luckily for you, a smooth-tongued advocate from the");
                print2("Rampart Chaotic Liberties Union gets you off!");
                Player.x = 58;
                Player.y = 40;
                screencheck(Player.x,Player.y);
            }
            else switch(Imprisonment++) {
                case 0:
                    print1("The Magistrate sternly reprimands you.");
                    print2("As a first-time offender, you are given probation.");
                    Player.y = 58;
                    Player.x = 40;
                    screencheck(Player.x,Player.y);
                    break;
                case 1:
                    print1("The Magistrate expresses shame for your conduct.");
                    print2("You are thrown in jail!");
                    morewait();
                    repair_jail();
                    Player.y = 54;
                    Player.x = 37 + (2*random_range(4));
                    screencheck(Player.x,Player.y);
                    l_portcullis_trap();
                    break;
                default:
                    print1("The Magistrate renders summary judgement.");
                    print2("You are sentenced to prison!");
                    morewait();
                    print1("The guards recognize you as a 'three-time-loser'");
                    print2("...and beat you up a little to teach you a lesson.");
                    p_damage(random_range(Imprisonment * 10),
                             UNSTOPPABLE,
                             "police brutality");
                    morewait();
                    repair_jail();
                    Player.y = 54;
                    Player.x = 37 + (2*random_range(4));
                    screencheck(Player.x,Player.y);
                    l_portcullis_trap();
                }
        }
    }
}