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!'"); } } } }
/* npcbehavior digits 1234 4 : alignment (LAWFUL,CHAOTIC, or NEUTRAL) 3 : primary combat action (melee,missile,spell,thief,flight,1..5) 2 : competence at 4 (0..9, 0 = incompetent, 9 = masterful) 1 : conversation mode status : 1 = dead, 2 = saved, 3 = retired, 4 = still playing */ int fixnpc(int status) { int npcbehavior=0; char response; if (status == 1) { /* player is dead, all undead are chaotic */ npcbehavior+=CHAOTIC; npcbehavior+=10; /* melee */ npcbehavior+=100*min(9,((int) (Player.level/3))); npcbehavior+=1000; /* threaten */ } else if (Behavior >= 0) npcbehavior = Behavior; else { menuclear(); menuprint("NPC Behavior Determination Module\n\n"); menuprint("Your overall NPC behavior is:"); if (Player.alignment < -10) { npcbehavior += CHAOTIC; menuprint("\n\n CHAOTIC"); } else if (Player.alignment > 10) { npcbehavior += LAWFUL; menuprint("\n\n LAWFUL"); } else { npcbehavior += NEUTRAL; menuprint("\n\n NEUTRAL"); } menuprint("\n\n1: hand-to-hand combat"); menuprint("\n2: missile combat"); menuprint("\n3: spellcasting"); menuprint("\n4: thieving"); menuprint("\n5: escape"); menuprint("\n\nEnter NPC response to combat: "); showmenu(); response = '0'; while ((response != '1') && (response != '2') && (response != '3') && (response != '4') && (response != '5')) response = menugetc(); menuaddch(response); npcbehavior+=10*(response - '0'); npcbehavior+=100*competence_check(response-'0'); response = '0'; menuclear(); menuprint("1: threaten"); menuprint("\n2: greet"); menuprint("\n3: aid"); menuprint("\n4: beg"); menuprint("\n5: silence"); menuprint("\n\nEnter NPC response to conversation: "); showmenu(); while ((response != '1') && (response != '2') && (response != '3') && (response != '4') && (response != '5')) response = menugetc(); menuaddch(response); npcbehavior+=1000*(response - '0'); xredraw(); } Behavior = npcbehavior; return(npcbehavior); }
void l_trifid(void) { int damage=0,stuck=TRUE; print1("The hedge comes alive with a surge of alien growth!"); while (stuck) { dataprint(); damage += Level->depth/2+1; print2("Razor-edged vines covered in suckers attach themselves to you."); morewait(); if (find_and_remove_item(OB_SALT_WATER,-1)) { print1("Thinking fast, you toss salt water on the trifid..."); print2("The trifid disintegrates with a frustrated sigh."); Level->site[Player.x][Player.y].locchar = FLOOR; Level->site[Player.x][Player.y].p_locf = L_NO_OP; lset(Player.x, Player.y, CHANGED); gain_experience(1000); stuck = FALSE; } else { p_damage(damage,UNSTOPPABLE,"a trifid"); morewait(); print1("You are entangled in tendrils..."); menuclear(); menuprint("a: Try to break free.\n"); menuprint("b: Hang limp and hope the tendrils uncoil.\n"); menuprint("c: Pray for assistance.\n"); menuprint("d: Attempt to bargain with the hedge.\n"); menuprint("e: Click your heels together and wish for escape.\n"); menuprint("ANYTHING ELSE: writhe and scream hopelessly.\n"); showmenu(); switch(menugetc()) { case 'a': if (Player.str > random_range(200)) { print1("Amazing! You're now free."); print2("The trifid writhes hungrily at you."); stuck = FALSE; } else print1("Well, THAT didn't work."); break; case 'b': print1("Well, at least you're facing your fate with dignity."); break; case 'c': if ((Player.patron == DRUID) && (Player.rank[PRIESTHOOD] > random_range(5))) { print1("A shaft of golden light bathes the alien plant"); print2("which grudginly lets you go...."); stuck = FALSE; } else print1("You receive no divine aid as yet."); break; case 'd': print1("The hedge doesn't answer your entreaties."); break; case 'e': print1("You forgot your ruby slippers, stupid."); break; default: print1("The hedge enjoys your camp play-acting...."); break; } } } xredraw(); }