Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Shadow
Moderator: CCGHQ Admins
Shadow
by BlindWillow » 24 Sep 2013, 22:50
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>
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: Shadow
by thefiremind » 24 Sep 2013, 23:15
That's bad news! Another function that got discontinued. Luckily, as I said in another occasion, I think that the EVASION_TEST can do everything that the EVASION_... constants could do before.BlindWillow wrote: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.
Why not making it easier:BlindWillow wrote: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.
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1">
<TRIGGER value="EVASION_TEST" pre_trigger="1">
return TriggerObject():GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_SHADOW ) ~= SecondaryObject():GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_SHADOW )
</TRIGGER>
</TRIGGERED_ABILITY>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Shadow
by BlindWillow » 24 Sep 2013, 23:33
I will have to test that out right now. I do hope it works, because that is nice and simple.
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests