(a) Unless otherwise provided by the statute defining the offense, a person is not an accomplice in an offense if:
(1) The person is a victim of the offense; or
(2) The offense is defined so that the person's conduct is inevitably incident to the commission of the offense.
(b) It is an affirmative defense to a prosecution for an offense respecting which the liability of the defendant is based on the conduct of another person that the defendant terminates his or her complicity prior to the commission of the offense and:
(1) Wholly deprives his or her complicity of effectiveness in the commission of the offense;
(2) Gives timely warning to an appropriate law enforcement authority; or
(3) Otherwise makes a proper effort to prevent commission of the offense.