[RPG] Attacking a target in dim light, from darkness, at great distance

combatdnd-5eranged-attackvision-and-light

Character A is in Darkness with no Darkvision

Character B is in Dim Light a hundred feet away from A

For further context, an ascii board (dashes indicate dimly lit area):

                    -B-----
                  -----------
 A               ------L------
                  -----------
                    -------

|        100 ft        |

Are any penalties imposed on A's Ranged Attacks?

I've been looking around, and the closest thing I can find is this:
How far away can you see light?
which tells me that Character A can definitely clearly see the light source.

Does this mean that they can also see the dimly lit character just fine, and make attacks as normal (provided their weapon is in range)?

In that case, does this mean that (not only can they attack without penalty) but they get advantage on their attacks due to being hidden by darkness?

Best Answer

[Note that the interaction darkness-->obscured-->blinded was subject to an erratum; if your PHB is an early printing this answer may look contrary to your rules.]

When you are in darkness someone trying to see you is "effectively blinded" but you are not (PHB p.183, "Vision and Light," errata'ed). Since you are unseen your attack roll has advantage (PHB p.195, "Unseen Attackers and Targets"). But your attack roll against your target--who is lightly obscured--is not affected (PHB p.183, "Vision and Light").

Therefore you attack with advantage. Yay!

(You ask if "they can also see the dimly lit character just fine, and make attacks as normal? " Attacks are normal, but they don't actually see the dimly-lit character "just fine": their perception checks into the dimly-lit area would be disadvantaged, per "Vision and Light.")