diff -pruN slashem-0.0.7E7F2-official/src/fountain.c slashem-0.0.7E7F2-april-fools/src/fountain.c --- slashem-0.0.7E7F2-official/src/fountain.c 2005-12-04 15:58:27.000000000 +0100 +++ slashem-0.0.7E7F2-april-fools/src/fountain.c 2006-04-11 14:36:22.000000000 +0200 @@ -44,6 +44,19 @@ void dowaterdemon() /* Water demon */ { register struct monst *mtmp; + register struct tm *lt; + time_t date; + +#if defined(BSD) && !defined(POSIX_TYPES) + (void) time((long *)(&date)); +#else + (void) time(&date); +#endif +#if (defined(ULTRIX) && !(defined(ULTRIX_PROTO) || defined(NHSTDC))) || (defined(BSD) && !defined(POSIX_TYPES)) + lt = (localtime((long *)(&date))); +#else + lt = (localtime(&date)); +#endif if(!(mvitals[PM_WATER_DEMON].mvflags & G_GONE)) { if((mtmp = makemon(&mons[PM_WATER_DEMON],u.ux,u.uy, NO_MM_FLAGS))) { @@ -57,13 +70,46 @@ dowaterdemon() /* Water demon */ if (rnd(100) > (60 + 5*level_difficulty())) { pline("Grateful for %s release, %s grants you a wish!", mhis(mtmp), mhe(mtmp)); - makewish(); - mongone(mtmp); - } else if (t_at(mtmp->mx, mtmp->my)) - (void) mintrap(mtmp); + if ((lt->tm_mday == 1) && ((lt->tm_mon+1)==4)) { + char buf[BUFSZ]; + struct obj *otmp, nothing; + int tries = 0; + nothing = zeroobj; /* lint suppression; only its address matters */ + if (flags.verbose) You("may wish for an object."); + retry: + getlin("For what do you wish?", buf); + if(buf[0] == '\033') buf[0] = 0; + otmp = readobjnam(buf, ¬hing, TRUE); + if (!otmp) { + pline("Nothing fitting that description exists in the game."); + if (++tries < 5) goto retry; + pline(thats_enough_tries); + otmp = readobjnam((char *)0, (struct obj *)0, TRUE); + if (!otmp) { + mongone(mtmp); + return;/* for safety; should never happen */ + } + } + if (otmp != ¬hing) { + verbalize("Ha, ha. April Fools!"); + if (u.uluck < 0 || !rn2(u.uluck)) change_luck(-1); + } + if (level_difficulty() < (u.uluck) || otmp == ¬hing) { + if (otmp != ¬hing) mpickobj(mtmp, otmp); + mongone(mtmp); + } else { + mpickobj(mtmp, otmp); + (void) mintrap(mtmp); + } + } else { + makewish(); + mongone(mtmp); + } + } else if (t_at(mtmp->mx, mtmp->my)) + (void) mintrap(mtmp); } } else - pline_The("fountain bubbles furiously for a moment, then calms."); + pline_The("fountain bubbles furiously for a moment, then calms."); } STATIC_OVL void