[RPG] How to compare hit % and damage between 1 attack vs 4 attacks with disadvantage

anydicednd-5estatisticswarlock

Quite a few scenarios here, wish my AnyDice fu were up to par—if it's too much, no need to cover all of them, just the most representative, so I can figure out the rest.
For the given character parameters:

Character level: 17+
Spell Attack Modifier: 11
Proficiency: 6
Charisma Modifier: 5
Target Armor Class: 21

How could I compare on AnyDice:

  1. Probability of hitting with Shocking Grasp vs probability of hitting at least once with 4 Eldritch Blast beams (with disadvantage)?
  2. Average damage in both cases (EB with Agonizing Blast).
  3. Probability of hitting with Shocking Grasp (with advantage) vs probability of hitting at least once with 4 Eldritch Blast beams (with disadvantage)?
  4. Average damage in both cases (EB with Agonizing Blast)?
  5. Tricky one: Probability of hitting with Shocking Grasp (with advantage) vs probability of hitting with 4 Eldritch Blast beams (with disadvantage until one hits, then the remaining ones without disadvantage—i.e., assuming Repelling Blast)?
  6. Average damage in both, assuming the target has Hex (extra 1d6 per hit).

Thanks!

Best Answer

I have compiled all the necessary statistics into one AnyDice program. AB refers to your attack bonus, AC is your enemy's armor class.

AnyDice can also store dice sequences in variables. This does not "roll" and store a number, but every possible outcome is considered every time we use the variable. We'll use this to store the damage for Eldritch Blast (1d10+5) and shocking grasp (4d8) in EB and SG, respectively.

Calculating a basic chance to hit in AnyDice is just 1d20+AB>=AC. With (dis)advantage, you can use [lowest/highest 1 of 2d20]+AB>=AC. 1 means you hit, 0 means you miss. We'll use these often, so let's store them in ATT, DIS and ADV.

To get the damage, you can multiply the result of the above with the damage calculation, e.g. ATT*SG.

The last thing to note is that in AnyDice 2*1d61d6+1d6. I wrote a simple sum/multiply function that returns the latter: [sum DIS times 4] = DIS+DIS+DIS+DIS.


That said, let's go through your points one by one:

  1. Hitting with shocking grasp is just a simple attack, which comes out to 55%.
    Hitting at least once with 4 attacks with disadvantage is just adding up 4 attacks with disadvantage, and then checking if the total result is at least 1, which comes out to 76.33%.

    Your chance to hit with at least one of four EB at disadvantage is therefore (76.33/55-1)*100%=38.78% higher than with shocking grasp.

  2. For average damage, the quickest way is to just multiply the chance to hit with the average damage of the attack. For a 2d8 shocking grasp, that is 55%/100% × 2 × 4.5 = 4.95. If you care about the statistics, multiply the damage term with the hit chance term.
    For the EB calculation, you do this separately for every attack.

  3. With advantage, the chance to hit with SG increases to 79.75% making it almost equal to the chance of hitting with EB (at least once).

  4. Same as 2, but with advantage.

  5. This one is indeed tricky. I put in another function to help. Passing DIS as a number (D:n) allows us to do things depending on the value "rolled". The first line is the recursion limit. If the attack is a miss, we continue recursively. Otherwise, we register 1 (we just hit after all), and roll normally 4-N times.

    I also included the damage in this case, with its own function due to me hardcoding stuff. The average damage increases by around 33% compared to all-disadvantage!

  6. I'll leave this one up to you, just add 1d6 to the damage variables at the top and re-run the program.