]> granicus.if.org Git - nethack/commitdiff
rndcolor()
authornethack.allison <nethack.allison>
Wed, 12 Mar 2003 18:26:17 +0000 (18:26 +0000)
committernethack.allison <nethack.allison>
Wed, 12 Mar 2003 18:26:17 +0000 (18:26 +0000)
> "A cloud of sangria gas billows from the chest.
> You stagger and your vision blurs."
> When I see the gas billowing from the chest, I'm not yet
> hallucinating. Shouldn't the gas have a normal colour, then?
> Only after my vision blurs should the gas assume a fake colour, I
> think.
>

doc/fixes34.2
src/do_name.c
src/trap.c

index 1ed2b2a6d337f23ef4d00984d8dbf51b6e5f24ad..cbdf90209619a7bc8b8ca572c1adcf7e65ca0e7f 100644 (file)
@@ -16,6 +16,7 @@ include statue contents in end of game inventory disclosure
 treat handlessness as a major problem when deciding prayer outcome
 perform artifact touch checks when putting on accessories
 missing noun in message when horns pierce through your helmet
+don't use hcolor() for trapped chest gases when you aren't hallucinating
 
 
 Platform- and/or Interface-Specific Fixes
index 9c6ded0e4717a0a4016314676ef4d355227dee1c..0b276bb87fe143ee5a734ed7392ddf139865b98b 100644 (file)
@@ -1002,6 +1002,15 @@ const char *colorpref;
                hcolors[rn2(SIZE(hcolors))] : colorpref;
 }
 
+/* return a random real color unless hallucinating */
+const char *
+rndcolor()
+{
+       int k = rn2(CLR_MAX);
+       return Hallucination ? hcolor((char *)0) : (k == NO_COLOR) ?
+               "colorless" : c_obj_colors[k];
+}
+
 /* Aliases for road-runner nemesis
  */
 static const char * const coynames[] = {
index c9f71b5c3830b303d48d7ae2260395d585bd617e..0f9580143bd73f06b2bc601a5e6a9334a18e41bf 100644 (file)
@@ -3586,7 +3586,7 @@ boolean disarm;
                case 0:
                        pline("A cloud of %s gas billows from %s.",
                                Blind ? blindgas[rn2(SIZE(blindgas))] :
-                               hcolor((char *)0), the(xname(obj)));
+                               rndcolor(), the(xname(obj)));
                        if(!Stunned) {
                            if (Hallucination)
                                pline("What a groovy feeling!");