Logistics Of Tarot Cloth and "2 Of ___" Cards

The Tarot Cloth is an item that doubles the effect of any rune or card used in Isaac. My question pertains to what occurs when you use a multiplier card while at 0 of that item.

If you use a 2 of clubs while at 0 bombs, you will end up with 4 (2 with no tarot cloth). Does the game "give you 2 bombs" twice, or does it "give you 2 bombs", then double the 2? I realize both would end in the same result, I'm just wondering if anyone knows.


TL;DR: It first gives you two bombs, then doubles that quantity.


Let's say there's a simple function that represents the Two of Spades' (2oS) effect:

int Activate2OfSpades()
    return currentBombCount * 2;

Using the Tarot Cloth with 2oS is supposed to cause the effect to happen twice. Potentially, this could lead to two possible workflows:

A) The entire process is done twice. Your current bomb count is doubled, then doubled again.

TarotCloth2oS_A()
    currentBombCount = Activate2OfSpades()
    currentBombCount = Activate2OfSpades()

B) The process is only done once, but applied twice.

TarotCloth2oS_B()
    tempValue = Activate2OfSpades()
    currentBombCount = currentBombValue + 2 * tempValue

Let's assume you have two bombs to start with. The outcome of workflow A should result in 8 bombs total, while workflow B results in 10. If you do this in game, you can see that you end up with 8 bombs, so clearly workflow A is what the code is doing.

Now, when you're at zero bombs, clearly there's a special case because under normal circumstances, both workflows would do absolutely nothing - your currentBombs value would stay the same. So let's update the initial 2oS function to accomodate this:

int Activate2OfSpades()
    if (currentBombCount == 0)
        currentBombCount = 2;
    else
        return currentBombCount * 2;

With this amendment, we can see that at zero initial bombs, both workflow A and B would result in 4 total bombs. So in this case you can't determine which workflow is being used.

However, since we already proved A is the one being used in the normal case, you can safely assume it is also being used in the special case.