sense adjacent traps if wielding MKoT without wearing gloves */
| 2750 | |
| 2751 | /* sense adjacent traps if wielding MKoT without wearing gloves */ |
| 2752 | void |
| 2753 | mkot_trap_warn(void) |
| 2754 | { |
| 2755 | static const char *const heat[7] = { |
| 2756 | "cool", "slightly warm", "warm", "very warm", |
| 2757 | "hot", "very hot", "like fire" |
| 2758 | }; |
| 2759 | |
| 2760 | if (!uarmg && u_wield_art(ART_MASTER_KEY_OF_THIEVERY)) { |
| 2761 | int idx, ntraps = count_surround_traps(u.ux, u.uy); |
| 2762 | |
| 2763 | if (ntraps != gm.mkot_trap_warn_count) { |
| 2764 | idx = min(ntraps, SIZE(heat) - 1); |
| 2765 | pline_The("Key feels %s%c", heat[idx], (ntraps > 3) ? '!' : '.'); |
| 2766 | } |
| 2767 | gm.mkot_trap_warn_count = ntraps; |
| 2768 | } else |
| 2769 | gm.mkot_trap_warn_count = 0; |
| 2770 | } |
| 2771 | |
| 2772 | /* Master Key is magic key if its bless/curse state meets our criteria: |
| 2773 | not cursed for rogues or blessed for non-rogues */ |
no test coverage detected