MCPcopy Create free account
hub / github.com/DFHack/dfhack / make_explosion

Function make_explosion

plugins/steam-engine.cpp:119–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void 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
148static const int WEAR_TICKS = 806400;
149

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected