Пример #1
0
/* Increase in level at appropriate experience gain */
void gain_level(void)
{
  int gained=FALSE;
  int hp_gain; /* FIXED! 12/30/98 */
  
  if (gamestatusp(SUPPRESS_PRINTING))
    return;
  while (expval(Player.level+1) <= Player.xp) {
    if (!gained)
      morewait();
    gained = TRUE;
    Player.level++;
    print1("You have attained a new experience level!");
    print2("You are now ");
    nprint2(getarticle(levelname(Player.level)));
    nprint2(levelname(Player.level));
    hp_gain = random_range(Player.con)+1; /* start fix 12/30/98 */
    if (Player.hp < Player.maxhp )
      Player.hp += hp_gain*Player.hp/Player.maxhp;
    else if (Player.hp < Player.maxhp + hp_gain)
      Player.hp = Player.maxhp + hp_gain;
    /* else leave current hp alone */
    Player.maxhp += hp_gain;
    Player.maxmana = calcmana();
    /* If the character was given a bonus, let him keep it.  Otherwise
     * recharge him. */
    Player.mana = max(Player.mana, Player.maxmana); /* end fix 12/30/98 */
    morewait();
  }
  if (gained) clearmsg();
  calc_melee();
}
Пример #2
0
int gymtrain(int *maxstat, int *stat)
{
    int trained = 0;

    if (Gymcredit + Player.cash < 2000)
        print2("You can't afford our training!");
    else {
        trained = 1;

        if (Gymcredit > 2000) Gymcredit -= 2000;
        else {
            Player.cash -= (2000-Gymcredit);
            Gymcredit = 0;
        }
        print2("Sweat. Sweat. ");
        if ((*maxstat < 30) &&
                ((*maxstat < random_range(30)) || (random_range(3)==1))) {
            nprint2("The training pays off!");
            (*maxstat)++;
            (*stat)++;
        }
        else {
            nprint2("You feel the healthy glow of a good workout.");
            if (*stat < *maxstat) {
                (*stat)++;
                print3("A feeling of rehabilitation washes through you.");
            }
        }
    }
    dataprint();

    return trained;
}
Пример #3
0
void l_water_station(void)
{
  print1("The fluid seems murky and unknowably deep.");
  print2("It bubbles and hisses threateningly.");
  morewait();
  if (Player.status[BREATHING]) {
    print1("You don't feel sanguine about trying to breathe that stuff!");
    morewait();
  }
  if (Player.immunity[ACID]) {
    print2("The vapor burns despite your immunity to acid!");
    morewait();
  }
  print1("Enter the fluid? [yn] ");
  if (ynq1()=='y') {
    if (Player.hp == 1) p_death("drowning in acid (ick, what a way to go)");
    else Player.hp = 1;
    dataprint();
    print2("You choke....");
    morewait();
    nprint2("Your lungs burn....");
    morewait();
    print2("Your body begins to disintegrate.... Leave the pool? [yn] ");
    if (ynq2()=='y')
      print2("Phew! That was close!");
    else {
      clearmsg();
      Player.con -= (15+random_range(15));
      if (Player.con > 0) {
	print1("That's odd, the fluid seems to have been neutralized....");
	print2("A moist miasma wafts above the void nearby.");
	Level->site[Player.x][Player.y].locchar = FLOOR;
	Level->site[Player.x][Player.y].p_locf = L_NO_OP;
	stationcheck();
      }
      else {
	print2("The bubbling fluid has destroyed your constitution!");
	p_death("the Essence of Water");
      }
    }
    
  }
  else print2("You step back from the pool of acid.");
}
Пример #4
0
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");
  }
}
Пример #5
0
void hp_req_print()
{
    morewait();
    print1("To advance further, you must obtain the Holy Symbol of ");

    switch(Player.patron) {
    case ODIN:
        nprint1(Priest[SET]);
        print2("who may be found in the main Temple of Set.");

        break;
    case SET:
        nprint1(Priest[ODIN]);
        print2("who may be found in the main Temple of Odin.");

        break;
    case ATHENA:
        nprint1(Priest[HECATE]);
        print2("who may be found in the main Temple of Hecate.");

        break;
    case HECATE:
        nprint1(Priest[ATHENA]);
        print2("who may be found in the main Temple of Athena.");

        break;
    case DRUID:
        print2("any of the aligned priests");
        nprint2(" who may be found in their main temples.");

        break;
    case DESTINY:
        nprint1(Priest[DESTINY]);
        print2("who may be found in the main Temple of Destiny.");

        break;
    }
}
Пример #6
0
int spellparse(void)
{
    int first, last, pos;
    char byte, prefix[80];
    int found = 0;
    int f, l;

    first = 0;
    while (first < NUMSPELLS && !Spells[spell_ids[first]].known)
        first++;
    if (first == NUMSPELLS) {
        print1("You don't know any spells!");
        return ABORT;
    }
    last = NUMSPELLS - 1;
    pos = 0;
    print2("");
    do {
        byte = mgetc();
        if (byte == BACKSPACE || byte == DELETE_CHAR) {
            if (pos > 0) {
                prefix[--pos] = '\0';
                byte = prefix[pos - 1];
                f = first;
                while (f >= 0 && !strncmp(prefix, spell_names[f], pos)) {
                    if (Spells[spell_ids[f]].known)
                        first = f;
                    f--;
                }
                l = last;
                while (l < NUMSPELLS && !strncmp(prefix, spell_names[l], pos)) {
                    if (Spells[spell_ids[l]].known)
                        last = l;
                    l++;
                }
                if (found)
                    found = 0;
                print2(prefix);
            }
            if (pos == 0) {
                first = 0;
                last = NUMSPELLS - 1;
                found = 0;
                print2("");
            }
        }
        else if (byte == ESCAPE) {
            xredraw();
            return ABORT;
        }
        else if (byte == '?')
            showknownspells(first, last);
        else if (byte != '\n') {
            if (byte >= 'A' && byte <= 'Z')
                byte += 'a' - 'A';
            if (found)
                continue;
            f = first;
            l = last;
            while (f < NUMSPELLS &&
                    (!Spells[spell_ids[f]].known ||
                     strlen(spell_names[f]) < pos || spell_names[f][pos] < byte))
                f++;
            while (l >= 0 && (!Spells[spell_ids[l]].known ||
                              strlen(spell_names[l]) < pos || spell_names[l][pos] > byte))
                l--;
            if (l < f)
                continue;
            prefix[pos++] = byte;
            prefix[pos] = '\0';
            nprint2(prefix + pos - 1);
            first = f;
            last = l;
            if (first == last && !found) {	/* unique name */
                found = 1;
                nprint2(spell_names[first] + pos);
            }
        }
    } while (byte != '\n');
    xredraw();
    if (found)
        return spell_ids[first];
    else {
        print3("That is an ambiguous abbreviation!");
        return ABORT;
    }
}
Пример #7
0
void increase_priest_rank(int deity)
{
    if(Player.rank[PRIESTHOOD] == 0) {
        switch(deity) {
        case ODIN:
            if(Player.alignment > 0) {
                print1("Odin hears your prayer!");
                print2(Priest[ODIN]);
                nprint2(" personally blesses you.");
                nprint2(" You are now a lay devotee of Odin.");
                Player.patron = ODIN;
                Player.rank[PRIESTHOOD] = LAY;
                Player.guildxp[PRIESTHOOD] = 1;
                morewait();
                learnclericalspells(ODIN, LAY);
            }
            else {
                print1("Odin ignores you.");
            }

            break;
        case SET:
            if(Player.alignment < 0) {
                print1("Set hears your prayer!");
                print2(Priest[SET]);
                nprint2(" personally blesses you.");
                nprint2(" You are now a lay devotee of Set.");
                Player.patron = SET;
                Player.rank[PRIESTHOOD] = LAY;
                Player.guildxp[PRIESTHOOD] = 1;
                morewait();
                learnclericalspells(SET, LAY);
            }
            else {
                print1("Set ignores you.");
            }

            break;
        case ATHENA:
            if(Player.alignment > 0) {
                print1("Athena hears your prayer!");
                print2(Priest[ATHENA]);
                nprint2(" personally blesses you.");
                nprint2(" You are now a lay devotee of Athena.");
                Player.patron = ATHENA;
                Player.rank[PRIESTHOOD] = LAY;
                Player.guildxp[PRIESTHOOD] = 1;
                morewait();
                learnclericalspells(ATHENA, LAY);
            }
            else {
                print1("Athena ignores you.");
            }

            break;
        case HECATE:
            if(Player.alignment < 0) {
                print1("Hecate hears your prayer!");
                print2(Priest[HECATE]);
                nprint2(" personally blesses you.");
                nprint2(" You are now a lay devotee of Hecate.");
                Player.patron = HECATE;
                Player.rank[PRIESTHOOD] = LAY;
                Player.guildxp[PRIESTHOOD] = 1;
                morewait();
                learnclericalspells(HECATE, LAY);
            }
            else {
                print1("Hecate ignores you.");
            }

            break;
        case DRUID:
            if(abs(Player.alignment) < 10) {
                print1(Priest[DRUID]);
                nprint1(" personally blesses you.");
                print2("You are now a lay devotee of the Druids.");
                Player.patron = DRUID;
                Player.rank[PRIESTHOOD] = LAY;
                Player.guildxp[PRIESTHOOD] = 1;
                morewait();
                learnclericalspells(DRUID, LAY);
            }
            else {
                print1("You hear a voice...");
                morewait();
                print2("\'Only those who embody the Balance my become Druids.\'");
            }

            break;
        case DESTINY:
            print1("The Lords of Destiny could hardly care less.");
            print2("But you can consider yourself now to be a lay devotee.");
            Player.patron = DESTINY;
            Player.rank[PRIESTHOOD] = LAY;
            Player.guildxp[PRIESTHOOD] = 1;
            
            break;
        default:
            print2("Some nameless god blesses you...");
            Player.hp = Player.maxhp;
            morewait();
            print2("The altar crumbles to dust and blows away.");
            Level->site[Player.x][Player.y].locchar = FLOOR;
            Level->site[Player.x][Player.y].p_locf = L_NO_OP;

            break;
        }
    }
    else if(deity == Player.patron) {
        if((((deity == ODIN) || (deity == ATHENA)) && (Player.alignment < 1))
           || (((deity == SET) || (deity == HECATE)) && (Player.alignment > 1))
           || ((deity == DRUID) && (abs(Player.alignment) > 10))) {
            print1("You have swerved from the One True Path!");
            print2("Your deity is greatly displeased...");
            Player.xp -= (Player.level * Player.level);
            Player.xp = max(0, Player.xp);
        }
        else if(Player.rank[PRIESTHOOD] == HIGHPRIEST) {
            answer_prayer();
        }
        else if(Player.rank[PRIESTHOOD] == SPRIEST) {
            if(Player.level > Priestlevel[deity]) {
                hp_req_test();
            }
            else {
                answer_prayer();
            }
        }
        else if(Player.rank[PRIESTHOOD] == PRIEST) {
            if(Player.guildxp[PRIESTHOOD] >= 4000) {
                print1("A heavenly fanfare surrounds you!");
                print2("Your deity raises you to the post of Senior Priest.");
                hp_req_print();
                Player.rank[PRIESTHOOD] = SPRIEST;
            }
            else {
                answer_prayer();
            }
        }
        else if(Player.rank[PRIESTHOOD] == ACOLYTE) {
            if(Player.guildxp[PRIESTHOOD] >= 1500) {
                print1("A trumpet sounds in the distance.");
                print2("Your deity rasies you to the post of Priest.");
                Player.rank[PRIESTHOOD] = PRIEST;
                morewait();
                learnclericalspells(deity, PRIEST);
            }
            else {
                answer_prayer();
            }
        }
        else if(Player.rank[PRIESTHOOD] == LAY) {
            if(Player.guildxp[PRIESTHOOD] >= 400) {
                print1("A mellifuous chime sounds from above the altar.");
                print2("Your deity raises you to the post of Acolyte.");
                Player.rank[PRIESTHOOD] = ACOLYTE;
                morewait();
                learnclericalspells(deity, ACOLYTE);
            }
            else {
                answer_prayer();
            }
        }
    }
}
Пример #8
0
/* gain for an item */
void acquire(int blessing)
{
    char otype;
    int index,id = ABORT;
    pob newthing;

    if (blessing < 0) {
        index = random_item();
        if (index == ABORT)
            mprint("You feel fortunate.");
        else {
            print1("Smoke drifts out of your pack.... ");
            print2("Destroyed: ");
            nprint2(itemid(Player.possessions[index]));
            morewait();
            dispose_lost_objects(1,Player.possessions[index]);
        }
    }
    else {
        newthing = ((pob) checkmalloc(sizeof(objtype)));
        /* DAG this assignment looks unneccessary */
        newthing->id = -1;
        if (gamestatusp(CHEATED))
            print1("Acquire which kind of item: !?][}{)/=%%\\& ");
        else
            print1("Acquire which kind of item: !?][}{)/=%%\\ ");
        otype = mgetc();
        switch (otype) {
        case (POTION&0xff):
            if (blessing > 0)
                id = itemlist(POTIONID,NUMPOTIONS);
            else
                id = random_range(NUMPOTIONS);
            if (id < 0) print2("You feel stupid.");
            else make_potion(newthing,id);
            break;
        case (SCROLL&0xff):
            if (blessing > 0)
                id = itemlist(SCROLLID,NUMSCROLLS);
            else
                id = random_range(NUMSCROLLS);
            if (id < 0) print2("You feel stupid.");
            else make_scroll(newthing,id);
            break;
        case (RING&0xff):
            if (blessing > 0)
                id = itemlist(RINGID,NUMRINGS);
            else
                id = random_range(NUMRINGS);
            if (id < 0) print2("You feel stupid.");
            else make_ring(newthing,id);
            break;
        case (STICK&0xff):
            if (blessing > 0)
                id = itemlist(STICKID,NUMSTICKS);
            else
                id = random_range(NUMSTICKS);
            if (id < 0) print2("You feel stupid.");
            else make_stick(newthing,id);
            break;
        case (ARMOR&0xff):
            if (blessing > 0)
                id = itemlist(ARMORID,NUMARMOR);
            else
                id = random_range(NUMARMOR);
            if (id < 0) print2("You feel stupid.");
            else make_armor(newthing,id);
            break;
        case (SHIELD&0xff):
            if (blessing > 0)
                id = itemlist(SHIELDID,NUMSHIELDS);
            else
                id = random_range(NUMSHIELDS);
            if (id < 0) print2("You feel stupid.");
            else make_shield(newthing,id);
            break;
        case (WEAPON&0xff):
            if (blessing > 0)
                id = itemlist(WEAPONID,NUMWEAPONS);
            else
                id = random_range(NUMWEAPONS);
            if (id < 0) print2("You feel stupid.");
            else make_weapon(newthing,id);
            break;
        case (BOOTS&0xff):
            if (blessing > 0)
                id = itemlist(BOOTID,NUMBOOTS);
            else
                id = random_range(NUMBOOTS);
            if (id < 0) print2("You feel stupid.");
            else make_boots(newthing,id);
            break;
        case (CLOAK&0xff):
            if (blessing > 0)
                id = itemlist(CLOAKID,NUMCLOAKS);
            else
                id = random_range(NUMCLOAKS);
            if (id < 0) print2("You feel stupid.");
            else make_cloak(newthing,id);
            break;
        case (FOOD&0xff):
            if (blessing > 0)
                id = itemlist(FOODID,NUMFOODS);
            else
                id = random_range(NUMFOODS);
            if (id < 0) print2("You feel stupid.");
            else make_food(newthing,id);
            break;
        case (THING&0xff):
            if (blessing > 0)
                id = itemlist(THINGID,NUMTHINGS);
            else
                id = random_range(NUMTHINGS);
            if (id < 0) print2("You feel stupid.");
            else make_thing(newthing,id);
            break;
        case (ARTIFACT&0xff):
            if (gamestatusp(CHEATED))
                id = itemlist(ARTIFACTID,NUMARTIFACTS);
            else
                id = -1;
            if (id < 0) print2("You feel stupid.");
            else make_artifact(newthing,id);
            break;
        default:
            print2("You feel stupid.");
        }
        xredraw();
        if (id != ABORT) {
            if (blessing > 0) {
                newthing->known = 2;
                Objects[id].known = 1;
            }
            newthing->used = FALSE;
            gain_item(newthing);
        }
        else
        {
            /* DAG newthing allocated but was not freed... was YA memory leak */
            /* use free() rather than free_obj() since newthing not initialized */
            free( (char *) newthing );
        }
    }
}
Пример #9
0
void l_castle(void)
{
    Object* o;
    int x, y;

    if (Player.level < 3) {
        print1("You can't possibly enter the castle, you nobody!");
        print2("Come back when you are famous.");
    }
    else {
        print1("You are ushered into the castle.");
        if (Player.rank[NOBILITY]<DUKE) {
            print2("His Grace, ");
            nprint2(Duke);
            nprint2("-- Duke of Rampart! <fanfare>");
            morewait();
            clearmsg();
        }
        if (Player.rank[NOBILITY]==0) {
            print1("Well, sirrah, wouldst embark on a quest? [yn] ");
            if (ynq1() == 'y') {
                print2("Splendid. Bring me the head of the Goblin King.");
                Player.rank[NOBILITY]=COMMONER;
            }
            else {
                print1("You scoundrel! Guards! Take this blackguard away!");
                morewait();
                p_damage(Player.maxhp / 2, UNSTOPPABLE, "castle guards for lese majeste");
                send_to_jail();
            }
        }
        else if (Player.rank[NOBILITY]==COMMONER) {
            if (find_and_remove_item(CORPSEID,GOBLIN_KING)) {
                print1("Good job, sirrah! I promote you to the rank of esquire.");
                Player.rank[NOBILITY]=ESQUIRE;
                gain_experience(100);
                print2("Now that you have proved yourself true, another quest!");
                morewait();
                print1("Bring to me a Holy Defender!");
                print2("One is said to be in the possession of the Great Wyrm");
                morewait();
                clearmsg();
                print1("in the depths of the sewers below the city.");
            }
            else print2("Do not return until you achieve the quest, caitiff!");
        }
        else if (Player.rank[NOBILITY]==ESQUIRE) {
            if (find_and_remove_item(OB_DEFENDER,-1)) {
                print1("My thanks, squire. In return, I dub thee knight!");
                Player.rank[NOBILITY]=KNIGHT;
                gain_experience(1000);
                print2("If thou wouldst please me further...");
                morewait();
                print1("Bring me a suit of dragonscale armor.");
                print2("You might have to kill a dragon to get one....");
            }
            else print2("Greetings, squire. My sword? What, you don't have it?");
        }
        else if (Player.rank[NOBILITY]==KNIGHT) {
            if (find_and_remove_item(OB_DRAGONSCALE,-1)) {
                print1("Thanks, good sir knight.");
                print2("Here are letters patent to a peerage!");
                Player.rank[NOBILITY]=LORD;
                gain_experience(10000);
                morewait();
                print1("If you would do me a final service...");
                print2("I require the Orb of Mastery. If you would be so kind...");
                morewait();
                print1("By the way, you might find the Orb in the possession");
                print2("Of the Elemental Master on the Astral Plane");
            }
            else print2("Your quest is not yet complete, sir knight.");
        }
        else if (Player.rank[NOBILITY]==LORD) {
            if (find_item(&o,OB_ORB_MASTERY,-1)) {
                print1("My sincerest thanks, my lord.");
                print2("You have proved yourself a true paragon of chivalry");
                morewait();
                print1("I abdicate the Duchy in your favor....");
                print2("Oh, you can keep the Orb, by the way....");
                Player.rank[NOBILITY]=DUKE;
                gain_experience(10000);
                strcpy(Duke,Player.name);
                morewait();
                Dukebehavior = fixnpc(4);
                save_hiscore_npc(12);
                for (y = 52; y < 63; y++)
                    for (x = 2; x < 52; x++) {
                        if (Level->site[x][y].p_locf == L_TRAP_SIREN) {
                            Level->site[x][y].p_locf = L_NO_OP;
                            lset(x, y, CHANGED);
                        }
                        if (x >= 12 && loc_statusp(x, y, SECRET)) {
                            lreset(x, y, SECRET);
                            lset(x, y, CHANGED);
                        }
                        if (x >= 20 && x <= 23 && y == 56) {
                            Level->site[x][y].locchar = FLOOR;
                            lset(x, y, CHANGED);
                        }
                    }

            }
            else print2("I didn't really think you were up to the task....");
        }
    }
}
Пример #10
0
void l_merc_guild(void)
{
    print1("Legion of Destiny, Mercenary Guild, Inc.");

    if (nighttime())
    {
        print2("The barracks are under curfew right now.");
        return;
    }

    print2("You enter Legion HQ, ");
    if (Player.rank[LEGION] == COMMANDANT)
    {
        nprint2("Your aide follows you to the staff room.");
        morewait();
        clearmsg();
    }
    else if (Player.rank[LEGION] > 0)
    {
        nprint2("and report to your commander.");
        morewait();
    }

    switch (Player.rank[LEGION])
    {
    case 0:
        nprint2("and see the Recruiting Centurion.");
        morewait();
        print2("Do you wish to join the Legion? [yn] ");

        if ('y' == ynq2())
        {
            clearmsg();
            if (Player.rank[ARENA] > 0)
            {
                print1("The Centurion checks your record, and gets angry:");
                print2("'The legion don't need any Arena Jocks. Git!'");
            }
            else if (Player.rank[ORDER] > 0)
            {
                print1("The Centurion checks your record, and is amused:");
                print2("'A paladin in the ranks? You must be joking.'");
            }
            else if (Player.con < 12)
            {
                print1("The Centurion looks you over, sadly.");
                print2("You are too fragile to join the legion.");
            }
            else if (Player.str < 10)
            {
                print1("The Centurion looks at you contemptuously.");
                print2("Your strength is too low to pass the physical!");
            }
            else
            {
                Object* newitem;
                bank_account * account;

                print1("You are tested for strength and stamina...");
                morewait();
                nprint1(" and you pass!");

                print2("Commandant ");
                nprint2(Commandant);
                nprint2(" shakes your hand.");
                morewait();

                print1("You are also issued a shortsword and leather.");
                print2("You are now a Legionaire.");
                morewait();
                clearmsg();

                /* gain shortsword */
                newitem = (Object*) checkmalloc(sizeof(Object));
                *newitem = Objects[OB_SHORT_SWORD];
                gain_item(newitem);

                /* gain leather armor */
                newitem = (Object*) checkmalloc(sizeof(Object));
                *newitem = Objects[OB_LEATHER];
                gain_item(newitem);

                cinema_scene("Your starting salary will be 500 AU per month paid into an account the",
                             "legion has set up for you. The password is \"loyalty\". Don't lose your card!", 0);

                /* gain bank card for salary account */
                account = bank_create_account(true, 0, "loyalty");
                account->balance = 500;

                Objects[OB_DEBIT_CARD].known = 1;
                newitem = bank_create_card(account->number, OB_DEBIT_CARD);
                gain_item(newitem);

                clearmsg();

                SalaryAmount = 500;
                SalaryAccount = account->number;

                Player.rank[LEGION] = LEGIONAIRE;
                Player.guildxp[LEGION] = 1;
                Player.str++;
                Player.con++;
                Player.maxstr++;
                Player.maxcon++;
            }
        }
        break;

    case COMMANDANT:
        print1("You find the disposition of your forces satisfactory.");
        break;

    case COLONEL:
        if ((Player.level > Commandantlevel)
                && find_and_remove_item(CORPSEID, DEMON_EMP))
        {
            print1("You liberated the Demon Emperor's Regalia!");
            morewait();
            clearmsg();

            print1("The Legion is assembled in salute to you!");
            print2("The Regalia is held high for all to see and admire.");
            morewait();
            clearmsg();

            print1("Commandant ");
            nprint1(Commandant);
            nprint1(" promotes you to replace him,");
            print2("and announces his own overdue retirement.");
            morewait();
            clearmsg();

            print1("You are the new Commandant of the Legion!");
            print2("The Emperor's Regalia is sold for a ridiculous sum.");
            morewait();
            clearmsg();

            print1("You now know the Spell of Regeneration.");
            print2("Your training is complete. You get top salary.");

            strcpy(Commandant, Player.name);
            Commandantlevel = Player.level;
            Commandantbehavior = fixnpc(4);
            save_hiscore_npc(8);

            Spells[S_REGENERATE].known = true;
            Player.rank[LEGION] = COMMANDANT;
            Player.str += 2;
            Player.con += 2;
            Player.maxstr += 2;
            Player.maxcon += 2;

            SalaryAmount = 10000;
        }
        else if (Player.level <= Commandantlevel)
        {
            clearmsg();
            print1("Your CO expresses satisfaction with your progress.");
            print2("But your service record does not yet permit promotion.");
        }
        else
        {
            clearmsg();
            print1("Why do you come empty handed?");
            print2("You must return with the Regalia of the Demon Emperor!");
        }
        break;

    case FORCE_LEADER:
        clearmsg();
        print1("Your CO expresses satisfaction with your progress.");

        if (Player.guildxp[LEGION] < merc_xps[Player.rank[LEGION]])
        {
            print2("But your service record does not yet permit promotion.");
        }
        else
        {
            print2("You have been promoted to Legion Colonel!");
            morewait();

            print1("Your next promotion is contingent on the return of");
            print2("the Regalia of the Demon Emperor.");
            morewait();

            print1("The Demon Emperor holds court at the base of a volcano");
            print2("to the far south, in the heart of a swamp.");
            morewait();
            clearmsg();

            print1("You have been taught the spell of heroism!");
            print2("You are given advanced training, and a raise.");

            Spells[S_HERO].known = true;
            Player.rank[LEGION]=COLONEL;
            Player.str++;
            Player.con++;
            Player.maxstr++;
            Player.maxcon++;

            SalaryAmount = 5000;
        }
        break;

    case CENTURION:
        clearmsg();
        print1("Your CO expresses satisfaction with your progress.");

        if (Player.guildxp[LEGION] < merc_xps[Player.rank[LEGION]])
        {
            print2("But your service record does not yet permit promotion.");
        }
        else
        {
            print2("You are now a Legion Force-Leader!");
            morewait();
            clearmsg();

            print1("You receive more training, and another raise.");

            Player.rank[LEGION]=FORCE_LEADER;
            Player.maxstr++;
            Player.str++;

            SalaryAmount = 2000;
        }
        break;

    case LEGIONAIRE:
        clearmsg();
        print1("Your CO expresses satisfaction with your progress.");

        if (Player.guildxp[LEGION] < merc_xps[Player.rank[LEGION]])
        {
            print2("But your service record does not yet permit promotion.");
        }
        else
        {
            print2("You are promoted to Legion Centurion!");
            morewait();
            clearmsg();

            print1("You get advanced training, and a higher salary.");

            Player.rank[LEGION] = CENTURION;
            Player.maxcon++;
            Player.con++;

            SalaryAmount = 1000;
        }
        break;
    }
}
Пример #11
0
void l_abyss(void)
{
  int i;
  if (Current_Environment != Current_Dungeon) {
    print1("You fall through a dimensional portal!");
    morewait();
    strategic_teleport(-1);
  }
  else {
    print1("You enter the infinite abyss!");
    morewait();
    if (random_range(100)==13) {
      print1("As you fall you see before you what seems like");
      print2("an infinite congerie of iridescent bubbles.");
      print3("You have met Yog Sothoth!!!");
      morewait();
      clearmsg();
      if (Player.alignment > -10) 
	p_death("the Eater of Souls");
      else {
	print1("The All-In-One must have taken pity on you.");
	print2("A transdimensional portal appears...");
	morewait();
	change_level(Level->depth,Level->depth+1,FALSE);
	gain_experience(2000);
	Player.alignment -= 50;
      }
    }
    else {
      i = 0;
      print1("You fall...");
      while(random_range(3)!=2) {
	if (i%6 == 0)
	    print2("and fall... ");
	else
	    nprint2("and fall... ");
	i++;
	morewait();
      }
      i++;
      print1("Finally,you emerge through an interdimensional interstice...");
      morewait();
      if (Level->depth+i>MaxDungeonLevels) {
	print2("You emerge high above the ground!!!!");
	print3("Yaaaaaaaah........");
	morewait();
	change_environment(E_COUNTRYSIDE);
	do {
	  setPlayerXY( random_range(COUNTRY_WIDTH), random_range(COUNTRY_LENGTH));
	} while(Country[Player.x][Player.y].base_terrain_type == CHAOS_SEA);
	p_damage(i*50,NORMAL_DAMAGE,"a fall from a great height");
      }
      else {
	print2("You built up some velocity during your fall, though....");
	morewait();
	p_damage(i*5,NORMAL_DAMAGE,"a fall through the abyss");
	change_level(Level->depth,Level->depth+i,FALSE);
	gain_experience(i*i*50);
      }
    }
  }
}