diff -Nbaur nethack-3.4.3/include/extern.h nethack-brewery/include/extern.h --- nethack-3.4.3/include/extern.h 2003-12-08 10:39:13.000000000 +1100 +++ nethack-brewery/include/extern.h 2005-09-14 13:22:57.000000000 +1000 @@ -1558,6 +1558,7 @@ E void FDECL(potionbreathe, (struct obj *)); E boolean FDECL(get_wet, (struct obj *)); E int NDECL(dodip); +E void FDECL(ferment, (genericptr_t, long)); E void FDECL(djinni_from_bottle, (struct obj *)); E struct monst *FDECL(split_mon, (struct monst *,struct monst *)); E const char *NDECL(bottlename); diff -Nbaur nethack-3.4.3/include/timeout.h nethack-brewery/include/timeout.h --- nethack-3.4.3/include/timeout.h 2003-12-08 10:39:13.000000000 +1100 +++ nethack-brewery/include/timeout.h 2005-09-14 13:17:35.000000000 +1000 @@ -28,7 +28,8 @@ #define BURN_OBJECT 3 #define HATCH_EGG 4 #define FIG_TRANSFORM 5 -#define NUM_TIME_FUNCS 6 +#define FERMENT 6 +#define NUM_TIME_FUNCS 7 /* used in timeout.c */ typedef struct fe { diff -Nbaur nethack-3.4.3/src/invent.c nethack-brewery/src/invent.c --- nethack-3.4.3/src/invent.c 2003-12-08 10:39:13.000000000 +1100 +++ nethack-brewery/src/invent.c 2005-09-14 13:38:24.000000000 +1000 @@ -2371,6 +2371,11 @@ if (obj->otyp == POT_OIL && obj->lamplit) return FALSE; + /* fermenting potions don't merge */ + if (obj->otyp == POT_FRUIT_JUICE) { + if (obj->corpsenm || otmp->corpsenm) return FALSE; + } + /* don't merge surcharged item with base-cost item */ if (obj->unpaid && !same_price(obj, otmp)) return FALSE; diff -Nbaur nethack-3.4.3/src/potion.c nethack-brewery/src/potion.c --- nethack-3.4.3/src/potion.c 2003-12-08 10:39:13.000000000 +1100 +++ nethack-brewery/src/potion.c 2005-09-14 13:33:23.000000000 +1000 @@ -1921,10 +1921,95 @@ return(1); } + if (potion->otyp == POT_FRUIT_JUICE && obj->otyp == CORPSE) { + switch (obj->corpsenm) { + case PM_BROWN_MOLD: + case PM_GREEN_MOLD: + case PM_YELLOW_MOLD: + case PM_RED_MOLD: + case PM_VIOLET_FUNGUS: + /* MRKR: Molds and fungi have various medicinal properties */ + + pline("%s %s.", The(cxname(obj)), otense(obj, "dissolve")); + potion->corpsenm = obj->corpsenm; + useup(obj); + /* fermentation takes a while... */ + start_timer(50 + rn2(50), TIMER_OBJECT, + FERMENT, (genericptr_t)potion); + break; + } + } + pline("Interesting..."); return(1); } +void +ferment(arg, timeout) +genericptr_t arg; +long timeout; +{ + struct obj *potion = (struct obj *)arg; + boolean need_newsym; + xchar x, y; + char whose[BUFSZ]; + short new_otyp; + + if (!potion) { +#ifdef DEBUG + pline("null potion in ferment()"); +#endif + return; + } + + /* Make sure it hasn't been transformed in the meantime */ + if (potion->otyp != POT_FRUIT_JUICE) return; + + switch (potion->corpsenm) { + case PM_BROWN_MOLD: + new_otyp = POT_BOOZE; + break; + case PM_GREEN_MOLD: + new_otyp = POT_HEALING; + break; + case PM_YELLOW_MOLD: + new_otyp = POT_CONFUSION; + break; + case PM_RED_MOLD: + new_otyp = POT_SLEEPING; + break; + case PM_VIOLET_FUNGUS: + new_otyp = POT_HALLUCINATION; + break; + default: + impossible("Strange yeast! (%d)", potion->corpsenm); + break; + } + + need_newsym = FALSE; + if (get_obj_location(potion, &x, &y, 0) && !Blind && cansee(x, y)) { + /* set up `whose[]' to be "Your" or "Fred's" or "The goblin's" */ + (void) Shk_Your(whose, potion); + switch (potion->where) { + case OBJ_INVENT: + case OBJ_MINVENT: + pline("%s %s %s.", + whose, aobjnam(potion, "turn"), + hcolor(OBJ_DESCR(objects[new_otyp]))); + break; + case OBJ_FLOOR: + You("see %s turn %s.", + (potion->quan > 1 ? + an(aobjnam(potion, NULL)) : aobjnam(potion, NULL)), + hcolor(OBJ_DESCR(objects[new_otyp]))); + break; + need_newsym = TRUE; + } + } + potion->otyp = new_otyp; + if (need_newsym) newsym(x, y); + +} void djinni_from_bottle(obj) diff -Nbaur nethack-3.4.3/src/timeout.c nethack-brewery/src/timeout.c --- nethack-3.4.3/src/timeout.c 2003-12-08 10:39:13.000000000 +1100 +++ nethack-brewery/src/timeout.c 2005-09-14 10:39:54.000000000 +1000 @@ -1318,7 +1318,8 @@ TTAB(revive_mon, (timeout_proc)0, "revive_mon"), TTAB(burn_object, cleanup_burn, "burn_object"), TTAB(hatch_egg, (timeout_proc)0, "hatch_egg"), - TTAB(fig_transform, (timeout_proc)0, "fig_transform") + TTAB(fig_transform, (timeout_proc)0, "fig_transform"), + TTAB(ferment, (timeout_proc)0, "ferment"), }; #undef TTAB