enlightenment for Half_xxx_damage (trunk only)

Include Half_physical_damage and Half_spell_damage in enlightenment
feedback and end-of-game disclosure.
This commit is contained in:
nethack.rankin
2007-05-05 22:44:51 +00:00
parent b85b3d47ff
commit cfdc51dbde
2 changed files with 24 additions and 1 deletions
+1
View File
@@ -300,6 +300,7 @@ some monsters can eat tins in addition to corpses to cure some ailments
add Roderick Schertler's pickup_thrown patch add Roderick Schertler's pickup_thrown patch
add ability to sort the list when viewing known spells with '+' command add ability to sort the list when viewing known spells with '+' command
describe magic cancellation from worn armor in enlightment/end-of-game feedback describe magic cancellation from worn armor in enlightment/end-of-game feedback
disclose half physical and/or spell damage in enlightment/end-of-game feedback
add atmospheric sound messages for temples add atmospheric sound messages for temples
sometimes give announcement message when monsters teleport to hero's vicinity sometimes give announcement message when monsters teleport to hero's vicinity
obsolete config file keywords: GRAPHICS, OBJECTS, TRAPS, EFFECTS obsolete config file keywords: GRAPHICS, OBJECTS, TRAPS, EFFECTS
+23 -1
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)cmd.c 3.5 2007/02/21 */ /* SCCS Id: @(#)cmd.c 3.5 2007/05/05 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -160,6 +160,7 @@ STATIC_PTR boolean NDECL(minimal_enlightenment);
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,char *)); STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,char *));
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *)); STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
STATIC_DCL void FDECL(enlght_halfdmg, (int,int));
static const char* readchar_queue=""; static const char* readchar_queue="";
static coord clicklook_cc; static coord clicklook_cc;
@@ -1025,6 +1026,25 @@ char *outbuf;
return outbuf; return outbuf;
} }
/* report half physical or half spell damage */
STATIC_OVL void
enlght_halfdmg(category, final)
int category;
int final;
{
const char *category_name;
char buf[BUFSZ];
switch (category) {
case HALF_PHDAM: category_name = "physical"; break;
case HALF_SPDAM: category_name = "spell"; break;
default: category_name = "unknown"; break;
}
Sprintf(buf, " %s %s damage",
(final || wizard) ? "half" : "reduced", category_name);
enl_msg(You_, "take", "took", buf, from_what(category));
}
void void
enlightenment(final) enlightenment(final)
int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
@@ -1253,6 +1273,8 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
if (armpro >= SIZE(mc_types)) armpro = SIZE(mc_types) - 1; if (armpro >= SIZE(mc_types)) armpro = SIZE(mc_types) - 1;
you_are(mc_types[armpro],""); you_are(mc_types[armpro],"");
} }
if (Half_physical_damage) enlght_halfdmg(HALF_PHDAM, final);
if (Half_spell_damage) enlght_halfdmg(HALF_SPDAM, final);
if (Protection_from_shape_changers) if (Protection_from_shape_changers)
you_are("protected from shape changers",""); you_are("protected from shape changers","");
if (Polymorph) you_are("polymorphing",""); if (Polymorph) you_are("polymorphing","");