mob.dm merge conflict part 4

After copying the latest mob.dm, I re-wrote the needed code. I tried to
be careful but I have no way to test if it compiles on this computer.
Please test before pulling.