Hi,
Even in lucid dreams (dreams in which one is aware that one is dreaming), one’s free will is greatly impaired–much more so than one feels that it is impaired. For a sin to be mortal one must have the full use of one’s free will. However, if one goes into a lucid dream from being awake, with the intention to do something sinful, then one has sinned by that intention.
Fr. Vincent Serpa, O.P.