/* hooray */ void p_win(void) { morewait(); clearmsg(); print1("You won!"); morewait(); display_win(); endgraf(); exit(0); }
void make_hp(pob o) { print1("A full-scale heavenly choir chants \'Hallelujah\' all around you!"); print2("You notice a change in the symbol you carry..."); switch(Player.patron) { case ODIN: *o = Objects[ARTIFACTID + 14]; break; case SET: *o = Objects[ARTIFACTID + 17]; break; case ATHENA: *o = Objects[ARTIFACTID + 16]; break; case HECATE: *o = Objects[ARTIFACTID + 15]; break; case DRUID: *o = Objects[ARTIFACTID + 18]; break; case DESTINY: *o = Objects[ARTIFACTID + 19]; break; } o->known = 2; /* Random hack to convey bit that symbol is functional */ o->charge = 17; morewait(); if(Player.patron == DRUID) { print1("Your deity raises you to the post of Archdruid!"); } else { print1("You deity raises you to the post of High Priest!"); } print2("You feel holy."); strcpy(Priest[Player.patron], Player.name); Priestlevel[Player.patron] = Player.level; Player.rank[PRIESTHOOD] = HIGHPRIEST; morewait(); learnclericalspells(Player.patron, HIGHPRIEST); }
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."); }
/* prints wherever cursor is in window, but checks to see if it should morewait and clear window */ void mprint(char *s) { int x,y; if (! gamestatusp(SUPPRESS_PRINTING)) { getyx(Msgw,y,x); if (x+strlen(s) >= ScreenWidth) { buffercycle(s); if (Msgw == Msg1w) { wclear(Msg2w); Msgw = Msg2w; } else { morewait(); wclear(Msg1w); wclear(Msg2w); wrefresh(Msg2w); Msgw = Msg1w; } } else if (x > 0) bufferappend(s); else buffercycle(s); wprintw(Msgw,s); waddch(Msgw,' '); wrefresh(Msgw); } }
/* read a scroll, book, tome, etc. */ void peruse() { int index; struct object *obj; clearmsg(); if (Player.status[BLINDED] > 0) print3("You're blind -- you can't read!!!"); else if (Player.status[AFRAID] > 0) print3("You are too afraid to stop to read a scroll!"); else { print1("Read -- "); index = getitem(SCROLL); if (index == ABORT) setgamestatus(SKIP_MONSTERS); else { obj = Player.possessions[index]; if (obj->objchar != SCROLL) { print3("There's nothing written on "); nprint3(itemid(obj)); } else { nprint1("You carefully unfurl the scroll...."); morewait(); item_use(obj); dispose_lost_objects(1,obj); } } } }
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_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 activate() { int index; char response; clearmsg(); print1("Activate -- item [i] or artifact [a] or quit [ESCAPE]?"); do response = (char) mcigetc(); while ((response != 'i') && (response != 'a') && (response != ESCAPE)); if (response != ESCAPE) { if (response == 'i') index = getitem(THING); else if (response == 'a') index = getitem(ARTIFACT); if (index != ABORT) { clearmsg(); print1("You activate it.... "); morewait(); item_use(Player.possessions[index]); } else setgamestatus(SKIP_MONSTERS); } else setgamestatus(SKIP_MONSTERS); }
void i_spells(pob o) { if (o->blessing > -1) Objects[o->id].known = 1; mprint("A scroll of spells."); morewait(); learnspell(o->blessing); }
void i_pepper_food(pob o) { mprint("You innocently start to chew the szechuan pepper....."); morewait(); mprint("hot."); morewait(); mprint("Hot."); morewait(); mprint("Hot!"); morewait(); mprint("HOT!!!!!!"); morewait(); p_damage(1,UNSTOPPABLE,"a szechuan pepper"); mprint("Your sinuses melt and run out your ears."); mprint("Your mouth and throat seem to be permanently on fire."); mprint("You feel much more awake now...."); Player.immunity[SLEEP]++; }
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 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."); }
static int user_character_smoke (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you smoke? [yn] ")) return 0; cinema_print_line(1, "*cough*"); morewait(); return -3; }
static int user_character_out_of_body (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Ever have an out-of-body experience? [yn] ")) return 0; cinema_print_line(1, "Wow, man! Fly the friendly skies..."); morewait(); return 3; }
static int user_character_pk (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you have PK? [yn] ")) return 0; cinema_print_line(1, "I can't tell you how much that moves me."); morewait(); return 6; }
static int user_character_animals (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do animals react oddly to your presence? [yn] ")) return 0; cinema_print_line(1, "How curious that must be."); morewait(); return 2; }
static int user_character_auras (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Can you see auras? [yn] ")) return 0; cinema_print_line(1, "How strange."); morewait(); return 3; }
static int user_character_ghosts (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you believe in ghosts? [yn] ")) return 0; cinema_print_line(1, "I do! I do! I do believe in ghosts!"); morewait(); return 2; }
static int user_character_irish (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Are you Irish? [yn] ")) return 0; cinema_print_line(1, "Is that blarney or what?"); morewait(); return 2; }
/* game over, you lose! */ void p_death(char *fromstring) { Player.hp = -1; print3("You died!"); morewait(); display_death(fromstring); player_dump(); endgraf(); exit(0); }
static int user_character_esp (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Do you have ESP? [yn] ")) return 0; cinema_print_line(1, "Somehow, I knew you were going to say that."); morewait(); return 3; }
static int user_character_spell (void) { cinema_blank(); if ('y' != cinema_ynq_line(0, "Did you ever cast a spell? [yn] ")) return 0; if ('y' != cinema_ynq_line(1, "Did it work? [yn] ")) return 3; cinema_print_line(2, "Sure it did..."); morewait(); return 7; }
void signalexit(int ignored) { clearmsg(); mprint("Yikes!"); morewait(); mprint("Sorry, caught a core-dump signal."); signalsave(0); endgraf(); printf("Bye!\n"); exit(0); }
/* try to break a weapon (from fumbling) */ void break_weapon(void) { if (Player.possessions[O_WEAPON_HAND] != NULL) { strcpy(Str1,"Your "); strcat(Str1,itemid(Player.possessions[O_WEAPON_HAND])); strcat(Str1," vibrates in your hand...."); mprint(Str1); (void) damage_item(Player.possessions[O_WEAPON_HAND]); morewait(); } }
void l_chaos(void) { if (gamestatusp(MOUNTED)) { print1("Your steed tries to swim in the raw Chaos, but seems to"); print2("be having some difficulties..."); morewait(); print1("probably because it's just turned into a chaffinch."); morewait(); resetgamestatus(MOUNTED); } if (! onewithchaos) print1("You are immersed in raw Chaos...."); if (Player.rank[ADEPT]) { if (! onewithchaos) { onewithchaos = 1; print2("You achieve oneness of Chaos...."); } Player.mana = max(Player.mana,calcmana()); Player.hp = max(Player.hp, Player.maxhp); } else if (onewithchaos) /* adept that gets amnesia from chaos storm */ { print2("The chaos sea doesn't seem to bother you at all."); } else if (Player.rank[PRIESTHOOD] && (! saved)) { print2("A mysterious force protects you from the Chaos!"); print3("Wow.... You feel a bit smug."); gain_experience(500); saved = TRUE; } else { print2("Uh oh...."); if (saved) nprint2("Nothing mysterious happens this time...."); morewait(); print1("Congratulations! You've achieved maximal entropy!"); Player.alignment -= 50; gain_experience(1000); p_death("immersion in raw Chaos"); } }
void menuprint(char *s) { int x,y; getyx(Menuw,y,x); if (y >= ScreenLength - 2) { wrefresh(Menuw); morewait(); wclear(Menuw); touchwin(Menuw); } wprintw(Menuw,s); }
/* try to drop a weapon (from fumbling) */ void drop_weapon(void) { if (Player.possessions[O_WEAPON_HAND] != NULL) { strcpy(Str1,"You dropped your "); strcat(Str1,Player.possessions[O_WEAPON_HAND]->objstr); mprint(Str1); morewait(); p_drop_at(Player.x,Player.y,1,Player.possessions[O_WEAPON_HAND]); conform_lost_objects(1,Player.possessions[O_WEAPON_HAND]); } else mprint("You feel fortunate."); }
void l_escalator(void) { print1("You have found an extremely long stairway going straight up."); print2("The stairs are grilled steel and the bannister is rubber."); morewait(); print1("Take the stairway? [yn] "); if (ynq1()=='y') { print1("The stairs suddenly start moving with a grind of gears!"); print2("You are wafted to the surface...."); change_environment(E_COUNTRYSIDE); } }
void l_tome2(void) { menuclear(); menuprint("\nYou discover in some ancient notes that the Star Gem can be"); menuprint("\nused for transportation, but also read a caution that it must"); menuprint("\nbe allowed to recharge a long time between uses."); menuprint("\nA marginal note says 'if only it could be reset to go somewhere"); menuprint("\nbesides Star Peak, the gem might be useful....'"); showmenu(); morewait(); xredraw(); }
void menulongprint(long n) { int x,y; getyx(Menuw,y,x); if (y >= ScreenLength - 2) { wrefresh(Menuw); morewait(); wclear(Menuw); touchwin(Menuw); } wprintw(Menuw,"%ld",n); }