]> granicus.if.org Git - nethack/commitdiff
Monsters can blind you with a camera
authorPasi Kallinen <paxed@alt.org>
Mon, 22 Aug 2022 10:32:12 +0000 (13:32 +0300)
committerPasi Kallinen <paxed@alt.org>
Mon, 22 Aug 2022 10:32:12 +0000 (13:32 +0300)
doc/fixes3-7-0.txt
src/muse.c

index ab3ebc03f1a6fcccb87054eeb8be41c2c3b69883..da9481db883d2815cbbc27c22f99f2de8b6f63e5 100644 (file)
@@ -1015,6 +1015,7 @@ expose fuzz tester to wizard-mode as #debugfuzzer extended command
 monsters which cannot move due to boulders or walls try to escape
 intelligent monsters see and remember when others trigger traps
 random figurines are of harder monsters
+monsters can blind you with a camera
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 3edd10bbbf341af3c2c193359fae360a86ab6bac..410b87e1f1f81efc3331d1620091ae2df6edbefa 100644 (file)
@@ -1150,6 +1150,7 @@ rnd_defensive_item(struct monst* mtmp)
 #define MUSE_WAN_TELEPORTATION 15
 #define MUSE_POT_SLEEPING 16
 #define MUSE_SCR_EARTH 17
+#define MUSE_CAMERA 18
 /*#define MUSE_WAN_UNDEAD_TURNING 20*/ /* also a defensive item so don't
                                      * redefine; nonconsecutive value is ok */
 
@@ -1402,6 +1403,14 @@ find_offensive(struct monst* mtmp)
             g.m.offensive = obj;
             g.m.has_offense = MUSE_SCR_EARTH;
         }
+        nomore(MUSE_CAMERA);
+        if (obj->otyp == EXPENSIVE_CAMERA
+            && (!Blind || hates_light(g.youmonst.data))
+            && dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) <= 2
+            && obj->spe > 0 && !rn2(6)) {
+            g.m.offensive = obj;
+            g.m.has_offense = MUSE_CAMERA;
+        }
 #if 0
         nomore(MUSE_SCR_FIRE);
         if (obj->otyp == SCR_FIRE && resists_fire(mtmp)
@@ -1708,6 +1717,22 @@ use_offensive(struct monst* mtmp)
 
         return (DEADMONSTER(mtmp)) ? 1 : 2;
     } /* case MUSE_SCR_EARTH */
+    case MUSE_CAMERA: {
+        if (Hallucination)
+            verbalize("Say cheese!");
+        else
+            pline("%s takes a picture of you with %s!",
+                  Monnam(mtmp), an(xname(otmp)));
+        g.m_using = TRUE;
+        if (!Blind) {
+            You("are blinded by the flash of light!");
+            make_blinded(Blinded + (long) rnd(1 + 50), FALSE);
+        }
+        lightdamage(otmp, TRUE, 5);
+        g.m_using = FALSE;
+        otmp->spe--;
+        return 1;
+    } /* case MUSE_CAMERA */
 #if 0
     case MUSE_SCR_FIRE: {
         boolean vis = cansee(mtmp->mx, mtmp->my);
@@ -2482,6 +2507,8 @@ searches_for_item(struct monst* mon, struct obj* obj)
         if (Is_container(obj) && !(Is_mbag(obj) && obj->cursed)
             && !obj->olocked)
             return TRUE;
+        if (typ == EXPENSIVE_CAMERA)
+            return (obj->spe > 0);
         break;
     case FOOD_CLASS:
         if (typ == CORPSE)