What is the highest average damage that a level 10 character can deal in response to being hit or damaged?



Premise

Typically, you deal damage by hitting the other guy with a stick (or a fireball) [citation needed]; however, spells like fire shield damage enemies who hit you:

In addition, whenever a creature within 5 feet of you hits you with a melee attack, the shield erupts with flame. The attacker takes 2d8 fire damage from a warm shield, or 2d8 cold damage from a cold shield.

Similarly, hellish rebuke allows you to damage enemies in response to them damaging you. Either way, the enemy wouldn’t have taken damage if they chose to just ignore you. This leads to my question: what is the highest average damage that a level 10 character can deal in response to being hit or damaged?

Restrictions

Character

  • Level 10.
  • May use the PHB and one of the following: EE, MToF, SCAG, VGtM, or XGtE. This restriction extends to spells, as well. (If the spell is one your build allows you to copy from a scroll or spellbook, however, you may pick it from any of those sources.)
  • No variant rules besides multiclassing, feats, and variant human.
  • Up to three magic items from DMG Tables F or G with a maximum rarity of Rare.

Combat

  • Four encounters; Combat 1, Combat 2, Short Rest, Combat 3, Combat 4 (each of these events is separated by 30 minutes). The Short Rest is mandatory.
  • Each combat encounter has you face off against two earth elementals. These elementals do not have any damage vulnerabilities, damage immunities, or condition immunities. They keep their damage resistances.
  • Each combat lasts three rounds. All participants get a turn in each round.
  • Enemies move next to the PC and attack normally.
  • Enemies do not make opportunity attacks.
  • For the sake of simplicity, treat enemies and the PC as if they had infinite health.
  • You may not use the Ready action. (Mainly to prevent "I ready blight for when I get damaged" from being the best answer.)
  • Any spell or ability that lasts 10 minutes or longer may be activated before entering combat. Any spell or ability that lasts longer than 8 hours may be activated the day before.
  • You may not spend more than 100 gp on spells that consume costly material components. (So casting identify and find familiar is fine, because identify doesn’t consume its costly component, but casting glyph of warding is not.)
  • You never lose concentration as a result of taking damage.
  • Allies cannot help you, unless you summon/create them yourself (via conjure animals, animate dead, etc.)

Damage calculation

  • Damage should be the average damage per round over the course of the adventuring day.
  • Only count damage dealt to enemies (the earth elementals) in direct response to, and in the same turn as, being hit or damaged. Hellish rebuke is fine. The extra damage dealt by absorb elements is not. You may still deal damage in other ways (in case it’s necessary for setup), you just can’t count it in the total.