void l_sacrificestone(void) { int sacrifice=1; int oldmaxhp = Player.maxhp; print1("You have come on a weathered basaltic block."); print2("On the top surface is an indentation in human shape."); morewait(); print1("You see old rust colored stains in the grain of the stone."); print2("You sense something awakening. Touch the block? [yn] "); if (ynq2() == 'y') { print1("You sense great pain emanating from the ancient altar."); print2("Climb on to the block? [yn] "); if (ynq2() == 'y') { print1("You are stuck fast to the block!"); print2("You feel your life-force being sucked away!"); morewait(); print1("Hit ESCAPE to try and get up at any moment, SPACE to remain."); do { switch(random_range(4)) { case 0: print2("You feel weaker."); break; case 1: print2("You feel your life fading."); break; case 2: print2("Your energy is vanishing."); break; case 3: print2("You are being drained."); break; } Player.hp -= sacrifice; Player.maxhp -= sacrifice/2; sacrifice *= 2; dataprint(); if ((Player.hp < 1) || (Player.maxhp < 1)) p_death("self-sacrifice"); } while (stillonblock()); print1("You manage to wrench yourself off the ancient altar!"); print2("You leave some skin behind, though...."); morewait(); if ((oldmaxhp > 10) && (Player.maxhp < 3 * oldmaxhp/4)) { print1("A strange red glow arises from the altar."); print2("The glow surrounds you.... You sense gratitude."); Player.pow += sacrifice; Player.maxpow += sacrifice/10; dataprint(); } else { print1("You a have a sense of rejection."); print2("A roil of fetid vapor smokes up from the altar."); gain_experience(sacrifice); } } else { print1("You sense an emotion of pique all around you."); print2("You retreat from the strange stone."); } } else { print1("You decide discretion to be the better part of valour."); print2("The stone seems to subside sleepily."); } }
void l_earth_station(void) { pob o; print1("The tendrilled mass reaches out for you from the muddy ooze."); if (find_item(&o,OB_SALT_WATER,-1)) print2("A splash of salt water does nothing to dissuade the vines."); morewait(); print1("Enter the overgrown mire? [yn] "); if (ynq1()=='y') { if (Player.hp == 1) p_death("being eaten alive"); else Player.hp = 1; dataprint(); print1("You are being dragged into the muck. Suckers bite you...."); print2("You're about to be entangled.... Leave the mud? [yn] "); if (ynq2()=='y') print2("Phew! That was close!"); else { Player.str -= (15+random_range(15)); if (Player.str > 0) { print1("That's odd, the vine withdraws...."); print2("A spatter of dirt sprays into the void nearby."); Level->site[Player.x][Player.y].locchar = FLOOR; Level->site[Player.x][Player.y].p_locf = L_NO_OP; stationcheck(); } else { print2("The tendril has destroyed your strength!"); p_death("the Essence of Earth"); } } } else print2("You step back from the ominous vegetation."); }
void l_charity(void) { long donation; print2("'Greetings, friend. Do you wish to make a donation?' [yn] "); if (ynq2()!='y') print3("'Pinchpurse!'"); else { clearmsg(); // print1("How much can you give? "); donation = parsenum("How much can you give?"); if (donation < 1) print2("'Go stick your head in a pig.'"); else if (donation > Player.cash) print2("'I'm afraid you're charity is bigger than your purse!'"); else if (donation < max(100,Player.level*Player.level*100)) { print2("'Oh, can't you do better than that?'"); print3("'Well, I guess we'll take it....'"); if (Player.alignment < 10) Player.alignment++; Player.cash -= donation; } else { print2("'Oh thank you kindly, friend, and bless you!'"); Player.cash -= donation; Player.alignment += 5; } } dataprint(); }
void l_fire_station(void) { print1("The flames leap up, and the heat is incredible."); if (Player.immunity[FLAME]) { print2("You feel the terrible heat despite your immunity to fire!"); morewait(); } print2("Enter the flames? [yn] "); if (ynq2()=='y') { if (Player.hp == 1) p_death("total incineration"); else Player.hp = 1; dataprint(); print1("You feel like you are being incinerated! Jump back? [yn] "); if (ynq1()=='y') print2("Phew! That was close!"); else { Player.pow -= (15+random_range(15)); if (Player.pow > 0) { print2("That's odd, the flame seems to have cooled down now...."); print3("A flicker of fire seems to dance above the void nearby."); Level->site[Player.x][Player.y].locchar = FLOOR; Level->site[Player.x][Player.y].p_locf = L_NO_OP; stationcheck(); } else { print2("The flames seem to have leached away all your mana!"); p_death("the Essence of Fire"); } } } else print2("You flinch away from the all-consuming fire."); }
void l_cartographer(void) { int i,j,x,y; print1("Ye Olde Mappe Shoppe."); print2("Map of the local area: 500Au. Buy it? [yn] "); if (ynq2()=='y') { if (Player.cash < 500) print3("Cursed be cheapskates! May you never find an aid station...."); else { print3("You now have the local area mapped."); Player.cash -= 500; dataprint(); switch(Villagenum) { case 1: x = 56; y = 5; break; default: case 2: x = 35; y = 11; break; case 3: x = 10; y = 40; break; case 4: x = 7; y = 6; break; case 5: x = 40; y = 43; break; case 6: x = 20; y = 41; break; } for(i=x-15; i<=x+15; i++) for(j=y-15; j<=y+15; j++) if ((i>=0)&&(i<64)&&(j>=0)&&(j<64)) { if (Country[i][j].current_terrain_type != Country[i][j].base_terrain_type) { c_set(i, j, CHANGED); Country[i][j].current_terrain_type = Country[i][j].base_terrain_type; } c_set(i, j, SEEN); } } } else print3("Don't blame me if you get lost...."); }
FILE *omegarc_check(void) { FILE *fd; getOmegaRCPath(); if ((fd = fopen(Str1,"r")) != NULL) { print2("Use .omegarc in home directory? [yn] "); if (ynq2()!='y') { fclose(fd); fd = NULL; } } clearmsg(); return(fd); }
void l_water_station(void) { print1("The fluid seems murky and unknowably deep."); print2("It bubbles and hisses threateningly."); morewait(); if (Player.status[BREATHING]) { print1("You don't feel sanguine about trying to breathe that stuff!"); morewait(); } if (Player.immunity[ACID]) { print2("The vapor burns despite your immunity to acid!"); morewait(); } print1("Enter the fluid? [yn] "); if (ynq1()=='y') { if (Player.hp == 1) p_death("drowning in acid (ick, what a way to go)"); else Player.hp = 1; dataprint(); print2("You choke...."); morewait(); nprint2("Your lungs burn...."); morewait(); print2("Your body begins to disintegrate.... Leave the pool? [yn] "); if (ynq2()=='y') print2("Phew! That was close!"); else { clearmsg(); Player.con -= (15+random_range(15)); if (Player.con > 0) { print1("That's odd, the fluid seems to have been neutralized...."); print2("A moist miasma wafts above the void nearby."); Level->site[Player.x][Player.y].locchar = FLOOR; Level->site[Player.x][Player.y].p_locf = L_NO_OP; stationcheck(); } else { print2("The bubbling fluid has destroyed your constitution!"); p_death("the Essence of Water"); } } } else print2("You step back from the pool of acid."); }
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(); }
void l_mindstone(void) { print1("You approach a giant crystal of some opaline material."); print2("Flashes of irridescent light glint from the object."); morewait(); print1("You feel your attention being drawn by the intricate crystal."); print2("Look away from the interesting phenomenon? [yn] "); if (ynq2()=='n') { print1("Your gaze focuses deeply on the gem...."); print2("The crystal seems to open up and surround you!"); morewait(); if (stonecheck(0)) { print1("Your mind has been enhanced by the experience!"); Player.maxiq = min(Player.maxiq+10,max(Player.maxiq,30)); dataprint(); } } else { print1("You manage to wrench your gaze from the odd jewel."); print2("The light flashes from the crystal diminish in frequency."); } }
void l_balancestone(void) { print1("This is a massive granite slab teetering dangerously on a corner."); print2("You feel a sense of balance as you regard it."); morewait(); clearmsg(); if (cinema_confirm("Your hand naturally drifts forward to touch it.")=='y') { print1("A vortex of mana spins about you!"); if (abs(Player.alignment) > random_range(50)) { print2("The cyclone whirls you off to a strange place!"); morewait(); change_environment(E_COUNTRYSIDE); do { setPlayerXY( random_range(COUNTRY_WIDTH), random_range(COUNTRY_LENGTH)); } while (Country[Player.x][Player.y].current_terrain_type == CHAOS_SEA); screencheck(Player.x,Player.y); drawvision(Player.x,Player.y); } else { print2("You are being drained of experience! Step back? [yn] "); if (ynq2()=='y') { clearmsg(); print1("The vortex calms down, dimishes, and then disappears."); } else { Player.xp -= Player.xp/4; dataprint(); print2("The vortex vanishes. Suddenly, there is a clap of thunder!"); morewait(); Player.alignment = 0; strategic_teleport(1); } } } else print1("You step back from the unlikely boulder."); }
/* 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_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_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_tourist(void) { print1("Greetings and welcome to Rampart."); print2("Would you like the tourist guide to the city? [yn]"); if( ynq2() == 'y' ) { menuclear(); menuprint("You now know how to find:\n\n"); if (! CitySiteList[L_ARMORER-CITYSITEBASE][0]) menuprint("Julie's Armor of Proof and Weapons of Quality\n"); CitySiteList[L_ARMORER-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_CLUB-CITYSITEBASE][0]) menuprint("Rampart Explorers' Club\n"); CitySiteList[L_CLUB-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_GYM-CITYSITEBASE][0]) menuprint("The Rampart Gymnasium\n"); CitySiteList[L_GYM-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_HEALER-CITYSITEBASE][0]) menuprint("Rampart Healers\n"); CitySiteList[L_HEALER-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_CASINO-CITYSITEBASE][0]) menuprint("Rampart Mithril Nugget Casino\n"); CitySiteList[L_CASINO-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_DINER-CITYSITEBASE][0]) menuprint("The Rampart Diner\n"); CitySiteList[L_DINER-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_CRAP-CITYSITEBASE][0]) menuprint("Les Crapeuleaux, fine dining\n"); CitySiteList[L_CRAP-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_COMMANDANT-CITYSITEBASE][0]) menuprint("Commandant Sonder's Rampart-fried Lyzzard partes\n"); CitySiteList[L_COMMANDANT-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_TAVERN-CITYSITEBASE][0]) menuprint("The Centaur and Nymph tavern\n"); CitySiteList[L_TAVERN-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_ALCHEMIST-CITYSITEBASE][0]) menuprint("Ambrosias' Potions et cie\n"); CitySiteList[L_ALCHEMIST-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_DPW-CITYSITEBASE][0]) menuprint("Rampart Department of Public Works\n"); CitySiteList[L_DPW-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_LIBRARY-CITYSITEBASE][0]) menuprint("Rampart Public Library\n"); CitySiteList[L_LIBRARY-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_PAWN_SHOP-CITYSITEBASE][0]) menuprint("Knight's Pawn Shop\n"); CitySiteList[L_PAWN_SHOP-CITYSITEBASE][0] = TRUE; if (! CitySiteList[L_CONDO-CITYSITEBASE][0]) menuprint("Luxury Condominiums\n"); CitySiteList[L_CONDO-CITYSITEBASE][0] = TRUE; showmenu(); morewait(); clearmsg(); xredraw(); print1("Have a nice day."); } else { clearmsg(); print1("Have a nice day then."); } }
void l_brothel(void) { char response; print1("You come to a heavily reinforced inner door."); print2("A sign reads `The House of the Eclipse'"); morewait(); clearmsg(); if (cinema_confirm("You are about to open the door.")=='y') { menuclear(); menuprint("a:knock on the door.\n"); menuprint("b:try to pick the lock.\n"); menuprint("c:bash down the door.\n"); menuprint("ESCAPE: Leave this house of ill repute.\n"); showmenu(); do response = menugetc(); while ((response != 'a') && (response != 'b') && (response != 'c') && (response != ESCAPE)); xredraw(); if (response == 'a') { if (!nighttime()) print2("There is no reponse."); else { print1("A window opens in the door."); print2("`500Au, buddy. For the night.' pay it? [yn] "); if (ynq2()=='y') { if (Player.cash < 500) { print1("`What, no roll?!'"); print2("The bouncer bounces you a little and lets you go."); p_damage(25,UNSTOPPABLE,"da bouncer"); } else { Player.cash -= 500; print1("You are ushered into an opulently appointed hall."); print2("After an expensive dinner (takeout from Les Crapuleux)"); morewait(); if (Player.preference == 'n') { switch(random_range(4)) { case 0: print1("you spend the evening playing German Whist with"); break; case 1: print1("you spend the evening discussing philosophy with"); break; case 2: print1("you spend the evening playing chess against"); break; case 3: print1("you spend the evening telling your adventures to"); } print2("various employees of the House of the Eclipse."); } else { print1("you spend an enjoyable and educational evening with"); if (Player.preference == 'm' || (Player.preference == 'y' && random_range(2))) switch(random_range(4)) { case 0: print2("Skarn the Insatiable, a satyr."); break; case 1: print2("Dryden the Defanged, an incubus."); break; case 2: print2("Gorgar the Equipped, a centaur."); break; case 3: print2("Hieronymus, the mendicant priest of Eros."); break; } else switch(random_range(4)) { case 0: print2("Noreen the Nymph (omaniac)"); break; case 1: print2("Angelface, a recanted succubus."); break; case 2: print2("Corporal Sue of the City Guard (moonlighting)."); break; case 3: print2("Sheena the Queena the Jungle, a wereleopard."); break; } } morewait(); if (hour() > 12) Time += ((24-hour())+8) * 60; else { Time += ((9-hour())*60); Date++; } Player.food = 40; Player.status[DISEASED] = 0; Player.status[POISONED] = 0; Player.hp = Player.maxhp; /* reduce temporary stat gains to max stat levels */ toggle_item_use(TRUE); Player.str = min(Player.str,Player.maxstr); Player.con = min(Player.con,Player.maxcon); Player.agi = min(Player.agi,Player.maxagi); Player.dex = min(Player.dex,Player.maxdex); Player.iq = min(Player.iq,Player.maxiq); Player.pow = min(Player.pow,Player.maxpow); toggle_item_use(FALSE); if (Player.preference == 'n') Player.iq++; /* whatever :-) */ else Player.con++; gain_experience(100); timeprint(); dataprint(); showflags(); morewait(); clearmsg(); if (Player.preference == 'n') print1("You arise refreshed the next morning..."); else print1("You arise, tired but happy, the next morning..."); } } else print2("What are you, some kinda prude?"); } } else if (response == 'b') { if (nighttime()) { print1("As you fumble at the lock, the door opens...."); print2("The bouncer tosses you into the street."); } else print1("The door appears to be bolted and barred from behind."); } else if (response == 'c') { if (nighttime()) { print1("As you charge toward the door it opens...."); print2("Yaaaaah! Thud!"); morewait(); print1("You run past the startled bouncer into a wall."); p_damage(20,UNSTOPPABLE,"a move worthy of Clouseau"); print2("The bouncer tosses you into the street."); } else { print1("Ouch! The door resists your efforts."); p_damage(1,UNSTOPPABLE,"a sturdy door"); morewait(); print1("You hear an irritated voice from inside:"); print2("'Keep it down out there! Some of us are trying to sleep!'"); } } } }
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_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."); } }