Example #1
0
void l_vault(void)
{
    print1("You come to a thick vault door with a complex time lock.");
    if ((hour()==23)) {
        print2("The door is open.");
        Level->site[12][56].locchar = FLOOR;
    }
    else {
        print2("The door is closed.");
        Level->site[12][56].locchar = WALL;
        morewait();
        clearmsg();
        if (cinema_confirm("You're about to try to crack the safe.")=='y') {
            if (random_range(100) < Player.rank[THIEVES]*Player.rank[THIEVES]) {
                print2("The lock clicks open!!!");
                gain_experience(5000);
                Level->site[12][56].locchar = FLOOR;
            }
            else {
                print2("Uh, oh, set off the alarm.... The castle guard arrives....");
                morewait();
                if (Player.rank[NOBILITY] == DUKE) {
                    clearmsg();
                    print1("\"Ah, just testing us, your Grace?  I hope we're up to scratch.\"");
                    morewait();
                }
                else
                    send_to_jail();
            }
        }
        else print2("Good move.");
    }
}
Example #2
0
void l_order(void)
{
  pob newitem;
  pml ml;
  print1("The Headquarters of the Order of Paladins.");
  morewait();
  if ((Player.rank[ORDER]==PALADIN) &&
      (Player.level > Justiciarlevel) &&
      gamestatusp(GAVE_STARGEM) &&
      Player.alignment > 300) {
    print1("You have succeeded in your quest!");
    morewait();
    print1("The previous Justiciar steps down in your favor.");
    print2("You are now the Justiciar of Rampart and the Order!");
    strcpy(Justiciar,Player.name);
    for (ml = Level->mlist; ml && (ml->m->id != HISCORE_NPC ||
	ml->m->aux2 != 15); ml = ml->next)
      /* just scan for current Justicar */;
    if (ml) {
      m_remove(ml->m); /* signals "death" -- no credit to player, though */
    }
    Justiciarlevel = Player.level;
    morewait();
    Justiciarbehavior = fixnpc(4);
    save_hiscore_npc(15);
    clearmsg();
    print1("You are awarded a blessed shield of deflection!");
    morewait();
    newitem = ((pob) checkmalloc(sizeof(objtype)));
    *newitem = Objects[OB_DEFLECT]; /* shield of deflection */
    newitem->blessing = 9;
    gain_item(newitem);
    morewait();
    Player.rank[ORDER] = JUSTICIAR;
    Player.maxstr += 5;
    Player.str += 5;
    Player.maxpow += 5;
    Player.pow += 5;
  }
  if (Player.alignment < 1) {
    if (Player.rank[ORDER] > 0) {
      print1("You have been tainted by chaos!");
      print2("You are stripped of your rank in the Order!");
      morewait();
      Player.rank[ORDER]= -1;
      send_to_jail();
    }
    else
      print1("Get thee hence, minion of chaos!");
  }
  else if (Player.rank[ORDER] == -1)
    print1("Thou again?  Get thee hence, minion of chaos!");
  else if (Player.rank[ORDER] == 0) {
    if (Player.rank[ARENA] != 0) 
      print1("We do not accept bloodstained gladiators into our Order.");
    else if (Player.rank[LEGION] != 0) 
      print1("Go back to your barracks, mercenary!");
    else {
      print1("Dost thou wish to join our Order? [yn] ");
      if (ynq1()=='y') {
	print1("Justiciar ");
	nprint1(Justiciar);
	nprint1(" welcomes you to the Order.");
	print2("'Mayest thou always follow the sublime path of Law.'");
	morewait();
	print1("You are now a Gallant in the Order.");
	print2("You are given a horse and a blessed spear.");
	morewait();
	Player.rank[ORDER] = GALLANT;
	Player.guildxp[ORDER] = 1;
	setgamestatus(MOUNTED);
	newitem = ((pob) checkmalloc(sizeof(objtype)));
	*newitem = Objects[OB_SPEAR]; /* spear */
	newitem->blessing = 9;
	newitem->plus = 1;
	newitem->known = 2;
	gain_item(newitem);
      }
    }
  } else {
      print1("'Welcome back, Paladin.'");
      if (!gamestatusp(MOUNTED)) {
	print2("You are given a new steed.");
	setgamestatus(MOUNTED);
      }
      morewait();
      clearmsg();
      if ((Player.hp < Player.maxhp) || (Player.status[DISEASED]) ||
	(Player.status[POISONED]))
	print1("Your wounds are treated by a medic.");
      cleanse(0);
      Player.hp = Player.maxhp;
      if ( Player.food <= 40 )
      {
        Player.food = 40;
        print2("You get a hot meal from the refectory.");
      }
      morewait();
      clearmsg();
      if (Player.rank[ORDER]==PALADIN) {
	if (Player.level <= Justiciarlevel)
	  print2("You are not experienced enough to advance.");
	else if (Player.alignment < 300)
	  print2("You are not sufficiently Lawful as yet to advance.");
	else print2("You must give the Star Gem to the LawBringer.");
      }
      else if (Player.rank[ORDER]==CHEVALIER) {
	if (Player.guildxp[ORDER] < 4000)
	  print2("You are not experienced enough to advance.");
	else if (Player.alignment < 200)
	  print2("You are not sufficiently Lawful as yet to advance.");
	else {
	  print1("You are made a Paladin of the Order!");
	  print2("You learn the Spell of Heroism and get Mithril Plate!");
	  morewait();
	  newitem = ((pob) checkmalloc(sizeof(objtype)));
	  *newitem = Objects[OB_MITHRIL_PLATE]; /* mithril plate armor */
	  newitem->blessing = 9;
	  newitem->known = 2;
	  gain_item(newitem);
	  morewait();
	  clearmsg();
	  print1("To advance you must rescue the Star Gem and return it");
	  print2("to its owner, the LawBringer, who resides on Star Peak.");
	  morewait();
	  print1("The Star Gem was stolen by the cursed Prime Sorceror,");
	  print2("whose headquarters may be found beyond the Astral Plane.");
	  morewait();
	  print1("The Oracle will send you to the Astral Plane if you");
	  print2("prove yourself worthy to her.");
	  morewait();
	  Spells[S_HERO].known = TRUE;
	  Player.rank[ORDER] = PALADIN;
	}
      }
      else if (Player.rank[ORDER]==GUARDIAN) {
	if (Player.guildxp[ORDER] < 1500)
	  print2("You are not experienced enough to advance.");
	else if (Player.alignment < 125)
	  print2("You are not yet sufficiently Lawful to advance.");
	else {
	  Player.rank[ORDER] = CHEVALIER;
	  print1("You are made a Chevalier of the Order!");
	  print2("You are given a Mace of Disruption!");
	  morewait();
	  clearmsg();
	  newitem = ((pob) checkmalloc(sizeof(objtype)));
	  *newitem = Objects[OB_MACE_DISRUPT]; /* mace of disruption */
	  newitem->known = 2;
	  gain_item(newitem);
	}
      }
      else if (Player.rank[ORDER]==GALLANT) {
	if (Player.guildxp[ORDER] < 400)
	  print2("You are not experienced enough to advance.");
	else if (Player.alignment < 50)
	  print2("You are not Lawful enough to advance.");
	else  {
	  print1("You are made a Guardian of the Order of Paladins!");
	  print2("You are given a Holy Hand Grenade (of Antioch).");
	  morewait();
	  print1("You hear a nasal monotone in the distance....");
	  print2("'...and the number of thy counting shall be 3...'");
	  morewait();
	  clearmsg();
	  Player.rank[ORDER] = GUARDIAN;
	  newitem = ((pob) checkmalloc(sizeof(objtype)));
	  *newitem = Objects[OB_ANTIOCH]; /* holy hand grenade. */
	  newitem->known = 2;
	  gain_item(newitem);
	}
      }
  }
  showflags();
}
Example #3
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....");
        }
    }
}
Example #4
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");
            }
        }
    }
}