Create battlefactory.js