Update battlefactory.js