"and my axe"
*scrolls down to see the next pannel*
*dies of laughter*
weaponizing floodgates is easy, just add magma
ive also heard theories about a player activated trap involving removing the designation of a floor or wall being built when it is partially complete, but i have never seen it done.
first, build one Z level above the hallway
F is floor, W is wall, and X is the floor or wall that will be used as a weapon
allow all the floors and walls to be built except X, then have X be built, when the dwarf arrives to build it, suspend the task before it is completed, this will leave the item being used suspended in space over the hallway
F W W W
F F X W
F W W W
next, after the task has been suspended, remove the floor adjacent to X and replace it with a wall
F W W W
F W X W
F W W W
normally when the player removes the designation of a construction that is partially complete the material used will simply be placed where the dwarf that was working on it stood, but that tile is now occupied by a wall, so the material (preferably something like jet or lead) will be placed in the open space, with nothing below it, it should just plop down into the hallway below and strike the invader on command.
it may also be possible to expand the system in a line like this
F W W W
F W X W
F W X W
F W X W
F W X W
F W X W
F W W W
this could be indefinitely scaled to match your hallway, and it would be 100% player triggered, so no waiting on your dwarves to actually pull a lever.
please note that i havent actually gotten around to testing this, somebody brought up the concept of a 100% player triggered trap a while back and somebody thought to use removal of designations to make materials fall, but nobody actually figured out a system to do it with, and this system is just my theory about how it could be done.