From 84e3c1aac9cfe0628e412c113a5b00b80c71d7b0 Mon Sep 17 00:00:00 2001 From: cohrs Date: Thu, 10 Oct 2002 21:13:05 +0000 Subject: [PATCH] B13002 - negative protection implement Michael's suggestion to tweak the protection message when your protection is negative. --- src/cmd.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index d0342bee7..247981363 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -971,7 +971,19 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */ you_have(enlght_combatinc("damage", u.udaminc, final, buf)); if (Slow_digestion) you_have("slower digestion"); if (Regeneration) enl_msg("You regenerate", "", "d", ""); - if (u.uspellprot || Protection) you_are("protected"); + if (u.uspellprot || Protection) { + int prot = 0; + + if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe; + if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe; + if (HProtection & INTRINSIC) prot += u.ublessed; + prot += u.uspellprot; + + if (prot < 0) + you_are("ineffectively protected"); + else + you_are("protected"); + } if (Protection_from_shape_changers) you_are("protected from shape changers"); if (Polymorph) you_are("polymorphing"); @@ -1474,8 +1486,8 @@ struct ext_func_tab extcmdlist[] = { #if defined(WIZARD) static const struct ext_func_tab debug_extcmdlist[] = { {"levelchange", "change experience level", wiz_level_change, TRUE}, - {"light sources", "show mobile light sources", wiz_light_sources, TRUE}, - {"monpoly_control", "control monster polymorphs", wiz_mon_polycontrol, TRUE}, + {"lightsources", "show mobile light sources", wiz_light_sources, TRUE}, + {"monpolycontrol", "control monster polymorphs", wiz_mon_polycontrol, TRUE}, {"panic", "test panic routine (fatal to game)", wiz_panic, TRUE}, {"poly", "polymorph self", wiz_polyself, TRUE}, {"seenv", "show seen vectors", wiz_show_seenv, TRUE},