Great reply, . In indian philosophy emotion stems from the ananda feature of the soul (the three features are sat = awareness, chit = knowledge and ananda = happiness, pleasure, bliss). First there is the uncaused, ever-existing thirst for ever expanding happiness (ananda). Based on this, sub-desires emerge and plans to fulfill them -- in the sense that all desire is a form of looking for happiness. And based on what happens next with the fulfillment of those desires (or the perspective of fulfillment/unfulfillment) emotions arise.
So, yes, based on what purposes (desires) you have, there are different emotions arising from that. Anxiety appears when our desires look like they won't be fulfilled. When that is absolutely confirmed (there's nothing to be done anymore) anxiety disappears and anger appears in some people, or detachment appears in other people.
RE: Pills of Wisdom #8 | Anxiety