It is currently 16 Dec 2018, 19:27
   
Text Size

Removing Supertypes (and Helm of the Host)

Moderators: Xander9009, CCGHQ Admins

Removing Supertypes (and Helm of the Host)

Postby Zambooo » 30 Nov 2018, 18:45

Can anybody illuminate me on how to remove the Legendary Supertype? I'm trying to make it work with Helm of the Host but it seems like on table return from SuperType_GetWritable() you can't use either Clear() to remove all Supertypes or ClearAllOfType( SUPERTYPE_LEGENDARY ) to remove just the Legendary one.
Both functions gave me errors
attempt to call method 'ClearAllOfType' (a nil value)
attempt to call method 'Clear' (a nil value)
Here's the piece of code, everything works fine except the supertype removal ofc:

Code: Select all
<TRIGGERED_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of combat on your turn, create a token that’s a copy of equipped creature, except the token isn’t legendary if equipped creature is legendary. That token gains haste.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début du combat pendant votre tour, créez un jeton qui est une copie de la créature équipée, excepté que le jeton n’est pas légendaire si la créature équipée est légendaire. Ce jeton acquiert la célérité.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo del combate en tu turno, crea una ficha que es una copia de la criatura equipada, excepto que la ficha no es legendaria si la criatura equipada es legendaria. Esa ficha gana la habilidad de prisa.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Erzeuge zu Beginn des Kampfes in deinem Zug einen Spielstein, der eine Kopie der ausgerüsteten Kreatur ist, außer dass der Spielstein nicht legendär ist, falls die ausgerüstete Kreatur legendär ist. Der Spielstein erhält Eile.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del combattimento nel tuo turno, crea una pedina che è una copia della creatura equipaggiata, tranne che la pedina non è leggendaria se la creatura equipaggiata è leggendaria. Quella pedina ha rapidità.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのターンの戦闘の開始時に、装備しているクリーチャーが伝説であってもそのトークンは伝説ではないことを除き、装備しているクリーチャーのコピーであるトークンを1体生成する。そのトークンは速攻を得る。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신의 턴 전투시작에, 장착된 생물의 복사본인 토큰 한 개를 만든다. 만약 장착된 생물이 전설적이라면, 토큰은 전설적이 아니다. 그 토큰은 신속을 얻는다.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале боя во время вашего хода создайте одну фишку, являющуюся копией снаряженного существа, за исключением того, что фишка не легендарная, если снаряженное существо является легендарным. Та фишка получает Ускорение.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início do combate em seu turno, crie uma ficha que seja uma cópia da criatura equipada, com a exceção de não ser lendária se a criatura equipada for lendária. Aquela ficha ganha ímpeto.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[在你回合的战斗开始时,派出一个衍生物,此衍生物为佩带此武具之生物的复制品,但如果佩带此武具的生物是传奇,该衍生物不是传奇。该衍生物获得敏捷异能。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[在你回合的戰鬥開始時,派出一個衍生物,此衍生物為佩帶此武具之生物的複製品,但如果佩帶此武具的生物是傳奇,該衍生物不是傳奇。該衍生物獲得敏捷異能。]]></LOCALISED_TEXT>
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
         return MTG():GetStep() == STEP_BEGIN_COMBAT and EffectSource():GetParent() ~= nil
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         local parent = EffectSource():GetParent()
         if parent ~= nil then
            MTG():PutTokenCopiesOntoBattlefield( parent, 1, EffectController(), EffectDC():Make_Chest(2) )
         end
      </RESOLUTION_TIME_ACTION>
      <CONTINUOUS_ACTION layer="4">
         local parent = EffectSource():GetParent()
         if parent ~= nil then
            if parent:GetSuperType():Test( SUPERTYPE_LEGENDARY ) then
               local tokenDC = EffectDC():Get_Chest(2)
               if tokenDC ~= nil then
                  local token = tokenDC:Get_CardPtr(0)
                  if token ~= nil then
                     local characteristics = token:GetCurrentCharacteristics()                     
                     local superType = characteristics:SuperType_GetWritable()
                     superType:ClearAllOfType( SUPERTYPE_LEGENDARY )
                  end
               end
            end
         end
      </CONTINUOUS_ACTION>
      <DURATION>
         return false
      </DURATION>
      <CONTINUOUS_ACTION layer="6">
         local tokenDC = EffectDC():Get_Chest(2)
         if tokenDC ~= nil then         
            local token = tokenDC:Get_CardPtr(0)
            if token ~= nil then
               local characteristics = token:GetCurrentCharacteristics()
               characteristics:Bool_Set( CHARACTERISTIC_HASTE, 1 )
            end
         end
      </CONTINUOUS_ACTION>
      <DURATION>
         return EffectDC():Get_Chest(2):Get_CardPtr(0) == nil
      </DURATION>
   </TRIGGERED_ABILITY>
Zambooo
 
Posts: 205
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 4 times

Re: Removing Supertypes (and Helm of the Host)

Postby Xander9009 » 03 Dec 2018, 03:39

I can't remember exactly how this was dealt with, but I encountered the same issue. It was for a different supertype (basic, I think), but I can't remember for sure...
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2829
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 102 times
Been thanked: 424 times

Re: Removing Supertypes (and Helm of the Host)

Postby Zambooo » 03 Dec 2018, 11:56

Xander9009 wrote:I can't remember exactly how this was dealt with, but I encountered the same issue. It was for a different supertype (basic, I think), but I can't remember for sure...
I truly wish you could give me more than that cause this issue is driving me insane :?:
Zambooo
 
Posts: 205
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 4 times

Re: Removing Supertypes (and Helm of the Host)

Postby Xander9009 » 05 Dec 2018, 00:43

If I manage to remember it, I'll definitely let you know. I tried looking, but nothing pinged my memory.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2829
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 102 times
Been thanked: 424 times


Return to 2014

Who is online

Users browsing this forum: No registered users and 4 guests


Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 4 guests

Login Form