spell of protection
Another item from the "A few bugs" mail. Casting spell of protection when previous casting(s) hadn't timed out yet miscalculated the new AC boost. At low levels--when this spell probably gets its most use--the bug wasn't noticeable. (At high levels when someone might cast it a whole bunch of times in succession, the effect could be noticed but was probably just assumed to be working as intended. Its behavior is somewhat convoluted.)
This commit is contained in:
@@ -924,6 +924,8 @@ you shouldn't see Sting glow light blue if you're blind
|
|||||||
when jumping, bumping into something is noisy
|
when jumping, bumping into something is noisy
|
||||||
flesh golems hit by electricity healed by wrong amount
|
flesh golems hit by electricity healed by wrong amount
|
||||||
fleeing monsters couldn't use stairs that lead to different dungeon branch
|
fleeing monsters couldn't use stairs that lead to different dungeon branch
|
||||||
|
casting spell of protection when previous casting(s) hadn't time out yet
|
||||||
|
miscalculated the new AC increment
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+26
-23
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 spell.c $NHDT-Date: 1434421353 2015/06/16 02:22:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */
|
/* NetHack 3.6 spell.c $NHDT-Date: 1444295991 2015/10/08 09:19:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.64 $ */
|
||||||
/* Copyright (c) M. Stephenson 1988 */
|
/* Copyright (c) M. Stephenson 1988 */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -720,10 +720,10 @@ int booktype;
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
cast_protection()
|
cast_protection()
|
||||||
{
|
{
|
||||||
int loglev = 0;
|
int l = u.ulevel, loglev = 0,
|
||||||
int l = u.ulevel;
|
gain, natac = u.uac + u.uspellprot;
|
||||||
int natac = u.uac - u.uspellprot;
|
/* note: u.uspellprot is subtracted when find_ac() factors it into u.uac,
|
||||||
int gain;
|
so adding here factors it back out (3.4.3,3.5 had this backwards) */
|
||||||
|
|
||||||
/* loglev=log2(u.ulevel)+1 (1..5) */
|
/* loglev=log2(u.ulevel)+1 (1..5) */
|
||||||
while (l) {
|
while (l) {
|
||||||
@@ -752,7 +752,8 @@ cast_protection()
|
|||||||
* 16-30 0 0, 5, 9, 11, 13, 14, 15
|
* 16-30 0 0, 5, 9, 11, 13, 14, 15
|
||||||
* 16-30 -10 0, 5, 8, 9, 10
|
* 16-30 -10 0, 5, 8, 9, 10
|
||||||
*/
|
*/
|
||||||
gain = loglev - (int) u.uspellprot / (4 - min(3, (10 - natac) / 10));
|
natac = (10 - natac) / 10; /* convert to positive and scale down */
|
||||||
|
gain = loglev - (int) u.uspellprot / (4 - min(3, natac));
|
||||||
|
|
||||||
if (gain > 0) {
|
if (gain > 0) {
|
||||||
if (!Blind) {
|
if (!Blind) {
|
||||||
@@ -763,28 +764,30 @@ cast_protection()
|
|||||||
pline_The("%s haze around you becomes more dense.", hgolden);
|
pline_The("%s haze around you becomes more dense.", hgolden);
|
||||||
} else {
|
} else {
|
||||||
rmtyp = levl[u.ux][u.uy].typ;
|
rmtyp = levl[u.ux][u.uy].typ;
|
||||||
atmosphere =
|
atmosphere = u.uswallow
|
||||||
u.uswallow
|
? ((u.ustuck->data == &mons[PM_FOG_CLOUD])
|
||||||
? ((u.ustuck->data == &mons[PM_FOG_CLOUD])
|
? "mist"
|
||||||
? "mist"
|
: is_whirly(u.ustuck->data)
|
||||||
: is_whirly(u.ustuck->data)
|
? "maelstrom"
|
||||||
? "maelstrom"
|
: is_animal(u.ustuck->data)
|
||||||
: is_animal(u.ustuck->data) ? "maw"
|
? "maw"
|
||||||
: "ooze")
|
: "ooze")
|
||||||
: u.uinwater ? "water" : (rmtyp == CLOUD)
|
: (u.uinwater
|
||||||
? "cloud"
|
? "water"
|
||||||
: IS_TREE(rmtyp)
|
: (rmtyp == CLOUD)
|
||||||
? "vegitation"
|
? "cloud"
|
||||||
: IS_STWALL(rmtyp)
|
: IS_TREE(rmtyp)
|
||||||
? "stone"
|
? "vegitation"
|
||||||
: "air";
|
: IS_STWALL(rmtyp)
|
||||||
|
? "stone"
|
||||||
|
: "air");
|
||||||
pline_The("%s around you begins to shimmer with %s haze.",
|
pline_The("%s around you begins to shimmer with %s haze.",
|
||||||
atmosphere, an(hgolden));
|
atmosphere, an(hgolden));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
u.uspellprot += gain;
|
u.uspellprot += gain;
|
||||||
u.uspmtime =
|
u.uspmtime = (P_SKILL(spell_skilltype(SPE_PROTECTION)) == P_EXPERT)
|
||||||
P_SKILL(spell_skilltype(SPE_PROTECTION)) == P_EXPERT ? 20 : 10;
|
? 20 : 10;
|
||||||
if (!u.usptime)
|
if (!u.usptime)
|
||||||
u.usptime = u.uspmtime;
|
u.usptime = u.uspmtime;
|
||||||
find_ac();
|
find_ac();
|
||||||
|
|||||||
Reference in New Issue
Block a user