]> granicus.if.org Git - nethack/commitdiff
add warning glow for Orcrist & Grimtooth
authorPatR <rankin@nethack.org>
Sat, 30 May 2015 00:42:15 +0000 (17:42 -0700)
committerPatR <rankin@nethack.org>
Sat, 30 May 2015 00:42:15 +0000 (17:42 -0700)
Make Orcrist glow light blue when orcs are present, just like Sting.
(Sting supposedly glowed because it was made by the elves of Gondolin
rather than any particular attribute built into it, and Orcrist was
made there too.  I think it also glowed in the Hobbit; that was how
Bilbo recognized what the situation was when he first saw Sting glow.
Maybe it was the other sword rather than Orcrist, but they were treated
as being functionally equivalent.)

Also make Grimtooth glow red when elves are present.  That's from thin
air, to give it some novelty.  Unlike Sting, whose double-damage bonus
is restricted to orc targets, Grimtooth's weak 1d6 bonus still applies
to all targets.

include/artilist.h
src/artifact.c
src/display.c

index 50ec60636a978c5b62634675856924dd0cc17c37..bde9d5b52d9017a92f826cb27c545defa74a298a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6  artilist.h      $NHDT-Date: 1432512781 2015/05/25 00:13:01 $  $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ */
+/* NetHack 3.6  artilist.h      $NHDT-Date: 1432946531 2015/05/30 00:42:11 $  $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -65,21 +65,24 @@ STATIC_OVL NEARDATA struct artifact artilist[] = {
     A("Cleaver", BATTLE_AXE, SPFX_RESTR, 0, 0, PHYS(3, 6), NO_DFNS, NO_CARY,
       0, A_NEUTRAL, PM_BARBARIAN, NON_PM, 1500L),
 
-    A("Grimtooth", ORCISH_DAGGER, SPFX_RESTR, 0, 0, PHYS(2, 6), NO_DFNS,
+    /*
+     *      Grimtooth glows in warning when elves are present, but its
+     *      damage bonus applies to all targets rather than just elves
+     *      (handled as special case in spec_dbon()).
+     */
+    A("Grimtooth", ORCISH_DAGGER, (SPFX_RESTR | SPFX_WARN | SPFX_DFLAG2),
+      0, M2_ELF, PHYS(2, 6), NO_DFNS,
       NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ORC, 300L),
     /*
      *      Orcrist and Sting have same alignment as elves.
+     *
+     *      The combination of SPFX_WARN+SPFX_DFLAG2+M2_value will trigger
+     *      EWarn_of_mon for all monsters that have the M2_value flag.
+     *      Sting and Orcrist will warn of M2_ORC monsters.
      */
-    A("Orcrist", ELVEN_BROADSWORD, SPFX_DFLAG2, 0, M2_ORC, PHYS(5, 0),
-      NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 2000L),
+    A("Orcrist", ELVEN_BROADSWORD, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC,
+      PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 2000L),
 
-    /*
-     *      The combination of SPFX_WARN and M2_something on an artifact
-     *      will trigger EWarn_of_mon for all monsters that have the
-     * appropriate
-     *      M2_something flags.  In Sting's case it will trigger EWarn_of_mon
-     *      for M2_ORC monsters.
-     */
     A("Sting", ELVEN_DAGGER, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC, PHYS(5, 0),
       NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 800L),
     /*
index 2a5873f79654c0dbc1f48e114db28b4856d368f4..89ca6109aeaabbff6aa0ff9b383fd37572483477 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 artifact.c      $NHDT-Date: 1432863398 2015/05/29 01:36:38 $  $NHDT-Branch: master $:$NHDT-Revision: 1.87 $ */
+/* NetHack 3.6 artifact.c      $NHDT-Date: 1432946531 2015/05/30 00:42:11 $  $NHDT-Branch: master $:$NHDT-Revision: 1.89 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -842,6 +842,10 @@ int tmp;
     if (!weap || (weap->attk.adtyp == AD_PHYS && /* check for `NO_ATTK' */
                   weap->attk.damn == 0 && weap->attk.damd == 0))
         spec_dbon_applies = FALSE;
+    else if (otmp->oartifact == ART_GRIMTOOTH)
+        /* Grimtooth has SPFX settings to warn against elves but we want its
+           damage bonus to apply to all targets, so bypass spec_applies() */
+        spec_dbon_applies = TRUE;
     else
         spec_dbon_applies = spec_applies(weap, mon);
 
@@ -1808,11 +1812,15 @@ long *abil;
     return (struct obj *) 0;
 }
 
+/* use for warning "glow" for Sting, Orcrist, and Grimtooth */
 void
 Sting_effects(orc_count)
 int orc_count;
 {
-    if (uwep && uwep->oartifact == ART_STING) {
+    if (uwep
+        && (uwep->oartifact == ART_STING
+            || uwep->oartifact == ART_ORCRIST
+            || uwep->oartifact == ART_GRIMTOOTH)) {
         /*
          * Toggling blindness in between warning messages can result in
          *   Sting glows light blue!  [...]  Sting stops quivering.
@@ -1824,7 +1832,9 @@ int orc_count;
             if (!Blind)
                 pline("%s %s %s!", bare_artifactname(uwep),
                       otense(uwep, "glow"),
-                      hcolor(NH_LIGHT_BLUE));
+                      hcolor((uwep->oartifact == ART_GRIMTOOTH)
+                             ? NH_RED
+                             : NH_LIGHT_BLUE));
             else
                 pline("%s quivers slightly.", bare_artifactname(uwep));
         } else if (orc_count == 0 && warn_obj_cnt > 0) {
index 3bb62436c188ab53e6fdc2645c55c9f4a45dd423..70d88ef826b7261548b47af33a253387c22dca53 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 display.c       $NHDT-Date: 1432863399 2015/05/29 01:36:39 $  $NHDT-Branch: master $:$NHDT-Revision: 1.55 $ */
+/* NetHack 3.6 display.c       $NHDT-Date: 1432946532 2015/05/30 00:42:12 $  $NHDT-Branch: master $:$NHDT-Revision: 1.56 $ */
 /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
 /* and Dave Cohrs, 1990.                                         */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1147,8 +1147,7 @@ see_monsters()
     /*
      * Make Sting glow blue or stop glowing if required.
      */
-    if (new_warn_obj_cnt != warn_obj_cnt && uwep
-        && uwep->oartifact == ART_STING) {
+    if (new_warn_obj_cnt != warn_obj_cnt) {
         Sting_effects(new_warn_obj_cnt);
         warn_obj_cnt = new_warn_obj_cnt;
     }