Exploring effects of magnetic field on the hadron resonance gas