It is currently 28 Apr 2024, 07:54
   
Text Size

Shadow

Moderator: CCGHQ Admins

Shadow

Postby 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. :lol:

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

Postby thefiremind » 24 Sep 2013, 23:15

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.
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: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. :lol:
Why not making it easier:
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>
Maybe I'm forgetting something, but I think this is all we need for shadow: if one of the 2 creatures has shadow and the other one doesn't, then they can't "interact".
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Shadow

Postby 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. [-o<
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: Shadow

Postby BlindWillow » 25 Sep 2013, 00:05

That seems to work just fine as far as I can tell.
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

In total there are 24 users online :: 0 registered, 0 hidden and 24 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 24 guests

Login Form