/* read a scroll, book, tome, etc. */ void peruse() { int index; struct object *obj; clearmsg(); if (Player.status[BLINDED] > 0) print3("You're blind -- you can't read!!!"); else if (Player.status[AFRAID] > 0) print3("You are too afraid to stop to read a scroll!"); else { print1("Read -- "); index = getitem(SCROLL); if (index == ABORT) setgamestatus(SKIP_MONSTERS); else { obj = Player.possessions[index]; if (obj->objchar != SCROLL) { print3("There's nothing written on "); nprint3(itemid(obj)); } else { nprint1("You carefully unfurl the scroll...."); morewait(); item_use(obj); dispose_lost_objects(1,obj); } } } }
/* for the examine function */ void describe_player(void) { if (Player.hp < (Player.maxhp /5)) print1("A grievously injured "); else if (Player.hp < (Player.maxhp /2)) print1("A seriously wounded "); else if (Player.hp < Player.maxhp) print1("A somewhat bruised "); else print1("A fit "); if (Player.status[SHADOWFORM]) nprint1("shadow"); else nprint1(levelname(Player.level)); nprint1(" named "); nprint1(Player.name); if (State.getMounted()) nprint1(" (riding a horse.)"); }
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; } }
/* Attempt to break an object o */ int damage_item(Object* o) { /* special case -- break star gem */ if (o->id == OB_STARGEM) { print1("The Star Gem shatters into a million glistening shards...."); if (Current_Environment == E_STARPEAK) { if (!State.getKilledLawbringer()) print2("You hear an agonizing scream of anguish and despair."); morewait(); print1("A raging torrent of energy escapes in an explosion of magic!"); print2("The energy flows to the apex of Star Peak where there is"); morewait(); clearmsg(); print1("an enormous explosion!"); morewait(); annihilate(1); print3("You seem to gain strength in the chaotic glare of magic!"); Player.str = max(Player.str, Player.maxstr + 5); /* FIXED! 12/25/98 */ Player.pow = max(Player.pow, Player.maxpow + 5); /* ditto */ Player.alignment -= 200; dispose_lost_objects(1,o); } else { morewait(); print1("The shards coalesce back together again, and vanish"); print2("with a muted giggle."); dispose_lost_objects(1,o); Objects[o->id].uniqueness = UNIQUE_UNMADE; /* FIXED! 12/30/98 */ } return 1; } else { if (o->fragility < random_range(30)) { if (o->objchar == STICK && o->charge > 0) { strcpy(Str1,"Your "); strcat(Str1,(o->blessing >= 0 ? o->truename : o->cursestr)); strcat(Str1," explodes!"); print1(Str1); morewait(); nprint1(" Ka-Blamm!!!"); /* general case. Some sticks will eventually do special things */ morewait(); manastorm(Player.x, Player.y, o->charge*o->level*10); dispose_lost_objects(1,o); return 1; } else if ((o->blessing > 0) && (o->level > random_range(10))) { strcpy(Str1,"Your "); strcat(Str1,itemid(o)); strcat(Str1," glows strongly."); print1(Str1); return 0; } else if ((o->blessing < -1) && (o->level > random_range(10))) { strcpy(Str1,"You hear an evil giggle from your "); strcat(Str1,itemid(o)); print1(Str1); return 0; } else if (o->plus > 0) { strcpy(Str1,"Your "); strcat(Str1,itemid(o)); strcat(Str1," glows and then fades."); print1(Str1); o->plus--; return 0; } else { if (o->blessing > 0) print1("You hear a faint despairing cry!"); else if (o->blessing < 0) print1("You hear an agonized scream!"); strcpy(Str1,"Your "); strcat(Str1,itemid(o)); strcat(Str1," shatters in a thousand lost fragments!"); print2(Str1); morewait(); dispose_lost_objects(1,o); return 1; } } return 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(); } } } }
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(); }
void l_sorcerors(void) { char action; int done=FALSE,fee; long total; print1("The Circle of Sorcerors."); if (Player.rank[CIRCLE] == -1) { print2("Fool! Didn't we tell you to go away?"); Player.mana = 0; dataprint(); } else while (! done) { if ((Player.rank[CIRCLE]==HIGHSORCEROR) && (Player.level > Primelevel) && find_and_remove_item(CORPSEID,LAWBRINGER)) { print2("You obtained the Crown of the Lawgiver!"); morewait(); print1("The Crown is ritually sacrificed to the Lords of Chaos."); print2("You are now the Prime Sorceror of the Inner Circle!"); strcpy(Prime,Player.name); Primelevel = Player.level; morewait(); Primebehavior = fixnpc(4); save_hiscore_npc(10); clearmsg(); print1("You learn the Spell of Disintegration!"); morewait(); clearmsg(); Spells[S_DISINTEGRATE].known = TRUE; Player.rank[CIRCLE] = PRIME; Player.maxpow += 10; Player.pow += 10; } menuclear(); menuprint("May we help you?\n\n"); menuprint("a: Become an Initiate of the Circle.\n"); menuprint("b: Raise your rank in the Circle.\n"); menuprint("c: Restore mana points\n"); menuprint("ESCAPE: Leave these Chambers of Power.\n"); showmenu(); action = mgetc(); if (action == ESCAPE) done = TRUE; else if (action == 'a') { if (Player.rank[CIRCLE] > 0) print2("You are already an initiate!"); else if (Player.alignment > 0) print2("You may not join -- you reek of Law!"); else if (Player.rank[COLLEGE] > 0) print2("Foolish Mage! You don't have the right attitude to Power!"); #ifdef INCLUDE_MONKS else if (Player.rank[MONKS] > 0) print2("Stupid monk. Go Meditate on this!"); #endif else { fee = 3000; fee += Player.alignment*100; fee += fee*(12 - Player.pow)/9; fee = max(100,fee); clearmsg(); mprint("For you, there is an initiation fee of"); mnumprint(fee); mprint(" Au."); print2("Pay it? [yn] "); if (ynq2() =='y') { if (Player.cash < fee) print3("Try again when you have the cash!"); else { print1("Prime Sorceror "); nprint1(Prime); print2("conducts your initiation into the circle of novices."); morewait(); clearmsg(); print1("You learn the Spell of Magic Missiles."); Spells[S_MISSILE].known = TRUE; Player.cash -= fee; dataprint(); Player.rank[CIRCLE] = INITIATE; Player.guildxp[CIRCLE] = 1; Player.maxpow++; Player.pow++; } } } } else if (action == 'b') { if (Player.rank[CIRCLE] == 0) print2("You have not even been initiated, yet!"); else if (Player.alignment > -1) { print1("Ahh! You have grown too lawful!!!"); print2("You are hereby blackballed from the Circle!"); Player.rank[CIRCLE] = -1; morewait(); clearmsg(); print1("A pox upon thee!"); if (! Player.immunity[INFECTION]) Player.status[DISEASED]+=100; print2("And a curse on your possessions!"); morewait(); clearmsg(); acquire(-1); clearmsg(); enchant(-1); bless(-1); print3("Die, false sorceror!"); p_damage(25,UNSTOPPABLE,"a sorceror's curse"); done = TRUE; } else if (Player.rank[CIRCLE]==PRIME) print2("You are at the pinnacle of mastery in the Circle."); else if (Player.rank[CIRCLE]==HIGHSORCEROR) { if (Player.level <= Primelevel) print2("You are not experienced enough to advance."); else print2("You must return with the Crown of the LawBringer!"); } else if (Player.rank[CIRCLE]==SORCEROR) { if (Player.guildxp[CIRCLE] < 4000) print2("You are not experienced enough to advance."); else { print1("You are now a High Sorceror of the Inner Circle!"); print2("You learn the Spell of Disruption!"); morewait(); clearmsg(); print1("To advance you must return with the LawBringer's Crown!"); print2("The LawBringer resides on Star Peak."); Spells[S_DISRUPT].known = TRUE; Player.rank[CIRCLE] = HIGHSORCEROR; Player.maxpow += 5; Player.pow += 5; } } else if (Player.rank[CIRCLE]==ENCHANTER) { if (Player.guildxp[CIRCLE] < 1500) print2("You are not experienced enough to advance."); else { print1("You are now a member of the Circle of Sorcerors!"); print2("You learn the Spell of Ball Lightning!"); Spells[S_LBALL].known = TRUE; Player.rank[CIRCLE] = SORCEROR; Player.maxpow += 2; Player.pow+=2; } } else if (Player.rank[CIRCLE]==INITIATE) { if (Player.guildxp[CIRCLE] < 400) print2("You are not experienced enough to advance."); else { print1("You are now a member of the Circle of Enchanters!"); print2("You learn the Spell of Firebolts."); Spells[S_FIREBOLT].known = TRUE; Player.rank[CIRCLE] = ENCHANTER; Player.maxpow+=2; Player.pow+=2; } } } else if (action == 'c') { done = TRUE; fee = Player.level*100; if (Player.rank[CIRCLE]) fee = fee / 2; clearmsg(); print1("That will be: "); mnumprint(fee); nprint1("Au. Pay it? [yn] "); if (ynq1()=='y') { if (Player.cash < fee) print2("Begone, deadbeat, or face the wrath of the Circle!"); else { Player.cash -= fee; total = calcmana(); while (Player.mana < total) { Player.mana++; dataprint(); } print2("Have a sorcerous day, now!"); } } else print2("Be seeing you!"); } } xredraw(); }
void l_condo(void) { pol ol,prev=NULL; int i,done=FALSE,over=FALSE,weeksleep=FALSE; char response; if (! gamestatusp(SOLD_CONDO)) { response = cinema_interact ("rp","Rampart Arms. Weekly Condo Rentals and Purchases", "Which are you interested in [r,p, or ESCAPE] ", NULL); if (response == 'p') { print2("Only 50,000Au. Buy it? [yn] "); if (ynq2()=='y') { if (Player.cash < 50000) print3("No mortgages, buddy."); else { setgamestatus(SOLD_CONDO); Player.cash-=50000; dataprint(); print2("You are the proud owner of a luxurious condo penthouse."); Condoitems = NULL; } } } else if (response == 'r') { print2("Weekly Rental, 1000Au. Pay for it? [yn] "); if (ynq2()=='y') { if (Player.cash < 1000) print2("Hey, pay the rent or out you go...."); else { weeksleep = TRUE; Player.cash -=1000; dataprint(); } } } else print2("Please keep us in mind for your housing needs."); } else { while (! done) { menuclear(); menuprint("Home Sweet Home\n"); menuprint("a: Leave items in your safe.\n"); menuprint("b: Retrieve items.\n"); menuprint("c: Take a week off to rest.\n"); menuprint("d: Retire permanently.\n"); menuprint("ESCAPE: Leave this place.\n"); showmenu(); response = (char) mcigetc(); if (response == 'a') { i = getitem(NULL_ITEM); if (i != ABORT) { if (Player.possessions[i]->blessing < 0) print2("The item just doesn't want to be stored away..."); else { ol = ((pol) checkmalloc(sizeof(oltype))); ol->thing = Player.possessions[i]; ol->next = Condoitems; Condoitems = ol; conform_unused_object(Player.possessions[i]); Player.possessions[i] = NULL; } } } else if (response == 'b') { ol = Condoitems; while ((ol != NULL) && (! over)) { print1("Retrieve "); nprint1(itemid(ol->thing)); nprint1(" [ynq] "); response = (char) mcigetc(); /* DAG -- fix memory leak where object list nodes weren't deleted */ if (response == 'y') { gain_item(ol->thing); if (ol == Condoitems) { ol = ol->next; free( Condoitems ); Condoitems = ol; } else { ol=ol->next; free( prev->next ); prev->next = ol; } } else if (response == 'q') over = TRUE; else { prev = ol; ol = ol->next; } } } else if (response == 'c') { weeksleep = TRUE; print1("You take a week off to rest..."); morewait(); } else if (response == 'd') { clearmsg(); if (cinema_confirm("You ponder settling down here for good.") == 'y') { p_win(); } } else if (response == ESCAPE) done = TRUE; } xredraw(); } if (weeksleep) { clearmsg(); print1("Taking a week off to rest..."); morewait(); toggle_item_use(TRUE); Player.hp = Player.maxhp; Player.str = Player.maxstr; Player.agi = Player.maxagi; Player.con = Player.maxcon; Player.dex = Player.maxdex; Player.iq = Player.maxiq; Player.pow = Player.maxpow; for (i=0; i<NUMSTATI; i++) if (Player.status[i]<1000) Player.status[i]=0; toggle_item_use(FALSE); Player.food = 36; print2("You're once again fit and ready to continue your adventure."); Time += 60*24*7; Date += 7; moon_check(); timeprint(); } }
void l_college(void) { char action; int done=FALSE,enrolled = FALSE; print1("The Collegium Magii. Founded 16937, AOF."); if (nighttime()) print2("The Registration desk is closed at night...."); else { while (! done) { if ((Player.rank[COLLEGE]==MAGE) && (Player.level > Archmagelevel) && find_and_remove_item(CORPSEID,EATER)) { print1("You brought back the heart of the Eater of Magic!"); morewait(); print1("The Heart is sent to the labs for analysis."); print2("The Board of Trustees appoints you Archmage!"); morewait(); clearmsg(); strcpy(Archmage,Player.name); Archmagelevel = Player.level; Player.rank[COLLEGE] = ARCHMAGE; Player.maxiq += 5; Player.iq += 5; Player.maxpow += 5; Player.pow += 5; morewait(); Archmagebehavior = fixnpc(4); save_hiscore_npc(9); } menuclear(); menuprint("May we help you?\n\n"); menuprint("a: Enroll in the College.\n"); menuprint("b: Raise your College rank.\n"); menuprint("c: Do spell research.\n"); menuprint("ESCAPE: Leave these hallowed halls.\n"); showmenu(); action = mgetc(); if (action == ESCAPE) done = TRUE; else if (action == 'a') { if (Player.rank[COLLEGE] > 0) print2("You are already enrolled!"); else if (Player.iq < 13) print2("Your low IQ renders you incapable of being educated."); else if (Player.rank[CIRCLE] > 0) print2("Sorcery and our Magic are rather incompatible, no?"); #ifdef INCLUDE_MONKS else if (Player.rank[MONKS] > 0) print2("Meditation will not leave you enough time for studies."); #endif else { if (Player.iq > 17) { print2("You are given a scholarship!"); morewait(); enrolled=TRUE; } else { print1("Tuition is 1000Au. "); nprint1("Pay it? [yn] "); if (ynq1() =='y') { if (Player.cash < 1000) print2("You don't have the funds!"); else { Player.cash -= 1000; enrolled = TRUE; dataprint(); } } } if (enrolled) { print1("Archmage "); nprint1(Archmage); nprint1(" greets you and congratulates you on your acceptance."); print2("You are now enrolled in the Collegium Magii!"); morewait(); print1("You are now a Novice."); print2("You may research 1 spell, for your intro class."); Spellsleft = 1; Player.rank[COLLEGE] = INITIATE; Player.guildxp[COLLEGE] = 1; Player.maxiq += 1; Player.iq += 1; Player.maxpow += 1; Player.pow += 1; } } } else if (action == 'b') { if (Player.rank[COLLEGE] == 0) print2("You have not even been initiated, yet!"); else if (Player.rank[COLLEGE]==ARCHMAGE) print2("You are at the pinnacle of mastery in the Collegium."); else if (Player.rank[COLLEGE]==MAGE) { if (Player.level <= Archmagelevel) print2("You are not experienced enough to advance."); else print2("You must return with the heart of the Eater of Magic!"); } else if (Player.rank[COLLEGE]==PRECEPTOR) { if (Player.guildxp[COLLEGE] < 4000) print2("You are not experienced enough to advance."); else { print1("You are now a Mage of the Collegium Magii!"); print2("You may research 6 spells for postdoctoral research."); Spellsleft += 6; morewait(); print1("To become Archmage, you must return with the"); print2("heart of the Eater of Magic"); morewait(); clearmsg(); print1("The Eater may be found on a desert isle somewhere."); Player.rank[COLLEGE] = MAGE; Player.maxiq += 2; Player.iq += 2; Player.maxpow += 2; Player.pow += 2; } } else if (Player.rank[COLLEGE]==STUDENT) { if (Player.guildxp[COLLEGE] < 1500) print2("You are not experienced enough to advance."); else { print1("You are now a Preceptor of the Collegium Magii!"); print2("You are taught the basics of ritual magic."); morewait(); clearmsg(); print1("Your position allows you to research 4 spells."); Spellsleft +=4; Spells[S_RITUAL].known = TRUE; Player.rank[COLLEGE] = PRECEPTOR; Player.maxiq += 1; Player.iq += 1; Player.maxpow += 1; Player.pow += 1; } } else if (Player.rank[COLLEGE]==NOVICE) { if (Player.guildxp[COLLEGE] < 400) print2("You are not experienced enough to advance."); else { print1("You are now a Student at the Collegium Magii!"); print2("You are taught the spell of identification."); morewait(); clearmsg(); print1("Thesis research credit is 2 spells."); Spellsleft+=2; Spells[S_IDENTIFY].known = TRUE; Player.rank[COLLEGE] = STUDENT; Player.maxiq += 1; Player.iq += 1; Player.maxpow += 1; Player.pow += 1; } } } else if (action == 'c') { clearmsg(); if (Spellsleft > 0) { print1("Research permitted: "); mnumprint(Spellsleft); nprint1(" Spells."); morewait(); } if (Spellsleft < 1) { print1("Extracurricular Lab fee: 2000 Au. "); nprint1("Pay it? [yn] "); if (ynq1()=='y') { if (Player.cash < 2000) print1("Try again when you have the cash."); else { Player.cash -= 2000; dataprint(); Spellsleft = 1; } } } if (Spellsleft > 0) { learnspell(0); Spellsleft--; } } } } xredraw(); }
void l_thieves_guild(void) { int fee,count,i,number,done=FALSE,dues=1000; char c,action; pob lockpick; print1("You have penetrated to the Lair of the Thieves' Guild."); if (! nighttime()) print2("There aren't any thieves around in the daytime."); else { if ((Player.rank[THIEVES]==TMASTER) && (Player.level > Shadowlordlevel) && find_and_remove_item(OB_JUSTICIAR_BADGE,-1)) { print2("You nicked the Justiciar's Badge!"); morewait(); print1("The Badge is put in a place of honor in the Guild Hall."); print2("You are now the Shadowlord of the Thieves' Guild!"); morewait(); print1("Who says there's no honor among thieves?"); strcpy(Shadowlord,Player.name); Shadowlordlevel = Player.level; morewait(); Shadowlordbehavior = fixnpc(4); save_hiscore_npc(7); clearmsg(); print1("You learn the Spell of Shadowform."); Spells[S_SHADOWFORM].known = TRUE; morewait(); clearmsg(); Player.rank[THIEVES]=SHADOWLORD; Player.maxagi += 2; Player.maxdex += 2; Player.agi += 2; Player.dex += 2; } while (! done) { menuclear(); if (Player.rank[THIEVES] == 0) menuprint("a: Join the Thieves' Guild.\n"); else menuprint("b: Raise your Guild rank.\n"); menuprint("c: Get an item identified.\n"); if (Player.rank[THIEVES] > 0) menuprint("d: Fence an item.\n"); menuprint("ESCAPE: Leave this Den of Iniquity."); showmenu(); action = mgetc(); if (action == ESCAPE) done = TRUE; else if (action == 'a') { done = TRUE; if (Player.rank[THIEVES]> 0) print2("You are already a member!"); else if (Player.alignment > 10) print2("You are too lawful to be a thief!"); else { dues += dues*(12-Player.dex)/9; dues += Player.alignment*5; dues = max(100,dues); clearmsg(); mprint("Dues are"); mnumprint(dues); mprint(" Au. Pay it? [yn] "); if (ynq1() =='y') { if (Player.cash < dues) { print1("You can't cheat the Thieves' Guild!"); print2("... but the Thieves' Guild can cheat you...."); Player.cash = 0; } else { print1("Shadowlord "); nprint1(Shadowlord); print2("enters your name into the roll of the Guild."); morewait(); clearmsg(); print1("As a special bonus, you get a free lockpick."); print2("You are taught the spell of Object Detection."); morewait(); Spells[S_OBJ_DET].known = TRUE; lockpick = ((pob) checkmalloc(sizeof(objtype))); *lockpick = Objects[OB_LOCK_PICK]; /* lock pick */ gain_item(lockpick); Player.cash -= dues; dataprint(); Player.guildxp[THIEVES]=1; Player.rank[THIEVES]=TMEMBER; Player.maxdex++;Player.dex++;Player.agi++;Player.maxagi++; } } } } else if (action == 'b') { if (Player.rank[THIEVES]==0) print2("You are not even a member!"); else if (Player.rank[THIEVES]==SHADOWLORD) print2("You can't get any higher than this!"); else if (Player.rank[THIEVES]==TMASTER) { if (Player.level <= Shadowlordlevel) print2("You are not experienced enough to advance."); else print2("You must bring back the Justiciar's Badge!"); } else if (Player.rank[THIEVES]==THIEF) { if (Player.guildxp[THIEVES] < 4000) print2("You are not experienced enough to advance."); else { print1("You are now a Master Thief of the Guild!"); print2("You are taught the Spell of Apportation."); morewait(); print1("To advance to the next level you must return with"); print2("the badge of the Justiciar (cursed be his name)."); morewait(); clearmsg(); print1("The Justiciar's office is just south of the gaol."); Spells[S_APPORT].known = TRUE; Player.rank[THIEVES]=TMASTER; Player.maxagi++; Player.maxdex++; Player.agi++; Player.dex++; } } else if (Player.rank[THIEVES]==ATHIEF) { if (Player.guildxp[THIEVES] < 1500) print2("You are not experienced enough to advance."); else { print1("You are now a ranking Thief of the Guild!"); print2("You learn the Spell of Invisibility."); Spells[S_INVISIBLE].known = TRUE; Player.rank[THIEVES]=THIEF; Player.agi++; Player.maxagi++; } } else if (Player.rank[THIEVES]==TMEMBER) { if (Player.guildxp[THIEVES] < 400) print2("You are not experienced enough to advance."); else { print1("You are now an Apprentice Thief!"); print2("You are taught the Spell of Levitation."); Spells[S_LEVITATE].known = TRUE; Player.rank[THIEVES]=ATHIEF; Player.dex++; Player.maxdex++; } } } else if (action == 'c') { if (Player.rank[THIEVES]==0) { print1("RTG, Inc, Appraisers. Identification Fee: 50Au/item."); fee = 50; } else { fee = 5; print1("The fee is 5Au per item."); } print2("Identify one item, or all possessions? [ip] "); if ((char) mcigetc()=='i') { if (Player.cash < fee) print2("Try again when you have the cash."); else { Player.cash -= fee; dataprint(); identify(0); } } else { count = 0; for(i=1;i<MAXITEMS;i++) if (Player.possessions[i] != NULL) if (Player.possessions[i]->known < 2) count++; for(i=0;i<Player.packptr;i++) if (Player.pack[i] != NULL) if (Player.pack[i]->known < 2) count++; clearmsg(); print1("The fee will be: "); mnumprint(max(count*fee,fee)); nprint1("Au. Pay it? [yn] "); if (ynq1()=='y') { if (Player.cash < max(count*fee,fee)) print2("Try again when you have the cash."); else { Player.cash -= max(count*fee,fee); dataprint(); identify(1); } } } } else if (action == 'd') { if (Player.rank[THIEVES]==0) print2("Fence? Who said anything about a fence?"); else { print1("Fence one item or go through pack? [ip] "); if ((char) mcigetc()=='i') { i = getitem(NULL_ITEM); if ((i==ABORT) || (Player.possessions[i] == NULL)) print2("Huh, Is this some kind of set-up?"); else if (Player.possessions[i]->blessing < 0) print2("I don't want to buy a cursed item!"); else { clearmsg(); print1("I'll give you "); mlongprint(2 * item_value(Player.possessions[i]) / 3); nprint1("Au each. OK? [yn] "); if (ynq1() == 'y') { number = getnumber(Player.possessions[i]->number); if ((number >= Player.possessions[i]->number) && Player.possessions[i]->used) { Player.possessions[i]->used = FALSE; item_use(Player.possessions[i]); } Player.cash += number*2*item_value(Player.possessions[i])/3; /* Fenced artifacts could turn up anywhere, really... */ if (Objects[Player.possessions[i]->id].uniqueness > UNIQUE_UNMADE) Objects[Player.possessions[i]->id].uniqueness = UNIQUE_UNMADE; dispose_lost_objects(number,Player.possessions[i]); dataprint(); } else print2("Hey, gimme a break, it was a fair price!"); } } else { for(i=0;i<Player.packptr;i++) { if (Player.pack[i]->blessing > -1) { clearmsg(); print1("Sell "); nprint1(itemid(Player.pack[i])); nprint1(" for "); mlongprint(2*item_value(Player.pack[i])/3); nprint1("Au each? [ynq] "); if ((c=ynq1())=='y') { number = getnumber(Player.pack[i]->number); Player.cash += 2*number * item_value(Player.pack[i]) / 3; Player.pack[i]->number -= number; if (Player.pack[i]->number < 1) { /* Fenced an artifact? You just might see it again. */ if (Objects[Player.pack[i]->id].uniqueness > UNIQUE_UNMADE) Objects[Player.pack[i]->id].uniqueness = UNIQUE_UNMADE; free((char *)Player.pack[i]); Player.pack[i] = NULL; } dataprint(); } else if (c=='q') break; } } fixpack(); } } } } } xredraw(); }
void i_jane_t (pob o) { int volume; int range_idx; int range_beg; int range_end; char first_letter; Objects[o->id].known = 1; print1("Jane's Guide to the World's Treasures: "); volume = random_range(6); switch (volume) { case 0: nprint1("SCROLLS"); range_beg = SCROLLID; range_end = POTIONID; break; case 1: nprint1("POTIONS"); range_beg = POTIONID; range_end = WEAPONID; break; case 2: nprint1("CLOAKS"); range_beg = CLOAKID; range_end = BOOTID; break; case 3: nprint1("BOOTS"); range_beg = BOOTID; range_end = RINGID; break; case 4: nprint1("RINGS"); range_beg = RINGID; range_end = STICKID; break; case 5: nprint1("STICKS"); range_beg = STICKID; range_end = ARTIFACTID; break; default: /* bomb on error */ range_beg = range_end = 0; assert(FALSE); } menuclear(); menuprint("You could probably now recognise:\n"); for(range_idx = range_beg; range_idx < range_end; ++range_idx) { Objects[range_idx].known = 1; first_letter = Objects[range_idx].truename[0]; if (is_capital_letter(first_letter) || volume == 3) sprintf(Str1, " %s\n", Objects[range_idx].truename); else if (is_vowel(first_letter)) sprintf(Str1, " an %s\n", Objects[range_idx].truename); else sprintf(Str1, " a %s\n", Objects[range_idx].truename); menuprint(Str1); } showmenu(); morewait(); xredraw(); }
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(); }
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; } }
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(); } }
/* 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) { State.setSuppressPrinting( true ); Player.possessions[index]->used = false; item_use(Player.possessions[index]); State.setSuppressPrinting( false ); } Player.possessions[index]->blessing -= 2; if (Player.possessions[index]->blessing < 0) Player.possessions[index]->plus = abs(Player.possessions[index]->plus) - 1; if (used) { State.setSuppressPrinting( true ); Player.possessions[index]->used = true; item_use(Player.possessions[index]); State.setSuppressPrinting( false ); } } } else { index = getitem(NULL_ITEM); if (index == CASHVALUE) { print1("Blessing your money has no effect."); morewait(); } else if (index != ABORT) { used = Player.possessions[index]->isUsed(); if (used) { State.setSuppressPrinting( true ); Player.possessions[index]->used = false; item_use(Player.possessions[index]); State.setSuppressPrinting( false ); } 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)) { State.setSuppressPrinting( true ); Player.possessions[index]->used = true; item_use(Player.possessions[index]); State.setSuppressPrinting( false ); } } } calc_melee(); }
void l_monastery(void) { char action; int done=FALSE,enrolled = FALSE; print1("Tholian Monastery of Rampart. Founded 12031, AOF."); print2("Welcome to our humble hovel."); if (nighttime()) print2("The monastery doors are sealed until dawn."); else { while (! done) { menuclear(); menuprint("Find your True Course:\n\n"); menuprint("a: Discover the Way.\n"); menuprint("b: Meditate on the Path.\n"); menuprint("c: Meditate on Knowledge.\n"); menuprint("d: Take an extended Meditation.\n"); menuprint("ESCAPE: Re-enter the World.\n"); showmenu(); action = mgetc(); if (action == ESCAPE) { done = TRUE; calc_melee(); } else if (action == 'a') { if (Player.rank[MONKS] > 0) print2("You are already initiated, Brother."); else if (Player.con < 13) print2("Your body is too fragile to walk the Path, child."); else if (Player.pow < 13) print2("Your mind is too fragile to follow the Path, child."); else if (Player.rank[COLLEGE] > 0) print2("The Collegium has corruputed your spirit, child."); else if (Player.rank[CIRCLE] > 0) print2("The Circle has corruputed your spirit, child."); else { if (Player.pow > 17) { print2("Your spirit is strong. You may study the Path with us."); morewait(); enrolled=TRUE; } else { print1("A substantial cash sacrifice will cleanse your spirit.. "); print2("Donate your worldly goods? [yn] "); if (ynq1() =='y') { if (Player.cash < 1000) { /* WDT HACK! I'd rather the monks have some other * criteria for joining. */ print2("You have not much to give."); } else { Player.cash = 0; enrolled = TRUE; dataprint(); } } } if (enrolled) { print1("Grandmaster "); nprint1(Grandmaster); nprint1(" welcomes you to the Brotherhood."); print2("You are now a Tholian Monk trainee!"); morewait(); print2("You may study the Way with us."); Studiesleft = 1; Player.rank[MONKS] = MONK_TRAINEE; Player.guildxp[MONKS] = 1; Player.maxpow += 1; Player.pow += 1; } } } else if (action == 'b') { if (Player.rank[MONKS] == 0) print2("You are not yet initiated, child."); else if (Player.rank[MONKS]==MONK_GRANDMASTER) print2("Your advancement lies within, Grandmaster."); else if (Player.rank[MONKS]==MONK_MASTER_TEARS) { if (Player.level <= Grandmasterlevel) print2("Seek more experience, Master."); else if ((Player.rank[MONKS]==MONK_MASTER_TEARS) && (Player.level > Grandmasterlevel) && find_and_remove_item(CORPSEID,EATER)) { print1("You brought back the heart of the Eater of Magic!"); morewait(); print1("The Heart is sent to the placed in the kitchen cauldron."); print2("The Grandmaster steps down. You are the new Grandmaster."); morewait(); clearmsg(); strcpy(Grandmaster,Player.name); Grandmasterlevel = Player.level; Player.rank[MONKS] = MONK_GRANDMASTER; Player.maxhp += (Player.maxpow * 3); Player.maxiq += 5; Player.iq+= 5; Player.maxpow += 3; Player.pow += 3; Player.maxstr += 3; Player.str += 3; morewait(); Grandmasterbehavior = fixnpc(4); save_hiscore_npc(16); } else print2("You must return with the heart of the Eater of Magic!"); } else if (Player.rank[MONKS]==MONK_MASTER_PAINS) { if (Player.guildxp[MONKS] < 40000) print2("Seek more experience, Master."); else { print1("You have travelled far, Master."); print2("You are now Master of Tears."); Studiesleft += 6; morewait(); print1("To become Grandmaster, you must return with the"); print2("heart of the Eater of Magic"); morewait(); clearmsg(); print1("The Eater may be found on a desert isle somewhere."); Spells[S_REGENERATE].known = TRUE; Player.rank[MONKS] = MONK_MASTER_TEARS; Player.maxhp += (Player.maxpow * 2); Player.maxpow += 2; Player.pow += 2; Player.maxstr += 2; Player.str += 2; Player.maxagi += 2; Player.agi += 2; } } else if (Player.rank[MONKS]==MONK_MASTER_SIGHS) { if (Player.guildxp[MONKS] < 15000) print2("Seek more experience, Master."); else { print1("The Path is long, Master."); print2("You are now Master of Pain."); morewait(); print1("You feel enlightened."); morewait(); clearmsg(); Studiesleft +=4; Spells[S_RITUAL].known = TRUE; Spells[S_RESTORE].known = TRUE; Player.status[ILLUMINATION] = 1500; /* enlightened */ Player.rank[MONKS] = MONK_MASTER_PAINS; Player.maxhp += Player.maxpow; Player.maxcon += 1; Player.con += 1; Player.maxdex += 2; Player.dex += 2; } } else if (Player.rank[MONKS]==MONK_MASTER) { if (Player.guildxp[MONKS] < 9000) print2("Seek more experience, Master."); else { print1("Drink, weary Master."); print2("You are now Master of Sighs."); morewait(); clearmsg(); Studiesleft +=2; Spells[S_HASTE].known = TRUE; Player.rank[MONKS] = MONK_MASTER_SIGHS; Player.maxhp += Player.maxpow; Player.maxcon += 1; Player.con += 1; Player.maxiq += 2; Player.iq += 2; } } else if (Player.rank[MONKS]==MONK_MONK) { if (Player.guildxp[MONKS] < 3000) print2("Seek more experience, Brother."); else { print1("A thousand steps on the path, Brother."); print2("You are now a Master."); morewait(); clearmsg(); Studiesleft +=2; Spells[S_HEAL].known = TRUE; Player.rank[MONKS] = MONK_MASTER; Player.maxhp += Player.maxpow; Player.maxcon += 1; Player.con += 1; Player.maxpow += 2; Player.pow += 5; /* [sic] */ } } else if (Player.rank[MONKS]==MONK_TRAINEE) { if (Player.guildxp[MONKS] < 1500) print2("Seek more experience, Brother."); else { print1("You have sought wisdom, Brother."); print2("You are now a Tholian Monk."); morewait(); clearmsg(); Studiesleft +=2; Spells[S_CURE].known = TRUE; Player.rank[MONKS] = MONK_MONK; Player.maxhp += Player.maxpow; Player.maxcon += 1; Player.con += 1; Player.maxpow += 1; Player.pow += 1; } } } else if (action == 'c') { clearmsg(); if (Studiesleft > 0) { print1("Studies permitted: "); mnumprint(Studiesleft); nprint1(" Studies."); morewait(); } if (Studiesleft < 1) { print1("Sacrifice clears a cluttered heart. "); nprint1("Donate your worldly cash? [yn] "); if (ynq1()=='y') { if (Player.cash < 2000) { if ( Player.rank[MONKS] >= MONK_GRANDMASTER ) print2("You have not much to give, Grandmaster."); else if ( Player.rank[MONKS] >= MONK_MASTER ) print2("You have not much to give, Master."); else print2("You have not much to give, Brother."); } else { Player.cash = 0; dataprint(); Studiesleft = 1; } } } if (Studiesleft > 0) { learnspell(0); Studiesleft--; } } else if (action == 'd') { if (Player.rank[MONKS] < MONK_MASTER) { clearmsg(); print1("Only Masters can achieve extended meditation, child."); print2(" "); } else { int i = 0; clearmsg(); print1("Seeking inner truth..."); morewait(); clearmsg(); morewait(); toggle_item_use(TRUE); Player.cash = 0; Player.hp = Player.maxhp; Player.str = Player.maxstr; Player.agi = Player.maxagi; Player.con = Player.maxcon; Player.dex = Player.maxdex; Player.iq = Player.maxiq; Player.pow = Player.maxpow; for (i=0;i<NUMSTATI;i++) if (Player.status[i]<1000) Player.status[i]=0; toggle_item_use(FALSE); Player.food = 43; print2("Your body and mind are whole."); if (random_range(2) == 1) { morewait(); print1("Extra whole!"); Player.maxhp += 1; } } Time += 60*24*7; Date += 7; moon_check(); timeprint(); } } } xredraw(); }
/* 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) { State.setSuppressPrinting( true ); Player.possessions[i]->used = false; item_use(Player.possessions[i]); State.setSuppressPrinting( false ); } 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) { State.setSuppressPrinting( true ); Player.possessions[i]->used = true; item_use(Player.possessions[i]); State.setSuppressPrinting( false ); } } } calc_melee(); } }
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(); } } } }