diff --git a/src/allmain.c b/src/allmain.c index 8fd4f17fb..180c30d9e 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -20,7 +20,7 @@ STATIC_DCL void FDECL(interrupt_multi, (const char *)); STATIC_DCL void FDECL(debug_fields, (const char *)); STATIC_DCL void NDECL(init_mchest); STATIC_DCL void NDECL(pickup_spirits); - +STATIC_DCL void NDECL(update_monclock); #ifdef EXTRAINFO_FN static long prev_dgl_extrainfo = 0; @@ -274,56 +274,9 @@ boolean resuming; been purged at end of their previous round of moving */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) mtmp->movement += mcalcmove(mtmp); - - /* From SporkHack & UnNetHack (modified) - * Vanilla generates a critter every 70-ish turns. - * The rate accelerates to every 50 or so below the Castle, - * and 'round every 25 turns once you've done the Invocation. - * - * (From EvilHack) - * We will push it even further. Monsters post-Invocation - * will almost always appear on the stairs (if present), and - * much more frequently; this, along with the extra intervene() - * calls, should certainly make it seem like you're wading back - * through the teeming hordes. - * - * Aside from that, a more general clock should be put on things; - * after about 50,000 turns, the frequency rate of appearance - * and difficulty of monsters generated will slowly increase until - * it reaches the point it will be at as if you were post-Invocation. - * - * The rate increases linearly with turns. The rule of thumb is that - * at turn x the rate is approximately (x / 30.0000) times the normal - * rate. Maximal rate is 8x the normal rate. - * ------------------------------------------------------------------- - * In Hack'EM - we are going to put Yet Another Twist on monster generation - * and use it to "punish" wishes. For every wish the player makes, the - * rate will increase! This lets the player have their wishes at the cost - * of a harder game later. - */ - monclock = MIN_MONGEN_RATE; - /* Don't let wishes influence the fuzzer */ - if (!iflags.debug_fuzzer) { - if (monclock > MIN_MONGEN_RATE / 2 && (u.uconduct.wishes >= 2L)) - monclock = MIN_MONGEN_RATE / 2; - if (monclock > MIN_MONGEN_RATE / 3 && (u.uconduct.wishes >= 3L)) - monclock = MIN_MONGEN_RATE / 3; - if (monclock > MIN_MONGEN_RATE / 4 && (u.uconduct.wishes >= 4L)) - monclock = MIN_MONGEN_RATE / 4; - if (monclock > MIN_MONGEN_RATE / 5 && (u.uconduct.wishes >= 5L)) - monclock = MIN_MONGEN_RATE / 5; - if (monclock > MIN_MONGEN_RATE / 6 && (u.uconduct.wishes >= 6L)) - monclock = MIN_MONGEN_RATE / 6; - if (monclock > MIN_MONGEN_RATE / 7 && (u.uconduct.wishes >= 7L)) - monclock = MIN_MONGEN_RATE / 7; - if (u.uconduct.wishes >= 8L) - monclock = MAX_MONGEN_RATE; - } - /* make sure we don't fall off the bottom */ - if (monclock < MAX_MONGEN_RATE) - monclock = MAX_MONGEN_RATE; - if (monclock > MIN_MONGEN_RATE) - monclock = MIN_MONGEN_RATE; + + /* Handle monster spawn rates */ + update_monclock(); if (!rn2(monclock)) { if (u.uevent.invoked && xupstair && rn2(10)) @@ -1450,10 +1403,14 @@ wishluck() return 0; if (u.uconduct.wishes < 2) return 0; + + /* For synchronizing monster spawn rates with wishes */ + update_monclock(); + /* Technically we can only get the player to -10, * so we force them to carry a virtual cursed luckstone. */ if (u.uconduct.wishes < 13) - return u.uconduct.wishes - 1; + return -(u.uconduct.wishes); else return -10; } @@ -1491,6 +1448,53 @@ pickup_spirits() } } } +} +STATIC_OVL void +update_monclock() +{ + /* From SporkHack & UnNetHack (modified) + * Vanilla generates a critter every 70-ish turns. + * The rate accelerates to every 50 or so below the Castle, + * and 'round every 25 turns once you've done the Invocation. + * + * (From EvilHack) + * We will push it even further. Monsters post-Invocation + * will almost always appear on the stairs (if present), and + * much more frequently; this, along with the extra intervene() + * calls, should certainly make it seem like you're wading back + * through the teeming hordes. + * + * Aside from that, a more general clock should be put on things; + * after about 50,000 turns, the frequency rate of appearance + * and difficulty of monsters generated will slowly increase until + * it reaches the point it will be at as if you were post-Invocation. + * + * The rate increases linearly with turns. The rule of thumb is that + * at turn x the rate is approximately (x / 30.0000) times the normal + * rate. Maximal rate is 8x the normal rate. + * ------------------------------------------------------------------- + * In Hack'EM - we are going to put Yet Another Twist on monster generation + * and use it to "punish" wishes. For every wish the player makes, the + * rate will increase! This lets the player have their wishes at the cost + * of a harder game later. + */ + monclock = MIN_MONGEN_RATE; +/* Don't let wishes influence the fuzzer */ + if (!iflags.debug_fuzzer) { + for (long i = 2; i <= 7; i++) { + if (monclock > MIN_MONGEN_RATE / i && (u.uconduct.wishes >= i)) { + monclock = MIN_MONGEN_RATE / i; + } + } + if (u.uconduct.wishes >= 8L) { + monclock = MAX_MONGEN_RATE; + } + } + /* make sure we don't fall off the bottom */ + if (monclock < MAX_MONGEN_RATE) + monclock = MAX_MONGEN_RATE; + if (monclock > MIN_MONGEN_RATE) + monclock = MIN_MONGEN_RATE; } /*allmain.c*/ diff --git a/src/zap.c b/src/zap.c index fe579f690..1cddc6ff2 100644 --- a/src/zap.c +++ b/src/zap.c @@ -7396,7 +7396,10 @@ makewish() "wished for \"%s\"", bufcpy); if ((adjust = wishluck())) { - change_luck(adjust == -10 ? -10 : -1); + if (adjust == -2 || adjust == -10) + change_luck(adjust); + else + change_luck(-1); set_moreluck(); } if (otmp != &zeroobj) {