diff -uNr ../nethack-3.3.1-unpatched/include/config.h ./include/config.h --- ../nethack-3.3.1-unpatched/include/config.h Thu Sep 14 13:00:37 2000 +++ ./include/config.h Thu Sep 14 13:00:19 2000 @@ -47,6 +47,9 @@ /* #define QT_GRAPHICS */ /* Qt interface */ /* #define GNOME_GRAPHICS */ /* Gnome interface */ +#define HITPOINTBAR /* graphical hitpoint meter behind player name */ +#define SOUNDFX /* sound effects via external 'listener' program */ + /* * Define the default window system. This should be one that is compiled * into your system (see defines above). Known window systems are: @@ -126,10 +129,10 @@ #ifndef WIZARD /* allow for compile-time or Makefile changes */ # ifndef KR1ED -# define WIZARD "wizard" /* the person allowed to use the -D option */ +# define WIZARD "mrq" /* the person allowed to use the -D option */ # else # define WIZARD -# define WIZARD_NAME "wizard" +# define WIZARD_NAME "mrq" # endif #endif diff -uNr ../nethack-3.3.1-unpatched/include/decl.h ./include/decl.h --- ../nethack-3.3.1-unpatched/include/decl.h Thu Sep 14 13:00:37 2000 +++ ./include/decl.h Thu Sep 14 13:00:19 2000 @@ -26,6 +26,8 @@ E NEARDATA int bases[MAXOCLASSES]; + +E int damagetaken; E NEARDATA int multi; E NEARDATA int warnlevel; E NEARDATA int nroom; diff -uNr ../nethack-3.3.1-unpatched/include/flag.h ./include/flag.h --- ../nethack-3.3.1-unpatched/include/flag.h Thu Sep 14 13:00:37 2000 +++ ./include/flag.h Thu Sep 14 13:00:19 2000 @@ -42,6 +42,12 @@ boolean forcefight; boolean friday13; /* it's Friday the 13th */ boolean help; /* look in data file for info about stuff */ +#ifdef HITPOINTBAR + boolean hitpointbar; /* colourful hit point status bar */ +#endif +#ifdef SOUNDFX + boolean soundfx; /* audio sound effects */ +#endif boolean ignintr; /* ignore interrupts */ #ifdef INSURANCE boolean ins_chkpt; /* checkpoint as appropriate */ diff -uNr ../nethack-3.3.1-unpatched/include/hack.h ./include/hack.h --- ../nethack-3.3.1-unpatched/include/hack.h Thu Sep 14 13:00:37 2000 +++ ./include/hack.h Thu Sep 14 13:00:19 2000 @@ -9,6 +9,101 @@ #include "config.h" #endif +/* sound stuff */ +#define SND_SOUNDPORT 1234 + +#define SND_ALARM "alarm.au" +#define SND_APPLAUSE "applause.au" +#define SND_APPLE "apple.au" +#define SND_BEES "bees.au" +#define SND_BELL "bell.au" +#define SND_BOOZE "beer.au" +#define SND_BOULDER "boulder.au" +#define SND_BUBBLES "bubbles.au" +#define SND_BUGLE "bugle.au" +#define SND_CASHREGISTER "cashregister.au" +#define SND_CAMERA "camera.au" +#define SND_CAT "meow.au" +#define SND_COCKATRICE "hiss.au" +#define SND_CURSE "asshole.au" +#define SND_CURSEDITEM "doh.au" +#define SND_CURSEDITEM2 "awshit.au" +#define SND_DESTROYARMOR "awshit.au" +#define SND_DICE "dice.au" +#define SND_DOORBREAK "doorbreak.au" +#define SND_DOORCLOSE "doorclose.au" +#define SND_DOOROPEN "dooropen.au" +#define SND_DRAWBRIDGE "drawbridge.au" +#define SND_DRINK "drink.au" +#define SND_DRIP "drip.au" +#define SND_DROPGOLD "dropgold.au" +#define SND_EAT "eat.au" +#define SND_ELEPHANT "elephant.au" +#define SND_ENCHANTLONG "enchantlong.au" +#define SND_ENCHANTSHORT "enchantshort.au" +#define SND_EXCALIBUR "excalibur.au" +#define SND_EXPLOSION "explosion.au" +#define SND_FAST "fast.au" +#define SND_FIRE "fire.au" +#define SND_FLUTE "flute.au" +#define SND_FLUTE2 "flute2.au" +#define SND_FOUNTAIN "fountain.au" +#define SND_FREEZE "freeze.au" +#define SND_FRIENDLY "hisweety.au" +#define SND_GALLOP "gallop.au" +#define SND_GLASS "glass.au" +#define SND_GOODBYE "goodbye.au" +#define SND_GOTHURT "ow.au" +#define SND_GURGLE "gurgle.au" +#define SND_HALLELUJAH "hallelujah.au" +#define SND_HALLU1 "bogus.au" +#define SND_HALLU2 "nowaydude.au" +#define SND_HARP "harp.au" +#define SND_HIT "hit.au" +#define SND_HORN "horn.au" +#define SND_HOWL "howl.au" +#define SND_KEYS "keys.au" +#define SND_KILL "kill.au" +#define SND_LAUGH "evillaugh.au" +#define SND_LEVELUPCAVEMAN "yabba.au" +#define SND_LIGHTNING "lightning.au" +#define SND_MAGICMISSILE "magicmissile.au" +#define SND_MISS "miss.au" +#define SND_MOSQUITOS "mosquitos.au" +#define SND_OFFHEAD "offhead.au" +#define SND_PICKAXE "ding.au" +#define SND_POLYMORPH "polymorph.au" +#define SND_POPEYE "popeye.au" +#define SND_PRAY "pray.au" +#define SND_SCARY "twizone.au" +#define SND_SEARCHING "searching.au" +#define SND_SIZZLE "sizzle.au" +#define SND_SNORE "snore.au" +#define SND_SLAM "slam.au" +#define SND_SPLASHING "splashlong.au" +#define SND_SPLASHSHORT "splashshort.au" +#define SND_SQUEAK "squeak.au" +#define SND_STETHOHALLU "deadjim.au" +#define SND_TELEPORT "portal.au" +#define SND_TEMPLEBAD "scary.au" +#define SND_TEMPLEGOOD "peace.au" +#define SND_THUNDER "thunder.au" +#define SND_THRONEROOM "throneroom.au" +#define SND_THRONEROOMSOUND1 "throneroomsound1.au" +#define SND_THRONEROOMSOUND2 "throneroomsound2.au" +#define SND_TORNADO "tornado.au" +#define SND_TRAPDOOR "trapdoor.au" +#define SND_VALKFOOD "valkfood.au" +#define SND_VALKLIFE "valklife.au" +#define SND_VOMIT "vomit.au" +#define SND_WELCOME "welcome.au" +#define SND_WELCOMEARCH "arch.au" +#define SND_WELCOMECAVEMAN "flint.au" +#define SND_WHISTLE "whistle.au" +#define SND_WHISTLEMAGIC "magicwhistle.au" +#define SND_WIELD "wield.au" +#define SND_WIND "wind.au" + /* For debugging beta code. */ #ifdef BETA #define Dpline pline diff -uNr ../nethack-3.3.1-unpatched/src/allmain.c ./src/allmain.c --- ../nethack-3.3.1-unpatched/src/allmain.c Thu Sep 14 13:00:37 2000 +++ ./src/allmain.c Thu Sep 14 13:00:19 2000 @@ -539,6 +539,20 @@ currentgend != flags.initgend)) Sprintf(eos(buf), " %s", genders[currentgend].adj); + if (Role_if(PM_VALKYRIE) || Race_if(PM_ELF) || Role_if(PM_WIZARD)) { +#ifdef SOUNDFX + playsound(SND_WELCOME); +#endif + } else if (Role_if(PM_ARCHEOLOGIST)) { +#ifdef SOUNDFX + playsound(SND_WELCOMEARCH); +#endif + } else if (Role_if(PM_CAVEMAN)) { +#ifdef SOUNDFX + playsound(SND_WELCOMECAVEMAN); +#endif + } + pline(new_game ? "%s %s, welcome to NetHack! You are a%s %s %s." : "%s %s, the%s %s %s, welcome back to NetHack!", Hello((struct monst *) 0), plname, buf, urace.adj, diff -uNr ../nethack-3.3.1-unpatched/src/apply.c ./src/apply.c --- ../nethack-3.3.1-unpatched/src/apply.c Thu Sep 14 13:00:37 2000 +++ ./src/apply.c Thu Sep 14 13:00:19 2000 @@ -61,6 +61,9 @@ pline(nothing_happens); return (1); } +#ifdef SOUNDFX + playsound(SND_CAMERA); +#endif obj->spe--; if (obj->cursed && !rn2(2)) { (void) zapyourself(obj, TRUE); @@ -164,6 +167,9 @@ if (Hallucination && sobj_at(CORPSE, rx, ry)) { /* (a corpse doesn't retain the monster's sex, so we're forced to use generic pronoun here) */ +#ifdef SOUNDFX + playsound(SND_STETHOHALLU); +#endif You_hear("a voice say, \"It's dead, Jim.\""); *resp = 1; return TRUE; @@ -223,16 +229,23 @@ return res; #endif } else if (u.dz) { - if (Underwater) + if (Underwater) { +#ifdef SOUNDFX + playsound(SND_SPLASHSHORT); +#endif You_hear("faint splashing."); + } else if (u.dz < 0 || !can_reach_floor()) You_cant("reach the %s.", (u.dz > 0) ? surface(u.ux,u.uy) : ceiling(u.ux,u.uy)); else if (its_dead(u.ux, u.uy, &res)) ; /* message already given */ - else if (Is_stronghold(&u.uz)) + else if (Is_stronghold(&u.uz)) { +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif You_hear("the crackling of hellfire."); - else + } else pline_The("%s seems healthy enough.", surface(u.ux,u.uy)); return res; } else if (obj->cursed && !rn2(2)) { @@ -291,6 +304,9 @@ use_whistle(obj) struct obj *obj; { +#ifdef SOUNDFX + playsound(SND_WHISTLE); +#endif You(whistle_str, obj->cursed ? "shrill" : "high"); wake_nearby(); } @@ -306,6 +322,9 @@ wake_nearby(); } else { int pet_cnt = 0; +#ifdef SOUNDFX + playsound(SND_WHISTLEMAGIC); +#endif You(whistle_str, Hallucination ? "normal" : "strange"); for(mtmp = fmon; mtmp; mtmp = nextmon) { nextmon = mtmp->nmon; /* trap might kill mon */ @@ -759,6 +778,9 @@ #ifdef AMIGA amii_speaker( obj, "ahdhgqeqdhehaqdqfhgw", AMII_MUFFLED_VOLUME ); #endif +#ifdef SOUNDFX + playsound(SND_BELL); +#endif if (obj->cursed && !rn2(4) && /* note: once any of them are gone, we stop all of them */ !(mvitals[PM_WOOD_NYMPH].mvflags & G_GONE) && @@ -803,6 +825,9 @@ wakem = TRUE; } else if (invoking) { +#ifdef SOUNDFX + playsound(SND_BELL); +#endif pline("%s issues an unsettling shrill sound...", The(xname(obj))); #ifdef AMIGA diff -uNr ../nethack-3.3.1-unpatched/src/artifact.c ./src/artifact.c --- ../nethack-3.3.1-unpatched/src/artifact.c Thu Sep 14 13:00:37 2000 +++ ./src/artifact.c Thu Sep 14 13:00:19 2000 @@ -718,6 +718,9 @@ /* the four basic attacks: fire, cold, shock and missiles */ if (attacks(AD_FIRE, otmp)) { if (realizes_damage) { +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif pline_The("fiery blade %s %s!", (mdef->data == &mons[PM_WATER_ELEMENTAL]) ? "vaporizes part of" : "burns", hittee); @@ -729,6 +732,9 @@ } if (attacks(AD_COLD, otmp)) { if (realizes_damage) { +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif pline_The("ice-cold blade freezes %s!", hittee); if (!rn2(4)) (void) destroy_mitem(mdef, POTION_CLASS, AD_COLD); return TRUE; @@ -738,6 +744,9 @@ if (realizes_damage) { if(youattack && otmp != uwep) pline("%s hits %s!", The(xname(otmp)), hittee); +#ifdef SOUNDFX + playsound(SND_LIGHTNING); +#endif pline("Lightning strikes %s!", hittee); if (!rn2(5)) (void) destroy_mitem(mdef, RING_CLASS, AD_ELEC); if (!rn2(5)) (void) destroy_mitem(mdef, WAND_CLASS, AD_ELEC); @@ -748,6 +757,9 @@ if (realizes_damage) { if(youattack && otmp != uwep) pline("%s hits %s!", The(xname(otmp)), hittee); +#ifdef SOUNDFX + playsound(SND_MAGICMISSILE); +#endif pline("A hail of magic missiles strikes %s!", hittee); return TRUE; } diff -uNr ../nethack-3.3.1-unpatched/src/botl.c ./src/botl.c --- ../nethack-3.3.1-unpatched/src/botl.c Thu Sep 14 13:00:37 2000 +++ ./src/botl.c Thu Sep 14 13:00:19 2000 @@ -4,6 +4,12 @@ #include "hack.h" +#define HP_RED "\e[41;30m" +#define HP_PURPLE "\e[45;30m" +#define HP_YELLOW "\e[43;30m" +#define HP_GREEN "\e[42;30m" +#define HP_BLUE "\e[44;30m" + #ifdef OVL0 extern const char *hu_stat[]; /* defined in eat.c */ @@ -160,10 +166,49 @@ bot1() { char newbot1[MAXCO]; + char temp[1024]; register char *nb; register int i,j; + int hp,hpmax; +#ifndef HITPOINTBAR + int damagetaken = 0; +#endif + int barstart,barend; + int bardam; /* damage taken last turn */ + int barlength; /* number of characters wide hpbar is + (barend - barstart) */ + int baramount; /* how much of the bar is drawn(depends on current hp)*/ + int damageamount; /* how much of the bar is drawn for damage taken */ + char hpbar[80]; + char hpcolor[15]; + + /*Strcpy(newbot1, plname); */ + + hp = Upolyd ? u.mh : u.uhp; + hpmax = Upolyd ? u.mhmax : u.uhpmax; + if(hp < 0) hp = 0; + + if (hp == hpmax) { + strcpy(hpcolor, HP_GREEN); + } else if (((double)hp / (double)hpmax) > 0.5) { + strcpy(hpcolor, HP_YELLOW); + } else if (((double)hp / (double)hpmax) > 0.25) { + strcpy(hpcolor, HP_PURPLE); + } else { + strcpy(hpcolor, HP_RED); + } + +#ifdef HITPOINTBAR + if (flags.hitpointbar) { + Strcpy(newbot1, "["); + Strcat(newbot1, plname); + } else { + Strcpy(newbot1, plname); + } +#else + Strcpy(newbot1, plname); +#endif - Strcpy(newbot1, plname); if('a' <= newbot1[0] && newbot1[0] <= 'z') newbot1[0] += 'A'-'a'; newbot1[10] = 0; Sprintf(nb = eos(newbot1)," the "); @@ -183,6 +228,47 @@ } else Sprintf(nb = eos(nb), rank()); + /* position of start/end of status bar */ + barstart = 1; + barend = strlen(newbot1); + + /* */ + barlength = barend - barstart; + baramount = ((double)hp / (double)hpmax) * barlength; + + /* damage taken */ + damageamount = ((double)damagetaken / (double)hpmax) * barlength; + if (damagetaken > 0) { + bardam = barstart + baramount + damageamount; + if (bardam > barend) bardam = barend; + } else { /* no damage */ + bardam = barstart + baramount; + } + +#ifdef HITPOINTBAR + damagetaken = 0; +#endif + + /* adjust bar end */ + barend = barstart + baramount; + + /* setup bar */ + strcpy(hpbar, ""); + for (i = 0; i < 80; i++) { + strcat(hpbar, " "); + } + + hpbar[1] = 'S'; + hpbar[barend] = 'E'; + /* this might overwrite the barend - this is okay */ + hpbar[bardam] = 'D'; + +#ifdef HITPOINTBAR + if (flags.hitpointbar) { + Strcat(newbot1, "]"); + } +#endif + Sprintf(nb = eos(nb)," "); i = mrank_sz + 15; j = (nb + 2) - newbot1; /* aka strlen(newbot1) but less computation */ @@ -206,8 +292,40 @@ if (flags.showscore) Sprintf(nb = eos(nb), " S:%ld", botl_score()); #endif +#ifdef HITPOINTBAR + if (flags.hitpointbar) { + /* merge hpbar and newbot1 */ + for (i = 0; i < strlen(newbot1); i++) { + char temp2[2]; + char bar_coloured[6]; + char bar_blank[6]; + + sprintf(bar_coloured, "\e[41m"); + sprintf(bar_blank, "\e[10m"); + sprintf(temp2, "%c", newbot1[i]); + if (hpbar[i] == 'S') { + strcat(temp, hpcolor); + strcat(temp, temp2); + } else if (hpbar[i] == 'E') { + strcat(temp, HP_BLUE); + strcat(temp, temp2); + } else if (hpbar[i] == 'D') { + strcat(temp, "\e[0m"); + strcat(temp, temp2); + } else { + strcat(temp, temp2); + } + } + } else { + strcpy(temp, newbot1); + } +#else + strcpy(temp, newbot1); +#endif + curs(WIN_STATUS, 1, 0); - putstr(WIN_STATUS, 0, newbot1); + /*putstr(WIN_STATUS, 0, newbot1); */ + putstr(WIN_STATUS, 0, temp); } /* provide the name of the current level for display by various ports */ @@ -278,6 +396,7 @@ if(Slimed) Sprintf(nb = eos(nb), " Slime"); if(cap > UNENCUMBERED) Sprintf(nb = eos(nb), " %s", enc_stat[cap]); + Strcat(newbot2, "\e[0m"); curs(WIN_STATUS, 1, 1); putstr(WIN_STATUS, 0, newbot2); } diff -uNr ../nethack-3.3.1-unpatched/src/dbridge.c ./src/dbridge.c --- ../nethack-3.3.1-unpatched/src/dbridge.c Thu Sep 14 13:00:37 2000 +++ ./src/dbridge.c Thu Sep 14 13:00:19 2000 @@ -719,8 +719,12 @@ pline("%s on drawbridge square", E_phrase(etmp, "are")); #endif if (is_pool(etmp->ex, etmp->ey) && !e_inview) - if (flags.soundok) + if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_SPLASHSHORT); +#endif You_hear("a splash."); + } if (e_survives_at(etmp, etmp->ex, etmp->ey)) { if (e_inview && !is_flyer(etmp->edata) && !is_floater(etmp->edata)) @@ -823,6 +827,9 @@ if (lev1->typ != DRAWBRIDGE_UP) return; x2 = x; y2 = y; get_wall_for_db(&x2,&y2); +#ifdef SOUNDFX + playsound(SND_DRAWBRIDGE); +#endif if (cansee(x,y) || cansee(x2,y2)) You("see a drawbridge %s down!", (distu(x2,y2) < distu(x,y)) ? "going" : "coming"); @@ -873,14 +880,22 @@ if (cansee(x2,y2)) pline_The("portcullis of the drawbridge falls into the %s!", lava ? "lava" : "moat"); - else if (flags.soundok) + else if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_SPLASHSHORT); +#endif You_hear("a loud *SPLASH*!"); + } } else { if (cansee(x,y)) pline_The("drawbridge collapses into the %s!", lava ? "lava" : "moat"); - else if (flags.soundok) + else if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_SPLASHSHORT); +#endif You_hear("a loud *SPLASH*!"); + } } lev1->typ = lava ? LAVAPOOL : MOAT; lev1->drawbridgemask = 0; @@ -891,8 +906,12 @@ } else { if (cansee(x,y)) pline_The("drawbridge disintegrates!"); - else + else { +#ifdef SOUNDFX + playsound(SND_DOORBREAK); +#endif You_hear("a loud *CRASH*!"); + } lev1->typ = ((lev1->drawbridgemask & DB_ICE) ? ICE : ROOM); lev1->icedpool = diff -uNr ../nethack-3.3.1-unpatched/src/decl.c ./src/decl.c --- ../nethack-3.3.1-unpatched/src/decl.c Thu Sep 14 13:00:37 2000 +++ ./src/decl.c Thu Sep 14 13:00:19 2000 @@ -19,6 +19,9 @@ NEARDATA int bases[MAXOCLASSES] = DUMMY; +#ifdef HITPOINTBAR +int damagetaken; +#endif NEARDATA int multi = 0; NEARDATA int warnlevel = 0; /* used by movemon and dochugw */ NEARDATA int nroom = 0; diff -uNr ../nethack-3.3.1-unpatched/src/detect.c ./src/detect.c --- ../nethack-3.3.1-unpatched/src/detect.c Thu Sep 14 13:00:37 2000 +++ ./src/detect.c Thu Sep 14 13:00:19 2000 @@ -910,10 +910,15 @@ cvt_sdoor_to_door(&levl[zx][zy]); /* .typ = DOOR */ if(levl[zx][zy].doormask & D_TRAPPED) { if(distu(zx, zy) < 3) b_trapped("door", 0); - else Norep("You %s an explosion!", + else { +#ifdef SOUNDFX + playsound(SND_EXPLOSION); +#endif + Norep("You %s an explosion!", cansee(zx, zy) ? "see" : (flags.soundok ? "hear" : "feel the shock of")); + } wake_nearto(zx, zy, 11*11); levl[zx][zy].doormask = D_NODOOR; } else diff -uNr ../nethack-3.3.1-unpatched/src/dig.c ./src/dig.c --- ../nethack-3.3.1-unpatched/src/dig.c Thu Sep 14 13:00:37 2000 +++ ./src/dig.c Thu Sep 14 13:00:19 2000 @@ -161,6 +161,9 @@ if(verbose) You("cannot dig in thin air."); return(FALSE); } else if (Is_waterlevel(&u.uz)) { +#ifdef SOUNDFX + playsound(SND_SPLASHSHORT); +#endif if(verbose) pline_The("water splashes and subsides."); return(FALSE); } else if ((IS_WALL(levl[x][y].typ) && @@ -792,6 +795,9 @@ dam = rnd(2) + dbon() + obj->spe; if (dam <= 0) dam = 1; +#ifdef SOUNDFX + playsound(SND_GOTHURT); +#endif You("hit yourself with %s.", yname(uwep)); /* self_pronoun() won't work twice in a sentence */ Strcpy(buf, self_pronoun("killed %sself with %%s pick-axe", @@ -826,9 +832,13 @@ /* (maybe `move_into_trap()' would be better) */ nomul(-d(2,2)); nomovemsg = "You pull free."; - } else + } else { +#ifdef SOUNDFX + playsound(SND_MISS); +#endif You("swing your %s through thin air.", - aobjnam(obj, (char *)0)); + aobjnam(obj, (char *)0)); + } } else { static const char *d_action[5] = { "digging", @@ -844,8 +854,14 @@ digging.pos.y = ry; assign_level(&digging.level, &u.uz); digging.effort = 0; +#ifdef SOUNDFX + playsound(SND_PICKAXE); +#endif You("start %s.", d_action[dig_target]); } else { +#ifdef SOUNDFX + playsound(SND_PICKAXE); +#endif You("%s %s.", digging.chew ? "begin" : "continue", d_action[dig_target]); digging.chew = FALSE; @@ -871,10 +887,17 @@ digging.pos.y = u.uy; assign_level(&digging.level, &u.uz); digging.effort = 0; +#ifdef SOUNDFX + playsound(SND_PICKAXE); +#endif You("start digging downward."); if (*u.ushops) shopdig(0); - } else + } else { +#ifdef SOUNDFX + playsound(SND_PICKAXE); +#endif You("continue digging downward."); + } did_dig_msg = FALSE; set_occupation(dig, "digging", 0); } diff -uNr ../nethack-3.3.1-unpatched/src/do.c ./src/do.c --- ../nethack-3.3.1-unpatched/src/do.c Thu Sep 14 13:00:37 2000 +++ ./src/do.c Thu Sep 14 13:00:19 2000 @@ -101,13 +101,19 @@ if (pushing ? !Blind : cansee(rx,ry)) { boolean moat = (ltyp != WATER) && !Is_medusa_level(&u.uz) && !Is_waterlevel(&u.uz); - +#ifdef SOUNDFX + playsound(SND_SPLASHSHORT); +#endif There("is a large splash as %s %s the %s.", the(xname(otmp)), fills_up? "fills":"falls into", lava ? "lava" : ltyp==POOL ? "pool" : moat ? "moat" : "water"); - } else if (flags.soundok) + } else if (flags.soundok) { +#ifdef SOUNDFX + if (lava) playsound(SND_SIZZLE); +#endif You_hear("a%s splash.", lava ? " sizzling" : ""); + } wake_nearto(rx, ry, 40); } @@ -398,9 +404,11 @@ return(FALSE); } if (obj->otyp == LOADSTONE && obj->cursed) { - if (*word) + if (*word) { + cursedsound(); pline("For some reason, you cannot %s the stone%s!", word, plur(obj->quan)); + } /* Kludge -- see invent.c */ if (obj->corpsenm) { struct obj *otmp; @@ -470,6 +478,9 @@ return(1); } #endif +#ifdef SOUNDFX + if (obj->oclass == GOLD_CLASS) playsound(SND_DROPGOLD); +#endif if (!can_reach_floor()) { if(flags.verbose) You("drop %s.", doname(obj)); if (obj->oclass != GOLD_CLASS || obj == invent) freeinv(obj); @@ -1171,6 +1182,9 @@ /* once Croesus is dead, his alarm doesn't work any more */ if (Is_knox(&u.uz) && (new || !mvitals[PM_CROESUS].died)) { You("penetrated a high security area!"); +#ifdef SOUNDFX + playsound(SND_ALARM); +#endif pline("An alarm sounds!"); for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if (!DEADMONSTER(mtmp) && mtmp->msleeping) mtmp->msleeping = 0; diff -uNr ../nethack-3.3.1-unpatched/src/do_wear.c ./src/do_wear.c --- ../nethack-3.3.1-unpatched/src/do_wear.c Thu Sep 14 13:00:37 2000 +++ ./src/do_wear.c Thu Sep 14 13:00:19 2000 @@ -1065,6 +1065,7 @@ { /* Curses, like chickens, come home to roost. */ if((otmp == uwep) ? welded(otmp) : (int)otmp->cursed) { + cursedsound(); You("can't. %s to be cursed.", (is_boots(otmp) || is_gloves(otmp) || otmp->quan > 1L) ? "They seem" : "It seems"); diff -uNr ../nethack-3.3.1-unpatched/src/dogmove.c ./src/dogmove.c --- ../nethack-3.3.1-unpatched/src/dogmove.c Thu Sep 14 13:00:37 2000 +++ ./src/dogmove.c Thu Sep 14 13:00:19 2000 @@ -155,11 +155,15 @@ /* TODO: Reveal presence of sea monster (especially sharks) */ } else /* hack: observe the action if either new or old location is in view */ - if (cansee(x, y) || cansee(mtmp->mx, mtmp->my)) + if (cansee(x, y) || cansee(mtmp->mx, mtmp->my)) { +#ifdef SOUNDFX + playsound(SND_EAT); +#endif pline("%s %s %s.", Monnam(mtmp), devour ? "devours" : "eats", (obj->oclass == FOOD_CLASS) ? singular(obj, doname) : doname(obj)); + } /* It's a reward if it's DOGFOOD and the player dropped/threw it. */ /* We know the player had it if invlet is set -dlc */ if(dogfood(mtmp,obj) == DOGFOOD && obj->invlet) diff -uNr ../nethack-3.3.1-unpatched/src/dokick.c ./src/dokick.c --- ../nethack-3.3.1-unpatched/src/dokick.c Thu Sep 14 13:00:37 2000 +++ ./src/dokick.c Thu Sep 14 13:00:19 2000 @@ -393,6 +393,9 @@ struct obj *otmp2; long loss = 0L; +#ifdef SOUNDFX + playsound(SND_SLAM); +#endif if(range < 2) pline("THUD!"); for(otmp = kickobj->cobj; otmp; otmp = otmp2) { @@ -407,6 +410,9 @@ result = "cracking"; } if (result) { +#ifdef SOUNDFX + playsound(SND_GLASS); +#endif You_hear("a muffled %s.",result); if(costly) loss += stolen_value(otmp, x, y, (boolean)shkp->mpeaceful, TRUE); @@ -708,6 +714,9 @@ } if (is_pool(x, y) ^ !!u.uinwater) { /* objects normally can't be removed from water by kicking */ +#ifdef SOUNDFX + playsound(SND_SPLASHSHORT); +#endif You("splash some water around."); return 1; } @@ -770,7 +779,10 @@ maploc->typ = ROOM; maploc->doormask = 0; /* don't leave loose ends.. */ (void) mkgold((long)rnd(200), x, y); - if (Blind) +#ifdef SOUNDFX + playsound(SND_DOORBREAK); +#endif + if (Blind) pline("CRASH! You destroy it."); else { pline("CRASH! You destroy the throne."); @@ -914,6 +926,9 @@ goto dumb; ouch: pline("Ouch! That hurts!"); +#ifdef SOUNDFX + playsound(SND_GOTHURT); +#endif exercise(A_DEX, FALSE); exercise(A_STR, FALSE); if (Blind) feel_location(x,y); /* we know we hit it */ @@ -967,10 +982,16 @@ maploc->doormask = D_NODOOR; b_trapped("door", FOOT); } else if(ACURR(A_STR) > 18 && !rn2(5) && !shopdoor) { +#ifdef SOUNDFX + playsound(SND_DOORBREAK); +#endif pline("As you kick the door, it shatters to pieces!"); exercise(A_STR, TRUE); maploc->doormask = D_NODOOR; } else { +#ifdef SOUNDFX + playsound(SND_DOORBREAK); +#endif pline("As you kick the door, it crashes open!"); exercise(A_STR, TRUE); maploc->doormask = D_BROKEN; @@ -1000,6 +1021,9 @@ } else { if (Blind) feel_location(x,y); /* we know we hit it */ exercise(A_STR, TRUE); +#ifdef SOUNDFX + playsound(SND_SLAM); +#endif pline("WHAMMM!!!"); if ((slev = Is_special(&u.uz)) && slev->flags.town) for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { diff -uNr ../nethack-3.3.1-unpatched/src/dothrow.c ./src/dothrow.c --- ../nethack-3.3.1-unpatched/src/dothrow.c Thu Sep 14 13:00:37 2000 +++ ./src/dothrow.c Thu Sep 14 13:00:19 2000 @@ -1384,6 +1384,9 @@ to_pieces = " into a thousand pieces"; /*FALLTHRU*/ case POT_WATER: /* really, all potions */ +#ifdef SOUNDFX + playsound(SND_GLASS); +#endif if (!in_view) You_hear("%s shatter!", something); else diff -uNr ../nethack-3.3.1-unpatched/src/eat.c ./src/eat.c --- ../nethack-3.3.1-unpatched/src/eat.c Thu Sep 14 13:00:37 2000 +++ ./src/eat.c Thu Sep 14 13:00:19 2000 @@ -834,6 +834,9 @@ You("seem slower."); } else { HFast |= FROMOUTSIDE; +#ifdef SOUNDFX + playsound(SND_FAST); +#endif You("seem faster."); } break; @@ -1027,9 +1030,13 @@ You("discard the open tin."); goto use_me; } - if (!tin.tin->cursed) + if (!tin.tin->cursed) { +#ifdef SOUNDFX + playsound(SND_POPEYE); +#endif pline("This makes you feel like %s!", Hallucination ? "Swee'pea" : "Popeye"); + } lesshungry(600); gainstr(tin.tin, 0); u.uconduct.food++; @@ -1163,6 +1170,10 @@ else if (otmp->blessed) rotted -= 2L; } +#ifdef SOUNDFX + playsound(SND_EAT); +#endif + if (mnum != PM_ACID_BLOB && !stoneable && rotted > 5L) { pline("Ulch - that %s was tainted!", mons[mnum].mlet == S_FUNGUS ? "fungoid vegetation" : @@ -1281,6 +1292,9 @@ fprefx(otmp) /* called on "first bite" of (non-corpse) food */ struct obj *otmp; { +#ifdef SOUNDFX + playsound(SND_EAT); +#endif switch(otmp->otyp) { case FOOD_RATION: if(u.uhunger <= 200) @@ -1325,6 +1339,9 @@ else #ifdef UNIX if (otmp->otyp == APPLE || otmp->otyp == PEAR) { +#ifdef SOUNDFX + playsound(SND_APPLE); +#endif if (!Hallucination) pline("Core dumped."); else { /* This is based on an old Usenet joke, a fake a.out manual page */ @@ -2094,6 +2111,11 @@ if (incr && occupation && (occupation != eatfood && occupation != opentin)) stop_occupation(); + if (Role_if(PM_VALKYRIE)) { +#ifdef SOUNDFX + playsound(SND_VALKFOOD); +#endif + } break; } u.uhs = newhs; @@ -2205,6 +2227,9 @@ void vomit() /* A good idea from David Neves */ { +#ifdef SOUNDFX + playsound(SND_VOMIT); +#endif make_sick(0L, (char *) 0, TRUE, SICK_VOMITABLE); nomul(-2); } diff -uNr ../nethack-3.3.1-unpatched/src/end.c ./src/end.c --- ../nethack-3.3.1-unpatched/src/end.c Thu Sep 14 13:00:37 2000 +++ ./src/end.c Thu Sep 14 13:00:19 2000 @@ -501,7 +501,10 @@ makeknown(AMULET_OF_LIFE_SAVING); Your("medallion %s!", !Blind ? "begins to glow" : "feels warm"); - if (how == CHOKING) You("vomit ..."); + if (how == CHOKING) { + playsound(SND_VOMIT); + You("vomit ..."); + } You_feel("much better!"); pline_The("medallion crumbles to dust!"); if (uamul) useup(uamul); @@ -671,6 +674,7 @@ } if (!done_stopprint) { + playsound(SND_GOODBYE); Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname, how != ASCENDED ? (const char *) ((flags.female && urole.name.f) ? diff -uNr ../nethack-3.3.1-unpatched/src/engrave.c ./src/engrave.c --- ../nethack-3.3.1-unpatched/src/engrave.c Thu Sep 14 13:00:37 2000 +++ ./src/engrave.c Thu Sep 14 13:00:19 2000 @@ -650,6 +650,9 @@ /* RAY wands */ case WAN_MAGIC_MISSILE: +#ifdef SOUNDFX + playsound(SND_MAGICMISSILE); +#endif ptext = TRUE; if (!Blind) { Sprintf(post_engr_text, @@ -733,6 +736,9 @@ xname(otmp)); doknown = TRUE; } +#ifdef SOUNDFX + playsound(SND_LIGHTNING); +#endif if (!Blind) { Strcpy(post_engr_text, "Lightning arcs from the wand."); @@ -1017,6 +1023,9 @@ if (multi) nomovemsg = "You finish engraving."; break; case BURN: +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif multi = -(len/10); if (multi) nomovemsg = is_ice(u.ux,u.uy) ? diff -uNr ../nethack-3.3.1-unpatched/src/exper.c ./src/exper.c --- ../nethack-3.3.1-unpatched/src/exper.c Thu Sep 14 13:00:37 2000 +++ ./src/exper.c Thu Sep 14 13:00:19 2000 @@ -197,6 +197,7 @@ } ++u.ulevel; if (u.ulevelmax < u.ulevel) u.ulevelmax = u.ulevel; + levelupsound(); pline("Welcome to experience level %d.", u.ulevel); adjabil(u.ulevel - 1, u.ulevel); /* give new intrinsics */ reset_rndmonst(NON_PM); /* new monster selection */ diff -uNr ../nethack-3.3.1-unpatched/src/fountain.c ./src/fountain.c --- ../nethack-3.3.1-unpatched/src/fountain.c Thu Sep 14 13:00:37 2000 +++ ./src/fountain.c Thu Sep 14 13:00:19 2000 @@ -35,8 +35,12 @@ if((mtmp = makemon(&mons[PM_WATER_MOCCASIN], u.ux, u.uy, NO_MM_FLAGS)) && t_at(mtmp->mx, mtmp->my)) (void) mintrap(mtmp); - } else + } else { +#ifdef SOUNDFX + playsound(SND_BUBBLES); +#endif pline_The("fountain bubbles furiously for a moment, then calms."); + } } STATIC_OVL @@ -371,6 +375,13 @@ } else { /* The lady of the lake acts! - Eric Backus */ /* Be *REAL* nice */ +#ifdef SOUNDFX + if (Role_if(PM_KNIGHT)) { + playsound(SND_EXCALIBUR); + } else { + playsound(SND_HALLELUJAH); + } +#endif pline("From the murky depths, a hand reaches up to bless the sword."); pline("As the hand retreats, the fountain disappears!"); obj = oname(obj, artiname(ART_EXCALIBUR)); diff -uNr ../nethack-3.3.1-unpatched/src/hack.c ./src/hack.c --- ../nethack-3.3.1-unpatched/src/hack.c Thu Sep 14 13:00:37 2000 +++ ./src/hack.c Thu Sep 14 13:32:39 2000 @@ -4,6 +4,14 @@ #include "hack.h" +#include +#include +#include +#include +#include +#include +#include + #ifdef OVL1 static void NDECL(maybe_wail); #endif /*OVL1*/ @@ -20,6 +28,107 @@ #ifdef OVL2 +#ifdef SOUNDFX +int playsound(char * whichsound) { + char filename[256]; + int sock,sock2,addrlen,nb; + struct sockaddr_in addr; + + if (!flags.soundfx) { + return -1; + } + + sock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); + if (sock == -1) { + return -1; + } + bzero((char *)&addr,sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = inet_addr("127.0.0.1"); + addr.sin_port = htons((unsigned short)(SND_SOUNDPORT)); + + if (connect(sock, &addr, sizeof(addr))) { + return -1; + } + + strcpy(filename, whichsound); + strcat(filename, "\n"); /* add newline */ + write(sock, filename,sizeof(filename)); + close(sock); + return 0; +} + +void levelupsound(void) { + static int whichsound = 0; + char filename[256]; + sprintf(filename, "levelup%d.au", whichsound); + + if (Role_if(PM_CAVEMAN)) { + playsound(SND_LEVELUPCAVEMAN); + } + + playsound(filename); + + if (++whichsound >= 7) { + whichsound = 0; + } +} + +void karatesound(void) { + char filename[256]; + sprintf(filename, "karate%d.au", rn2(18)+1); + playsound(filename); +} + +void bladesound(void) { + char filename[256]; + sprintf(filename, "blade%d.au", rn2(3)+1); + playsound(filename); +} + +void whipsound(void) { + char filename[256]; + sprintf(filename, "whip%d.au", rn2(3)+1); + playsound(filename); +} + +void bluntsound(void) { + char filename[256]; + sprintf(filename, "blunt%d.au", rn2(3)+1); + playsound(filename); +} + +void hitmonstersound() { + if (Role_if(PM_SAMURAI) || Role_if(PM_MONK)) { + karatesound(); + } else { + if (!uwep) { + bluntsound(); + } else if (is_blade(uwep)) { + bladesound(); + } else if (objects[uwep->otyp].oc_skill == P_WHIP) { + whipsound(); + } else bluntsound(); + } +} + +void cursedsound(void) { + if (rn2(2)) { + playsound(SND_CURSEDITEM); + } else { + playsound(SND_CURSEDITEM2); + } +} + +void hallucinationsound(void) { + if (rn2(2)) { + playsound(SND_HALLU1); + } else { + playsound(SND_HALLU2); + } +} +#endif + boolean revive_nasty(x, y, msg) int x,y; @@ -223,10 +332,12 @@ #ifdef STEED if (!u.usteed) { #endif - if (moves > lastmovetime+2 || moves < lastmovetime) + if (moves > lastmovetime+2 || moves < lastmovetime) { + playsound(SND_BOULDER); pline("With %s effort you move %s.", throws_rocks(youmonst.data) ? "little" : "great", the(xname(otmp))); + } exercise(A_STR, TRUE); #ifdef STEED } else @@ -1325,6 +1436,7 @@ Blind ? "humid" : "muddy"); break; case COURT: + playsound(SND_THRONEROOM); You("enter an opulent throne room!"); break; case LEPREHALL: @@ -1338,6 +1450,7 @@ You("have an uncanny feeling..."); break; case BEEHIVE: + playsound(SND_BEES); You("enter a giant beehive!"); break; case COCKNEST: @@ -1663,10 +1776,15 @@ for (i = 0, powercnt = 0; i < SIZE(powers); ++i) if (u.uprops[powers[i]].intrinsic & INTRINSIC) ++powercnt; + if (powercnt < 4) playsound(SND_VALKLIFE); + pline(powercnt >= 4 ? "%s, all your powers will be lost..." : "%s, your life force is running out.", who); } } else { + if (u.uhp != 1) { + playsound(SND_HOWL); + } You_hear(u.uhp == 1 ? "the wailing of the Banshee..." : "the howling of the CwnAnnwn..."); } @@ -1689,6 +1807,9 @@ return; } + if (n > 0) playsound(SND_GOTHURT); + damagetaken = n; + u.uhp -= n; if(u.uhp > u.uhpmax) u.uhpmax = u.uhp; /* perhaps n was negative */ diff -uNr ../nethack-3.3.1-unpatched/src/lock.c ./src/lock.c --- ../nethack-3.3.1-unpatched/src/lock.c Thu Sep 14 13:00:37 2000 +++ ./src/lock.c Thu Sep 14 13:00:19 2000 @@ -553,6 +553,9 @@ /* door is known to be CLOSED */ if (rnl(20) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) { +#ifdef SOUNDFX + playsound(SND_DOOROPEN); +#endif pline_The("door opens."); if(door->doormask & D_TRAPPED) { b_trapped("door", FINGER); @@ -673,6 +676,9 @@ u.usteed || #endif rn2(25) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) { +#ifdef SOUNDFX + playsound(SND_DOORCLOSE); +#endif pline_The("door closes."); door->doormask = D_CLOSED; if (Blind) @@ -827,10 +833,17 @@ if (MON_AT(x, y)) (void) mb_trapped(m_at(x,y)); else if (flags.verbose) { - if (cansee(x,y)) + if (cansee(x,y)) { +#ifdef SOUNDFX + playsound(SND_EXPLOSION); +#endif pline("KABOOM!! You see a door explode."); - else if (flags.soundok) + } else if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_EXPLOSION); +#endif You_hear("a distant explosion."); + } } door->doormask = D_NODOOR; unblock_point(x,y); @@ -840,6 +853,9 @@ } door->doormask = D_BROKEN; if (flags.verbose) { +#ifdef SOUNDFX + playsound(SND_DOORBREAK); +#endif if (cansee(x,y)) pline_The("door crashes open!"); else if (flags.soundok) diff -uNr ../nethack-3.3.1-unpatched/src/mcastu.c ./src/mcastu.c --- ../nethack-3.3.1-unpatched/src/mcastu.c Thu Sep 14 13:00:37 2000 +++ ./src/mcastu.c Thu Sep 14 13:00:19 2000 @@ -86,6 +86,9 @@ } break; case AD_MAGM: +#ifdef SOUNDFX + playsound(SND_MAGICMISSILE); +#endif You("are hit by a shower of missiles!"); if(Antimagic) { shieldeff(u.ux, u.uy); diff -uNr ../nethack-3.3.1-unpatched/src/mhitm.c ./src/mhitm.c --- ../nethack-3.3.1-unpatched/src/mhitm.c Thu Sep 14 13:00:37 2000 +++ ./src/mhitm.c Thu Sep 14 13:00:19 2000 @@ -85,6 +85,11 @@ fmt = (could_seduce(magr,mdef,mattk) && !magr->mcan) ? "%s pretends to be friendly to" : "%s misses"; Sprintf(buf, fmt, Monnam(magr)); + if (could_seduce(magr,mdef,mattk) && !magr->mcan) { +#ifdef SOUNDFX + playsound(SND_FRIENDLY); +#endif + } pline("%s %s.", buf, mon_nam_too(mdef_name, mdef, magr)); } else noises(magr, mattk); } @@ -605,10 +610,14 @@ tmp = 0; break; } - if (vis) + if (vis) { +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif pline("%s is %s!", Monnam(mdef), mattk->aatyp == AT_HUGS ? "being roasted" : "on fire"); + } if (pd == &mons[PM_STRAW_GOLEM] || pd == &mons[PM_PAPER_GOLEM]) { if (vis) pline("%s burns completely!", Monnam(mdef)); @@ -637,7 +646,12 @@ tmp = 0; break; } - if (vis) pline("%s is covered in frost!", Monnam(mdef)); + if (vis) { +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif + pline("%s is covered in frost!", Monnam(mdef)); + } if (resists_cold(mdef)) { if (vis) pline_The("frost doesn't seem to chill %s!", @@ -827,6 +841,9 @@ 0 : MM_AGR_DIED)); } if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_LAUGH); +#endif if (!vis) You_hear("laughter."); else pline("%s chuckles.", Monnam(magr)); } diff -uNr ../nethack-3.3.1-unpatched/src/mhitu.c ./src/mhitu.c --- ../nethack-3.3.1-unpatched/src/mhitu.c Thu Sep 14 13:00:37 2000 +++ ./src/mhitu.c Thu Sep 14 13:00:19 2000 @@ -91,9 +91,12 @@ if (!canspotmon(mtmp)) map_invisible(mtmp->mx, mtmp->my); - if(could_seduce(mtmp, &youmonst, mattk) && !mtmp->mcan) + if(could_seduce(mtmp, &youmonst, mattk) && !mtmp->mcan) { +#ifdef SOUNDFX + playsound(SND_FRIENDLY); +#endif pline("%s pretends to be friendly.", Monnam(mtmp)); - else { + } else { if (!flags.verbose || !nearmiss) pline("%s misses.", Monnam(mtmp)); else @@ -1099,8 +1102,12 @@ if (flags.soundok) You_hear("a cough from %s!", mon_nam(mtmp)); } else { - if (flags.soundok) + if (flags.soundok){ +#ifdef SOUNDFX + playsound(SND_COCKATRICE); +#endif You_hear("%s hissing!", s_suffix(mon_nam(mtmp))); + } if(!rn2(10) || (flags.moonphase == NEW_MOON && !have_lizard())) { do_stone: @@ -1323,6 +1330,9 @@ if(!night() && mdat == &mons[PM_GREMLIN]) break; if(!mtmp->mcan && !rn2(10)) { if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_LAUGH); +#endif if (Blind) You_hear("laughter."); else pline("%s chuckles.", Monnam(mtmp)); } @@ -1567,6 +1577,9 @@ } break; case AD_PHYS: +#ifdef SOUNDFX + playsound(SND_TORNADO); +#endif You("are pummeled with debris!"); exercise(A_STR, FALSE); break; @@ -1864,6 +1877,12 @@ if (u.mh < 1) rehumanize(); } else { u.uhp -= n; +#ifdef SOUNDFX + playsound(SND_GOTHURT); +#endif +#ifdef HITPOINTBAR + damagetaken += n; +#endif if(u.uhp < 1) done_in_by(mtmp); } } diff -uNr ../nethack-3.3.1-unpatched/src/minion.c ./src/minion.c --- ../nethack-3.3.1-unpatched/src/minion.c Thu Sep 14 13:00:37 2000 +++ ./src/minion.c Thu Sep 14 13:00:19 2000 @@ -140,6 +140,9 @@ Amonnam(mtmp), demand, plur(demand)); if ((offer = bribe(mtmp)) >= demand) { +#ifdef SOUNDFX + playsound(SND_LAUGH); +#endif pline("%s vanishes, laughing about cowardly mortals.", Amonnam(mtmp)); } else { diff -uNr ../nethack-3.3.1-unpatched/src/mon.c ./src/mon.c --- ../nethack-3.3.1-unpatched/src/mon.c Thu Sep 14 13:00:37 2000 +++ ./src/mon.c Thu Sep 14 13:00:19 2000 @@ -558,6 +558,9 @@ touch_artifact(otmp,mtmp)) { if (mtmp->data == &mons[PM_RUST_MONSTER] && otmp->oerodeproof) { if (canseemon(mtmp) && flags.verbose) { +#ifdef SOUNDFX + playsound(SND_EAT); +#endif pline("%s eats %s!", Monnam(mtmp), distant_name(otmp,doname)); @@ -572,10 +575,13 @@ /* KMH -- Don't eat undigestable/choking objects */ } else if (otmp->otyp != AMULET_OF_STRANGULATION && otmp->otyp != RIN_SLOW_DIGESTION) { - if (cansee(mtmp->mx,mtmp->my) && flags.verbose) + if (cansee(mtmp->mx,mtmp->my) && flags.verbose) { +#ifdef SOUNDFX + playsound(SND_EAT); +#endif pline("%s eats %s!", Monnam(mtmp), distant_name(otmp,doname)); - else if (flags.soundok && flags.verbose) + } else if (flags.soundok && flags.verbose) You_hear("a crunching sound."); mtmp->meating = otmp->owt/2 + 1; /* Heal up to the object's weight in hp */ @@ -650,9 +656,13 @@ otmp->otyp == RIN_SLOW_DIGESTION) continue; ++count; - if (cansee(mtmp->mx,mtmp->my) && flags.verbose) + if (cansee(mtmp->mx,mtmp->my) && flags.verbose) { +#ifdef SOUNDFX + playsound(SND_EAT); +#endif pline("%s eats %s!", Monnam(mtmp), distant_name(otmp, doname)); + } else if (flags.soundok && flags.verbose) You_hear("a slurping sound."); /* Heal up to the object's weight in hp */ @@ -1691,8 +1701,17 @@ } else if (mtmp->mtame) { adjalign(-15); /* bad!! */ /* your god is mighty displeased... */ - if (!Hallucination) You_hear("the rumble of distant thunder..."); - else You_hear("the studio audience applaud!"); + if (!Hallucination) { +#ifdef SOUNDFX + playsound(SND_THUNDER); +#endif + You_hear("the rumble of distant thunder..."); + } else { +#ifdef SOUNDFX + playsound(SND_APPLAUSE); +#endif + You_hear("the studio audience applaud!"); + } } else if (mtmp->mpeaceful) adjalign(-5); diff -uNr ../nethack-3.3.1-unpatched/src/monmove.c ./src/monmove.c --- ../nethack-3.3.1-unpatched/src/monmove.c Thu Sep 14 13:00:37 2000 +++ ./src/monmove.c Thu Sep 14 13:00:19 2000 @@ -972,6 +972,9 @@ unblock_point(mtmp->mx,mtmp->my); /* vision */ if(mb_trapped(mtmp)) return(2); } else { +#ifdef SOUNDFX + playsound(SND_DOOROPEN); +#endif if (flags.verbose) { if (canseeit) You("see a door unlock and open."); @@ -989,6 +992,9 @@ unblock_point(mtmp->mx,mtmp->my); /* vision */ if(mb_trapped(mtmp)) return(2); } else { +#ifdef SOUNDFX + playsound(SND_DOOROPEN); +#endif if (flags.verbose) { if (canseeit) You("see a door open."); @@ -1008,6 +1014,9 @@ if(mb_trapped(mtmp)) return(2); } else { if (flags.verbose) { +#ifdef SOUNDFX + playsound(SND_DOORBREAK); +#endif if (canseeit) You("see a door crash open."); else if (flags.soundok) diff -uNr ../nethack-3.3.1-unpatched/src/muse.c ./src/muse.c --- ../nethack-3.3.1-unpatched/src/muse.c Thu Sep 14 13:00:37 2000 +++ ./src/muse.c Thu Sep 14 13:00:19 2000 @@ -124,6 +124,9 @@ int dam = d(obj->spe+2, 6); if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_EXPLOSION); +#endif if (vis) pline("%s zaps %s, which suddenly explodes!", Monnam(mon), an(xname(obj))); else You_hear("a zap and an explosion in the distance."); @@ -530,6 +533,9 @@ } else impossible("No need for unicorn horn?"); return 2; case MUSE_BUGLE: +#ifdef SOUNDFX + playsound(SND_BUGLE); +#endif if (vismon) pline("%s plays %s!", Monnam(mtmp), doname(otmp)); else if (flags.soundok) @@ -1709,8 +1715,12 @@ different methods of maintaining speed ratings: player's character becomes "very fast" temporarily; monster becomes "one stage faster" permanently */ - if (vismon) + if (vismon) { +#ifdef SOUNDFX + playsound(SND_FAST); +#endif pline("%s is suddenly moving faster.", Monnam(mtmp)); + } if (oseen) makeknown(POT_SPEED); mon_adjust_speed(mtmp, 1); m_useup(mtmp, otmp); diff -uNr ../nethack-3.3.1-unpatched/src/music.c ./src/music.c --- ../nethack-3.3.1-unpatched/src/music.c Thu Sep 14 13:00:37 2000 +++ ./src/music.c Thu Sep 14 13:00:19 2000 @@ -376,6 +376,9 @@ if (do_spec && instr->spe > 0) { check_unpaid(instr); instr->spe--; +#ifdef SOUNDFX + playsound(SND_FLUTE2); +#endif You("produce soft music."); put_monsters_to_sleep(u.ulevel * 5); exercise(A_DEX, TRUE); @@ -383,6 +386,9 @@ } /* else FALLTHRU */ case WOODEN_FLUTE: /* May charm snakes */ do_spec &= (rn2(ACURR(A_DEX)) + u.ulevel > 25); +#ifdef SOUNDFX + playsound(SND_FLUTE); +#endif pline("%s %s.", The(xname(instr)), do_spec ? "trills" : "toots"); if (do_spec) charm_snakes(u.ulevel * 3); @@ -393,6 +399,9 @@ if (do_spec && instr->spe > 0) { check_unpaid(instr); instr->spe--; +#ifdef SOUNDFX + playsound(SND_HORN); +#endif if (!getdir((char *)0)) { pline("%s vibrates.", The(xname(instr))); break; @@ -410,11 +419,17 @@ break; } /* else FALLTHRU */ case TOOLED_HORN: /* Awaken or scare monsters */ +#ifdef SOUNDFX + playsound(SND_HORN); +#endif You("produce a frightful, grave sound."); awaken_monsters(u.ulevel * 30); exercise(A_WIS, FALSE); break; case BUGLE: /* Awaken & attract soldiers */ +#ifdef SOUNDFX + playsound(SND_BUGLE); +#endif You("extract a loud noise from %s.", the(xname(instr))); awaken_soldiers(); exercise(A_WIS, FALSE); @@ -423,6 +438,9 @@ if (do_spec && instr->spe > 0) { check_unpaid(instr); instr->spe--; +#ifdef SOUNDFX + playsound(SND_HARP); +#endif pline("%s produces very attractive music.", The(xname(instr))); charm_monsters((u.ulevel - 1) / 3 + 1); @@ -431,6 +449,9 @@ } /* else FALLTHRU */ case WOODEN_HARP: /* May calm Nymph */ do_spec &= (rn2(ACURR(A_DEX)) + u.ulevel > 25); +#ifdef SOUNDFX + playsound(SND_HARP); +#endif pline("%s %s.", The(xname(instr)), do_spec ? "produces a lilting melody" : "twangs"); if (do_spec) calm_nymphs(u.ulevel * 3); diff -uNr ../nethack-3.3.1-unpatched/src/options.c ./src/options.c --- ../nethack-3.3.1-unpatched/src/options.c Thu Sep 14 13:00:37 2000 +++ ./src/options.c Thu Sep 14 13:24:39 2000 @@ -96,6 +96,9 @@ #else {"hilite_pet", (boolean *)0, FALSE}, #endif +#ifdef HITPOINTBAR + {"hitpointbar", &flags.hitpointbar, FALSE}, +#endif #ifdef ASCIIGRAPH {"IBMgraphics", &iflags.IBMgraphics, FALSE}, #else @@ -169,6 +172,9 @@ {"silent", &flags.silent, TRUE}, {"sortpack", &flags.sortpack, TRUE}, {"sound", &flags.soundok, TRUE}, +#ifdef SOUNDFX + {"soundfx", &flags.soundfx, FALSE}, +#endif {"standout", &flags.standout, FALSE}, {"time", &flags.time, FALSE}, #ifdef TIMED_DELAY diff -uNr ../nethack-3.3.1-unpatched/src/pickup.c ./src/pickup.c --- ../nethack-3.3.1-unpatched/src/pickup.c Thu Sep 14 13:00:37 2000 +++ ./src/pickup.c Thu Sep 14 13:00:19 2000 @@ -1023,6 +1023,9 @@ obj->quan, plur(obj->quan), where); return 0; } else if (gold_capacity < count) { +#ifdef SOUNDFX + playsound(SND_CASHREGISTER); +#endif You("can only %s %s of the %ld gold pieces lying %s.", telekinesis ? "acquire" : "carry", gold_capacity == 1L ? "one" : "some", obj->quan, where); @@ -1032,6 +1035,9 @@ obj->quan -= gold_capacity; costly_gold(obj->ox, obj->oy, gold_capacity); } else { +#ifdef SOUNDFX + playsound(SND_CASHREGISTER); +#endif u.ugold += count; if ((nearload = near_capacity()) != 0) pline("%s %ld gold piece%s.", @@ -1087,6 +1093,15 @@ } } + if (obj->otyp == SKELETON_KEY){ + if (Role_if(PM_VALKYRIE) || Role_if(PM_ELF) || + Role_if(PM_WIZARD)) { +#ifdef SOUNDFX + playsound(SND_KEYS); +#endif + } + } + if ((res = lift_object(obj, (struct obj *)0, &count, telekinesis)) <= 0) return res; diff -uNr ../nethack-3.3.1-unpatched/src/polyself.c ./src/polyself.c --- ../nethack-3.3.1-unpatched/src/polyself.c Thu Sep 14 13:00:37 2000 +++ ./src/polyself.c Thu Sep 14 13:00:19 2000 @@ -293,6 +293,9 @@ if (!uarmg) selftouch("No longer petrify-resistant, you"); made_change: +#ifdef SOUNDFX + playsound(SND_POLYMORPH); +#endif new_light = Upolyd ? emits_light(youmonst.data) : 0; if (old_light != new_light) { if (old_light) diff -uNr ../nethack-3.3.1-unpatched/src/potion.c ./src/potion.c --- ../nethack-3.3.1-unpatched/src/potion.c Thu Sep 14 13:00:37 2000 +++ ./src/potion.c Thu Sep 14 13:00:19 2000 @@ -163,9 +163,9 @@ if (!xtime && old && !Blindfolded && haseyes(youmonst.data)) { if (talk) { - if (Hallucination) + if (Hallucination) { pline("Far out! Everything is all cosmic again!"); - else You("can see again."); + } else You("can see again."); } changed = TRUE; } @@ -204,8 +204,10 @@ if (!xtime) message = "Everything looks SO boring now."; - else + else { + hallucinationsound(); message = "Oh wow! Everything seems so cosmic!"; + } if (mask) { if (HHallucination) changed = TRUE; @@ -346,6 +348,9 @@ switch(otmp->otyp){ case POT_RESTORE_ABILITY: case SPE_RESTORE_ABILITY: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif unkn++; if(otmp->cursed) { pline("Ulch! This makes you feel mediocre!"); @@ -374,6 +379,9 @@ TRUE, 0L); break; case POT_WATER: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if(!otmp->blessed && !otmp->cursed) { pline("This tastes like water."); u.uhunger += rnd(10); @@ -422,6 +430,9 @@ } break; case POT_BOOZE: +#ifdef SOUNDFX + playsound(SND_BOOZE); +#endif unkn++; pline("Ooph! This tastes like %s%s!", otmp->odiluted ? "watered down " : "", @@ -440,6 +451,9 @@ } break; case POT_ENLIGHTENMENT: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if(otmp->cursed) { unkn++; You("have an uneasy feeling..."); @@ -459,11 +473,17 @@ case SPE_INVISIBILITY: /* spell cannot penetrate mummy wrapping */ if (BInvis && uarmc->otyp == MUMMY_WRAPPING) { +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif You_feel("rather itchy under your %s.", xname(uarmc)); break; } /* FALLTHRU */ case POT_INVISIBILITY: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (Invis || Blind || BInvis) { nothing++; } else { @@ -483,6 +503,9 @@ { int msg = Invisible && !Blind; +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif unkn++; if (otmp->cursed) pline("Yecch! This tastes %s.", @@ -516,6 +539,9 @@ break; } case POT_PARALYSIS: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (Free_action) You("stiffen momentarily."); else { @@ -543,6 +569,9 @@ break; case POT_MONSTER_DETECTION: case SPE_DETECT_MONSTERS: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (otmp->blessed) { int x, y; @@ -568,11 +597,17 @@ break; case POT_OBJECT_DETECTION: case SPE_DETECT_TREASURE: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (object_detect(otmp, 0)) return(1); /* nothing detected */ exercise(A_WIS, TRUE); break; case POT_SICKNESS: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif pline("Yecch! This stuff tastes like poison."); if (otmp->blessed) { pline("(But in fact it was mildly stale %s juice.)", @@ -607,6 +642,9 @@ } break; case POT_CONFUSION: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if(!Confusion) if (Hallucination) { pline("What a trippy feeling!"); @@ -619,6 +657,9 @@ FALSE); break; case POT_GAIN_ABILITY: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if(otmp->cursed) { pline("Ulch! That potion tasted foul!"); unkn++; @@ -637,11 +678,17 @@ break; case POT_SPEED: if(Wounded_legs && !otmp->cursed) { +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif heal_legs(); unkn++; break; } /* and fall through */ case SPE_HASTE_SELF: +#ifdef SOUNDFX + playsound(SND_FAST); +#endif if(!Very_fast) /* wwf@doe.carleton.ca */ You("are suddenly moving %sfaster.", Fast ? "" : "much "); @@ -654,12 +701,18 @@ incr_itimeout(&HFast, rn1(10, 100 + 60 * bcsign(otmp))); break; case POT_BLINDNESS: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if(Blind) nothing++; make_blinded(itimeout_incr(Blinded, rn1(200, 250 - 125 * bcsign(otmp))), TRUE); break; case POT_GAIN_LEVEL: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (otmp->cursed) { unkn++; /* they went up a level */ @@ -692,12 +745,18 @@ u.uexp = rndexp(); break; case POT_HEALING: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif You_feel("better."); healup(d(6 + 2 * bcsign(otmp), 4), !otmp->cursed ? 1 : 0, !!otmp->blessed, !otmp->cursed); exercise(A_CON, TRUE); break; case POT_EXTRA_HEALING: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif You_feel("much better."); healup(d(6 + 2 * bcsign(otmp), 8), otmp->blessed ? 5 : !otmp->cursed ? 2 : 0, @@ -707,6 +766,9 @@ exercise(A_STR, TRUE); break; case POT_FULL_HEALING: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif You_feel("completely healed."); healup(400, 4+4*bcsign(otmp), !otmp->cursed, TRUE); /* Restore one lost level if blessed */ @@ -718,6 +780,9 @@ break; case POT_LEVITATION: case SPE_LEVITATION: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (otmp->cursed) HLevitation &= ~I_SPECIAL; if(!Levitation) { /* kludge to ensure proper operation of float_up() */ @@ -747,6 +812,9 @@ break; case POT_GAIN_ENERGY: /* M. Stephenson */ { register int num; +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if(otmp->cursed) You_feel("lackluster."); else @@ -764,6 +832,9 @@ { boolean good_for_you = FALSE; +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (otmp->lamplit) { if (likes_fire(youmonst.data)) { pline("Ahh, a refreshing drink."); @@ -781,6 +852,9 @@ } break; case POT_ACID: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif if (Acid_resistance) /* Not necessarily a creature who _likes_ acid */ pline("This tastes %s.", Hallucination ? "tangy" : "sour"); @@ -794,6 +868,9 @@ if (Stoned) fix_petrification(); break; case POT_POLYMORPH: +#ifdef SOUNDFX + playsound(SND_DRINK); +#endif You_feel("a little %s.", Hallucination ? "normal" : "strange"); if (!Unchanging) polyself(); break; @@ -860,6 +937,9 @@ if(isyou) { distance = 0; +#ifdef SOUNDFX + playsound(SND_GLASS); +#endif pline_The("%s crashes on your %s and breaks into shards.", botlnam, body_part(HEAD)); losehp(rnd(2), "thrown potion", KILLED_BY_AN); @@ -877,6 +957,9 @@ } else { Strcpy(buf, mnam); } +#ifdef SOUNDFX + playsound(SND_GLASS); +#endif pline_The("%s crashes on %s and breaks into shards.", botlnam, buf); } diff -uNr ../nethack-3.3.1-unpatched/src/pray.c ./src/pray.c --- ../nethack-3.3.1-unpatched/src/pray.c Thu Sep 14 13:00:37 2000 +++ ./src/pray.c Thu Sep 14 13:00:19 2000 @@ -183,6 +183,10 @@ int i; struct obj *otmp; const char *what = (const char *)0; + +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif switch (trouble) { case TROUBLE_STONED: @@ -196,6 +200,9 @@ delayed_killer = 0; break; case TROUBLE_STRANGLED: +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif if (uamul && uamul->otyp == AMULET_OF_STRANGULATION) { Your("amulet vanishes!"); useup(uamul); @@ -373,6 +380,9 @@ aligntyp resp_god; { if (u.uswallow) { +#ifdef SOUNDFX + playsound(SND_LIGHTNING); +#endif pline("Suddenly a bolt of lightning comes down at you from the heavens!"); pline("It strikes %s!", mon_nam(u.ustuck)); if (!resists_elec(u.ustuck)) { @@ -384,6 +394,9 @@ } else pline("%s seems unaffected.", Monnam(u.ustuck)); } else { +#ifdef SOUNDFX + playsound(SND_LIGHTNING); +#endif pline("Suddenly, a bolt of lightning strikes you!"); if (Reflecting) { shieldeff(u.ux, u.uy); @@ -588,6 +601,11 @@ char repair_buf[BUFSZ]; *repair_buf = '\0'; + +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif + if (uwep->oeroded || uwep->oeroded2) Sprintf(repair_buf, " and %s now as good as new", uwep->quan == 1L ? "is" : "are"); @@ -626,6 +644,9 @@ } break; case 3: +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif /* takes 2 hints to get the music to enter the stronghold */ if (flags.soundok && !u.uevent.uopened_dbridge) { if(u.uevent.uheard_tune < 1) { @@ -645,6 +666,9 @@ } /* Otherwise, falls into next case */ case 2: +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif if (!Blind) You("are surrounded by %s glow.", an(hcolor(golden))); @@ -658,6 +682,9 @@ break; case 4: { register struct obj *otmp; +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif if (Blind) You_feel("the power of %s.", u_gname()); @@ -677,6 +704,9 @@ } case 5: { const char *msg="\"and thus I grant thee the gift of %s!\""; +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif godvoice(u.ualign.type, "Thou hast pleased me with thy progress,"); if (!(HTelepat & INTRINSIC)) { HTelepat |= FROMOUTSIDE; @@ -708,6 +738,10 @@ const char *dropped_item; int sp_no; +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif + HSee_invisible |= FROMOUTSIDE; HFire_resistance |= FROMOUTSIDE; HCold_resistance |= FROMOUTSIDE; @@ -821,6 +855,10 @@ struct obj *otmp; int sp_no, trycnt = u.ulevel + 1; +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif + pline("An object appears at your %s!", makeplural(body_part(FOOT))); /* not yet known spells given preference over already known ones */ @@ -882,6 +920,9 @@ ((other || changed > 1L) ? "s" : ""), (changed > 1L ? "" : "s"), (bless_water ? hcolor(light_blue) : hcolor(Black))); } +#ifdef SOUNDFX + if (changed) playsound(SND_HALLELUJAH); +#endif return((boolean)(changed > 0L)); } @@ -1076,6 +1117,9 @@ if (u.ualign.record < ALIGNLIM) You_feel("appropriately %s.", align_str(u.ualign.type)); else You_feel("you are thoroughly on the right path."); +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif adjalign(5); value += 3; } else @@ -1127,8 +1171,12 @@ } /* real Amulet */ if (otmp->otyp == FAKE_AMULET_OF_YENDOR) { - if (flags.soundok) + if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_THUNDER); +#endif You_hear("a nearby thunderclap."); + } if (!otmp->known) { You("realize you have made a %s.", Hallucination ? "boo-boo" : "mistake"); @@ -1300,6 +1348,9 @@ if (otmp->spe < 0) otmp->spe = 0; if (otmp->cursed) uncurse(otmp); dropy(otmp); +#ifdef SOUNDFX + playsound(SND_HALLELUJAH); +#endif pline("An object appears at your %s!", makeplural(body_part(FOOT))); godvoice(u.ualign.type, "Use my gift wisely!"); @@ -1387,6 +1438,10 @@ /* set up p_type and p_alignment */ if (!can_pray(TRUE)) return 0; + +#ifdef SOUNDFX + playsound(SND_PRAY); +#endif #ifdef WIZARD if (wizard && p_type >= 0) { diff -uNr ../nethack-3.3.1-unpatched/src/priest.c ./src/priest.c --- ../nethack-3.3.1-unpatched/src/priest.c Thu Sep 14 13:00:37 2000 +++ ./src/priest.c Thu Sep 14 13:00:19 2000 @@ -369,12 +369,24 @@ if(!sanctum) { /* !tended -> !shrined */ if(!shrined || !p_coaligned(priest) || - u.ualign.record < -5) + u.ualign.record < -5) { +#ifdef SOUNDFX + playsound(SND_TEMPLEBAD); +#endif You("have a%s forbidding feeling...", (!shrined) ? "" : " strange"); - else You("experience a strange sense of peace."); + } + else { +#ifdef SOUNDFX + playsound(SND_TEMPLEGOOD); +#endif + You("experience a strange sense of peace."); + } } } else { +#ifdef SOUNDFX + playsound(SND_SCARY); +#endif switch(rn2(3)) { case 0: You("have an eerie feeling..."); break; case 1: You_feel("like you are being watched."); break; diff -uNr ../nethack-3.3.1-unpatched/src/read.c ./src/read.c --- ../nethack-3.3.1-unpatched/src/read.c Thu Sep 14 13:00:37 2000 +++ ./src/read.c Thu Sep 14 13:00:19 2000 @@ -167,6 +167,9 @@ p_glow1(otmp) register struct obj *otmp; { +#ifdef SOUNDFX + playsound(SND_ENCHANTSHORT); +#endif Your("%s %s briefly.", xname(otmp), Blind ? "vibrates" : "glows"); } @@ -176,6 +179,9 @@ register struct obj *otmp; register const char *color; { +#ifdef SOUNDFX + playsound(SND_ENCHANTSHORT); +#endif Your("%s %s%s for a moment.", xname(otmp), Blind ? "vibrates" : "glows ", @@ -651,6 +657,10 @@ boolean special_armor; boolean same_color; +#ifdef SOUNDFX + playsound(SND_ENCHANTSHORT); +#endif + otmp = some_armor(&youmonst); if(!otmp) { strange_feeling(sobj, @@ -698,6 +708,9 @@ /* KMH -- catch underflow */ s = sobj->cursed ? -otmp->spe : otmp->spe; if (s > (special_armor ? 5 : 3) && rn2(s)) { +#ifdef SOUNDFX + playsound(SND_ENCHANTLONG); +#endif Your("%s violently %s%s%s for a while, then evaporates.", xname(otmp), Blind ? "vibrates" : "glows", @@ -732,6 +745,13 @@ setworn(otmp, W_ARM); break; } +#ifdef SOUNDFX + if (s*s>1) { + playsound(SND_ENCHANTLONG); + } else { + playsound(SND_ENCHANTSHORT); + } +#endif Your("%s %s%s%s%s for a %s.", xname(otmp), s == 0 ? "violently " : nul, @@ -775,7 +795,11 @@ exercise(A_STR, FALSE); exercise(A_CON, FALSE); return(1); - } else + } else { +#ifdef SOUNDFX + playsound(SND_DESTROYARMOR); +#endif + } known = TRUE; } else { /* armor and scroll both cursed */ Your("%s vibrates.", xname(otmp)); @@ -850,6 +874,9 @@ You_hear("%s close by.", (confused || sobj->cursed) ? "sad wailing" : "maniacal laughter"); +#ifdef SOUNDFX + playsound(SND_LAUGH); +#endif break; } case SCR_BLANK_PAPER: @@ -899,6 +926,9 @@ if(uwep && (uwep->oclass == WEAPON_CLASS || is_weptool(uwep)) && confused) { /* oclass check added 10/25/86 GAN */ +#ifdef SOUNDFX + playsound(SND_ENCHANTSHORT); +#endif uwep->oerodeproof = !(sobj->cursed); if (Blind) { uwep->rknown = FALSE; @@ -1076,6 +1106,9 @@ else You_feel("a pleasant warmth in your %s.", makeplural(body_part(HAND))); } else { +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif pline_The("scroll catches fire and you burn your %s.", makeplural(body_part(HAND))); losehp(1, "scroll of fire", KILLED_BY_AN); @@ -1085,6 +1118,9 @@ if (Underwater) pline_The("water around you vaporizes violently!"); else { +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif pline_The("scroll erupts in a tower of flame!"); burn_away_slime(); } diff -uNr ../nethack-3.3.1-unpatched/src/shk.c ./src/shk.c --- ../nethack-3.3.1-unpatched/src/shk.c Thu Sep 14 13:00:37 2000 +++ ./src/shk.c Thu Sep 14 13:00:19 2000 @@ -234,8 +234,12 @@ if(!shkp) return; - if (flags.soundok) + if (flags.soundok) { +#ifdef SOUNDFX + playsound(SND_ALARM); +#endif pline("An alarm sounds!"); + } nokops = ((mvitals[PM_KEYSTONE_KOP].mvflags & G_GONE) && (mvitals[PM_KOP_SERGEANT].mvflags & G_GONE) && @@ -338,6 +342,9 @@ eshkp->credit, plur(eshkp->credit)); total = 0L; /* credit gets cleared by setpaid() */ } else { +#ifdef SOUNDFX + playsound(SND_CURSE); +#endif You("escaped the shop without paying!"); total -= eshkp->credit; } @@ -2982,6 +2989,9 @@ mnexto(shkp); /* for some reason the shopkeeper can't come next to you */ if (distu(shkp->mx, shkp->my) > 2) { +#ifdef SOUNDFX + playsound(SND_CURSE); +#endif pline("%s curses you in anger and frustration!", shkname(shkp)); rile_shk(shkp); diff -uNr ../nethack-3.3.1-unpatched/src/sounds.c ./src/sounds.c --- ../nethack-3.3.1-unpatched/src/sounds.c Thu Sep 14 13:00:37 2000 +++ ./src/sounds.c Thu Sep 14 13:00:19 2000 @@ -42,22 +42,54 @@ hallu = Hallucination ? 1 : 0; if (level.flags.nfountains && !rn2(400)) { + int num = rn2(3)+hallu; static const char *fountain_msg[4] = { "bubbling water.", "water falling on coins.", "the splashing of a naiad.", "a soda fountain!", }; - You_hear(fountain_msg[rn2(3)+hallu]); + switch (num) { + case 0: +#ifdef SOUNDFX + playsound(SND_BUBBLES); +#endif + break; + case 1: + case 3: +#ifdef SOUNDFX + playsound(SND_FOUNTAIN); +#endif + break; + case 2: +#ifdef SOUNDFX + playsound(SND_SPLASHING); +#endif + break; + } + You_hear(fountain_msg[num]); } #ifdef SINK if (level.flags.nsinks && !rn2(300)) { + int num = rn2(2)+hallu; static const char *sink_msg[3] = { "a slow drip.", "a gurgling noise.", "dishes being washed!", }; - You_hear(sink_msg[rn2(2)+hallu]); + switch(num) { + case 0: +#ifdef SOUNDFX + playsound(SND_DRIP); +#endif + break; + case 1: +#ifdef SOUNDFX + playsound(SND_GURGLE); +#endif + break; + } + You_hear(sink_msg[num]); } #endif if (level.flags.has_court && !rn2(200)) { @@ -76,6 +108,21 @@ /* finding one is enough, at least for now */ int which = rn2(3)+hallu; +#ifdef SOUNDFX + switch(which) { + case 0: + if (rn2(2) == 0) playsound(SND_THRONEROOMSOUND1); + else playsound(SND_THRONEROOMSOUND2); + break; + case 2: + playsound(SND_OFFHEAD); + break; + case 3: + playsound(SND_CAT); + break; + } +#endif + if (which != 2) You_hear(throne_msg[which]); else pline(throne_msg[2], his[flags.female]); return; @@ -83,12 +130,20 @@ } } if (level.flags.has_swamp && !rn2(200)) { + int num = rn2(2)+hallu; static const char *swamp_msg[3] = { "hear mosquitoes!", "smell marsh gas!", /* so it's a smell...*/ "hear Donald Duck!", }; - You(swamp_msg[rn2(2)+hallu]); +#ifdef SOUNDFX + switch(num) { + case 0: + playsound(SND_MOSQUITOS); + break; + } +#endif + You(swamp_msg[num]); return; } if (level.flags.has_vault && !rn2(200)) { @@ -119,8 +174,12 @@ if (gold_in_vault) You_hear(!hallu ? "someone counting money." : "the quarterback calling the play."); - else + else { +#ifdef SOUNDFX + playsound(SND_SEARCHING); +#endif You_hear("someone searching."); + } break; } /* fall into... (yes, even for hallucination) */ @@ -139,6 +198,9 @@ if (DEADMONSTER(mtmp)) continue; if ((mtmp->data->mlet == S_ANT && is_flyer(mtmp->data)) && mon_in_room(mtmp, BEEHIVE)) { +#ifdef SOUNDFX + playsound(SND_BEES); +#endif switch (rn2(2)+hallu) { case 0: You_hear("a low buzzing."); @@ -160,6 +222,10 @@ if (DEADMONSTER(mtmp)) continue; if (is_undead(mtmp->data) && mon_in_room(mtmp, MORGUE)) { +#ifdef SOUNDFX + if (rn2(2) == 0) playsound(SND_SCARY); + else playsound(SND_TEMPLEBAD); +#endif switch (rn2(2)+hallu) { case 0: You("suddenly realize it is unnaturally quiet."); @@ -178,6 +244,7 @@ } } if (level.flags.has_barracks && !rn2(200)) { + int num = rn2(3)+hallu; static const char *barracks_msg[4] = { "blades being honed.", "loud snoring.", @@ -196,12 +263,26 @@ mon_in_room(mtmp, BARRACKS) && /* sleeping implies not-yet-disturbed (usually) */ (mtmp->msleeping || ++count > 5)) { - You_hear(barracks_msg[rn2(3)+hallu]); +#ifdef SOUNDFX + switch (num) { + case 0: + playsound(SND_WIELD); + break; + case 1: + playsound(SND_SNORE); + break; + case 2: + playsound(SND_DICE); + break; + } +#endif + You_hear(barracks_msg[num]); return; } } } if (level.flags.has_zoo && !rn2(200)) { + int num = rn2(2)+hallu; static const char *zoo_msg[3] = { "a sound reminiscent of an elephant stepping on a peanut.", "a sound reminiscent of a seal barking.", @@ -211,6 +292,14 @@ if (DEADMONSTER(mtmp)) continue; if ((mtmp->msleeping || is_animal(mtmp->data)) && mon_in_room(mtmp, ZOO)) { +#ifdef SOUNDFX + switch(num) { + case 0: + playsound(SND_ELEPHANT); + break; + } +#endif + You_hear(zoo_msg[rn2(2)+hallu]); return; } @@ -224,12 +313,23 @@ } if (tended_shop(sroom) && !index(u.ushops, ROOM_INDEX(sroom) + ROOMOFFSET)) { + int num = rn2(2)+hallu; static const char *shop_msg[3] = { "someone cursing shoplifters.", "the chime of a cash register.", "Neiman and Marcus arguing!", }; - You_hear(shop_msg[rn2(2)+hallu]); +#ifdef SOUNDFX + switch(num) { + case 0: + playsound(SND_CURSE); + break; + case 1: + playsound(SND_CASHREGISTER); + break; + } +#endif + You_hear(shop_msg[num]); } return; } @@ -240,6 +340,7 @@ break; /* and don't produce silly effects when she's clearly visible */ if (mtmp && (hallu || !canseemon(mtmp))) { + int num = rn2(3)+hallu*2; static const char *ora_msg[5] = { "a strange wind.", /* Jupiter at Dodona */ "convulsive ravings.", /* Apollo at Delphi */ @@ -247,7 +348,17 @@ "someone say \"No more woodchucks!\"", "a loud ZOT!" /* both rec.humor.oracle */ }; - You_hear(ora_msg[rn2(3)+hallu*2]); +#ifdef SOUNDFX + switch(num){ + case 0: + playsound(SND_WIND); + break; + case 2: + playsound(SND_SNORE); + break; + } +#endif + You_hear(ora_msg[num]); } return; } diff -uNr ../nethack-3.3.1-unpatched/src/spell.c ./src/spell.c --- ../nethack-3.3.1-unpatched/src/spell.c Thu Sep 14 13:00:37 2000 +++ ./src/spell.c Thu Sep 14 13:00:19 2000 @@ -185,7 +185,12 @@ if(!u.uhave.bell || !u.uhave.menorah) { pline("A chill runs down your %s.", body_part(SPINE)); - if(!u.uhave.bell) You_hear("a faint chime..."); + if(!u.uhave.bell) { +#ifdef SOUNDFX + playsound(SND_BELL); +#endif + You_hear("a faint chime..."); + } if(!u.uhave.menorah) pline("Vlad's doppelganger is amused."); return; } diff -uNr ../nethack-3.3.1-unpatched/src/steed.c ./src/steed.c --- ../nethack-3.3.1-unpatched/src/steed.c Thu Sep 14 13:00:37 2000 +++ ./src/steed.c Thu Sep 14 13:00:19 2000 @@ -337,6 +337,9 @@ return; } +#ifdef SOUNDFX + playsound(SND_GALLOP); +#endif pline("%s gallops!", Monnam(u.usteed)); u.ugallop += rn1(20, 30); return; @@ -384,6 +387,7 @@ case DISMOUNT_BYCHOICE: default: if (otmp && otmp->cursed) { + cursedsound(); You("can't. The saddle seems to be cursed."); otmp->bknown = TRUE; return; diff -uNr ../nethack-3.3.1-unpatched/src/teleport.c ./src/teleport.c --- ../nethack-3.3.1-unpatched/src/teleport.c Thu Sep 14 13:00:37 2000 +++ ./src/teleport.c Thu Sep 14 13:00:19 2000 @@ -361,6 +361,9 @@ /* possible extensions: introduce a small error if magic power is low; allow transfer to solid rock */ if (teleok(cc.x, cc.y, FALSE)) { +#ifdef SOUNDFX + playsound(SND_TELEPORT); +#endif teleds(cc.x, cc.y); return; } @@ -368,6 +371,9 @@ } } +#ifdef SOUNDFX + playsound(SND_TELEPORT); +#endif (void) safe_teleds(); } @@ -576,6 +582,9 @@ killer = 0; /* still alive, so far... */ +#ifdef SOUNDFX + playsound(SND_TELEPORT); +#endif if (newlev < 0) { if (newlev <= -10) { You("arrive in heaven."); @@ -674,6 +683,9 @@ /* problem: level teleport landing escapes the check */ if (!on_level(&u.uz, &u.uz0)) return; +#ifdef SOUNDFX + playsound(SND_TELEPORT); +#endif You("activated a magic portal!"); /* prevent the poor shnook, whose amulet was stolen while in diff -uNr ../nethack-3.3.1-unpatched/src/timeout.c ./src/timeout.c --- ../nethack-3.3.1-unpatched/src/timeout.c Thu Sep 14 13:00:37 2000 +++ ./src/timeout.c Thu Sep 14 13:00:19 2000 @@ -1140,6 +1140,9 @@ if(levl[u.ux][u.uy].typ == CLOUD) { /* inside a cloud during a thunder storm is deafening */ +#ifdef SOUNDFX + playsound(SND_THUNDER); +#endif pline("Kaboom!!! Boom!! Boom!!"); if(!u.uinvulnerable) { stop_occupation(); diff -uNr ../nethack-3.3.1-unpatched/src/trap.c ./src/trap.c --- ../nethack-3.3.1-unpatched/src/trap.c Thu Sep 14 13:00:37 2000 +++ ./src/trap.c Thu Sep 14 13:00:19 2000 @@ -359,6 +359,9 @@ } return; } +#ifdef SOUNDFX + playsound(SND_TRAPDOOR); +#endif if(*u.ushops) shopdig(1); if (Is_stronghold(&u.uz)) { @@ -609,6 +612,9 @@ } } else { seetrap(trap); +#ifdef SOUNDFX + playsound(SND_SQUEAK); +#endif pline("A board beneath you squeaks loudly."); wake_nearby(); } @@ -736,8 +742,12 @@ } break; } - if (!In_sokoban(&u.uz)) + if (!In_sokoban(&u.uz)) { +#ifdef SOUNDFX + playsound(SND_TRAPDOOR); +#endif You("fall into %s pit!", a_your[trap->madeby_u]); + } /* wumpus reference */ if (Role_if(PM_RANGER) && !trap->madeby_u && !trap->once && In_quest(&u.uz) && Is_qlocate(&u.uz)) { @@ -931,6 +941,9 @@ blow_up_landmine(trap) struct trap *trap; { +#ifdef SOUNDFX + playsound(SND_EXPLOSION); +#endif scatter(trap->tx, trap->ty, 4, MAY_DESTROY | MAY_HIT | MAY_FRACTURE | VIS_EFFECTS, (struct obj *)0); @@ -1064,6 +1077,9 @@ } } if (otyp == BOULDER && closed_door(bhitpos.x,bhitpos.y)) { +#ifdef SOUNDFX + playsound(SND_DOORBREAK); +#endif if (cansee(bhitpos.x, bhitpos.y)) pline_The("boulder crashes through a door."); levl[bhitpos.x][bhitpos.y].doormask = D_BROKEN; @@ -1206,8 +1222,12 @@ } } else if (metallivorous(mptr)) { if (trap->ttyp == BEAR_TRAP) { - if (canseemon(mtmp)) + if (canseemon(mtmp)) { +#ifdef SOUNDFX + playsound(SND_EAT); +#endif pline("%s eats a bear trap!", Monnam(mtmp)); + } deltrap(trap); mtmp->meating = 5; mtmp->mtrapped = 0; @@ -1269,6 +1289,9 @@ case SQKY_BOARD: if(is_flyer(mptr)) break; /* stepped on a squeaky board */ +#ifdef SOUNDFX + playsound(SND_SQUEAK); +#endif if (in_sight) { pline("A board beneath %s squeaks loudly.", mon_nam(mtmp)); seetrap(trap); diff -uNr ../nethack-3.3.1-unpatched/src/uhitm.c ./src/uhitm.c --- ../nethack-3.3.1-unpatched/src/uhitm.c Thu Sep 14 13:00:37 2000 +++ ./src/uhitm.c Thu Sep 14 13:00:19 2000 @@ -914,6 +914,7 @@ else if(!flags.verbose) You("hit it."); else You("%s %s%s", Role_if(PM_BARBARIAN) ? "smite" : "hit", mon_nam(mon), canseemon(mon) ? exclam(tmp) : "."); + hitmonstersound(); } if (silvermsg) { @@ -944,6 +945,7 @@ xkilled(mon, 0); return FALSE; } else if (destroyed) { + hitmonstersound(); killed(mon); /* takes care of most messages */ } else if(u.umconf && !thrown) { nohandglow(mon); @@ -1147,6 +1149,9 @@ } break; case AD_FIRE: +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif if (!Blind) pline("%s is %s!", Monnam(mdef), mattk->aatyp == AT_HUGS ? @@ -1575,6 +1580,9 @@ end_engulf(); return(2); case AD_PHYS: +#ifdef SOUNDFX + playsound(SND_TORNADO); +#endif pline("%s is pummeled with your debris!",Monnam(mdef)); break; case AD_ACID: @@ -1606,6 +1614,9 @@ } else dam = 0; break; case AD_COLD: +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif if (rn2(2)) { if (resists_cold(mdef)) { pline("%s seems mildly chilly.", Monnam(mdef)); @@ -1616,6 +1627,9 @@ } else dam = 0; break; case AD_FIRE: +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif if (rn2(2)) { if (resists_fire(mdef)) { pline("%s seems mildly hot.", Monnam(mdef)); @@ -1656,10 +1670,17 @@ { if (could_seduce(&youmonst, mdef, mattk)) You("pretend to be friendly to %s.", mon_nam(mdef)); - else if(canspotmon(mdef) && flags.verbose) + else if(canspotmon(mdef) && flags.verbose) { +#ifdef SOUNDFX + playsound(SND_MISS); +#endif You("miss %s.", mon_nam(mdef)); - else + } else { +#ifdef SOUNDFX + playsound(SND_MISS); +#endif You("miss it."); + } if (!mdef->msleeping && mdef->mcanmove) wakeup(mdef); } @@ -1940,8 +1961,14 @@ /* wrath of gods for attacking Oracle */ if(Antimagic) { shieldeff(u.ux, u.uy); +#ifdef SOUNDFX + playsound(SND_MAGICMISSILE); +#endif pline("A hail of magic missiles narrowly misses you!"); } else { +#ifdef SOUNDFX + playsound(SND_MAGICMISSILE); +#endif You("are hit by magic missiles appearing from thin air!"); mdamageu(mon, tmp); } diff -uNr ../nethack-3.3.1-unpatched/src/were.c ./src/were.c --- ../nethack-3.3.1-unpatched/src/were.c Thu Sep 14 13:00:37 2000 +++ ./src/were.c Thu Sep 14 13:00:19 2000 @@ -26,8 +26,12 @@ case PM_HUMAN_WEREJACKAL: howler = "jackal"; break; default: howler = (char *)0; break; } - if (howler) + if (howler) { +#ifdef SOUNDFX + playsound(SND_HOWL); +#endif You_hear("a %s howling at the moon.", howler); + } } } } else if (!rn2(30) || Protection_from_shape_changers) { diff -uNr ../nethack-3.3.1-unpatched/src/wield.c ./src/wield.c --- ../nethack-3.3.1-unpatched/src/wield.c Thu Sep 14 13:00:37 2000 +++ ./src/wield.c Thu Sep 14 13:00:19 2000 @@ -270,6 +270,11 @@ if (flags.pushweapon && uwep) setuswapwep(uwep); result = ready_weapon(wep); +#ifdef SOUNDFX + if (uwep) { + if (is_blade(uwep)) playsound(SND_WIELD); + } +#endif untwoweapon(); return (result); @@ -627,6 +632,13 @@ return(1); } if (!Blind) { +#ifdef SOUNDFX + if (amount*amount == 1) { + playsound(SND_ENCHANTSHORT); + } else { + playsound(SND_ENCHANTLONG); + } +#endif xtime = (amount*amount == 1) ? "moment" : "while"; Your("%s %s for a %s.", aobjnam(uwep, amount == 0 ? "violently glow" : "glow"), diff -uNr ../nethack-3.3.1-unpatched/src/wizard.c ./src/wizard.c --- ../nethack-3.3.1-unpatched/src/wizard.c Thu Sep 14 13:00:37 2000 +++ ./src/wizard.c Thu Sep 14 13:00:19 2000 @@ -569,9 +569,12 @@ register struct monst *mtmp; { if (mtmp->iswiz) { - if (!rn2(5)) /* typical bad guy action */ + if (!rn2(5)) { /* typical bad guy action */ +#ifdef SOUNDFX + playsound(SND_LAUGH); +#endif pline("%s laughs fiendishly.", Monnam(mtmp)); - else + } else if (u.uhave.amulet && !rn2(SIZE(random_insult))) verbalize("Relinquish the amulet, %s!", random_insult[rn2(SIZE(random_insult))]); diff -uNr ../nethack-3.3.1-unpatched/src/zap.c ./src/zap.c --- ../nethack-3.3.1-unpatched/src/zap.c Thu Sep 14 13:00:37 2000 +++ ./src/zap.c Thu Sep 14 13:00:19 2000 @@ -1735,10 +1735,16 @@ break; case SPE_FIREBALL: +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif You("explode a fireball on top of yourself!"); explode(u.ux, u.uy, 11, d(6,6), WAND_CLASS); break; case WAN_FIRE: +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif makeknown(WAN_FIRE); case FIRE_HORN: if (Fire_resistance) { @@ -1774,6 +1780,9 @@ case WAN_MAGIC_MISSILE: makeknown(WAN_MAGIC_MISSILE); case SPE_MAGIC_MISSILE: +#ifdef SOUNDFX + playsound(SND_MAGICMISSILE); +#endif if(Antimagic) { shieldeff(u.ux, u.uy); pline_The("missiles bounce!"); @@ -2676,6 +2685,9 @@ #endif break; case ZT_FIRE: +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif if (resists_fire(mon)) { sho_shieldeff = TRUE; break; @@ -2696,6 +2708,9 @@ } break; case ZT_COLD: +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif if (resists_cold(mon)) { sho_shieldeff = TRUE; break; @@ -2836,6 +2851,9 @@ } break; case ZT_FIRE: +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif if (Fire_resistance) { shieldeff(sx, sy); You("don't feel hot!"); @@ -3029,6 +3047,10 @@ struct obj *otmp; int spell_type; +#ifdef SOUNDFX + if (abstype == ZT_MAGIC_MISSILE) playsound(SND_MAGICMISSILE); +#endif + /* if its a Hero Spell then get its SPE_TYPE */ spell_type = is_hero_spell(type) ? SPE_MAGIC_MISSILE + abstype : 0; @@ -3345,6 +3367,9 @@ if (lev->typ == WATER) { /* For now, don't let WATER freeze. */ +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif if (cansee(x,y)) pline_The("water freezes for a moment."); else @@ -3363,15 +3388,26 @@ } bury_objs(x,y); if(cansee(x,y)) { - if(moat) + if(moat) { +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif Norep("The moat is bridged with ice!"); - else if(lava) + } else if(lava) Norep("The lava cools and solidifies."); - else + else { +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif Norep("The water freezes."); + } newsym(x,y); - } else if(flags.soundok && !lava) + } else if(flags.soundok && !lava) { +#ifdef SOUNDFX + playsound(SND_FREEZE); +#endif You_hear("a crackling sound."); + } if (x == u.ux && y == u.uy) { if (u.uinwater) { /* not just `if (Underwater)' */ @@ -3407,11 +3443,18 @@ switch(abstype) { case ZT_FIRE: new_doormask = D_NODOOR; +#ifdef SOUNDFX + playsound(SND_FIRE); +#endif see_txt = "The door is consumed in flames!"; sense_txt = "smell smoke."; break; case ZT_COLD: new_doormask = D_NODOOR; +#ifdef SOUNDFX + playsound(SND_FREEZE); + playsound(SND_GLASS); +#endif see_txt = "The door freezes and shatters!"; sense_txt = "feel cold."; break; diff -uNr ../nethack-3.3.1-unpatched/win/tty/wintty.c ./win/tty/wintty.c --- ../nethack-3.3.1-unpatched/win/tty/wintty.c Thu Sep 14 13:00:36 2000 +++ ./win/tty/wintty.c Thu Sep 14 13:00:20 2000 @@ -1721,7 +1721,8 @@ if(flags.botlx) *ob = 0; if(!cw->cury && (int)strlen(str) >= CO) { /* the characters before "St:" are unnecessary */ - nb = index(str, ':'); + /*nb = index(str, ':'); */ + nb = 0; if(nb && nb > str+2) str = nb - 2; } @@ -1735,7 +1736,11 @@ } break; } +#ifdef HITPOINTBAR + if((*ob != *nb) || (flags.hitpointbar)) +#else if(*ob != *nb) +#endif tty_putsym(WIN_STATUS, i, cw->cury, *nb); if(*ob) ob++; }