A simulation method for X-ray pulsar signal based on Monte Carlo