| 2203 | } |
| 2204 | |
| 2205 | bool 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 | } |
no test coverage detected