]> granicus.if.org Git - nethack/commitdiff
have #jump cast "jumping"
authorPatR <rankin@nethack.org>
Sun, 20 Dec 2015 03:39:20 +0000 (19:39 -0800)
committerPatR <rankin@nethack.org>
Sun, 20 Dec 2015 03:39:20 +0000 (19:39 -0800)
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.

doc/fixes36.1
src/apply.c

index 4d92f1a6d0def148e54a39969647e25c4d0c0be2..47feb85aaff11e046c6495d0abd90e378cd28a62 100644 (file)
@@ -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
index 12d6812bfdaeeb953fdcc2a9c24c022cadf9dadc..0af45749aebdb5237d23476a369afdfee26e28c2 100644 (file)
@@ -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 */