Skip to content

Commit

Permalink
scroll usage; also spell of ID (trunk only)
Browse files Browse the repository at this point in the history
     Make a not-very-robust fix for the report from <email deleted> about
being told a scoll disappears as you read it, then for the case of cursed
remove curse being told that the scroll disintegrates.  He missed similar
case for scroll of fire erupting into flames after it had disappeared.
This suppresses the "disappears" part of the scroll reading message for
those two cases, but won't be very reliable if other scroll messages
referring to the scroll itself get introduced in the future.  [Several
paths through scroll of fire won't report that it burns, and now it doesn't
give the disappears message any more.  I don't think that's worth worrying
about; the scroll leaving inventory after burning up is implicit.]

     Also cut down on redundant feedback for several scrolls (genocide,
charging, identify, stinking cloud) that start off by informing the player
what they are.  That's only needed when the the player doesn't already
know the type of scroll.  I've always felt it silly to be told that I've
"found a scroll of genocide" when I'm intentionally reading a known scroll
of genocide.  All these types of scroll give a subsequent prompt which
makes them recongizable if you somehow manage to choose the wrong object
when picking the one to read.

    Lastly, make spell of identify behave like ordinary uncursed scroll of
identify by default instead of ususally ID'ing multiple items.  Now you'll
need to be skilled or better in divination spells skill in order to get the
blessed scroll effect out of it.  And give some feedback if the spell is
cast when not carrying any inventory; it was just silently moving on to the
user's next command in that case.
  • Loading branch information
nethack.rankin committed Feb 16, 2006
1 parent 6a892db commit 73e9225
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 50 deletions.
1 change: 1 addition & 0 deletions doc/fixes35.0
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ put #define for potion occupant chance and cursed wand zap chance in one place
candles should not be fireproof
recognize most instances where hallucinatory monster name should be treated
as a personal name (to avoid "the Barney") instead of a description
avoid giving misleading or redundant feedback when reading scrolls


Platform- and/or Interface-Specific Fixes
Expand Down
2 changes: 1 addition & 1 deletion include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ E struct obj *FDECL(getobj, (const char *,const char *));
E int FDECL(ggetobj, (const char *,int (*)(OBJ_P),int,BOOLEAN_P,unsigned *));
E void FDECL(fully_identify_obj, (struct obj *));
E int FDECL(identify, (struct obj *));
E void FDECL(identify_pack, (int));
E void FDECL(identify_pack, (int,BOOLEAN_P));
E int FDECL(askchain, (struct obj **,const char *,int,int (*)(OBJ_P),
int (*)(OBJ_P),int,const char *));
E void FDECL(prinv, (const char *,struct obj *,long));
Expand Down
6 changes: 3 additions & 3 deletions src/cmd.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)cmd.c 3.5 2005/11/19 */
/* SCCS Id: @(#)cmd.c 3.5 2006/02/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -513,14 +513,14 @@ wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */
return 0;
}

