# 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.

• This should be easily testable. Start with 2 bombs and use the Tarot Cloth. Do you end up with 6 or 8 bombs? If 6, then the game doubles your current count and adds it back twice. If 8, then the game doubles it twice. – Mage Xy Oct 16 at 18:03
• @MageXy The 2 of clubs and 2 of spades give you 2 bombs and keys respectively while at 0, so this is not testable while at 2 bombs. At 2 bombs, you would end up with 8. That is NOT my question. – David Oct 16 at 19:01
• Why are you asking? – Wrigglenite Oct 16 at 19:34
• @Wrigglenite Just interested in the way the game code works. As I said I know either way it's gonna give the same output. It's not an imperatively important question. – David Oct 16 at 19:47
• @David That is your question, you just don't realize it. Effectively, you're asking "does the Tarot Cloth calculate the quantity given twice and apply both, or does it calculate it once and apply it twice?" I will try to post an answer that explains in more detail. – Mage Xy Oct 16 at 21:50

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()
``````

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

``````TarotCloth2oS_B()
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.