/* WDT HACK! This should use the interaction code, and should allow * direct input. */ int getnumber(int range) { int done=FALSE,value=1; int atom; if (range==1) return(1); else while (! done) { clearmsg(); wprintw(Msg1w,"How many? Change with < or >, ESCAPE to select:"); mnumprint(value); #ifndef MSDOS do atom=mcigetc(); while ((atom != '<')&&(atom != '>')&&(atom!=ESCAPE)); if ((atom=='>') && (value < range)) value++; else if ((atom=='<') && (value > 1)) value--; else if (atom==ESCAPE) done = TRUE; #else atom=mcigetc(); switch (atom) { case '>': case 'k': #ifdef KEY_UP case KEY_UP: #endif if (value < range) value++; break; case '<': case 'j': #ifdef KEY_DOWN case KEY_DOWN: #endif if (value > 1) value--; break; #ifdef KEY_HOME case KEY_HOME: #endif value = 1; break; #ifdef KEY_LL case KEY_LL: #endif value = range; break; case ESCAPE: done = TRUE; break; } #endif } return(value); }
int initstats(void) { char response; char savedg[80]; print1("Do you want to run a character [c], load a game [l], or "); print2("play yourself [p]?"); /* RM 04-19-2000 loading patch */ do response = (char) mcigetc(); while ((response!='c')&&(response != 'p')&&(response !='l')); if (response == 'c') omegan_character_stats(); else if (response == 'l') { /* RM 04-19-2000: loading patch - a blatant hack */ clearmsg(); print1("Enter saved game name: "); strcpy(savedg,msgscanstring()); game_restore(savedg); return true; } else { clearmsg(); /* RM 04-19-2000 loading patch - fix the display */ user_character_stats(); user_intro(); print1("Do you want to save this set-up to .omegarc in your home directory? [yn] "); if (ynq1()=='y') save_omegarc(); } xredraw(); return false; }
void activate() { int index; char response; clearmsg(); print1("Activate -- item [i] or artifact [a] or quit [ESCAPE]?"); do response = (char) mcigetc(); while ((response != 'i') && (response != 'a') && (response != ESCAPE)); if (response != ESCAPE) { if (response == 'i') index = getitem(THING); else if (response == 'a') index = getitem(ARTIFACT); if (index != ABORT) { clearmsg(); print1("You activate it.... "); morewait(); item_use(Player.possessions[index]); } else setgamestatus(SKIP_MONSTERS); } else setgamestatus(SKIP_MONSTERS); }
FILE *omegarc_check() { FILE *fd; #if defined(MSDOS) || defined(AMIGA) || defined(_WIN32) if ((fd = fopen("omega.rc","rb")) != NULL) { print2("Use omega.rc in current directory? [yn] "); #else sprintf(Str1, "%s/.omegarc", getenv("HOME")); if ((fd = fopen(Str1,"r")) != NULL) { print2("Use .omegarc in home directory? [yn] "); #endif if (ynq2()!='y') { fclose(fd); fd = NULL; } } clearmsg(); return(fd); } void initstats() { char response; print1("Do you want to run a character [c] or play yourself [p]?"); do response = (char) mcigetc(); while ((response!='c')&&(response != 'p')); if (response == 'c') omegan_character_stats(); else { user_character_stats(); user_intro(); #if defined(MSDOS) || defined(AMIGA) || defined(_WIN32) print1("Do you want to save this set-up to omega.rc in this directory? [yn] "); #else print1("Do you want to save this set-up to .omegarc in your home directory? [yn] "); #endif if (ynq1()=='y') save_omegarc(); } xredraw(); }
/* Prayer occurs at altars, hence the name of the function */ void l_altar() { int i; int deity; char response; if(Current_Environment == E_COUNTRYSIDE) { deity = DRUID; } else { deity = Level->site[Player.x][Player.y].aux; } switch(deity) { case ODIN: print1("This granite altar is graven with a gallows."); break; case SET: print1("This sandstone altar has a black hand drawn on it."); break; case HECATE: print1("This silver altar is inlaid with a black cresent moon."); break; case ATHENA: print1("This golden altar is inscribed with an owl."); break; case DESTINY: print1("This crystal altar is in the form of an omega."); break; case DRUID: print1("This oaken altar is ornately engraved with leaves."); break; default: print1("This rude altar has no markings."); break; } print2("Worship at this altar? [yn] "); if(ynq2() == 'y') { if(Player.rank[PRIESTHOOD] == 0) { increase_priest_rank(deity); } else if(!check_sacrilege(deity)) { if(Blessing) { print1("You have a sense of immanence."); } print2("Request a Blessing, Sacrifice an item, or just Pray [b,s,p] "); response = mcigetc(); while((response != 'b') && (response != 's') && (response != 'p') && (response != ESCAPE)) { response = mcigetc(); } if(response == 'b') { print1("You beg a heavenly benefice."); print2("You hear a gong resonating throughout eternity..."); morewait(); if(Blessing) { print1("A shaft of lecent radiance lances dwon from the heavens!"); print2("You feel uplifted..."); morewait(); gain_experience(Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * 50); cleanse(1); heal(10); bless(1); Blessing = FALSE; increase_priest_rank(deity); } else { print1("Your ardent plea is ignored."); print2("You feel ashamed."); Player.xp -= (Player.xp / 4); } calc_melee(); } else if(response == 's') { print1("Which item to Sacrifice?"); i = getitem('\0'); if(i == ABORT) { i = 0; } if(Player.possessions[i] == NULL) { print1("You have insulted your deity!"); print2("Not a good idea, as it turns out..."); dispel(-1); p_damage(Player.hp - 1, UNSTOPPABLE, "a god's pique"); } else if(true_item_value(Player.possessions[i]) > (Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * 50)) { print1("With a burst of blue flame, your offering vanishes!"); dispose_lost_objects(1, Player.possessions[i]); print2("A violet nimbus settles around your head and slowly fades."); morewait(); Blessing = TRUE; } else { print1("A darkling glow envelopes your offering!"); print2("The glow slowly fades..."); morewait(); setgamestatus(SUPPRESS_PRINTING); if(Player.possessions[i]->used) { Player.possessions[i]->used = FALSE; item_use(Player.possessions[i]); Player.possessions[i]->blessing = -1 - abs(Player.possessions[i]->blessing); Player.possessions[i]->used = TRUE; item_use(Player.possessions[i]); } else { Player.possessions[i]->blessing = -1 - abs(Player.possessions[i]->blessing); } resetgamestatus(SUPPRESS_PRINTING); } } else if(response == 'p') { if(deity != Player.patron) { print1("Nothing seems to happen."); } else { increase_priest_rank(deity); } } } } }
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 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_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(); } }
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."); } }
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(); } }