MCPcopy Create free account
hub / github.com/crawl/crawl / timeout_tombs

Function timeout_tombs

crawl-ref/source/timed-effects.cc:822–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820}
821
822void 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
859void timeout_binding_sigils()
860{

Callers 2

update_levelFunction · 0.85
run_environment_effectsFunction · 0.85

Calls 8

monster_atFunction · 0.85
_drop_tombFunction · 0.85
invalid_monster_indexFunction · 0.85
get_allMethod · 0.80
lose_energyMethod · 0.80
get_typeMethod · 0.45
posMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected