I'd be interested to know how you would control where the magma was routed to. Perhaps an array of levers, a lot of gear mechanism logic, and many, many pumps/floodgates?
Or perhaps pressure plates could be employed to help with selection.
You can do a binary coded switch system with an execute switch. Like for example:
Switches toggled (0= Off, 1= On)
10110 = Portal #22 with the execute switch at the entrance to the binary gallery to act as a final shot (or two of them like a twin-key administrated execution; like nuclear bombs and such are done.)
As for the toggle device consider a long line of water channeled or pressurized in a tunnel, and for the binary switches, use a single floodgate for each binary number (1,2,4,8...), and the "execution gates" to allow water to hit the final trigger(s) that releases all of the second gates to finalize the command to fire. There will be a catch a level below the switches that'll always be pumped back into the reservoir that powers the binary mechanism, allowing for pressure.
Here's a diagram:
7 = pressurized water
^ = Trap
X = Floodgate
█ = wall
. = Hole in ground/Channel
Switches (all off)
First 8 Last 8
(1-128) (256-32768)
███████████████████
█òòòòòòòò òòòòòòòò█
█████████ █████████
FinA█ò ò█FinB
███ ███
Final Execution switch Zone
█████
█7█.█ Drain
█7█^█ Final Switch (Open all Inner FGs)
█X█X███(FinA AND FinB Switch)
█ .█Drain
███████
Upper Floor
1 2 4 8 16...
███████████████████████████████████████
█.█.█.█.█.█.█.█.█.█.█.█.█.█.█.█.██.%% █Return Drain Pump (TO reservoir) (ALWAYS ON)
█X█X█X█X█X█X█X█X█X█X█X█X█X█X█X█X███████Anti-Backsplash FGs (since it's pressurized water we're dealing with)
█^█^█^█^█^█^█^█^█^█^█^█^█^█^█^█^█ (Linked to, of course, the BIN #-ed FGs)
█X█X█X█X█X█X█X█X█X█X█X█X█X█X█X█X█ Final Switch (All), Toggled by =AND(FinA, FinB) Switches
█X█X█X█X█X█X█X█X█X█X█X█X█X█X█X█X██Individual switches (can 'Crush water')
█777777777777777777777777777777777 Pressurized Reservoir
██████████████████████████████████
(# switch AND FINAL = TRUE)
(FG Closed = FLASE/Off)
Lower Floor
███████████████████████████████████████
█ %%██ Return Drain (Where it would be located compared to above.) (ALWAYS ON)
███████████████████████████████████████
Whatever would operate on a specific number.
End Result: Profit and a precise attack.
This method is scalabe, and being pressurized, and using pressure switches for the number commands, it is also allowed to be adjusted to be stylish or modified. This could make for some interesting machines to be precisely timed and used, provided necessary functions and commands are set.
Caution, this may take ALOT of mechanisms to construct if you go by my thought of execution.
1 = 1 mech (1)
2 = 2 mechs. (10)
3 = 3 mechs. (11) opening a 3rd FG that uses the #3 switch.
It would be like a competition ladder to complete the execution.
You could try and modify my initial plans to work in that fashion instead. I'm just a tad burned out right now to figure that one out.
If anyone has a simpler method, be my guest. But, I'm not too hot with HEX or OCT or anything like that.