Example #1
0
void l_tactical_exit(void)
{
  if (optionp(CONFIRM)) {
    if (cinema_confirm("You're about to leave this place.") != 'y')
      return;
  }
  /* Free up monsters and items, and the level, if not SAVE_LEVELS */
  free_level(Level);
  Level = NULL;
  if ((Current_Environment == E_TEMPLE) || 
      (Current_Environment == E_TACTICAL_MAP) )
    change_environment(E_COUNTRYSIDE);
  else change_environment(Last_Environment);
}
Example #2
0
void l_void_station(void)
{
  int i,something=FALSE;
  if (cinema_confirm("You're about to Peter Pan into an endless void.")=='y') {
    if (Level->mlist == NULL) {
      print2("You fall forever. Eventually you die of starvation.");
      morewait();
      while(Player.hp>0) {
	Time+=60;
	hourly_check();
	usleep(250000);
      }
    }
    else {
      print1("You enter the void.");
      print2("You feel a sudden surge of power from five directions.");
      morewait();
      something = (Player.packptr > 0);
      if (! something)
	for(i=0;((i<MAXITEMS)&&(!something));i++)
	  if (Player.possessions[i] != NULL)
	    something = TRUE;
      if (something) {
	print1("The flow of power is disrupted by something!");
	print2("The power is unbalanced! You lose control!");
	morewait();
	print1("Each of your cells explodes with a little scream of pain.");
	print2("Your disrupted essence merges with the megaflow.");
	p_death("the Power of the Void");
      }
      else if (! gamestatusp(PREPARED_VOID)){
	print1("The hungry void swallows you whole!");
	print2("Your being dissipates with a pathetic little sigh....");
	p_death("the Emptyness of the Void");
      }
      else {
	print1("The flow of power rages through your body,");
	print2("but you manage to master the surge!");
	print3("You feel adept....");
	morewait();clearmsg();
	print1("With a thought, you soar up through the void to the");
	print2("place from whence you came.");
	print3("As the platform of the Challenge dwindles beneath you");
	morewait();
	clearmsg();
	print1("You see Death raise his scythe to you in a salute.");
	Player.rank[ADEPT] = 1;
	setgamestatus(COMPLETED_CHALLENGE);
	FixedPoints = calc_points();
	/* set so change_environment puts player in correct temple! */
	Player.x = 49;
	Player.y = 59;
	print2("You find yourself back in the Temple of Destiny.");
	morewait();
	change_environment(E_TEMPLE);
      }
    }
  }
  else print2("You back away from the edge....");
}
Example #3
0
void l_enter_circle(void)
{
  print1("You see a translucent stairway before you, leading down.");
  print2("Take it? [yn] ");
  if (ynq()=='y')
    change_environment(E_CIRCLE);
}
Example #4
0
void l_countryside(void)
{
    if (optionp(CONFIRM)) {
        if (cinema_confirm("You're about to return to the countryside.") != 'y')
            return;
    }
    change_environment(E_COUNTRYSIDE);
}
Example #5
0
void l_arena_exit(void)
{
  resetgamestatus(ARENA_MODE);
#ifndef MSDOS_SUPPORTED_ANTIQUE
  free_level(Level);
#endif
  Level = NULL;
  change_environment(E_CITY);
}
Example #6
0
void l_escalator(void)
{
  print1("You have found an extremely long stairway going straight up.");
  print2("The stairs are grilled steel and the bannister is rubber.");
  morewait();
  print1("Take the stairway? [yn] ");
  if (ynq1()=='y') {
    print1("The stairs suddenly start moving with a grind of gears!");
    print2("You are wafted to the surface....");
    change_environment(E_COUNTRYSIDE);
  }
}
Example #7
0
void l_house_exit(void)
{
  if (optionp(CONFIRM)) {
    clearmsg();
    if (cinema_confirm("You're about to step out of this abode.") != 'y')
      return;
  }
#ifndef MSDOS_SUPPORTED_ANTIQUE
  free_level(Level);
#endif
  Level = NULL;
  change_environment(Last_Environment);
}
Example #8
0
void l_enter_court(void)
{
  print1("You have found a magical portal! Enter it? [yn] ");
  if (ynq1()=='y') {
    if (! gamestatusp(COMPLETED_CASTLE)) {
      if (! gamestatusp(ATTACKED_ORACLE)) {
	print2("A dulcet voice says: 'Jolly good show!'");
	morewait();
      }
      setgamestatus(COMPLETED_CASTLE);
    }
    change_environment(E_COURT);
  }
}
Example #9
0
/* check to see if too much tunneling has been done in this level */
void tunnelcheck(void)
{
    if ((Level->depth == 0 && Current_Environment != E_DLAIR) ||
            Current_Environment == E_ASTRAL)
        return;
    Level->tunnelled++;
    if ((Level->tunnelled) > (Level->level_length)/4)
        mprint("Dust and stone fragments fall on you from overhead.");
    if ((Level->tunnelled) >(Level->level_length)/2)
        mprint("You hear groaning and creaking noises.");
    if ((Level->tunnelled) > (3*(Level->level_length))/4)
        mprint("The floor trembles and you hear a loud grinding screech.");
    if ((Level->tunnelled) > Level->level_length) {
        mprint("With a scream of tortured stone, the entire dungeon caves in!!!");
        gain_experience(5000);
        if (Player.status[SHADOWFORM]) {
            change_environment(E_COUNTRYSIDE);
            switch (Country[Player.x][Player.y].base_terrain_type)
            {
            case CASTLE:
            case STARPEAK:
            case CAVES:
            case VOLCANO:
                Country[Player.x][Player.y].current_terrain_type = MOUNTAINS;
                break;
            case DRAGONLAIR:
                Country[Player.x][Player.y].current_terrain_type = DESERT;
                break;
            case MAGIC_ISLE:
                Country[Player.x][Player.y].current_terrain_type = CHAOS_SEA;
                break;
            case PALACE:
                Country[Player.x][Player.y].current_terrain_type = JUNGLE;
                break;
            }
            Country[Player.x][Player.y].base_terrain_type =
                Country[Player.x][Player.y].current_terrain_type;
            c_set(Player.x, Player.y, CHANGED);
            print1("In your shadowy state, you float back up to the surface.");
            return;
        }
        mprint("You are flattened into an unpleasant jellylike substance.");
        p_death("dungeon cave-in");
    }
}
Example #10
0
void l_adept(void)
{
    print1("You see a giant shimmering gate in the form of an omega.");
    if (! gamestatusp(ATTACKED_ORACLE)) {
        if (Player.str+Player.con+Player.iq+Player.pow < 100)
            print2("A familiar female voice says: I would not advise this now....");
        else print2("A familiar female voice says: Go for it!");
    }
    morewait();
    clearmsg();
    if (cinema_confirm("You're about to step into the mystic portal.")!='y') {
        if (Player.level > 100) {
            print1("The Lords of Destiny spurn your cowardice and indecision...");
            Player.xp = 0;
            Player.level = 0;
            Player.hp = Player.maxhp = Player.con;
            Player.mana = calcmana();
            print2("You suddenly feel very inexperienced.");
            dataprint();
            morewait();
            clearmsg();
        }
        print1("You edge away from the challenge.");
    }
    else {
        clearmsg();
        print1("You pass through the portal.");
        morewait();
        drawomega();
        print1("Like wow man! Colors! ");
        if (Player.patron != DESTINY) {
            print2("Strange forces try to tear you apart!");
            p_damage(random_range(200),UNSTOPPABLE,"a vortex of chaos");
        }
        else print2("Some strange force shields you from a chaos vortex!");
        morewait();
        print1("Your head spins for a moment....");
        print2("and clears....");
        morewait();
        Player.hp = Player.maxhp;
        Player.mana = calcmana();
        change_environment(E_ABYSS);
    }
}
Example #11
0
void l_balancestone(void)
{
  print1("This is a massive granite slab teetering dangerously on a corner.");
  print2("You feel a sense of balance as you regard it.");
  morewait();
  clearmsg();
  if (cinema_confirm("Your hand naturally drifts forward to touch it.")=='y') {
    print1("A vortex of mana spins about you!");
    if (abs(Player.alignment) > random_range(50)) {
      print2("The cyclone whirls you off to a strange place!");
      morewait();
      change_environment(E_COUNTRYSIDE);
      do {
	  setPlayerXY( random_range(COUNTRY_WIDTH), random_range(COUNTRY_LENGTH));
      } while (Country[Player.x][Player.y].current_terrain_type == CHAOS_SEA);
      screencheck(Player.x,Player.y);
      drawvision(Player.x,Player.y);
    }
    else {
      print2("You are being drained of experience! Step back? [yn] ");
      if (ynq2()=='y') {
	clearmsg();
	print1("The vortex calms down, dimishes, and then disappears.");
      }
      else {
	Player.xp -= Player.xp/4;
	dataprint();
	print2("The vortex vanishes. Suddenly, there is a clap of thunder!");
	morewait();
	Player.alignment = 0;
	strategic_teleport(1);
      }
    }
  }
  else print1("You step back from the unlikely boulder.");
}
Example #12
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();
                }
        }
    }
}
Example #13
0
void l_arena(void)
{
    char response;
    Object* newitem;
    int i,prize,monsterlevel;
    char *melee = NULL;

    print1("Rampart Coliseum");
    if (Player.rank[ARENA] == 0) {
        print2("Enter the games, or Register as a Gladiator? [e,r,ESCAPE] ");
        do response = (char) mcigetc();
        while ((response != 'e') && (response != 'r') && (response != ESCAPE));
    }
    else {
        print2("Enter the games? [yn] ");
        response = ynq2();
        if (response == 'y') response = 'e';
        else response = ESCAPE;
    }
    if (response == 'r') {
        if (Player.rank[ARENA]>0)
            print2("You're already a gladiator....");
        else if (Player.rank[ORDER]>0)
            print2("We don't let Paladins into our Guild.");
        else if (Player.rank[LEGION]>0)
            print2("We don't train no stinkin' mercs!");
        else if (Player.str < 13)
            print2("Yer too weak to train!");
        else if (Player.agi < 12)
            print2("Too clumsy to be a gladiator!");
        else {
            print1("Ok, yer now an Arena Trainee.");
            print2("Here's a wooden sword, and a shield");
            morewait();
            clearmsg();
            newitem = ((Object*) checkmalloc(sizeof(Object)));
            *newitem = Objects[OB_CLUB]; /* club */
            gain_item(newitem);
            newitem = ((Object*) checkmalloc(sizeof(Object)));
            *newitem = Objects[OB_LRG_RND_SHIELD]; /* shield */
            gain_item(newitem);
            Player.rank[ARENA] = TRAINEE;
            Arena_Opponent = 3;
            morewait();
            clearmsg();
            print1("You've got 5000Au credit at the Gym.");
            Gymcredit+=5000;
        }
    }
    else if (response == 'e') {
        print1("OK, we're arranging a match....");
        morewait();
        Arena_Monster = ((Monster*) checkmalloc(sizeof(Monster)));
        Arena_Victory = false;
        switch(Arena_Opponent) {
        case 0:
            *Arena_Monster = Monsters[GEEK];
            break;
        case 1:
            *Arena_Monster = Monsters[HORNET];
            break;
        case 2:
            *Arena_Monster = Monsters[HYENA];
            break;
        case 3:
            *Arena_Monster = Monsters[GOBLIN];
            break;
        case 4:
            *Arena_Monster = Monsters[GRUNT];
            break;
        case 5:
            *Arena_Monster = Monsters[TOVE];
            break;
        case 6:
            *Arena_Monster = Monsters[APPR_NINJA];
            break;
        case 7:
            *Arena_Monster = Monsters[SALAMANDER];
            break;
        case 8:
            *Arena_Monster = Monsters[ANT];
            break;
        case 9:
            *Arena_Monster = Monsters[MANTICORE];
            break;
        case 10:
            *Arena_Monster = Monsters[SPECTRE];
            break;
        case 11:
            *Arena_Monster = Monsters[BANDERSNATCH];
            break;
        case 12:
            *Arena_Monster = Monsters[LICHE];
            break;
        case 13:
            *Arena_Monster = Monsters[AUTO_MAJOR];
            break;
        case 14:
            *Arena_Monster = Monsters[JABBERWOCK];
            break;
        case 15:
            *Arena_Monster = Monsters[JOTUN];
            break;
        default:
            if ((Player.rank[ARENA] < 5) && (Player.rank[ARENA] > 0)) {
                strcpy(Str1,Champion);
                strcat(Str1,", the arena champion");
                *Arena_Monster = Monsters[HISCORE_NPC];
                Arena_Monster->name = salloc(Str1);
                strcpy(Str2,"The corpse of ");
                strcat(Str2,Str1);
                Arena_Monster->corpseString = salloc(Str2);
                m_status_set( Arena_Monster, ALLOC );
                Arena_Monster->level = 20;
                Arena_Monster->hp = Championlevel*Championlevel*5;
                Arena_Monster->hit = Championlevel*4;
                Arena_Monster->ac = Championlevel*3;
                Arena_Monster->dmg = 100+Championlevel*2;
                Arena_Monster->xpv = Championlevel*Championlevel*5;
                Arena_Monster->speed = 3;
                melee = Arena_Monster->combatManeuvers = (char *) checkmalloc(30*sizeof(char));
                strcpy(Arena_Monster->combatManeuvers,"");
                for(i=0; i<Championlevel/5; i++)
                    strcat(Arena_Monster->combatManeuvers,"L?R?");
                m_status_set(Arena_Monster, MOBILE);
                m_status_set(Arena_Monster, HOSTILE);
            }
            else {
                do
                    i = random_range(ML9 - ML0) + ML0;
                while (i == NPC || i == HISCORE_NPC || i == ZERO_NPC ||
                        (Monsters[i].uniqueness != COMMON) ||
                        (Monsters[i].dmg == 0));
                *Arena_Monster = Monsters[i];
            }
            break;
        }
        monsterlevel = Arena_Monster->level;
        if (Arena_Monster->level != 20) {
            strcpy(Str1,nameprint());
            strcat(Str1," the ");
            strcat(Str1,Arena_Monster->name);
            Arena_Monster->name = salloc(Str1);
            strcpy(Str2,"The corpse of ");
            strcat(Str2,Str1);
            Arena_Monster->corpseString = salloc(Str2);
            m_status_set( Arena_Monster, ALLOC );
        }
        Arena_Monster->uniqueness = UNIQUE_MADE;
        print1("You have a challenger: ");
        print2(Arena_Monster->name);
        Arena_Monster->wasAttackedByPlayer = true;
        m_status_set(Arena_Monster,HOSTILE);
        /* DAG  pump up the stats of the arena monster; from env.c */
        /* DAG should we even do this for the champion? */
        Arena_Monster->hp += Arena_Monster->level*10;
        Arena_Monster->hit += Arena_Monster->hit;
        Arena_Monster->dmg += Arena_Monster->dmg/2;

        morewait();
        clearmsg();
        change_environment(E_ARENA);
        print1("Let the battle begin....");

        time_clock(true);
        while (Current_Environment == E_ARENA)
            time_clock(false);

        /* DAG all this nasty mess cleaned up...  */
        /* one process with m_status_set( Arena_Monster, ALLOC) */

        /* free(name); */
        /* free(corpse); */

        if (melee)
            free(melee);
        if (! Arena_Victory) {
            print1("The crowd boos your craven behavior!!!");
            if (Player.rank[ARENA] > 0) {
                print2("You are thrown out of the Gladiator's Guild!");
                morewait();
                clearmsg();
                if (Gymcredit > 0) print1("Your credit at the gym is cut off!");
                Gymcredit = 0;
                Player.rank[ARENA] = -1;
            }
        }
        else {
            Arena_Opponent++;
            if (monsterlevel == 20) {
                print1("The crowd roars its approval!");
                if (Player.rank[ARENA]) {
                    print2("You are the new Arena Champion!");
                    Championlevel = Player.level;
                    strcpy(Champion,Player.name);
                    Player.rank[ARENA] = 5;
                    morewait();
                    Championbehavior = fixnpc(4);
                    save_hiscore_npc(11);
                    print1("You are awarded the Champion's Spear: Victrix!");
                    morewait();
                    newitem = ((Object*) checkmalloc(sizeof(Object)));
                    *newitem = Objects[OB_VICTRIX];
                    gain_item(newitem);

                }
                else {
                    print1("As you are not an official gladiator,");
                    nprint1("you are not made Champion.");
                    morewait();
                }
            }
            morewait();
            clearmsg();
            print1("Good fight! ");
            nprint1("Your prize is: ");
            prize = max(25,monsterlevel * 50);
            if (Player.rank[ARENA] > 0) prize *= 2;
            mnumprint(prize);
            nprint1("Au.");
            Player.cash+=prize;
            if ((Player.rank[ARENA]<4) &&
                    (Arena_Opponent>5) &&
                    (Arena_Opponent % 3 == 0)) {
                if (Player.rank[ARENA]>0) {
                    Player.rank[ARENA]++;
                    morewait();
                    print1("You've been promoted to a stronger class!");
                    print2("You are also entitled to additional training.");
                    Gymcredit+=Arena_Opponent*1000;
                }
            }
        }
        xredraw();
    }
    else clearmsg();
}
Example #14
0
void l_oracle(void)
{
    char response;
    if (gamestatusp(ATTACKED_ORACLE) && (! gamestatusp(COMPLETED_ASTRAL))) {
        print1("You come before a blue crystal dais. You see a broken mirror.");
        print2("Look in the mirror? [yn] ");
        if (ynq2()=='y') {
            print1("A strange force rips you from your place....");
            Player.hp = 1;
            print2("You feel drained....");
            dataprint();
            print3("You find yourself in a weird flickery maze.");
            change_environment(E_ASTRAL);
        }
    }
    else {
        print1("You come before a blue crystal dais. There is a bell and a mirror.");
        print2("Ring the bell [b], look in the mirror [m], or leave [ESCAPE] ");
        do response = (char) mcigetc();
        while ((response != 'b') && (response != 'm') && (response != ESCAPE));
        if (response == 'b') {
            print1("The ringing note seems to last forever.");
            print2("You notice a robed figure in front of you....");
            morewait();
            print1("The oracle doffs her cowl. Her eyes glitter with blue fire!");
            print2("Attack her? [yn] ");
            if (ynq2() == 'y') {
                setgamestatus(ATTACKED_ORACLE);
                print1("The oracle deftly avoids your attack.");
                print2("She sneers at you and vanishes.");
            }
            else {
                print2("She stares at you...and speaks:");
                if (!gamestatusp(SPOKE_TO_DRUID)) {
                    print3("'The ArchDruid speaks wisdom in his forest shrine.'");
                }
                else if (!gamestatusp(COMPLETED_CAVES)) {
                    print3("'Thou mayest find aught of interest in the caves to the South.'");
                }
                else if (!gamestatusp(COMPLETED_SEWERS)) {
                    print3("'Turn thy attention to the abyssal depths of the city.'");
                }
                else if (!gamestatusp(COMPLETED_CASTLE)) {
                    print3("'Explorest thou the depths of the Castle of the ArchMage.'");
                }
                else if (!gamestatusp(COMPLETED_ASTRAL)) {
                    morewait();
                    print1("'Journey to the Astral Plane and meet the Gods' servants.'");
                    print2("The oracle holds out her hand. Do you take it? [yn] ");
                    if (ynq2()=='y') {
                        print1("'Beware: Only the Star Gem can escape the Astral Plane.'");
                        print2("A magic portal opens behind the oracle. She leads you");
                        morewait();
                        print1("through a sequence of special effects that would have");
                        print2("IL&M technicians cursing in awe and deposits you in an");
                        morewait();
                        clearmsg();
                        print1("odd looking room whose walls seem strangely insubstantial.");
                        gain_experience(5000);
                        change_environment(E_ASTRAL);
                    }
                    else print3("You detect the hint of a sneer from the oracle.");
                }
                else if (!gamestatusp(COMPLETED_VOLCANO)) {
                    print3("'The infernal maw may yield its secrets to thee now.'");
                }
                else if (!gamestatusp(COMPLETED_CHALLENGE)) {
                    print3("'The challenge of adepthood yet awaits thee.'");
                }
                else {
                    morewait();
                    print1("'My lord: Thou hast surpassed my tutelage forever.");
                    print2("Fare thee well.'");
                    print3("The oracle replaces her hood and seems to fade away....");
                }
            }
        }
        else if (response == 'm') {
            print1("You seem to see yourself. Odd....");
            knowledge(1);
        }
        else print2("You leave this immanent place.");
    }
}
Example #15
0
void l_mansion(void)
{
    if (cinema_confirm("You're about to enter a palatial mansion.")=='y')
        change_environment(E_MANSION);
}
Example #16
0
void l_house(void)
{
    if (cinema_confirm("You're about to walk into someone's house.")=='y')
        change_environment(E_HOUSE);
}
Example #17
0
void l_hovel(void)
{
    if (cinema_confirm("You're about to duck into a hovel.")=='y')
        change_environment(E_HOVEL);
}
Example #18
0
void l_safe(void)
{
    char response;
    pob newitem;
    int attempt = 0;
    response = cinema_interact("pfqi",
                               "You have discovered a safe!",
                               "Pick the lock [p], Force the door [f], or ignore [ESCAPE]",
                               NULL);

    if (response == 'p')
        attempt = (2*Player.dex + Player.rank[THIEVES]*10 - random_range(100))/10;
    else if (response == 'f')
        attempt = (Player.dmg - random_range(100))/10;
    if (attempt > 0) {
        Player.alignment -= 4;
        gain_experience(50);
        print2("The door springs open!");
        Level->site[Player.x][Player.y].locchar = FLOOR;
        Level->site[Player.x][Player.y].p_locf = L_NO_OP;
        lset(Player.x, Player.y, CHANGED);
        if (random_range(2) == 1) {
            print1("You find:");
            do {
                newitem = create_object(difficulty());
                print2(itemid(newitem));
                morewait();
                gain_item(newitem);
            } while (random_range(3) == 1);
        }
        else print2("The safe was empty (awwwww....)");
    }
    else {
        print3("Your attempt at burglary failed!");
        if (attempt == -1) {
            print1("A siren goes off! You see flashing red lights everywhere!");
            morewait();
            if (Last_Environment == E_CITY) {
                print2("The city guard shows up! They collar you in no time flat!");
                change_environment(E_CITY);
                morewait();
                send_to_jail();
            }
        }
        else if (attempt == -2) {
            print1("There is a sudden flash!");
            p_damage(random_range(25),FLAME,"a safe");
            print2("The safe has self-destructed.");
            Level->site[Player.x][Player.y].locchar = RUBBLE;
            Level->site[Player.x][Player.y].p_locf = L_RUBBLE;
            lset(Player.x, Player.y, CHANGED);
        }
        else if (attempt == -3) {
            print1("The safe jolts you with electricity!");
            lball(Player.x,Player.y,Player.x,Player.y,30);
        }
        else if (attempt < -3) {
            print1("You are hit by an acid spray!");
            if (Player.possessions[O_CLOAK] != NULL) {
                print2("Your cloak is destroyed!");
                conform_lost_object(Player.possessions[O_CLOAK]);
                p_damage(10,ACID,"a safe");
            }
            else if (Player.possessions[O_ARMOR] != NULL) {
                print2("Your armor corrodes!");
                Player.possessions[O_ARMOR]->dmg-=3;
                Player.possessions[O_ARMOR]->hit-=3;
                Player.possessions[O_ARMOR]->aux-=3;
                p_damage(10,ACID,"a safe");
            }
            else {
                print2("The acid hits your bare flesh!");
                p_damage(random_range(100),ACID,"a safe");
            }
        }
    }
}
Example #19
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);
      }
    }
  }
}
Example #20
0
void l_lift(void)
{
  char response;
  int levelnum;
  int distance;
  int too_far = 0;

  Level->site[Player.x][Player.y].locchar = FLOOR;
  Level->site[Player.x][Player.y].p_locf = L_NO_OP;
  lset(Player.x, Player.y, CHANGED);
  print1("You walk onto a shimmering disk....");
  print2("The disk vanishes, and a glow surrounds you.");
  print3("You feel weightless.... You feel ghostly....");
  morewait();
  clearmsg();
  print1("Go up, down, or neither [u,d,ESCAPE] ");
  do response = (char) mcigetc();
  while ((response != 'u') && 
	 (response != 'd') &&
	 (response != ESCAPE));
  if (response != ESCAPE) {
    print1("How many levels?");
    levelnum = (int) parsenum("");
    if (levelnum > 6) {
      too_far = 1;
      levelnum = 6;
    }
    if (response == 'u' && Level->depth - levelnum < 1) {
      distance = levelnum - Level->depth;
      change_environment(E_COUNTRYSIDE); /* "you return to the countryside." */
      if (distance > 0) {
	nprint1("..");
	print2("...and keep going up!  You hang in mid air...");
	morewait();
	print3("\"What goes up...\"");
	morewait();
	print3("Yaaaaaaaah........");
	p_damage(distance*10,NORMAL_DAMAGE,"a fall from a great height");
      }
      return;
    }
    else if (response == 'd' && Level->depth + levelnum > MaxDungeonLevels) {
      too_far = 1;
      levelnum = MaxDungeonLevels - Level->depth;
    }
    if (levelnum == 0) {
      print1("Nothing happens.");
      return;
    }
    if (too_far) {
      print1("The lift gives out partway...");
      print2("You rematerialize.....");
    }
    else
      print1("You rematerialize.....");
    change_level(Level->depth,
		(response=='d' ? 
		 Level->depth+levelnum : 
		 Level->depth-levelnum),
		FALSE);
    roomcheck();
  }
}