From: nethack.allison Date: Sun, 19 Feb 2006 23:28:38 +0000 (+0000) Subject: confused scroll of light X-Git-Tag: MOVE2GIT~1111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f65d0710b62f79039313802d81a7ff8b2dcfe3f3;p=nethack confused scroll of light Implement the following suggestion by - 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. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 8649c07b5..e09dcb6b9 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -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 diff --git a/include/extern.h b/include/extern.h index acfd0275e..ed1ebdd5b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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)); diff --git a/src/makemon.c b/src/makemon.c index a6f77b483..8efc35bfd 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -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--) { diff --git a/src/read.c b/src/read.c index 1c0794b1e..2119d6821 100644 --- a/src/read.c +++ b/src/read.c @@ -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) { diff --git a/src/zap.c b/src/zap.c index 8e49eb24d..3101bf082 100644 --- 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;