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(); }
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(); } }