[verb (dictionary form)] + つもりで [verb た-form] + つもりで [verb て-form] + いる + つもりで [i-adj] + つもりで [na-adj] + な + つもりで [noun] + の + つもりで
つもりで is つもり joined to the rest of the sentence by で: you do the second thing with the first in mind. After the dictionary form of a verb, it is the intention you act on: "with the aim of". After a noun such as じょうだん冗談 with の, it is what you meant something as.
With most other nouns, つもりで means acting as if that were so: as if you were the customer, as if this were the real thing.
After a た-form, it pretends that something has already happened. Most often that is money you didn't spend: you act as if you had, and put it aside.
しんだ死んだつもりで is a set phrase: with nothing left to lose, all in.After an adjective or a ている-form, つもりで is what you believed about yourself while you did something, and the sentence usually goes on to show you were wrong. つもりでいる is the same belief held over time.