The rules about Warlock Thought Shield say this:
You also have resistance to psychic damage, and whenever a creature deals psychic damage to you, that creature takes the same amount of damage that you do.
My two questions are:
If a creature does 40 points of psychic damage to a warlock, then is it the case that 20 points of damage is done to the warlock, and 20 points of damage is done to the creature? If the damage is reduced somehow to the warlock, is that damage dealt to the creature also reduced?
Is the damage done back to the creature considered untyped or psychic? If the creature is immune to psychic damage, does the creature take any damage?
I have a preference for official rulings with citation.