migrated js files / impl battle and win conditions