]> granicus.if.org Git - nethack/commitdiff
fix B14013 - experience calculation
authornethack.rankin <nethack.rankin>
Wed, 20 Nov 2002 22:44:15 +0000 (22:44 +0000)
committernethack.rankin <nethack.rankin>
Wed, 20 Nov 2002 22:44:15 +0000 (22:44 +0000)
     Put in the missing parentheses that <Someone> reported; I don't know
how much that's going to impact experience calculations.  Also, update
some related code that didn't reflect the increase in default speed
from 10 to 12 back in 3.3.0.

doc/fixes34.1
src/exper.c

index 7cdc789ff5420cd51aedb390fe373953d9723cae..8d5d7cf4b5bc2dd4edec385a46839a410b5f1313 100644 (file)
@@ -308,6 +308,7 @@ level teleport while on a sleeping steed caused panic and possible crash
 breaking wand of digging causing a shopkeeper to fall left unpaid items unpaid
 use get_adjacent_loc() rather than getdir() directly for some things where
        you want to ensure valid adjacent coordinates are returned
+minor experience calculation tweaks
 
 
 Platform- and/or Interface-Specific Fixes
index 932b2833a58b4a5552ecc2838d0e5ee7de80f3cd..649f1c6899b48a18aef1025ad041943a7b1857e5 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)exper.c    3.4     2002/07/11      */
+/*     SCCS Id: @(#)exper.c    3.4     2002/11/20      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -49,10 +49,11 @@ experience(mtmp, nk)        /* return # of exp points for mtmp after nk killed */
        tmp = 1 + mtmp->m_lev * mtmp->m_lev;
 
 /*     For higher ac values, give extra experience */
-       if((i = find_mac(mtmp)) < 3) tmp += (7 - i) * (i < 0) ? 2 : 1;
+       if ((i = find_mac(mtmp)) < 3) tmp += (7 - i) * ((i < 0) ? 2 : 1);
 
 /*     For very fast monsters, give extra experience */
-       if(ptr->mmove >= 12) tmp += (ptr->mmove >= 18) ? 5 : 3;
+       if (ptr->mmove > NORMAL_SPEED)
+           tmp += (ptr->mmove > (3*NORMAL_SPEED/2)) ? 5 : 3;
 
 /*     For each "special" attack type give extra experience */
        for(i = 0; i < NATTK; i++) {