| 820 | } |
| 821 | |
| 822 | void timeout_tombs(int duration) |
| 823 | { |
| 824 | if (!duration) |
| 825 | return; |
| 826 | |
| 827 | for (map_marker *mark : env.markers.get_all(MAT_TOMB)) |
| 828 | { |
| 829 | if (mark->get_type() != MAT_TOMB) |
| 830 | continue; |
| 831 | |
| 832 | map_tomb_marker *cmark = dynamic_cast<map_tomb_marker*>(mark); |
| 833 | cmark->duration -= duration; |
| 834 | |
| 835 | // Empty tombs disappear early. |
| 836 | monster* mon_entombed = monster_at(cmark->pos); |
| 837 | bool empty_tomb = !(mon_entombed || you.pos() == cmark->pos); |
| 838 | bool zin = (cmark->source == -GOD_ZIN); |
| 839 | |
| 840 | if (cmark->duration <= 0 || empty_tomb) |
| 841 | { |
| 842 | _drop_tomb(cmark->pos, empty_tomb, zin); |
| 843 | |
| 844 | monster* mon_src = |
| 845 | !invalid_monster_index(cmark->source) ? &env.mons[cmark->source] |
| 846 | : nullptr; |
| 847 | // A monster's Tomb of Doroklohe spell. |
| 848 | if (mon_src |
| 849 | && mon_src == mon_entombed) |
| 850 | { |
| 851 | mon_src->lose_energy(EUT_SPELL); |
| 852 | } |
| 853 | |
| 854 | env.markers.remove(cmark); |
| 855 | } |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | void timeout_binding_sigils() |
| 860 | { |
no test coverage detected