Leo Trupheus got it right, as the guide mentions:
This immunity is implemented using the same system as standard protection...All normal protection rules still apply.
It's literally the same protection as defenders get. That's what made the B variant so appealing from a dev standpoint, I just had to add simple logic to give attacks an equivalent amount of protection as a the retal is good for, all the other code for protection logic and things that happen when you win a castle were already there - so CLI was able to get hacked right into the middle of all that.
Interestingly enough, I implemented CLI in 3 simple lines of code.
The A variant would have been significantly more complex, probably would have been 1500 lines of code and got its fingers into many subsystems in the game. The B variant is so simple, can't imagine we have any regression bugs, should go off without a hitch 🙂