/* ^I command - identify hero's inventory */
/* ^I command - reveal and optionally identify hero's inventory */
STATIC_PTR int
wiz_identify()
{
if (wizard) {
iflags.override_ID = (int)cmd_from_func(wiz_identify);
if (display_inventory((char *)0, TRUE) == -1)
identify_pack(0);
identify_pack(0, FALSE);
iflags.override_ID = 0;
} else pline("Unavailable command '^I'.");
return 0;
Expand Down
103 changes: 60 additions & 43 deletions src/read.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)read.c 3.5 2005/10/07 */
/* SCCS Id: @(#)read.c 3.5 2006/02/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -32,7 +32,7 @@ int
doread()
{
register struct obj *scroll;
register boolean confused;
boolean confused, nodisappear;

known = FALSE;
if(check_capacity((char *)0)) return (0);
Expand Down Expand Up @@ -116,19 +116,26 @@ doread()
return(study_book(scroll));
}
scroll->in_use = TRUE; /* scroll, not spellbook, now being read */
if(scroll->otyp != SCR_BLANK_PAPER) {
if(Blind)
pline("As you %s the formula on it, the scroll disappears.",
is_silent(youmonst.data) ? "cogitate" : "pronounce");
else
pline("As you read the scroll, it disappears.");
if(confused) {
if (Hallucination)
pline("Being so trippy, you screw up...");
if (scroll->otyp != SCR_BLANK_PAPER) {
/* a few scroll feedback messages describe something happening
to the scroll itself, so avoid "it disappears" for those */
nodisappear = (scroll->otyp == SCR_FIRE ||
(scroll->otyp == SCR_REMOVE_CURSE && scroll->cursed));
if (Blind)
pline(nodisappear ? "You %s the formula on the scroll." :
"As you %s the formula on it, the scroll disappears.",
is_silent(youmonst.data) ? "cogitate" : "pronounce");
else
pline("Being confused, you mis%s the magic words...",
is_silent(youmonst.data) ? "understand" : "pronounce");
}
pline(nodisappear ? "You read the scroll." :
"As you read the scroll, it disappears.");
if (confused) {
if (Hallucination)
pline("Being so trippy, you screw up...");
else
pline("Being confused, you %s the magic words...",
is_silent(youmonst.data) ? "misunderstand" :
"mispronounce");
}
}
if(!seffects(scroll)) {
if(!objects[scroll->otyp].oc_name_known) {
Expand Down Expand Up @@ -647,12 +654,15 @@ seffects(sobj)
struct obj *sobj;
{
int cval;
boolean confused = (Confusion != 0),
boolean confused = (Confusion != 0), already_known,
old_erodeproof, new_erodeproof;
struct obj *otmp;

if (objects[sobj->otyp].oc_magic)
exercise(A_WIS, TRUE); /* just for trying */
already_known = (sobj->oclass == SPBOOK_CLASS || /* spell */
objects[sobj->otyp].oc_name_known);

switch(sobj->otyp) {
#ifdef MAIL
case SCR_MAIL:
Expand Down Expand Up @@ -1059,7 +1069,8 @@ struct obj *sobj;
}
break;
case SCR_GENOCIDE:
You("have found a scroll of genocide!");
if (!already_known)
You("have found a scroll of genocide!");
known = TRUE;
if (sobj->blessed) do_class_genocide();
else do_genocide(!sobj->cursed | (2 * !!Confusion));
Expand Down Expand Up @@ -1090,26 +1101,33 @@ struct obj *sobj;
if (food_detect(sobj))
return(1); /* nothing detected */
break;
case SPE_IDENTIFY:
cval = rn2(5);
goto id;
case SCR_IDENTIFY:
/* known = TRUE; */
if(confused)
You("identify this as an identify scroll.");
else
pline("This is an identify scroll.");
if (sobj->blessed || (!sobj->cursed && !rn2(5))) {
cval = rn2(5);
/* Note: if rn2(5)==0, identify all items */
if (cval == 1 && sobj->blessed && Luck > 0) ++cval;
} else cval = 1;
if(!objects[sobj->otyp].oc_name_known) more_experienced(0,10);
if (confused)
You("identify this as an identify scroll.");
else if (!already_known ||
/* force feedback now if invent will become
empty after using up this scroll */
(sobj->quan == 1L && inv_cnt() == 1))
pline("This is an identify scroll.");
if (!already_known) more_experienced(0, 10);
useup(sobj);
makeknown(SCR_IDENTIFY);
id:
if(invent && !confused) {
identify_pack(cval);
/*FALLTHRU*/
case SPE_IDENTIFY:
cval = 1;
if (sobj->blessed || (!sobj->cursed && !rn2(5))) {
cval = rn2(5);
/* note: if cval==0, identify all items */
if (cval == 1 && sobj->blessed && Luck > 0) ++cval;
}
if (invent && !confused) {
identify_pack(cval, !already_known);
} else if (sobj->otyp == SPE_IDENTIFY) {
/* when casting a spell we know we're not confused,
so inventory must be empty (another message has
already been given above if reading a scroll) */
pline("You're not carrying anything to be identified.");
}
return(1);
case SCR_CHARGING:
Expand All @@ -1128,7 +1146,8 @@ struct obj *sobj;
break;
}
known = TRUE;
pline("This is a charging scroll.");
if (!already_known)
pline("This is a charging scroll.");
otmp = getobj(all_count, "charge");
if (!otmp) break;
recharge(otmp, sobj->cursed ? -1 : (sobj->blessed ? 1 : 0));
Expand Down Expand Up @@ -1183,12 +1202,8 @@ struct obj *sobj;
exercise(A_WIS, FALSE);
break;
case SCR_FIRE:
/*
* Note: Modifications have been made as of 3.0 to allow for
* some damage under all potential cases.
*/
cval = bcsign(sobj);
if(!objects[sobj->otyp].oc_name_known) more_experienced(0,10);
if (!already_known) more_experienced(0,10);
useup(sobj);
makeknown(SCR_FIRE);
if(confused) {
Expand All @@ -1206,9 +1221,9 @@ struct obj *sobj;
}
return(1);
}
if (Underwater)
pline_The("water around you vaporizes violently!");
else {
if (Underwater) {
pline_The("water around you vaporizes violently!");
} else {
pline_The("scroll erupts in a tower of flame!");
burn_away_slime();
}
Expand Down Expand Up @@ -1344,9 +1359,11 @@ struct obj *sobj;
{
coord cc;

You("have found a scroll of stinking cloud!");
if (!already_known)
You("have found a scroll of stinking cloud!");
known = TRUE;
pline("Where do you want to center the cloud?");
pline("Where do you want to center the %scloud?",
already_known ? "stinking " : "");
cc.x = u.ux;
cc.y = u.uy;
if (getpos(&cc, TRUE, "the desired position") < 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/sit.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)sit.c 3.5 2005/06/02 */
/* SCCS Id: @(#)sit.c 3.5 2006/03/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -262,7 +262,7 @@ dosit()
You("are granted an insight!");
if (invent) {
/* rn2(5) agrees w/seffects() */
identify_pack(rn2(5));
identify_pack(rn2(5), FALSE);
}
break;
case 13:
Expand Down
2 changes: 1 addition & 1 deletion src/spell.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,13 @@ boolean atme;
case SPE_CONFUSE_MONSTER:
case SPE_DETECT_FOOD:
case SPE_CAUSE_FEAR:
case SPE_IDENTIFY:
/* high skill yields effect equivalent to blessed scroll */
if (role_skill >= P_SKILLED) pseudo->blessed = 1;
/* fall through */
case SPE_CHARM_MONSTER:
case SPE_MAGIC_MAPPING:
case SPE_CREATE_MONSTER:
case SPE_IDENTIFY:
(void) seffects(pseudo);
break;

Expand Down

0 comments on commit 73e9225

Please sign in to comment.