* Adds auto-exclusions for any monsters in LOS that need them. */
| 88 | * Adds auto-exclusions for any monsters in LOS that need them. |
| 89 | */ |
| 90 | void add_auto_excludes() |
| 91 | { |
| 92 | if (!is_map_persistent() || !map_bounds(you.pos())) |
| 93 | return; |
| 94 | |
| 95 | vector<monster*> mons; |
| 96 | for (radius_iterator ri(you.pos(), LOS_DEFAULT); ri; ++ri) |
| 97 | { |
| 98 | monster *mon = monster_at(*ri); |
| 99 | if (!mon || mon->is_summoned()) |
| 100 | continue; |
| 101 | |
| 102 | // Something of a speed hack, but some vaults have a TON of plants. |
| 103 | if (mon->is_firewood()) |
| 104 | continue; |
| 105 | if (_need_auto_exclude(mon) && !is_exclude_root(*ri)) |
| 106 | { |
| 107 | int radius = _get_full_exclusion_radius(); |
| 108 | // Sting and Harpoon Shot's minimum ranges, respectively. |
| 109 | if (mon->type == MONS_SCRUB_NETTLE) |
| 110 | radius = min(radius, 4); |
| 111 | else if (mon->type == MONS_STARFLOWER) |
| 112 | radius = min(radius, 6); |
| 113 | |
| 114 | set_exclude(*ri, radius, true); |
| 115 | mons.emplace_back(mon); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | if (mons.empty()) |
| 120 | return; |
| 121 | |
| 122 | mprf(MSGCH_WARN, "Marking area around %s as unsafe for travelling.", |
| 123 | describe_monsters_condensed(mons).c_str()); |
| 124 | learned_something_new(HINT_AUTO_EXCLUSION); |
| 125 | } |
| 126 | |
| 127 | travel_exclude::travel_exclude(const coord_def &p, int r, |
| 128 | bool autoexcl, string dsc, bool vaultexcl) |
no test coverage detected