From: PatR Date: Sun, 20 Dec 2015 03:39:20 +0000 (-0800) Subject: have #jump cast "jumping" X-Git-Tag: NetHack-3.6.1_RC01~1138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f87fd929e5d88a23b3ab4735ef3d21c21291ae14;p=nethack have #jump cast "jumping" Requested during beta testing: if hero can't jump, have #jump command attempt to cast the jumping spell. This is similar to how #unturn and ^T cast spells when used while lacking the innate ability. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 4d92f1a6d..47feb85aa 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -69,6 +69,8 @@ naming Sting or Orcrist now breaks illiterate conduct different feedback for reading a scroll of mail created by writing with marker wizard mode #wizintrinsic reading non-cursed scroll of enchant weapon uncurses welded tin opener +if hero has no jumping ability but knows the jumping spell, the #jump command + will attempt to cast the spell Platform- and/or Interface-Specific New Features diff --git a/src/apply.c b/src/apply.c index 12d6812bf..0af45749a 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 apply.c $NHDT-Date: 1450573880 2015/12/20 01:11:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.216 $ */ +/* NetHack 3.6 apply.c $NHDT-Date: 1450582748 2015/12/20 03:39:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.217 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1502,6 +1502,17 @@ int magic; /* 0=Physical, otherwise skill level */ { coord cc; + /* attempt "jumping" spell if hero has no innate jumping ability */ + if (!magic && !Jumping) { + int sp_no; + + for (sp_no = 0; sp_no < MAXSPELL; ++sp_no) + if (spl_book[sp_no].sp_id == NO_SPELL) + break; + else if (spl_book[sp_no].sp_id == SPE_JUMPING) + return spelleffects(sp_no, FALSE); + } + if (!magic && (nolimbs(youmonst.data) || slithy(youmonst.data))) { /* normally (nolimbs || slithy) implies !Jumping, but that isn't necessarily the case for knights */