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

Method update_cloud_state

crawl-ref/source/map-knowledge.cc:309–331  ·  view source on GitHub ↗

If there's a cloud in this cell that we know should be gone, remove it. Returns true if a cloud was removed.

Source from the content-addressed store, hash-verified

307/// If there's a cloud in this cell that we know should be gone, remove it.
308/// Returns true if a cloud was removed.
309bool map_cell::update_cloud_state()
310{
311 if (visible())
312 return false; // we're already up-to-date
313
314 // player non-opaque clouds vanish instantly out of los
315 if (_cloud && _cloud->killer == KILL_YOU_MISSILE
316 && !is_opaque_cloud(_cloud->type))
317 {
318 clear_cloud();
319 return true;
320 }
321
322 // still winds KOs all clouds, even those out of LOS
323 if (_cloud && env.level_state & LSTATE_STILL_WINDS)
324 {
325 clear_cloud();
326 return true;
327 }
328
329 // TODO: track decay & vanish appropriately (based on some worst case?)
330 return false;
331}
332
333/**
334 * Find the known map bounds as a pair of coordinates. This is a minimal

Callers 1

update_cloud_knowledgeFunction · 0.80

Calls 2

visibleFunction · 0.85
is_opaque_cloudFunction · 0.85

Tested by

no test coverage detected