If a thief sticks a gun in your ribs and asks for your money, you have two choices.
If you don't give up the money and he shoots you, it's arguable that that could have been avoided, had you done as asked. So in a limited sense, your choice played a role in the consequence of the trigger being pulled.
But the overriding situation was, is, and remains illegal. The thief has no color of right allowing him to do what he is doing, and your resistance to his act may have led to your death, but your resistance does not somehow convert his shooting you into a legal or justified act.This applies in so many areas. If you leave your car unlocked with a laptop sitting on the seat, you are a damn fool, and no one will be very surprised when it is stolen. But your leaving the door unlocked does not change the essential nature of what the thief does, which is to commit the crime of theft.