]> granicus.if.org Git - nethack/commitdiff
confused scroll of light
authornethack.allison <nethack.allison>
Sun, 19 Feb 2006 23:28:38 +0000 (23:28 +0000)
committernethack.allison <nethack.allison>
Sun, 19 Feb 2006 23:28:38 +0000 (23:28 +0000)
Implement the following suggestion by <email deleted>
- Reading a scroll of light while confused should
create a hostile yellow light (black light if cursed).

It only creates the light monster effect 1 out of 5 times.

doc/fixes35.0
include/extern.h
src/makemon.c
src/read.c
src/zap.c

index 8649c07b52aee737a3a50f1c6f02d83328c2fdea..e09dcb6b9321ccb7aa3c0c4707a06c5e3275f972 100644 (file)
@@ -182,6 +182,7 @@ number_pad:3 run-time option to use inverted phone keypad layout for movement
 number_pad:-1 to swap function of y and z keys; z to move NW, y to zap wands
 display spell retention information in the spell menu
 tame ghouls can eat old eggs
+new effect for reading a scroll of light while confused
 
 
 Platform- and/or Interface-Specific New Features
index acfd0275e5497a68e7dd5aa918bf7e4592895674..ed1ebdd5b1ab8118a4d9de28efdf4c296f0ec852 100644 (file)
@@ -974,7 +974,7 @@ E int FDECL(monhp_per_lvl, (struct monst *));
 E void FDECL(newmonhp, (struct monst *,int));
 E struct mextra *NDECL(newmextra);
 E struct monst *FDECL(makemon, (struct permonst *,int,int,int));
-E boolean FDECL(create_critters, (int,struct permonst *));
+E boolean FDECL(create_critters, (int,struct permonst *,BOOLEAN_P));
 E struct permonst *NDECL(rndmonst);
 E void FDECL(reset_rndmonst, (int));
 E struct permonst *FDECL(mkclass, (CHAR_P,int));
index a6f77b4839d5bb6256f019ab91f6adbde896d55b..8efc35bfdebe2457ec4145a2fa564e820c73d684 100644 (file)
@@ -1160,16 +1160,17 @@ int mndx;
 /* used for wand/scroll/spell of create monster */
 /* returns TRUE iff you know monsters have been created */
 boolean
-create_critters(cnt, mptr)
+create_critters(cnt, mptr, neverask)
 int cnt;
 struct permonst *mptr;         /* usually null; used for confused reading */
+boolean neverask;
 {
        coord c;
        int x, y;
        struct monst *mon;
        boolean known = FALSE;
 #ifdef WIZARD
-       boolean ask = wizard;
+       boolean ask = (wizard && !neverask);
 #endif
 
        while (cnt--) {
index 1c0794b1eb7cb21b1907e5b8c47c9bc68e1d1adb..2119d682116786e7cc41ca97bb97d6f70b98c77b 100644 (file)
@@ -1010,7 +1010,7 @@ struct obj *sobj;
        case SPE_CREATE_MONSTER:
            if (create_critters(1 + ((confused || scursed) ? 12 : 0) +
                                ((sblessed || rn2(73)) ? 0 : rnd(4)),
-                       confused ? &mons[PM_ACID_BLOB] : (struct permonst *)0))
+                       confused ? &mons[PM_ACID_BLOB] : (struct permonst *)0,FALSE))
                known = TRUE;
            /* no need to flush monsters; we ask for identification only if the
             * monsters are not visible
@@ -1074,8 +1074,15 @@ struct obj *sobj;
                else do_genocide(!scursed | (2 * !!Confusion));
                break;
        case SCR_LIGHT:
-               if(!Blind) known = TRUE;
-               litroom(!confused && !scursed, sobj);
+               if (!confused || rn2(5)) {
+                       if(!Blind) known = TRUE;
+                       litroom(!confused && !sobj->cursed, sobj);
+               } else {
+                  /* could be scroll of create monster, don't set known ...*/
+                   (void) create_critters(1, !sobj->cursed ?
+                               &mons[PM_YELLOW_LIGHT] :
+                               &mons[PM_BLACK_LIGHT], TRUE);
+               }
                break;
        case SCR_TELEPORTATION:
                if (confused || scursed) {
index 8e49eb24d062c168b10efafe016c9a04db4900da..3101bf0820471f22a556beca79c53e3ba516b567 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1876,7 +1876,7 @@ register struct obj *obj;
                        break;
                case WAN_CREATE_MONSTER:
                        known = create_critters(rn2(23) ? 1 : rn1(7,2),
-                                       (struct permonst *)0);
+                                       (struct permonst *)0, FALSE);
                        break;
                case WAN_WISHING:
                        known = TRUE;