]> granicus.if.org Git - nethack/commitdiff
spell skils for role-specific special spell
authorPatR <rankin@nethack.org>
Fri, 5 Feb 2016 08:25:39 +0000 (00:25 -0800)
committerPatR <rankin@nethack.org>
Fri, 5 Feb 2016 08:25:39 +0000 (00:25 -0800)
Every role has a specific spell that they having an easier time
casting.  Samurai's special spell is clairvoyance but samurai is
restricted in divination spells.  Requested about 4.5 years ago:
allow samurai to achieve basic skill in divination.

Similar for barbarian, special spell is haste self but escape spells
are restricted.  All the other roles can already get at least basic
in their special spell's category.

There were several choices:
1) leave things as they are;
2) give those two roles different special spells;
3) allow them to reach basic in the spell category of the existing
   special spell;
4) #2 for one of those roles, #3 for the other.

I went with #3.  To compensate, reduce attack spell skill limit from
skilled to basic for both.  (#4 might be better, since the reason to
want divination enhanced is most likely identify and magic mapping,
not interest in clairvoyance.)

src/u_init.c
src/weapon.c

index f0c1e37569bb3fd5555d1768ead2903cde4d3c19..50e90d9d7fb04c4a4ae3ec0c76601c56696ae10f 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 u_init.c        $NHDT-Date: 1446861772 2015/11/07 02:02:52 $  $NHDT-Branch: master $:$NHDT-Revision: 1.35 $ */
+/* NetHack 3.6 u_init.c        $NHDT-Date: 1454660565 2016/02/05 08:22:45 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.37 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -270,7 +270,8 @@ static const struct def_skill Skill_B[] = {
     { P_SPEAR, P_SKILLED },
     { P_TRIDENT, P_SKILLED },
     { P_BOW, P_BASIC },
-    { P_ATTACK_SPELL, P_SKILLED },
+    { P_ATTACK_SPELL, P_BASIC },
+    { P_ESCAPE_SPELL, P_BASIC }, /* special spell is haste self */
     { P_RIDING, P_BASIC },
     { P_TWO_WEAPON_COMBAT, P_BASIC },
     { P_BARE_HANDED_COMBAT, P_MASTER },
@@ -458,7 +459,8 @@ static const struct def_skill Skill_S[] = {
     { P_LANCE, P_SKILLED },
     { P_BOW, P_EXPERT },
     { P_SHURIKEN, P_EXPERT },
-    { P_ATTACK_SPELL, P_SKILLED },
+    { P_ATTACK_SPELL, P_BASIC },
+    { P_DIVINATION_SPELL, P_BASIC }, /* special spell is clairvoyance */
     { P_CLERIC_SPELL, P_SKILLED },
     { P_RIDING, P_SKILLED },
     { P_TWO_WEAPON_COMBAT, P_EXPERT },
index cdbd440db44c136cf9131415c7e55d699c465587..4a6ebbea37e749eb4ac328a1c8fbde03f109d08d 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 weapon.c        $NHDT-Date: 1446078767 2015/10/29 00:32:47 $  $NHDT-Branch: master $:$NHDT-Revision: 1.55 $ */
+/* NetHack 3.6 weapon.c        $NHDT-Date: 1454660575 2016/02/05 08:22:55 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.57 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1147,7 +1147,7 @@ enhance_weapon_skill()
 
 /*
  * Change from restricted to unrestricted, allowing P_BASIC as max.  This
- * function may be called with with P_NONE.  Used in pray.c.
+ * function may be called with with P_NONE.  Used in pray.c as well as below.
  */
 void
 unrestrict_weapon_skill(skill)
@@ -1501,6 +1501,10 @@ const struct def_skill *class_skill;
             P_ADVANCE(skill) = practice_needed_to_advance(P_SKILL(skill) - 1);
         }
     }
+
+    /* each role has a special spell; allow at least basic for its type
+       (despite the function name, this works for spell skills too) */
+    unrestrict_weapon_skill(spell_skilltype(urole.spelspec));
 }
 
 void