Update battleengine.js