I almost flooded my fort in the first year when I tried to make an underground farm under an aquifer. It was a sandy desert, too, which froze in winter, so there was no water source except the aquifer.
Was kinda stupid really. I somehow thought that a pressure plate rigged to trigger on water would close a floodgate. Heh.
I made a floodgated 1x1 room, and dug a staircase up into the aquifer. Water came down, and I blocked it. So far so good. I make a pressure plate to "shut off" the floodgate if water gets out of the area, and order the lever pulled. I flood the farming area, but when I ask someone to pull the lever again, everyone decided to go eat, and water rose too high. "Meh", I thought, "I gotta make a drainage system. The brilliant solution was to tell a miner to dig a trench in front of the door, that would later be expanded into a multilevel drop to a reservoir below. And covered with grates. Yeah.
Because of funky digging the miner got trapped in the room, and because of my pressure plate, the water that escaped as he opened the door held the floodgate open. The miner was stranded in a room that was quickly becoming a watery grave. Frantic attempts to save the miner included:
- ordering the lever pulled, to no avail - pressure plate held the gate open;
- ordering the construction of grates at the mason's, more on that later;
- ordering another miner to complete the drain, which proved impossible because of poor planning - water flooded the area where he would have to dig;
- ordering the trapped miner to build a wall to block water was attempted a bit too late - water too deep;
- ordering the same miner to dig himself out was attempted even more too late - miner was drowning;
Finally, ordering the other miner to breach the already-full room wall saved the miner who was winded and would probably not live another 5 seconds. The miner was kinda washed out of the room, and dropped sleeping. I tried to contain the flood by digging a channel across the corridor, which helped for a bit, but before that was executed, I ordered the deconstruction of the pressure plate - which I should have done from the start. A speedy carpenter/mechanic crossover happily escaped death by drowning when the miner was chipping the last bit of floor that separated him and the plate, and deconstructed the plate. Then pulled the lever.
The flood stopped, but I had my main staircase flooded, because the water could not be held by a single 2x1 trench at that point. In this whole time, the mason whom I ordered to construct the grates did a great job - he ran all the way from z -2 to z -6, through the walled-out aquifer and two corridors 5 screens long, and returned the same way with one chert stone. He took the single most distant stone he could possibly reach from his workshop, just because it was 4 tiles below. Another stone was 7 tiles to the left of the shop. Toady REALLY should do something with that distance calculation thing.