It is currently 12 Nov 2025, 21:19
   
Text Size

Wild defiance + Hexproof

Moderator: CCGHQ Admins

Wild defiance + Hexproof

Postby pcastellazzi » 21 Sep 2012, 12:29

I coded wild defiance as follow:

Code: Select all
<TRIGGERED_ABILITY filter_zone="ZONE_IN_PLAY">
  <TRIGGER value="BECAME_TARGET" simple_qualifier="objectyoucontrol">
    local target = TriggerObject()
    local spell  = SecondaryObject()

    return (
          target ~= nil
      and target:GetCardType():Test(CARD_TYPE_CREATURE) ~= 0
      and target:GetZone() == ZONE_IN_PLAY
      and spell ~= nil
      and (spell:GetCardType():Test(CARD_TYPE_INSTANT) ~= 0
       or  spell:GetCardType():Test(CARD_TYPE_SORCERY)  ~= 0)
    )
  </TRIGGER>

  <CONTINUOUS_ACTION>
    local target = TriggerObject()

    if target ~= nil then
      local characteristics = target:GetCurrentCharacteristics()
      characteristics:Power_Add(3)
      characteristics:Toughness_Add(3)
    end

  </CONTINUOUS_ACTION>

  <DURATION simple_duration="UntilEOT" />
</TRIGGERED_ABILITY>
It work for most cases, but when i target my own Dungrove Elder with Titanic Growth it does not. My question is should i need to do something special to handle creatures with hexproof?
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: Wild defiance + Hexproof

Postby RiiakShiNal » 21 Sep 2012, 12:52

Your problem may actually be that you did not include the proper layer for your CONTINUOUS_ACTION (which should be 7c). Because Dungrove Elder has an ability which sets it's power and toughness (which probably runs on layer 7a) it is more than likely canceling the effect of Wild Defiance (which is probably running on layer 0 because you did not set it even though it should be running on 7c). I think it unlikely that the problem is because of hexproof.
RiiakShiNal
Programmer
 
Posts: 2189
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Wild defiance + Hexproff (fixed)

Postby pcastellazzi » 21 Sep 2012, 16:40

Good catch. Thank you very much.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 11 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 guests (based on users active over the past 10 minutes)
Most users ever online was 9824 on 10 Nov 2025, 04:33

Users browsing this forum: No registered users and 11 guests

Login Form