blindness has just started or just ended--caller enforces that; called by Blindf_on(), Blindf_off(), and make_blinded() */
| 333 | /* blindness has just started or just ended--caller enforces that; |
| 334 | called by Blindf_on(), Blindf_off(), and make_blinded() */ |
| 335 | void |
| 336 | toggle_blindness(void) |
| 337 | { |
| 338 | boolean Stinging = (uwep && (EWarn_of_mon & W_WEP) != 0L); |
| 339 | |
| 340 | /* blindness has just been toggled */ |
| 341 | disp.botl = TRUE; /* status conditions need update */ |
| 342 | gv.vision_full_recalc = 1; /* vision has changed */ |
| 343 | /* this vision recalculation used to be deferred until moveloop(), |
| 344 | but that made it possible for vision irregularities to occur |
| 345 | (cited case was force bolt hitting an adjacent potion of blindness |
| 346 | and then a secret door; hero was blinded by vapors but then got the |
| 347 | message "a door appears in the wall" because wall spot was IN_SIGHT) */ |
| 348 | vision_recalc(0); |
| 349 | if (Blind_telepat || Infravision || Stinging) |
| 350 | see_monsters(); /* also counts EWarn_of_mon monsters */ |
| 351 | /* |
| 352 | * Avoid either of the sequences |
| 353 | * "Sting starts glowing", [become blind], "Sting stops quivering" or |
| 354 | * "Sting starts quivering", [regain sight], "Sting stops glowing" |
| 355 | * by giving "Sting is quivering" when becoming blind or |
| 356 | * "Sting is glowing" when regaining sight so that the eventual |
| 357 | * "stops" message matches the most recent "Sting is ..." one. |
| 358 | */ |
| 359 | if (Stinging) |
| 360 | Sting_effects(-1); |
| 361 | /* update dknown flag for inventory picked up while blind */ |
| 362 | if (!Blind) |
| 363 | learn_unseen_invent(); |
| 364 | } |
| 365 | |
| 366 | DISABLE_WARNING_FORMAT_NONLITERAL |
| 367 |
no test coverage detected