From 1ba1422eba147c875ea90c1d0456511a8519cecf Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 5 Apr 2020 13:21:54 +0300 Subject: [PATCH] Confused scroll of light conjures tame cancelled lights Tame cancelled lights are actually quite interesting and useful: they are a mobile light source that will follow you around, and because they are cancelled they won't explode at hostile monsters. This replaces the existing confused scroll effect of creating an area of darkness (the cursed scroll of light still produces this effect). If you are confused *and* the scroll is cursed, it summons black lights instead of yellow ones. Original change by copperwater , added with formatting and some functional changes. --- doc/fixes37.0 | 1 + src/read.c | 35 ++++++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 01c61e4ee..66e389cc0 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -107,6 +107,7 @@ make shriekers summon baby purple worms if purple worms would be too tough make non-tame (baby) purple worms eat corpses off the ground make baby purple worms attack shriekers make hero polymorphed into baby purple worm warned against shriekers +confused scroll of light summons tame cancelled lights Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/read.c b/src/read.c index 18d2cfd2f..3f0bba568 100644 --- a/src/read.c +++ b/src/read.c @@ -1252,19 +1252,40 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ do_genocide((!scursed) | (2 * !!Confusion)); break; case SCR_LIGHT: - if (!confused || rn2(5)) { + if (!confused) { if (!Blind) g.known = TRUE; - litroom(!confused && !scursed, sobj); - if (!confused && !scursed) { + litroom(!scursed, sobj); + if (!scursed) { if (lightdamage(sobj, TRUE, 5)) g.known = TRUE; } } else { - /* could be scroll of create monster, don't set known ...*/ - (void) create_critters(1, !scursed ? &mons[PM_YELLOW_LIGHT] - : &mons[PM_BLACK_LIGHT], - TRUE); + int pm = scursed ? PM_BLACK_LIGHT : PM_YELLOW_LIGHT; + + if ((g.mvitals[pm].mvflags & G_GONE)) { + pline("Tiny lights sparkle in the air momentarily."); + } else { + /* surround with cancelled tame lights which won't explode */ + boolean sawlights = FALSE; + int numlights = rn1(2,3) + (sblessed * 2); + int i; + + for (i = 0; i < numlights; ++i) { + struct monst * mon = makemon(&mons[pm], u.ux, u.uy, + MM_EDOG | NO_MINVENT); + initedog(mon); + mon->msleeping = 0; + mon->mcan = TRUE; + if (canspotmon(mon)) + sawlights = TRUE; + newsym(mon->mx, mon->my); + } + if (sawlights) { + pline("Lights appear all around you!"); + g.known = TRUE; + } + } } break; case SCR_TELEPORTATION: