battle simulator with javascript weapon