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_air_station(void) { print1("The whirlwind spins wildly and crackles with lightning."); if (Player.immunity[ELECTRICITY]) print2("You feel static cling despite your immunity to electricity!"); morewait(); print1("Enter the storm? [yn] "); if (ynq1()=='y') { if (Player.hp == 1) p_death("being torn apart and then electrocuted"); else Player.hp = 1; dataprint(); print1("You are buffeted and burnt by the storm...."); print2("You begin to lose consciousness.... Leave the storm? [yn] "); if (ynq1()=='y') print2("Phew! That was close!"); else { Player.iq -= (random_range(15)+15); if (Player.iq > 0) { print1("That's odd, the storm subsides...."); print2("A gust of wind brushes past 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 swirling storm has destroyed your intelligence!"); p_death("the Essence of Air"); } } } else print2("You step back from the ominous whirlwind."); }
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_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(); }
int gymtrain(int *maxstat, int *stat) { int trained = 0; if (Gymcredit + Player.cash < 2000) print2("You can't afford our training!"); else { trained = 1; if (Gymcredit > 2000) Gymcredit -= 2000; else { Player.cash -= (2000-Gymcredit); Gymcredit = 0; } print2("Sweat. Sweat. "); if ((*maxstat < 30) && ((*maxstat < random_range(30)) || (random_range(3)==1))) { nprint2("The training pays off!"); (*maxstat)++; (*stat)++; } else { nprint2("You feel the healthy glow of a good workout."); if (*stat < *maxstat) { (*stat)++; print3("A feeling of rehabilitation washes through you."); } } } dataprint(); return trained; }
void omegan_character_stats(void) { int share1,share2,i=0; print1("To reroll hit ESCAPE; hit any other key to accept these stats."); do { i++; #if REROLLS == -1 sprintf(Str1, "Generated character # %d", i ); #else sprintf(Str1, "You have only %d chance%s to reroll... ", REROLLS - i, (i == (REROLLS-1) ) ? "":"s"); #endif print2(Str1); Player.iq = Player.maxiq = 4 + random_range(5)+ (share1 = random_range(6)) + (share2 = random_range(6)); Player.pow = Player.maxpow = 4 + random_range(5) + share1 +share2; Player.dex = Player.maxdex = 4 + random_range(5)+ (share1 = random_range(6)) + (share2 = random_range(6)); Player.agi = Player.maxagi = 4 + random_range(5) + share1 +share2; Player.str = Player.maxstr = 4 + random_range(5)+ (share1 = random_range(6)) + (share2 = random_range(6)); Player.con = Player.maxcon = 4 + random_range(5) + share1 +share2; Player.cash = random_range(100)+random_range(100)+ random_range(100)+random_range(100)+random_range(100); Player.hp=Player.maxhp=Player.con; Player.mana=Player.maxmana = calcmana(); calc_melee(); dataprint(); #if REROLLS == -1 } while (mgetc() == ESCAPE); #else }
void stationcheck(void) { int stationsleft=FALSE; int i,j; morewait(); clearmsg(); print1("You feel regenerated."); Player.hp = Player.maxhp; dataprint(); for(j=0;j<Level->level_length;j++) for(i=0;i<Level->level_width;i++) if ((Level->site[i][j].locchar == WATER) || (Level->site[i][j].locchar == HEDGE) || (Level->site[i][j].locchar == WHIRLWIND) || (Level->site[i][j].locchar == FIRE)) stationsleft=TRUE; if (! stationsleft) { print1("There is a noise like a wild horse's neigh."); print2("You spin around, and don't see anyone around at all"); print3("except for a spurred black cloaked figure carrying a scythe."); morewait();clearmsg(); print1("Death coughs apologetically. He seems a little embarrassed."); print2("A voice peals out:"); print3("'An Adept must be able to conquer Death himself...."); make_site_monster(32,4,DEATH); } }
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...."); }
/* do dmg points of damage of type dtype, from source fromstring */ void p_damage(int dmg, int dtype, char *fromstring) { if (State.getFastMove()) { drawvision(Player.x,Player.y); State.setFastMove(false); } if (! p_immune(dtype)) { if (dtype == NORMAL_DAMAGE) Player.hp -= max(1,(dmg-Player.absorption)); else Player.hp -= dmg; if (Player.hp < 1) p_death(fromstring); } else mprint("You resist the effects!"); dataprint(); }
void healforpay(void) { if (Player.cash < 50) print2("You can't afford to be healed!"); else { Player.cash -= 50; if (Player.hp < Player.maxhp ) { Player.hp += 20+random_range(20); if (Player.hp > Player.maxhp) Player.hp = Player.maxhp; } print2("Another medical marvel...."); } dataprint(); }
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."); }
void l_adept(void) { print1("You see a giant shimmering gate in the form of an omega."); if (! gamestatusp(ATTACKED_ORACLE)) { if (Player.str+Player.con+Player.iq+Player.pow < 100) print2("A familiar female voice says: I would not advise this now...."); else print2("A familiar female voice says: Go for it!"); } morewait(); clearmsg(); if (cinema_confirm("You're about to step into the mystic portal.")!='y') { if (Player.level > 100) { print1("The Lords of Destiny spurn your cowardice and indecision..."); Player.xp = 0; Player.level = 0; Player.hp = Player.maxhp = Player.con; Player.mana = calcmana(); print2("You suddenly feel very inexperienced."); dataprint(); morewait(); clearmsg(); } print1("You edge away from the challenge."); } else { clearmsg(); print1("You pass through the portal."); morewait(); drawomega(); print1("Like wow man! Colors! "); if (Player.patron != DESTINY) { print2("Strange forces try to tear you apart!"); p_damage(random_range(200),UNSTOPPABLE,"a vortex of chaos"); } else print2("Some strange force shields you from a chaos vortex!"); morewait(); print1("Your head spins for a moment...."); print2("and clears...."); morewait(); Player.hp = Player.maxhp; Player.mana = calcmana(); change_environment(E_ABYSS); } }
void heal(int amount) { if (amount > -1) { mprint("You feel better."); if (Player.hp < Player.maxhp + amount) { Player.hp += random_range(10*amount)+1; if (Player.hp > Player.maxhp) Player.hp = Player.maxhp + amount; } Player.status[BLINDED] = 0; } else { mprint("You feel unwell."); Player.hp -= random_range(10*abs(amount)+1); if (Player.hp < 0) p_death("magical disruption"); } dataprint(); }
void l_chaostone(void) { print1("This is a menhir carved of black marble with veins of gold."); print2("It emanates an aura of raw chaos, which is not terribly"); morewait(); print1("surprising, considering its location."); if (Player.alignment < 0) print2("You feel an almost unbearable attraction to the stone."); else print2("You find it extremely difficult to approach the stone."); morewait(); clearmsg(); if (cinema_confirm("You reach out your fist to strike it.")=='y') { print1("A sudden flux of energy surrounds you!"); morewait(); if (stonecheck(-1)) { print2("You feel stronger!"); Player.maxstr = min(Player.maxstr+10,max(30,Player.maxstr)); dataprint(); } } else print1("You step back from the ominous dolmech."); }
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_lawstone(void) { print1("This is a stele carved of blueish-green feldspar."); print2("You feel an aura of serenity rising from it, and your gaze"); morewait(); print1("is attracted to the bulk of Star Peak to the North-East."); if (Player.alignment > 0) print2("You feel a subtle attraction to the stone."); else print2("You find the stone extremely distasteful to contemplate."); morewait(); clearmsg(); if (cinema_confirm("Your arm moves as though compelled to grasp it.")=='y') { print1("A matrix of power flows about you!"); morewait(); if (stonecheck(1)) { print2("You feel more vigorous!"); Player.maxcon = min(Player.maxcon+10,max(Player.maxcon,30)); dataprint(); } } else print1("You step back from the strange obelisk."); }
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."); }
/* values over 1000 indicate a permanent effect */ void tenminute_status_check(void) { if ((Player.status[SHADOWFORM]>0) && (Player.status[SHADOWFORM]<1000)) { Player.status[SHADOWFORM]--; if (Player.status[SHADOWFORM] == 0) { Player.immunity[NORMAL_DAMAGE]--; Player.immunity[ACID]--; Player.immunity[THEFT]--; Player.immunity[INFECTION]--; mprint("You feel less shadowy now."); } } if ((Player.status[ILLUMINATION]>0) && (Player.status[ILLUMINATION]<1000)) { Player.status[ILLUMINATION]--; if (Player.status[ILLUMINATION] == 0) { mprint("Your light goes out!"); } } if ((Player.status[VULNERABLE]>0) && (Player.status[VULNERABLE]<1000)){ Player.status[VULNERABLE]--; if (Player.status[VULNERABLE] == 0) mprint("You feel less endangered."); } if ((Player.status[DEFLECTION]>0) && (Player.status[DEFLECTION]<1000)){ Player.status[DEFLECTION]--; if (Player.status[DEFLECTION] == 0) mprint("You feel less well defended."); } if ((Player.status[ACCURATE]>0) && (Player.status[ACCURACY]<1000)){ Player.status[ACCURATE]--; if (Player.status[ACCURATE] == 0) { calc_melee(); mprint("The bulls' eyes go away."); } } if ((Player.status[HERO]>0) && (Player.status[HERO]<1000)){ Player.status[HERO]--; if (Player.status[HERO] == 0) { calc_melee(); mprint("You feel less than super."); } } if ((Player.status[LEVITATING]>0) && (Player.status[LEVITATING]<1000)){ Player.status[LEVITATING]--; if (Player.status[LEVITATING] == 0) mprint("You're no longer walking on air."); } if (Player.status[DISEASED]>0) { Player.status[DISEASED]--; if (Player.status[DISEASED] == 0) { showflags(); mprint("You feel better now."); } } if ((Player.status[INVISIBLE] > 0) && (Player.status[INVISIBLE]<1000)){ Player.status[INVISIBLE]--; if (Player.status[INVISIBLE] == 0) mprint("You feel more opaque now."); } if ((Player.status[BLINDED]>0) && (Player.status[BLINDED]<1000)) { Player.status[BLINDED]--; if (Player.status[BLINDED] == 0) mprint("You can see again."); } if ((Player.status[TRUESIGHT]>0) && (Player.status[TRUESIGHT]<1000)) { Player.status[TRUESIGHT]--; if (Player.status[TRUESIGHT] == 0) mprint("You feel less keen now."); } if ((Player.status[BERSERK]>0) && (Player.status[BERSERK]<1000)) { Player.status[BERSERK]--; if (Player.status[BERSERK] == 0) mprint("You stop foaming at the mouth."); } if ((Player.status[ALERT]>0) && (Player.status[ALERT] < 1000)) { Player.status[ALERT]--; if (Player.status[ALERT] == 0) mprint("You feel less alert now."); } if ((Player.status[BREATHING]>0) && (Player.status[BREATHING] < 1000)) { Player.status[BREATHING]--; if (Player.status[BREATHING] == 0) mprint("You feel somewhat congested."); } if ((Player.status[DISPLACED]>0) && (Player.status[DISPLACED] < 1000)) { Player.status[DISPLACED]--; if (Player.status[DISPLACED]==0) mprint("You feel a sense of position."); } timeprint(); dataprint(); }
/* A value over 1000 indicates a permanent effect */ void minute_status_check(void) { int i; if (Player.status[HASTED]>0) { if (Player.status[HASTED] < 1000) { Player.status[HASTED]--; if (Player.status[HASTED]==0) { mprint("The world speeds up."); calc_melee(); } } } if (Player.status[POISONED]>0) { Player.status[POISONED]--; p_damage(3,POISON,"poison"); if (Player.status[POISONED] == 0) { showflags(); mprint("You feel better now."); } } if (Player.immunity[UNSTOPPABLE]>0) { for(i=0;i<NUMIMMUNITIES;i++) Player.immunity[i]--; if (Player.immunity[UNSTOPPABLE]==1) mprint("You feel vincible again."); } if (Player.status[IMMOBILE]>0) { Player.status[IMMOBILE]--; if (Player.status[IMMOBILE] == 0) mprint("You can move again."); } if (Player.status[SLEPT]>0) { Player.status[SLEPT]--; if (Player.status[SLEPT] == 0) { mprint("You woke up."); } } if (Player.status[REGENERATING]>0) { if ((Player.hp < Player.maxhp) && (Player.mana > 0)){ Player.hp++; Player.mana--; dataprint(); } if (Player.status[REGENERATING] < 1000) { Player.status[REGENERATING]--; if (Player.status[REGENERATING] == 0) { mprint("You feel less homeostatic."); } } } if (Player.status[SLOWED]>0) { if (Player.status[SLOWED] < 1000) { Player.status[SLOWED]--; if (Player.status[SLOWED] == 0) { mprint("You feel quicker now."); calc_melee(); } } } if (Player.status[RETURNING]>0) { Player.status[RETURNING]--; if (Player.status[RETURNING] == 10) mprint("Your return spell slowly hums towards activation..."); else if (Player.status[RETURNING] == 8) mprint("There is an electric tension in the air!"); else if (Player.status[RETURNING] == 5) mprint("A vortex of mana begins to form around you!"); else if (Player.status[RETURNING] == 1) mprint("Your surroundings start to warp and fade!"); if (Player.status[RETURNING] == 0) level_return(); } if (Player.status[AFRAID]>0) { if (Player.status[AFRAID] < 1000) { Player.status[AFRAID]--; if (Player.status[AFRAID] == 0) { mprint("You feel bolder now."); } } } }
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."); } }
/* This is to be called whenever anything might change player performance in melee, such as changing weapon, statistics, etc. */ void calc_melee(void) { calc_weight(); Player.maxweight = (Player.str * Player.agi * 10); Player.absorption = Player.status[PROTECTION]; Player.defense = 2 * statmod(Player.agi)+(Player.level/2); Player.hit = Player.level + statmod(Player.dex)+1; Player.dmg = statmod(Player.str)+3; Player.speed = 5 - min(4,(statmod(Player.agi)/2)); if (Player.status[HASTED] > 0) Player.speed = Player.speed / 2; if (Player.status[SLOWED] > 0) Player.speed = Player.speed * 2; if (Player.itemweight > 0) switch(Player.maxweight / Player.itemweight) { case 0: Player.speed+=6; break; case 1: Player.speed+=3; break; case 2: Player.speed+=2; break; case 3: Player.speed+=1; break; } if (Player.status[ACCURATE]) Player.hit+=20; if (Player.status[HERO]) Player.hit+=Player.dex; if (Player.status[HERO]) Player.dmg+=Player.str; if (Player.status[HERO]) Player.defense+=Player.agi; if (Player.status[HERO]) Player.speed=Player.speed / 2; Player.speed = max(1,min(25,Player.speed)); if (State.getMounted()) { Player.speed = 3; Player.hit += 10; Player.dmg += 10; } else if (Player.rank[MONKS] > 0) { /* monks are faster when not in armor or on horseback */ if (Player.possessions[O_ARMOR] == NULL) { Player.speed += (min(0,(Player.rank[MONKS] -1))); } } /* weapon */ /* have to check for used since it could be a 2h weapon just carried in one hand */ if (Player.possessions[O_WEAPON_HAND] != NULL) if (Player.possessions[O_WEAPON_HAND]->used && ((Player.possessions[O_WEAPON_HAND]->objchar==WEAPON)|| (Player.possessions[O_WEAPON_HAND]->objchar==MISSILEWEAPON))) { Player.hit += Player.possessions[O_WEAPON_HAND]->hit + Player.possessions[O_WEAPON_HAND]->plus; Player.dmg += Player.possessions[O_WEAPON_HAND]->dmg + Player.possessions[O_WEAPON_HAND]->plus; } if (Player.rank[MONKS] > 0) { /* monks */ /* aren't monks just obscene? PGM */ if (Player.possessions[O_WEAPON_HAND] == NULL) /*barehanded*/ { /* all monks get a bonus in unarmed combat */ Player.hit += ( Player.rank[MONKS] * Player.level ); Player.dmg += ( Player.rank[MONKS] * Player.level ); Player.defense += ( Player.rank[MONKS] * Player.level ); if (Player.rank[MONKS] == MONK_GRANDMASTER) { /* Grandmaster does 3x damage in unarmed combat. */ Player.dmg *= 3; } } } /* shield or defensive weapon */ if (Player.possessions[O_SHIELD] != NULL) { Player.defense += Player.possessions[O_SHIELD]->aux + Player.possessions[O_SHIELD]->plus; } /* armor */ if (Player.possessions[O_ARMOR] != NULL) { Player.absorption += Player.possessions[O_ARMOR]->dmg; Player.defense += Player.possessions[O_ARMOR]->plus - Player.possessions[O_ARMOR]->aux; } if (strlen(Player.combatManeuvers) > 2*maneuvers()) default_maneuvers(); comwinprint(); showflags(); dataprint(); }
main() { int ar[MAXROW][MAXCOL],n, m, i,j, col; char cflag, names[MAXROW][MAXCOL]; do { printf("Enter the number of students and the number of scores \n"); scanf("%d%d", &n, &m); } while (n > MAXROW || m > MAXCOL); for (i = 0; i < n; i++) { printf("Enter the last name of student %d (no spaces in the name) followed by Enter\n",i+1); scanf ("%s", names[i]); printf("Enter %d integer scores for the student %s \n",m, names[i]); for (j = 0; j < m; j++) { scanf ("%d", &ar[i][j]); } } printf("Now we will see if the data got entered correctly\n"); dataprint(names, ar, n, m); getchar(); /* this consumes the leftover ENTER character */ for (;;) { printf("Enter N if you want to sort on the names, or C if you want to sort on a column, or E to exit\n"); cflag = getchar(); getchar(); printf ("You entered %c\n", cflag); if (cflag == 'E') return; if (cflag == 'C') { printf("Enter a column number between 1 and %d to sort on: ", m); scanf (" %d", &col); getchar(); printf("The entry was %d\n ", col); twodsort (ar, names, n, m, col-1); /* for (i = 0; i < n; i++) { printf("%s ", names[i]); } */ printf("\n\nNow we will see if the array got sorted correctly on column %d\n", col); dataprint(names, ar, n, m); } else { stringsort(ar, names, n, m); printf("\n\nNow we will see if the array got sorted correctly on the names\n"); dataprint(names, ar, n, m); } } }
/* various kinds of wishes */ void wish(int blessing) { int i; char wishstr[80]; clearmsg(); print1("What do you wish for? "); if (blessing < 0) deathprint(); else strcpy(wishstr,msgscanstring()); if (blessing < 0 || strcmp(wishstr,"Death")==0) { print2("As you wish, so shall it be."); p_death("a deathwish"); } if (strcmp(wishstr,"Power")==0) { print2("You feel a sudden surge of energy"); Player.mana=calcmana()*10; } else if (strcmp(wishstr,"Skill")==0) { print2("You feel more competent."); if (gamestatusp(CHEATED)) gain_experience(10000); else gain_experience(min(10000,Player.xp)); } else if (strcmp(wishstr,"Wealth")==0) { print2("You are submerged in shower of gold pieces!"); Player.cash += 10000; } else if (strcmp(wishstr,"Balance")==0) { print2("You feel neutral."); Player.alignment = 0; } else if (strcmp(wishstr,"Chaos")==0) { print2("You feel chaotic."); Player.alignment -= 25; } else if (strcmp(wishstr,"Law")==0) { print2("You feel lawful."); Player.alignment += 25; } else if (strcmp(wishstr,"Location")==0) strategic_teleport(1); else if (strcmp(wishstr,"Knowledge")==0) { print2("You feel more knowledgeable."); i = random_range(NUMSPELLS); if (Spells[i].known) Spells[i].powerdrain = (max(1,Spells[i].powerdrain/2)); else Spells[i].known = TRUE; } else if (strcmp(wishstr,"Health")==0) { print2("You feel vigorous"); Player.hp = max( Player.hp, Player.maxhp); Player.status[DISEASED] = 0; Player.status[POISONED] = 0; Player.food = 43; /* Wish for Health when starving does some good. PGM */ } else if (strcmp(wishstr,"Destruction")==0) annihilate(gamestatusp(CHEATED)); else if (strcmp(wishstr,"Acquisition")==0) acquire(gamestatusp(CHEATED)); else if (strcmp(wishstr,"Summoning")==0) summon(gamestatusp(CHEATED),-1); else if (strcmp(wishstr,"Stats") == 0 && gamestatusp(CHEATED)) { Player.str = Player.maxstr = Player.con = Player.maxcon = Player.agi = Player.maxagi = Player.dex = Player.maxdex = Player.iq = Player.maxiq = Player.pow = Player.maxpow = 200; calc_melee(); } else print2("You feel stupid."); dataprint(); 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_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_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 p_movefunction(int movef) { /* loc functs above traps should be activated whether levitating or not */ drawvision(Player.x,Player.y); sign_print(Player.x,Player.y,false); if (Player.status[SHADOWFORM]) switch(movef) { /* player in shadow form is unable to do most things */ case L_CHAOS: l_chaos(); break; case L_ABYSS: l_abyss(); break; case L_ARENA_EXIT: l_arena_exit(); break; case L_ENTER_COURT: l_enter_court(); break; case L_ESCALATOR: l_escalator(); break; case L_COLLEGE: l_college(); break; case L_SORCERORS: l_sorcerors(); break; case L_ALTAR: l_altar(); break; case L_TACTICAL_EXIT: l_tactical_exit(); break; case L_HOUSE_EXIT: l_house_exit(); break; case L_HOUSE: l_house(); break; case L_HOVEL: l_hovel(); break; case L_MANSION: l_mansion(); break; case L_COUNTRYSIDE: l_countryside(); break; case L_ORACLE: l_oracle(); break; case L_TEMPLE_WARNING: l_temple_warning(); break; case L_ENTER_CIRCLE: l_enter_circle(); break; case L_CIRCLE_LIBRARY: l_circle_library(); break; case L_TOME1: l_tome1(); break; case L_TOME2: l_tome2(); break; case L_ADEPT: l_adept(); break; case L_VOICE1: l_voice1(); break; case L_VOICE2: l_voice2(); break; case L_VOICE3: l_voice3(); break; case L_VOID: l_void(); break; case L_FIRE_STATION: l_fire_station(); break; case L_EARTH_STATION: l_earth_station(); break; case L_WATER_STATION: l_water_station(); break; case L_AIR_STATION: l_air_station(); break; case L_VOID_STATION: l_void_station(); break; } else if ((! Player.status[LEVITATING]) || State.getMounted() || (Cmd == '@') || /* @ command activates all effects under player */ (movef < LEVITATION_AVOIDANCE)) { if (movef != L_NO_OP) { State.setFastMove(false); dataprint(); } switch(movef) { /* miscellaneous */ case L_NO_OP: l_no_op(); break; case L_HEDGE: l_hedge(); break; case L_WATER: l_water(); break; case L_LIFT: l_lift(); break; case L_LAVA: l_lava(); break; case L_FIRE: l_fire(); break; case L_WHIRLWIND: l_whirlwind(); break; case L_RUBBLE: l_rubble(); break; case L_MAGIC_POOL: l_magic_pool(); break; case L_CHAOS: l_chaos(); break; case L_ABYSS: l_abyss(); break; case L_PORTCULLIS_TRAP: l_portcullis_trap(); break; case L_RAISE_PORTCULLIS: l_raise_portcullis(); break; case L_DROP_EVERY_PORTCULLIS: l_drop_every_portcullis(); break; case L_ARENA_EXIT: l_arena_exit(); break; case L_TRIFID: l_trifid(); break; case L_ENTER_COURT: l_enter_court(); break; case L_ESCALATOR: l_escalator(); break; case L_THRONE: l_throne(); break; case L_TRAP_DART: l_trap_dart(); break; case L_TRAP_SIREN: l_trap_siren(); break; case L_TRAP_PIT: l_trap_pit(); break; case L_TRAP_DOOR: l_trap_door(); break; case L_TRAP_SNARE: l_trap_snare(); break; case L_TRAP_BLADE: l_trap_blade(); break; case L_TRAP_FIRE: l_trap_fire(); break; case L_TRAP_TELEPORT: l_trap_teleport(); break; case L_TRAP_DISINTEGRATE: l_trap_disintegrate(); break; case L_TRAP_SLEEP_GAS: l_trap_sleepgas(); break; case L_TRAP_MANADRAIN: l_trap_manadrain(); break; case L_TRAP_ACID: l_trap_acid(); break; case L_TRAP_ABYSS: l_trap_abyss(); break; /*door functions */ case L_BANK: l_bank(); break; case L_ARMORER: l_armorer(); break; case L_CLUB: l_club(); break; case L_GYM: l_gym(); break; case L_BROTHEL: l_brothel(); break; case L_THIEVES_GUILD: l_thieves_guild(); break; case L_COLLEGE: l_college(); break; case L_HEALER: l_healer(); break; case L_STATUE_WAKE: l_statue_wake(); break; case L_CASINO: l_casino(); break; case L_COMMANDANT: l_commandant(); break; case L_DINER: l_diner(); break; case L_CRAP: l_crap(); break; case L_TAVERN: l_tavern(); break; case L_MERC_GUILD: l_merc_guild(); break; case L_MONASTERY: l_monastery(); break; case L_ALCHEMIST: l_alchemist(); break; case L_SORCERORS: l_sorcerors(); break; case L_CASTLE: l_castle(); break; case L_ARENA: l_arena(); break; case L_VAULT: l_vault(); break; case L_DPW: l_dpw(); break; case L_LIBRARY: l_library(); break; case L_PAWN_SHOP: l_pawn_shop(); break; case L_CONDO: l_condo(); break; case L_TOURIST: l_tourist(); break; case L_ALTAR: l_altar(); break; case L_TACTICAL_EXIT: l_tactical_exit(); break; case L_HOUSE_EXIT: l_house_exit(); break; case L_SAFE: l_safe(); break; case L_HOUSE: l_house(); break; case L_HOVEL: l_hovel(); break; case L_MANSION: l_mansion(); break; case L_COUNTRYSIDE: l_countryside(); break; case L_ORACLE: l_oracle(); break; case L_ORDER: l_order(); break; case L_CARTOGRAPHER: l_cartographer(); break; case L_TEMPLE_WARNING: l_temple_warning(); break; case L_ENTER_CIRCLE: l_enter_circle(); break; case L_CIRCLE_LIBRARY: l_circle_library(); break; case L_TOME1: l_tome1(); break; case L_TOME2: l_tome2(); break; case L_CHARITY: l_charity(); break; case L_CHAOSTONE: l_chaostone(); break; case L_VOIDSTONE: l_voidstone(); break; case L_BALANCESTONE: l_balancestone(); break; case L_LAWSTONE: l_lawstone(); break; case L_SACRIFICESTONE: l_sacrificestone(); break; case L_MINDSTONE: l_mindstone(); break; /* challenge functions */ case L_ADEPT: l_adept(); break; case L_VOICE1: l_voice1(); break; case L_VOICE2: l_voice2(); break; case L_VOICE3: l_voice3(); break; case L_VOID: l_void(); break; case L_FIRE_STATION: l_fire_station(); break; case L_EARTH_STATION: l_earth_station(); break; case L_WATER_STATION: l_water_station(); break; case L_AIR_STATION: l_air_station(); break; case L_VOID_STATION: l_void_station(); break; } } }
void l_throne(void) { pob o; int i; print1("You have come upon a huge ornately appointed throne!"); print2("Sit in it? [yn] "); if (ynq1()=='y') { if (! find_item(&o,OB_SCEPTRE,-1)) { print1("The throne emits an eerie violet-black radiance."); print2("You find, to your horror, that you cannot get up!"); print3("You feel an abstract sucking sensation..."); for(i=0;i<NUMSPELLS;i++) Spells[i].known = FALSE; Player.pow = 3; Player.mana = 0; Player.hp = 1; dispel(-1); morewait();clearmsg(); print1("The radiance finally ceases. You can get up now."); } else { if (HiMagicUse == Date) print3("You hear the sound of a magic kazoo played by an asthmatic."); else { HiMagicUse = Date; print1("Following some strange impulse, you raise the Sceptre...."); print2("You hear a magical fanfare, repeated three times."); switch(HiMagic++) { case 0: print3("Strength."); Player.str+=5; Player.maxstr+=5; break; case 1: print3("Constitution."); Player.con+=5; Player.maxcon+=5; break; case 2: print3("Dexterity."); Player.dex+=5; Player.maxdex+=5; break; case 3: print3("Agility."); Player.agi+=5; Player.maxagi+=5; break; case 4: print3("Intelligence."); Player.iq+=5; Player.maxiq+=5; break; case 5: print3("Power."); Player.pow+=5; Player.maxpow+=5; break; default: if (Spells[S_WISH].known) { print1("A mysterious voice mutters peevishly...."); print2("So what do you want now? A medal?"); } else { print1("Mystic runes appear in the air before you:"); print2("They appear to describe some high-powered spell."); morewait(); print1("You hear a distant voice...."); print2("'You may now tread the path of High Magic.'"); Spells[S_WISH].known = TRUE; } break; case 17: print1("Weird flickering lights play over the throne."); print2("You hear a strange droning sound, as of a magical"); morewait(); print1("artifact stressed by excessive use...."); print2("With an odd tinkling sound the throne shatters!"); Level->site[Player.x][Player.y].locchar = RUBBLE; Level->site[Player.x][Player.y].p_locf = L_RUBBLE; lset(Player.x, Player.y, CHANGED); if (find_and_remove_item(OB_SCEPTRE,-1)) { morewait(); print1("Your sceptre reverberates with the noise, and"); print2("it too explodes in a spray of shards."); } break; } calc_melee(); dataprint(); } } } }