Update battle-engine.js