added switching between melee and ranged weapons in battle