diff --git a/src/botl.c b/src/botl.c index 365eda211..d6a1ebf0c 100644 --- a/src/botl.c +++ b/src/botl.c @@ -880,13 +880,13 @@ bot_via_windowport(void) #endif } } - condtests[bl_blind].test = (Blind); + condtests[bl_blind].test = (Blind) ? TRUE : FALSE; condtests[bl_conf].test = (Confusion) ? TRUE : FALSE; - condtests[bl_deaf].test = (Deaf); - condtests[bl_fly].test = (Flying); - condtests[bl_glowhands].test = (u.umconf); - condtests[bl_hallu].test = (Hallucination); - condtests[bl_lev].test = (Levitation); + condtests[bl_deaf].test = (Deaf) ? TRUE : FALSE; + condtests[bl_fly].test = (Flying) ? TRUE : FALSE; + condtests[bl_glowhands].test = (u.umconf) ? TRUE : FALSE; + condtests[bl_hallu].test = (Hallucination) ? TRUE : FALSE; + condtests[bl_lev].test = (Levitation) ? TRUE : FALSE; condtests[bl_ride].test = (u.usteed) ? TRUE : FALSE; condtests[bl_slime].test = (Slimed) ? TRUE : FALSE; condtests[bl_stone].test = (Stoned) ? TRUE : FALSE; @@ -897,7 +897,7 @@ bot_via_windowport(void) test_if_enabled(bl_bareh) = (!uarmg && !uwep); test_if_enabled(bl_icy) = (levl[u.ux][u.uy].typ == ICE); test_if_enabled(bl_slippery) = (Glib) ? TRUE : FALSE; - test_if_enabled(bl_woundedl) = (Wounded_legs); + test_if_enabled(bl_woundedl) = (Wounded_legs) ? TRUE : FALSE; if (g.multi < 0) { cond_cache_prepA(); diff --git a/src/insight.c b/src/insight.c index c57496c77..6133919d2 100644 --- a/src/insight.c +++ b/src/insight.c @@ -183,7 +183,8 @@ trap_predicament(char *outbuf, int final, boolean wizxtra) confers the target property; item must have been seen and its type discovered but it doesn't necessarily have to be fully identified */ static boolean -cause_known(int propindx) /* index of a property which can be conveyed by worn item */ +cause_known( + int propindx) /* index of a property which can be conveyed by worn item */ { register struct obj *o; long mask = W_ARMOR | W_AMUL | W_RING | W_TOOL; @@ -1379,21 +1380,35 @@ attributes_enlightenment(int unused_mode UNUSED, int final) you_are("warned of undead", from_what(WARN_UNDEAD)); if (Searching) you_have("automatic searching", from_what(SEARCHING)); - if (Clairvoyant) + if (Clairvoyant) { you_are("clairvoyant", from_what(CLAIRVOYANT)); - else if ((HClairvoyant || EClairvoyant) && BClairvoyant) { + } else if ((HClairvoyant || EClairvoyant) && BClairvoyant) { Strcpy(buf, from_what(-CLAIRVOYANT)); - if (!strncmp(buf, " because of ", 12)) - /* overwrite substring */ - memcpy(buf, " if not for ", 12); + (void) strsubst(buf, " because of ", " if not for "); enl_msg(You_, "could be", "could have been", " clairvoyant", buf); } if (Infravision) you_have("infravision", from_what(INFRAVISION)); - if (Detect_monsters) - you_are("sensing the presence of monsters", ""); - if (u.umconf) - you_are("going to confuse monsters", ""); + if (Detect_monsters) { + Strcpy(buf, "sensing the presence of monsters"); + if (wizard) { + long detectmon_timeout = (HDetect_monsters & TIMEOUT); + + if (detectmon_timeout) + Sprintf(eos(buf), " (%ld)", detectmon_timeout); + } + you_are(buf, ""); + } + if (u.umconf) { /* 'u.umconf' is a counter rather than a timeout */ + Strcpy(buf, " monsters when hitting them"); + if (wizard && !final) { + if (u.umconf == 1) + Strcat(buf, " (next hit only)"); + else /* u.umconf > 1 */ + Sprintf(eos(buf), " (next %u hits)", u.umconf); + } + enl_msg(You_, "will confuse", "would have confused", buf, ""); + } /*** Appearance and behavior ***/ if (Adornment) {