Don has been a royal pain to Harry, who just so happens to be an aspiring magician, and decides to get some of his own back: he casts a curse of bad luck! Now whenever Donald rolls dice, draws cards, or does any other luck-based activity, he gets the worst result possible.
But, he loves playing poker, so he thinks of a clever way to beat the system: Before looking at their hands, he swaps with a random player! Now someone else will get his bad luck. Or will they?
Let's say that his bad luck can't be defeated or evaded. Even after swapping cards, he still always has the worst hand. But this means that the spell can somehow know that he is going to exchange hands, rather than just ensuring he gets dealt a bad one. Additionally, immediate bad luck trumps later good luck - so if he runs to catch a bus, he'll miss it, even if that bus would crash 10 minutes later.
Magic works according to specific rules, and is definitely not conscious or self aware, so how is it able to ensure his luck is bad regardless of what he does to avoid it?
Currently, the only thing I can think of is some sort of reverse causality - that whenever something good happens, the luck spell causes that to not have happened. But, that's getting into time travel, which is really messy. Can anyone think of a way to implement this spell so that it is something an apprentice magician could cast, rather than something powerful and complicated? I want the world to be very similar to ours, which means magicians can't be too powerful.
Edit: To clarify what I am asking.
For a spell to cause bad luck to someone, it needs to know the difference between a "good" and "bad" outcome. This is easy to test once the outcome has happened - just check, "is target happy?" yes = good, no = bad.
The problem is, that it needs to know this before the outcome happens. So it needs to be able to determine if a future event is good or bad. Which means it either needs to be able to send a signal back in time or be able to model the world accurately enough to form a solid prediction, which is effectively precognition. Either of these are incredibly powerful effects, which would have a huge impact on the world. Lotteries would go out of business, election outcomes would be known in advance, wars would come down to who has the best precog rather than the best army... all in all, it would cause huge changes.
I don't want this; I want a world that looks pretty much the same as ours, except that, lurking in the shadows, are a small number of people with magic powers, who can cause supernatural good/bad luck, but are sufficiently un-powerful as to have a minimal impact on the rest of the world.
The problem I am trying to solve is, how can a magic spell know that a specific nudge will cause a good or bad outcome, without being sentient, or able to see the future?