Shadow

In coding Nether Traitor for a deck I'm working on, I noticed the old EVASION_INDEX way of handling shadow doesn't seem to work anymore. I came up with the following, and it seems to work in testing, but I would like to get the opinion of the resident coding experts, as who knows what the AI is really thinking when it blocks and doesn't block. 
Here's the new evasion test:

Here's the new evasion test:
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1">
<TRIGGER value="EVASION_TEST" pre_trigger="1">
if EffectSource() ~= nil then
if EffectSource():GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_SHADOW ) == true then
return ( TriggerObject() == EffectSource() and SecondaryObject():GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_SHADOW ) == false ) or ( SecondaryObject() == EffectSource() and TriggerObject():GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_SHADOW ) == false )
end
end
</TRIGGER>
</TRIGGERED_ABILITY>