Friend is the nicest towards me when she's not pissed and the coldest to me when she is?

I have a friend who's a girl. When she doesn't have any problems going on, she's the kindest/nicest and I'm her favourite from all of her other friends and she's very flirty. But when she has personal issues (on her period for example) she's quite cold to me and not talkative, and only towards me, not towards her other friends. Why?

Friend is the nicest towards me when she's not pissed and the coldest to me when she is?
Post Opinion