Let's say that there is a combat. There's is one player character and two enemies- one melee and one ranged. The player character has Armor of Agathys (or some other spell) and wants the melee combatant to hit them- but they also have a shield and light armor. If the initiative was Melee, Ranged, Player-
Could the player use their shield to defend the ranged attack, but not the melee attack?
Could the player apply their Dex bonus from their light armor to defend the ranged attack, but not the melee attack?