| 117 | } |
| 118 | |
| 119 | void make_explosion(df::coord center, int power) |
| 120 | { |
| 121 | static const int bias[9] = { |
| 122 | 60, 30, 60, |
| 123 | 30, 0, 30, |
| 124 | 60, 30, 60 |
| 125 | }; |
| 126 | |
| 127 | int mat_type = builtin_mats::WATER, mat_index = -1; |
| 128 | int i = 0; |
| 129 | |
| 130 | for (int dx = -1; dx <= 1; dx++) |
| 131 | { |
| 132 | for (int dy = -1; dy <= 1; dy++) |
| 133 | { |
| 134 | int size = power - bias[i++]; |
| 135 | auto pos = center + df::coord(dx,dy,0); |
| 136 | |
| 137 | if (size > 0) |
| 138 | Maps::spawnFlow(pos, flow_type::MaterialDust, mat_type, mat_index, size); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | Gui::showAutoAnnouncement( |
| 143 | announcement_type::CAVE_COLLAPSE, center, |
| 144 | "A boiler has exploded!", COLOR_RED, true |
| 145 | ); |
| 146 | } |
| 147 | |
| 148 | static const int WEAR_TICKS = 806400; |
| 149 |
no outgoing calls
no test coverage detected