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

Function get_vortex_phase

crawl-ref/source/cloud.cc:2205–2218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2203}
2204
2205bool get_vortex_phase(const coord_def& loc)
2206{
2207 coord_def center = get_cloud_originator(loc);
2208 if (center.origin())
2209 return ui_random(2); // source died/went away
2210 else
2211 {
2212 int x = loc.x - center.x;
2213 int y = loc.y - center.y;
2214 double dir = atan2(x, y) / PI;
2215 double dist = sqrt(x * x + y * y);
2216 return ((int)floor(dir * 2 + dist * 0.33 - (you.frame_no % 54) / 2.7)) & 1;
2217 }
2218}

Callers 2

_get_cloud_varietyFunction · 0.85
_fixup_cloud_varietiesFunction · 0.85

Calls 4

ui_randomFunction · 0.85
atan2Function · 0.85
sqrtFunction · 0.85
originMethod · 0.80

Tested by

no test coverage detected