Re-ported the old battle engine

See title