It is currently 18 Jul 2025, 22:01
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby thefiremind » 31 Dec 2013, 09:27

drleg3nd wrote:ok TFM here's all the functions and codes I have, I'm still having trouble with same issues.
You wrote kIORA instead of KIORA in the LOL file... you should know by now that everything is case-sensitive in Lua.
< 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: 722 times

Re: Formal Request Thread

Postby RiiakShiNal » 31 Dec 2013, 14:07

thefiremind wrote:I had totally forgot about this problem because it has been solved for tokens with the new P/T token function in DotP2014. #-o I just had an idea: what if we make Primal Clay grant itself a static ability that continuously sets the LinkedDC register where the choice should be stored? The copy would copy that ability as well, setting its own LinkedDC at least once (then it wouldn't matter if it loses all abilities later on). I have never tried to do something similar, though, so I don't know if it works as planned.
I don't think that works because granted abilities are not copied, though the ability that grants the ability would be copied there is no value in any data chest to figure out which ability to grant to set the LinkedDC() value.

An example that shows that granted abilities are not copied would be to have a Grizzly Bears affected by Sensei Golden-Tail to get Bushido 1 then you use Vesuvan Doppelganger become a copy of the Grizzly Bears. The Vesuvan Doppelganger would not have the Bushido 1 ability because the granted ability was not copied.

Until we find some way to copy data chest values or we rewrite cards that copy other cards to check for things like this we won't be able to properly make cards like Primal Clay. It would be great if the engine had a function to set a copyable data chest for instances like this.

NeoAnderson wrote:Guys i have a problem,

I have coded this card Clockwork Avian, now i was coding Tawnos's Coffin (same effect of Oubliette, but it release the card also when is untapped).
I used Clockwork Avian to test Tawnos’s Coffin but when it returns to the battlefield it add 4 additional +1/+0 counters on it.
For example : i exile Clockwork Avian when it has 4, +1/+0 counters, when it return to the battlefield it will have 8 +1/+0 counters.
This happens because Tawnos’s Coffin store the 4 counters before to exile it, then when it come back, it gives back these counters, and the transition trigger of Clockwork Avian add the standar 4 counters.
Is this compliant to the rules of these card combined togheter?

Clockwork Avian | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="CLOCKWORK_AVIAN_202456" />
  <CARDNAME text="CLOCKWORK_AVIAN" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Creatura Alata Meccanica]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="202456" />
  <ARTID value="202456" />
  <ARTIST name="Randy Asplund" />
  <CASTING_COST cost="{5}" />
  <TYPE metaname="Artifact" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Bird" />
  <EXPANSION value="AQ" />
  <RARITY metaname="U" />
  <POWER value="0" />
  <TOUGHNESS value="4" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
  </STATIC_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Creatura Alata Meccanica entra nel campo di battaglia con quattro segnalini +1/+0 su di essa.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
   <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusZeroCounters(), 4)
    end
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Alla fine del combattimento, se la Creatura Alata Meccanica ha attaccato o bloccato in questo combattimento, rimuovi un segnalino +1/+0 da essa.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_STEP">
  if  MTG():GetStep() == STEP_END_OF_COMBAT then
  local target_creature = EffectSource()
    if target_creature ~= nil then
       local interrogation = MTG():ClearInterrogationQuery()
       interrogation:SetObject(target_creature)
       if interrogation:Test( INTERROGATE_ATTACKS, INTERROGATE_THIS_TURN ) or EffectSource():IsBlocking() == true then
          return true
       end
     end
   else
     return false
   end
</TRIGGER>
  <RESOLUTION_TIME_ACTION>
    local target_creature = EffectSource()
    if target_creature ~= nil then
        target_creature:RemoveCounters( MTG():PlusOnePlusZeroCounters(), 1)
     end
  </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{X}, {T}: Metti fino a X segnalini +1/+0 sulla Creatura Alata Meccanica. Questa abilità non può far sì che il numero complessivo dei segnalini +1/+0 sulla Creatura Alata Meccanica sia superiore a quattro. Attiva questa abilità solo durante il tuo mantenimento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
      <COST type="TapSelf" />
      <COST type="generic">
       <PREREQUISITE>
            return ( Object():CountCounters(MTG():PlusOnePlusZeroCounters()) &lt; 4 ) and ( EffectController():CanPayManaCost("{1}") )
      </PREREQUISITE>

    <PLAY_TIME_ACTION>
    if EffectSource() ~= nil then
       local counters = Object():CountCounters(MTG():PlusOnePlusZeroCounters())
       local MaxToAdd = 0
       for i=1, (4 - counters) do
          local CostString = "{"..i.."}"
          if EffectController():CanPayManaCost(CostString) then
             MaxToAdd = i
          end
       end
       EffectController():BeginNewNumericalChoice()
       EffectController():AddNumericalChoiceAnswer(MaxToAdd)
       EffectController():AskNumericalChoiceQuestion( "CARD_QUERY_NAXOS_SPHINX" )
    end
   </PLAY_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
      local CountersToAdd = EffectController():GetNumericalChoiceResult()
      local CostString = "{"..CountersToAdd.."}"
      EffectController():PayManaCost(CostString)
      EffectDC():Set_Int(0,CountersToAdd)
    end
   </RESOLUTION_TIME_ACTION>
   </COST>
    <AVAILABILITY upkeep="1">
      return EffectController():MyTurn()
    </AVAILABILITY>

   <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
      local CountersToAdd = EffectDC():Get_Int(0)
      if CountersToAdd ~= nil then
         EffectSource():AddCounters( MTG():PlusOnePlusZeroCounters(), CountersToAdd )
      end
    end
   </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>   
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
I'm not entirely sure of the rulings in this case, but seeing as Tawnos's Coffin says "return that exiled card to the battlefield under its owner's control with the noted number and kind of counters on it" and Clockwork Avian says it "enters the battlefield with four +1/+0 counters on it" I would assume that depending on which effect resolves last it should enter with 4 or less counters on it.

For example if it is exiled while it has 3 +1/+0 counters on it:
  • If Tawnos's Coffin effect to return it to the battlefield resolves last then Clockwork Avian will initially put 4 +1/+0 counters on it and then Tawnos's Coffin will have to remove 1 to return it with the "noted" number and kind of counters. Ultimately will enter with 3 +1/+0 counters.
  • If Clockwork Avian effect resolves last then Tawnos's Coffin will put 3 +1/+0 counters on it and the Clockwork Avian effect will have to add 1 +1/+0 counter to "enter the battlefield with four" counters on it. Ultimately will enter with 4 +1/+0 counters.

Both cards specify the number of counters it should enter the battlefield with so they should both check and adjust according to how many counters are currently present rather than blindly adding. At least this is how I interpret the text on the cards in accordance with the rules.

Though I believe that all the cards that have been coded up to now have been coded to just blindly add counters for abilities such as this (which may be wrong considering abilities like Oubliette and Tawnos's Coffin). Though since until recently we didn't have Oubliette or Tawnos's Coffin there wasn't a problem until now.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby NeoAnderson » 31 Dec 2013, 15:50

RiiakShiNal wrote:
thefiremind wrote:I had totally forgot about this problem because it has been solved for tokens with the new P/T token function in DotP2014. #-o I just had an idea: what if we make Primal Clay grant itself a static ability that continuously sets the LinkedDC register where the choice should be stored? The copy would copy that ability as well, setting its own LinkedDC at least once (then it wouldn't matter if it loses all abilities later on). I have never tried to do something similar, though, so I don't know if it works as planned.
I don't think that works because granted abilities are not copied, though the ability that grants the ability would be copied there is no value in any data chest to figure out which ability to grant to set the LinkedDC() value.

An example that shows that granted abilities are not copied would be to have a Grizzly Bears affected by Sensei Golden-Tail to get Bushido 1 then you use Vesuvan Doppelganger become a copy of the Grizzly Bears. The Vesuvan Doppelganger would not have the Bushido 1 ability because the granted ability was not copied.

Until we find some way to copy data chest values or we rewrite cards that copy other cards to check for things like this we won't be able to properly make cards like Primal Clay. It would be great if the engine had a function to set a copyable data chest for instances like this.
I think we could find a walk around, but i have to ask something to understand if it could be done.
When a card make a copy, does it changes also is CardRef? If the card ref remains unchanged probably we could make something.
I try to exaplain, supposing that the copy card card ref is fixed, we could do :
1. Add a primal clay ability who retrieve a datachest indexed with copying card ref number, when primal clay become target of a spell or ability. Set into this chest the choosen values.
2. Another ability who set the Primal clay to the stored value if the datachest is not nil.
3. Clear the datachest when the ability resolves or at end of that step.
RiiakShiNal wrote:
NeoAnderson wrote:Guys i have a problem,
I have coded this card Clockwork Avian, now i was coding Tawnos's Coffin (same effect of Oubliette, but it release the card also when is untapped).
I used Clockwork Avian to test Tawnos’s Coffin but when it returns to the battlefield it add 4 additional +1/+0 counters on it.
For example : i exile Clockwork Avian when it has 4, +1/+0 counters, when it return to the battlefield it will have 8 +1/+0 counters.
This happens because Tawnos’s Coffin store the 4 counters before to exile it, then when it come back, it gives back these counters, and the transition trigger of Clockwork Avian add the standar 4 counters.
Is this compliant to the rules of these card combined togheter?

Clockwork Avian | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="CLOCKWORK_AVIAN_202456" />
  <CARDNAME text="CLOCKWORK_AVIAN" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Creatura Alata Meccanica]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Clockwork Avian]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="202456" />
  <ARTID value="202456" />
  <ARTIST name="Randy Asplund" />
  <CASTING_COST cost="{5}" />
  <TYPE metaname="Artifact" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Bird" />
  <EXPANSION value="AQ" />
  <RARITY metaname="U" />
  <POWER value="0" />
  <TOUGHNESS value="4" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
  </STATIC_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Creatura Alata Meccanica entra nel campo di battaglia con quattro segnalini +1/+0 su di essa.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Clockwork Avian enters the battlefield with four +1/+0 counters on it.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
   <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusZeroCounters(), 4)
    end
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Alla fine del combattimento, se la Creatura Alata Meccanica ha attaccato o bloccato in questo combattimento, rimuovi un segnalino +1/+0 da essa.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_STEP">
  if  MTG():GetStep() == STEP_END_OF_COMBAT then
  local target_creature = EffectSource()
    if target_creature ~= nil then
       local interrogation = MTG():ClearInterrogationQuery()
       interrogation:SetObject(target_creature)
       if interrogation:Test( INTERROGATE_ATTACKS, INTERROGATE_THIS_TURN ) or EffectSource():IsBlocking() == true then
          return true
       end
     end
   else
     return false
   end
</TRIGGER>
  <RESOLUTION_TIME_ACTION>
    local target_creature = EffectSource()
    if target_creature ~= nil then
        target_creature:RemoveCounters( MTG():PlusOnePlusZeroCounters(), 1)
     end
  </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{X}, {T}: Metti fino a X segnalini +1/+0 sulla Creatura Alata Meccanica. Questa abilità non può far sì che il numero complessivo dei segnalini +1/+0 sulla Creatura Alata Meccanica sia superiore a quattro. Attiva questa abilità solo durante il tuo mantenimento.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{X}, {T}: Put up to X +1/+0 counters on Clockwork Avian. This ability can’t cause the total number of +1/+0 counters on Clockwork Avian to be greater than four. Activate this ability only during your upkeep.]]></LOCALISED_TEXT>
      <COST type="TapSelf" />
      <COST type="generic">
       <PREREQUISITE>
            return ( Object():CountCounters(MTG():PlusOnePlusZeroCounters()) &lt; 4 ) and ( EffectController():CanPayManaCost("{1}") )
      </PREREQUISITE>

    <PLAY_TIME_ACTION>
    if EffectSource() ~= nil then
       local counters = Object():CountCounters(MTG():PlusOnePlusZeroCounters())
       local MaxToAdd = 0
       for i=1, (4 - counters) do
          local CostString = "{"..i.."}"
          if EffectController():CanPayManaCost(CostString) then
             MaxToAdd = i
          end
       end
       EffectController():BeginNewNumericalChoice()
       EffectController():AddNumericalChoiceAnswer(MaxToAdd)
       EffectController():AskNumericalChoiceQuestion( "CARD_QUERY_NAXOS_SPHINX" )
    end
   </PLAY_TIME_ACTION>
   <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
      local CountersToAdd = EffectController():GetNumericalChoiceResult()
      local CostString = "{"..CountersToAdd.."}"
      EffectController():PayManaCost(CostString)
      EffectDC():Set_Int(0,CountersToAdd)
    end
   </RESOLUTION_TIME_ACTION>
   </COST>
    <AVAILABILITY upkeep="1">
      return EffectController():MyTurn()
    </AVAILABILITY>

   <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
      local CountersToAdd = EffectDC():Get_Int(0)
      if CountersToAdd ~= nil then
         EffectSource():AddCounters( MTG():PlusOnePlusZeroCounters(), CountersToAdd )
      end
    end
   </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>   
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
I'm not entirely sure of the rulings in this case, but seeing as Tawnos's Coffin says "return that exiled card to the battlefield under its owner's control with the noted number and kind of counters on it" and Clockwork Avian says it "enters the battlefield with four +1/+0 counters on it" I would assume that depending on which effect resolves last it should enter with 4 or less counters on it.

For example if it is exiled while it has 3 +1/+0 counters on it:
  • If Tawnos's Coffin effect to return it to the battlefield resolves last then Clockwork Avian will initially put 4 +1/+0 counters on it and then Tawnos's Coffin will have to remove 1 to return it with the "noted" number and kind of counters. Ultimately will enter with 3 +1/+0 counters.
  • If Clockwork Avian effect resolves last then Tawnos's Coffin will put 3 +1/+0 counters on it and the Clockwork Avian effect will have to add 1 +1/+0 counter to "enter the battlefield with four" counters on it. Ultimately will enter with 4 +1/+0 counters.

Both cards specify the number of counters it should enter the battlefield with so they should both check and adjust according to how many counters are currently present rather than blindly adding. At least this is how I interpret the text on the cards in accordance with the rules.

Though I believe that all the cards that have been coded up to now have been coded to just blindly add counters for abilities such as this (which may be wrong considering abilities like Oubliette and Tawnos's Coffin). Though since until recently we didn't have Oubliette or Tawnos's Coffin there wasn't a problem until now.
Theoretically I agree with you for this reason i have exposed this issue, i only would be sure that this should be the behaviour to be compliant with official rules.
If it is sure i think will be not so complicated to add a check to understand if this kind of cards have to add, remove or do nothing when they come back onto battlefield.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby drleg3nd » 31 Dec 2013, 17:12

thefiremind wrote:
drleg3nd wrote:ok TFM here's all the functions and codes I have, I'm still having trouble with same issues.
You wrote kIORA instead of KIORA in the LOL file... you should know by now that everything is case-sensitive in Lua.
Function | Open
Code: Select all
-- Constants and functions for TFM&G2K's Planeswalkers
-- Namesets updated to: Theros

PLW_LAST_DAMAGER = 991

PLANESWALKER_TYPE_AJANI = PLANESWALKER_TYPES
PLANESWALKER_TYPE_CHANDRA = PLANESWALKER_TYPES + 1
PLANESWALKER_TYPE_GARRUK = PLANESWALKER_TYPES + 2
PLANESWALKER_TYPE_JACE = PLANESWALKER_TYPES + 3
PLANESWALKER_TYPE_LILIANA = PLANESWALKER_TYPES + 4
PLANESWALKER_TYPE_DOMRI = PLANESWALKER_TYPES + 5
PLANESWALKER_TYPE_ELSPETH = PLANESWALKER_TYPES + 6
PLANESWALKER_TYPE_GIDEON = PLANESWALKER_TYPES + 7
PLANESWALKER_TYPE_KARN = PLANESWALKER_TYPES + 8
PLANESWALKER_TYPE_KOTH = PLANESWALKER_TYPES + 9
PLANESWALKER_TYPE_BOLAS = PLANESWALKER_TYPES + 10
PLANESWALKER_TYPE_NISSA = PLANESWALKER_TYPES + 11
PLANESWALKER_TYPE_RAL = PLANESWALKER_TYPES + 12
PLANESWALKER_TYPE_SARKHAN = PLANESWALKER_TYPES + 13
PLANESWALKER_TYPE_SORIN = PLANESWALKER_TYPES + 14
PLANESWALKER_TYPE_TAMIYO = PLANESWALKER_TYPES + 15
PLANESWALKER_TYPE_TEZZERET = PLANESWALKER_TYPES + 16
PLANESWALKER_TYPE_TIBALT = PLANESWALKER_TYPES + 17
PLANESWALKER_TYPE_VENSER = PLANESWALKER_TYPES + 18
PLANESWALKER_TYPE_VRASKA = PLANESWALKER_TYPES + 19
PLANESWALKER_TYPE_ASHIOK = PLANESWALKER_TYPES + 20
PLANESWALKER_TYPE_XENAGOS = PLANESWALKER_TYPES + 21
PLANESWALKER_TYPE_KIORA = PLANESWALKER_TYPES + 22

PLW_NameSet = function(nameset, index)
   local t = {}

   t.PLANESWALKERS = {
   "AJANI_GOLDMANE",
   "AJANI_VENGEANT",
   "AJANI_CALLER_OF_THE_PRIDE",
   "ASHIOK_NIGHTMARE_WEAVER",
   "CHANDRA_ABLAZE",
   "CHANDRA_NALAAR",
   "CHANDRA_PYROMASTER",
   "CHANDRA_THE_FIREBRAND",
   "DOMRI_RADE",
   "ELSPETH_TIREL",
   "ELSPETH_KNIGHTERRANT",
   "ELSPETH_SUNS_CHAMPION",
   "GARRUK_RELENTLESS",
   "GARRUK_THE_VEILCURSED",
   "GARRUK_WILDSPEAKER",
   "GARRUK_CALLER_OF_BEASTS",
   "GARRUK_PRIMAL_HUNTER",
   "GIDEON_JURA",
   "GIDEON_CHAMPION_OF_JUSTICE",
   "JACE_BELEREN",
   "JACE_ARCHITECT_OF_THOUGHT",
   "JACE_MEMORY_ADEPT",
   "JACE_THE_MIND_SCULPTOR",
   "KARN_LIBERATED",
   "KOTH_OF_THE_HAMMER",
   "LILIANA_OF_THE_DARK_REALMS",
   "LILIANA_OF_THE_VEIL",
   "LILIANA_VESS",
   "NICOL_BOLAS_PLANESWALKER",
   "NISSA_REVANE",
   "RAL_ZAREK",
   "SARKHAN_THE_MAD",
   "SARKHAN_VOL",
   "SORIN_MARKOV",
   "SORIN_LORD_OF_INNISTRAD",
   "TAMIYO_THE_MOON_SAGE",
   "TEZZERET_THE_SEEKER",
   "TEZZERET_AGENT_OF_BOLAS",
   "TIBALT_THE_FIENDBLOODED",
   "VENSER_THE_SOJOURNER",
   "VRASKA_THE_UNSEEN",
   "XENAGOS_THE_REVELER",
   "KIORA_THE_CRASHING_WAVE"
   }

   t.TARGET_ENCHANTMENTS_NOT_CREATURES = {
   "ABOLISH",
   "ABSOLVER_THRULL",
   "ACIDIC_SLIME",
   "ALLAY",
   "ALTARS_LIGHT",
   "ANNUL",
   "ARENSONS_AURA",
   "ARGIVIAN_FIND",
   "ARTISANS_SORROW",
   "AURA_BLAST",
   "AURA_EXTRACTION",
   "AURA_FRACTURE",
   "AURA_MUTATION",
   "AURA_OF_SILENCE",
   "AURA_SHARDS",
   "AURAMANCER",
   "AVEN_CLOUDCHASER",
   "BALDUVIAN_SHAMAN",
   "BLIGHTCASTER",
   "BLOOD_OATH",
   "BREAK_ASUNDER",
   "CAPASHEN_UNICORN",
   "CLEAR",
   "CLOUDCHASER_EAGLE",
   "CREEPING_MOLD",
   "CURSEBREAK",
   "DARU_SANCTIFIER",
   "DAWNING_PURIST",
   "DEGLAMER",
   "DEMYSTIFY",
   "DESTRUCTIVE_REVELRY",
   "DEVOUT_CHAPLAIN",
   "DEVOUT_WITNESS",
   "DISEMPOWER",
   "DISENCHANT",
   "DISMANTLING_BLOW",
   "DISPELLERS_CAPSULE",
   "DOWSING_SHAMAN",
   "DRUID_LYRIST",
   "DUERGAR_HEDGEMAGE",
   "ECHOING_CALM",
   "ELF_REPLICA",
   "ELVISH_HEXHUNTER",
   "ELVISH_LYRIST",
   "ERASE",
   "ESPER_CHARM",
   "FADE_INTO_ANTIQUITY",
   "FILIGREE_FRACTURE",
   "FRANTIC_PURIFICATION",
   "GLEEFUL_SABOTAGE",
   "GOLGARI_CHARM",
   "HANNA_SHIPS_NAVIGATOR",
   "HARMONIC_SLIVER",
   "HIDE",
   "HOODWINK",
   "HULL_BREACH",
   "ILLUMINATION",
   "INDRIK_STOMPHOWLER",
   "KAMI_OF_ANCIENT_LAW",
   "KEENING_APPARITION",
   "KITHKIN_SPELLDUSTER",
   "KOR_SANCTIFIERS",
   "KROSAN_GRIP",
   "LEAVE_NO_TRACE",
   "LEONIN_RELICWARDER",
   "MINE_EXCAVATION",
   "MOLDER",
   "MONK_IDEALIST",
   "MONK_REALIST",
   "MYSTIC_MELTING",
   "NANTUKO_CALMER",
   "NANTUKO_VIGILANTE",
   "NATURAL_END",
   "NATURALIZE",
   "NATURES_CLAIM",
   "NIKKOONNA",
   "NULLMAGE_SHEPHERD",
   "ORIMS_THUNDER",
   "PEACE_AND_QUIET",
   "POLIS_CRUSHER",
   "PRIEST_OF_IROAS",
   "QASALI_PRIDEMAGE",
   "QUAGMIRE_DRUID",
   "QUIET_PURITY",
   "RAIN_OF_THORNS",
   "RAY_OF_DISSOLUTION",
   "RAY_OF_DISTORTION",
   "RAY_OF_REVELATION",
   "RELIC_CRUSH",
   "RELIQUARY_MONK",
   "RENDING_VINES",
   "RETURN_TO_DUST",
   "REVOKE_EXISTENCE",
   "RONOM_UNICORN",
   "RUST_SCARAB",
   "SCOUR",
   "SEAL_OF_CLEANSING",
   "SEAL_OF_PRIMORDIUM",
   "SEED_SPARK",
   "SERENE_OFFERING",
   "SERRAS_LITURGY",
   "SHINEWEND",
   "SILVERCHASE_FOX",
   "SKULL_OF_ORM",
   "SLICE_IN_TWAIN",
   "SOLEMN_OFFERING",
   "SOLTARI_VISIONARY",
   "SPRING_CLEANING",
   "STERN_PROCTOR",
   "STOMP_AND_HOWL",
   "SUNDERING_GROWTH",
   "SUNDERING_VITAE",
   "SWAN_SONG",
   "SYLVOK_REPLICA",
   "TATTOO_WARD",
   "TEAR",
   "TEFERIS_CARE",
   "TERASHIS_GRASP",
   "THUNDERSCAPE_BATTLEMAGE",
   "TOLARIAN_EMISSARY",
   "TRAGIC_POET",
   "TREASURY_THRULL",
   "TRYGON_PREDATOR",
   "URGENT_EXORCISM",
   "VIRIDIAN_ZEALOT",
   "WANE",
   "WAR_PRIEST_OF_THUNE",
   "WEAR_AWAY",
   "WICKERBOUGH_ELDER",
   "WILD_SWING",
   "WIPE_CLEAN",
   "WISPMARE"
   }

   t.TARGET_ENCHANTMENTS_AND_CREATURES = {
   "ANGELIC_EDICT",
   "BANISHING_STROKE",
   "BANISHMENT_DECREE",
   "CRIME",
   "ETHERSWORN_ADJUDICATOR",
   "IONAS_JUDGMENT",
   "MORTIFY",
   "PHARIKAS_MENDER",
   "TREVAS_CHARM"
   }

   return t[nameset:upper()][index]
end

PLW_SubTypes = function(index)
   local t = {
   AJANI_GOLDMANE=PLANESWALKER_TYPE_AJANI,
   AJANI_VENGEANT=PLANESWALKER_TYPE_AJANI,
   AJANI_CALLER_OF_THE_PRIDE=PLANESWALKER_TYPE_AJANI,
   ASHIOK_NIGHTMARE_WEAVER=PLANESWALKER_TYPE_ASHIOK,
   CHANDRA_ABLAZE=PLANESWALKER_TYPE_CHANDRA,
   CHANDRA_NALAAR=PLANESWALKER_TYPE_CHANDRA,
   CHANDRA_PYROMASTER=PLANESWALKER_TYPE_CHANDRA,
   CHANDRA_THE_FIREBRAND=PLANESWALKER_TYPE_CHANDRA,
   DOMRI_RADE=PLANESWALKER_TYPE_DOMRI,
   ELSPETH_TIREL=PLANESWALKER_TYPE_ELSPETH,
   ELSPETH_KNIGHTERRANT=PLANESWALKER_TYPE_ELSPETH,
   ELSPETH_SUNS_CHAMPION=PLANESWALKER_TYPE_ELSPETH,
   GARRUK_RELENTLESS=PLANESWALKER_TYPE_GARRUK,
   GARRUK_THE_VEILCURSED=PLANESWALKER_TYPE_GARRUK,
   GARRUK_WILDSPEAKER=PLANESWALKER_TYPE_GARRUK,
   GARRUK_CALLER_OF_BEASTS=PLANESWALKER_TYPE_GARRUK,
   GARRUK_PRIMAL_HUNTER=PLANESWALKER_TYPE_GARRUK,
   GIDEON_JURA=PLANESWALKER_TYPE_GIDEON,
   GIDEON_CHAMPION_OF_JUSTICE=PLANESWALKER_TYPE_GIDEON,
   JACE_BELEREN=PLANESWALKER_TYPE_JACE,
   JACE_ARCHITECT_OF_THOUGHT=PLANESWALKER_TYPE_JACE,
   JACE_MEMORY_ADEPT=PLANESWALKER_TYPE_JACE,
   JACE_THE_MIND_SCULPTOR=PLANESWALKER_TYPE_JACE,
   KARN_LIBERATED=PLANESWALKER_TYPE_KARN,
   KOTH_OF_THE_HAMMER=PLANESWALKER_TYPE_KOTH,
   LILIANA_OF_THE_DARK_REALMS=PLANESWALKER_TYPE_LILIANA,
   LILIANA_OF_THE_VEIL=PLANESWALKER_TYPE_LILIANA,
   LILIANA_VESS=PLANESWALKER_TYPE_LILIANA,
   NICOL_BOLAS_PLANESWALKER=PLANESWALKER_TYPE_BOLAS,
   NISSA_REVANE=PLANESWALKER_TYPE_NISSA,
   RAL_ZAREK=PLANESWALKER_TYPE_RAL,
   SARKHAN_THE_MAD=PLANESWALKER_TYPE_SARKHAN,
   SARKHAN_VOL=PLANESWALKER_TYPE_SARKHAN,
   SORIN_MARKOV=PLANESWALKER_TYPE_SORIN,
   SORIN_LORD_OF_INNISTRAD=PLANESWALKER_TYPE_SORIN,
   TAMIYO_THE_MOON_SAGE=PLANESWALKER_TYPE_TAMIYO,
   TEZZERET_THE_SEEKER=PLANESWALKER_TYPE_TEZZERET,
   TEZZERET_AGENT_OF_BOLAS=PLANESWALKER_TYPE_TEZZERET,
   TIBALT_THE_FIENDBLOODED=PLANESWALKER_TYPE_TIBALT,
   VENSER_THE_SOJOURNER=PLANESWALKER_TYPE_VENSER,
   VRASKA_THE_UNSEEN=PLANESWALKER_TYPE_VRASKA,
   XENAGOS_THE_REVELER=PLANESWALKER_TYPE_XENAGOS,
   KIORA_THE_CRASHING_WAVE=PLANESWALKER_TYPE_KIORA
   }
   return t[index]
end

PLW_IsInNameSet = function(card, nameset)
-- returns true if card's name is in the given nameset
   if card ~= nil and nameset ~= nil then
      local index = 1
      local name = PLW_NameSet(nameset, 1)
      while name ~= nil do
         if card:GetCardName() == name then
            return true
         end
         index = index + 1
         name = PLW_NameSet(nameset, index)
      end
   end
   return false
end

PLW_FilterNameSet = function(filter, nameset, condition)
-- adds the given nameset to the filter (condition=true/1 means to include the names, otherwise the names will be excluded)
   if filter ~= nil and nameset ~= nil then
         local locfilter = filter
         local operator = OP_NOT
         if condition == 1 or condition == true then
            locfilter = filter:AddSubFilter_Or()
            operator = OP_IS
         end
         local index = 1
         local name = PLW_NameSet(nameset, 1)
         while name ~= nil do
            locfilter:Add(FE_CARD_NAME, operator, name)
            index = index + 1
            name = PLW_NameSet(nameset, index)
         end
   end
end

PLW_GetSubType = function(card)
-- returns the Planeswalker sub-type according to the card name
   if card ~= nil then
      local subtype = PLW_SubTypes( card:GetCardName() )
      if subtype ~= nil then
         return subtype
      end
   end
   return -1
end

PLW_CreateUniqueToken = function(filename, cardname, player)
-- Creates a token from filename only if there are no tokens called cardname on the battlefield belonging to player
-- It doesn't make any check about token duplication, so it's better to use this for invisible tokens that need to be created on first turn
   local filter = ClearFilter()
   filter:Add(FE_CARD_NAME, OP_IS, cardname)
   filter:Add(FE_CONTROLLER, OP_IS, player)
   if filter:CountStopAt(1) == 0 then
      MTG():PutTokensOntoBattlefield(filename, 1, player)
   end
end

PLW_SetLastDamager = function(victim, damager)
-- Saves the last damager of the victim using RSN's ObjectDC
   if RSN_GetObjectDC ~= nil then
      RSN_GetObjectDC(victim, true):Set_CardPtr(PLW_LAST_DAMAGER, damager)
   end
end

PLW_GetLastDamager = function(victim)
-- Gets the last damager of the victim using RSN's ObjectDC
   if RSN_GetObjectDC ~= nil then
      local chest = RSN_GetObjectDC(victim, false)
      if chest ~= nil then
         return chest:Get_CardPtr(PLW_LAST_DAMAGER)
      end
   end
   return nil
end

PLW_FilterPermanents = function(filter)
-- filters the 5 permanent types so that cards with no types cannot be chosen
-- (I'm excluding tribal since there are no cards that have that type alone)
   local subFilter = filter:AddSubFilter_Or()
   for type=CARD_TYPE_ARTIFACT,CARD_TYPE_PLANESWALKER do
      if type ~= CARD_TYPE_INSTANT then
         subFilter:Add(FE_TYPE, OP_IS, type)
      end
   end
end

PLW_FilterPermanentsExcept = function(filter, exception)
-- same as function above, but excluding a type
   filter:Add(FE_TYPE, OP_NOT, exception)
   local subFilter = filter:AddSubFilter_Or()
   for type=CARD_TYPE_ARTIFACT,CARD_TYPE_PLANESWALKER do
      if type ~= CARD_TYPE_INSTANT and type ~= exception then
         subFilter:Add(FE_TYPE, OP_IS, type)
      end
   end
end

PLW_FilterNonlandPermanents = function(filter)
-- wrapper for the very common nonland permanents filter
   PLW_FilterPermanentsExcept(filter, CARD_TYPE_LAND)
end

PLW_DisplayManaPool = function(player)
-- displays the mana pool when using RiiakShiNal's mana tokens (credits: sumomole, gorem2k)
   if player:IsAI() == false then
      local count = {}
      local message = ""
      local color_letter = {"X", "W", "U", "B", "R", "G"}
      local mana_cardname = {"TOKEN_MANA_C", "TOKEN_MANA_W", "TOKEN_MANA_U", "TOKEN_MANA_B", "TOKEN_MANA_R", "TOKEN_MANA_G"}
      for i=0,5 do
         local filter = ClearFilter()
         filter:Add( FE_CARD_NAME, OP_IS, mana_cardname[i+1] )
         filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
         filter:Add(FE_IS_TAPPED, false)
         count[i] = filter:Count()
         message = message.."{"..color_letter[i+1].."}"..count[i].."   "
      end
      player:DisplayMessage(" mana pool: \]\n\n\["..message)
   end
end

PLW_UntilMyNextTurn = function(currentTurn)
-- to be used in durations that last "until your next turn"
   if currentTurn ~= nil then
      local controller = EffectController()
      if controller ~= nil then
         return controller:MyTurn() and MTG():GetTurnNumber() > currentTurn
      else
         -- NOTE: This still fails if the effect is issued during another player's turn or if players skip turns or take extra turns.
         -- The solutions are too complicated to be worth using them so I decided to live with the approximation.
         return MTG():GetTurnNumber() >= currentTurn + MTG():GetNumberOfPlayers()
      end
   end
   return true
end

PLW_ShutDownDoublingSeason = function()
-- to be used in costs that add counters, so that Doubling Season doesn't double them
   local filter = ClearFilter()
   filter:Add(FE_CARD_NAME, OP_IS, "DOUBLING_SEASON")
   filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
   local filter_count = filter:EvaluateObjects()
   if filter_count > 0 then
      for i=0,filter_count-1 do
         filter:GetNthEvaluatedObject(i):GetCurrentCharacteristics():LoseAllAbilities()
      end
   end
end
still same result
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby NeoAnderson » 31 Dec 2013, 17:56

Last card coded and new doubts :

I have coded Tetravus, i have used Riiak ObjectDC Functions to implement this card.
It works but i would ask to you some opinions :

1. the card as i coded it is compliant to the follow official rules :

10/4/2004: If the Tetravus is destroyed when the Tetravites are off the card, they are not destroyed, they are just orphaned.
10/4/2004: Any +1/+1 counter which is on this card can be turned into a Tetravite token. It does not care where the +1/+1 counter came from.
10/4/2004: Only Tetravites from this specific Tetravus may be used for the ability. Ones from a different Tetravus can't.
8/1/2008: This card now has two upkeep-triggered abilities. Its controller chooses the order they are put on the stack, and thus the order in which they resolve each upkeep.


About the last rule i have used this idea :
I made an empty trigger ability for the Upkeep, and i have turned the 2 upkeep-triggered abilities of Tetravus into activated ability. These Activated ability can only be played into upkeep and just once per turn. Doing this way we can decide if we want or not to activate them, and we also can enstabilish the order.
Do you think this will be enough compliant to the Mtg rules, or the fact to have changed them from triggered into Activated abilities means a lot?


The token i am using into the follow code is a custom token made by me.

Tetravus | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="TETRAVUS_202590" />
  <CARDNAME text="TETRAVUS" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Tetravus]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Tetravus]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="202590" />
  <ARTID value="202590" />
  <ARTIST name="Mark Tedin" />
  <CASTING_COST cost="{6}" />
  <TYPE metaname="Artifact" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Construct" />
  <EXPANSION value="ME4" />
  <RARITY metaname="R" />
  <POWER value="1" />
  <TOUGHNESS value="1" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
  </STATIC_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Tetravus entra nel campo di battaglia con tre segnalini +1/+1.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Tetravus enters the battlefield with three +1/+1 counters on it.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
   <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 3)
    end
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, puoi rimuovere un qualsiasi numero di segnalini +1/+1 dal Tetravus. Se lo fai, metti sul campo di battaglia altrettante

pedine creatura artefatto Tetravite 1/1 incolori. Ognuna di esse ha volare e “Questa creatura non può essere incantata.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, you may remove any number of +1/+1 counters from Tetravus. If you do, put that many 1/1 colorless Tetravite artifact

creature tokens onto the battlefield. They each have flying and “This creature can’t be enchanted.”]]></LOCALISED_TEXT>
 <COST mana_cost="{0}" type="Mana" />
 <AVAILABILITY per_turn_limit="1" />
 <AVAILABILITY upkeep="1">
      return EffectController():MyTurn() and ( Object():CountCounters(MTG():PlusOnePlusOneCounters()) &gt; 0 )
 </AVAILABILITY>

      <PLAY_TIME_ACTION>
      local Player = EffectController()
                local counters = EffectSource():CountCounters(MTG():PlusOnePlusOneCounters())
      if (Player ~= nil) then
             Player:BeginNewNumericalChoice()
             Player:AddNumericalChoiceAnswer(counters)
             Player:AskNumericalChoiceQuestion( "CARD_QUERY_TETRAVUS" )
      end
      </PLAY_TIME_ACTION>
                <RESOLUTION_TIME_ACTION>
      local Player = EffectController()
       local CountersToRemove = Player:GetNumericalChoiceResult()
                EffectSource():RemoveCounters( MTG():PlusOnePlusOneCounters(), CountersToRemove)
                MTG():PutTokensOntoBattlefield( "TOKEN_TETRAVITE_1_1_C_F_202590001", CountersToRemove, EffectController(), EffectDC():Make_Chest(0) )
      </RESOLUTION_TIME_ACTION>

  <RESOLUTION_TIME_ACTION>
   local target_player = EffectController()
      local tokenDC = EffectDC():Get_Chest(0)
      local Chest_id = Object():GetRef()
      local count_so_far = 0
        local chest =  RSN_GetObjectDC( Object(), false )
         if chest == nil then
            chest = RSN_ObjectDC()
         end
       for i=0,tokenDC:Count()-1 do
          local target_card = tokenDC:Get_CardPtr(i)
              if target_card ~= nil  then
                         count_so_far = chest:Get_Int(0)
             chest:Set_CardPtr(1 + count_so_far, target_card)
             chest:Protect_CardPtr(1 + count_so_far)
             chest:Set_Int(0, count_so_far + 1)
               end
         end
    </RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>

  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, puoi esiliare un qualsiasi numero di pedine messe sul campo di battaglia con il Tetravus. Se lo fai, metti altrettanti

segnalini +1/+1 sul Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, you may exile any number of tokens put onto the battlefield with Tetravus. If you do, put that many +1/+1 counters on

Tetravus.]]></LOCALISED_TEXT>
    <COST mana_cost="{0}" type="Mana" />
    <AVAILABILITY per_turn_limit="1" />
    <AVAILABILITY upkeep="1">
      return EffectController():MyTurn()
    </AVAILABILITY>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_DESTROY" definition="0" compartment="0" up_to="1" >
    local Chest_id = Object():GetRef()
    local chest = RSN_GetObjectDC( Object(), false )
    if chest ~= nil then
       local number = chest:Get_Int(0)
       if number ~= nil then
       MTG():SetTargetCount(number)
       end
    end
    </TARGET>

  <TARGET_DEFINITION id="0">
    MTG():ClearFilterMark()
    local filter = ClearFilter()
    local Chest_id = Object():GetRef()
    local chest = RSN_GetObjectDC( Object(), false )
    if chest ~= nil then
    local count_so_far = chest:Get_Int(0)
       for i = 1, (count_so_far) do
        local target = chest:Get_CardPtr(i)
       if target ~= nil then
         target:MarkForFilter()
        end
      end
    filter:SetMarkedObjectsOnly()
    end
    </TARGET_DEFINITION>

<RESOLUTION_TIME_ACTION>
 local ChestA = EffectDC():Make_Chest(4)
 local chest = RSN_GetObjectDC( Object(), false )
 if chest ~= nil then
    local count_so_far = chest:Get_Int(0)
    local secondCount = 0
    for i = 1, (count_so_far) do
        local target = chest:Get_CardPtr(i)
        if target ~= nil then
            local value = 0
            local Targets = EffectDC():Get_Targets(0):Count()
            if Targets &gt; 0 then
               for j = 0,(Targets - 1) do
                  local target_card = EffectDC():Get_Targets(0):Get_CardPtr(j)
                  if target_card == target  then
                     value = 1
                  end
               end
               if value == 0 then
                  secondCount = secondCount + 1
                  ChestA:Set_CardPtr(secondCount, target)
               end
           end
        end 
    end
    ChestA:Set_Int(0, secondCount)
 end     
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
 local ChestA = EffectDC():Get_Chest(4)
 local chest = RSN_GetObjectDC( Object(), false )
 if ChestA ~= nil then
    local count_so_far = ChestA:Get_Int(0)
    local secondCount = 0
    for i = 1, (count_so_far) do
        local target = ChestA:Get_CardPtr(i)
        if target ~= nil then
               secondCount = secondCount + 1
               chest:Set_CardPtr(secondCount, target)
        end 
    end
    chest:Set_Int(0, secondCount)
 end     
</RESOLUTION_TIME_ACTION>

<RESOLUTION_TIME_ACTION>
 local Targets = EffectDC():Get_Targets(0):Count()
      if Targets &gt; 0 then
         for i = 0,(Targets - 1) do
          local target_card = EffectDC():Get_Targets(0):Get_CardPtr(i)
              if target_card ~= nil  then
         target_card:Exile()
                        EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 1)
               end
         end
      end
</RESOLUTION_TIME_ACTION>

</ACTIVATED_ABILITY>

<TRIGGERED_ABILITY>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
      return  (MTG():GetStep() == STEP_UPKEEP)
    </TRIGGER>
<RESOLUTION_TIME_ACTION>
  local j = 0
  for i = 0, 1000 do
        j = j + 1
    end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>

<TRIGGERED_ABILITY>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
      return  (MTG():GetStep() == STEP_UPKEEP)
    </TRIGGER>
<RESOLUTION_TIME_ACTION>
  local j = 0
  for i = 0, 1000 do
        j = j + 1
    end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>

<TOKEN_REGISTRATION reservation="1" type="TOKEN_TETRAVITE_1_1_C_F_202590001" />
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
TETRAVITE TOKEN | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
   <FILENAME text="TOKEN_TETRAVITE_1_1_C_F_202590001" />
   <CARDNAME text="TOKEN_TETRAVITE_1_1_C_F" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[TETRAVITE]]></LOCALISED_TEXT>
   </TITLE>
   <MULTIVERSEID value="202590001" />
   <ARTID value="202590001" />
   <ARTIST name="BaxaArt" />
   <CASTING_COST cost="" />
   <TYPE metaname="Artifact" />
   <TYPE metaname="Creature" />
   <SUB_TYPE metaname="Tetravite" />
   <EXPANSION value="AQ" />
   <RARITY metaname="T" />
   <POWER value="1" />
   <TOUGHNESS value="1" />
   <TOKEN />
   <STATIC_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
      <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
   </STATIC_ABILITY>
   <SFX text="COMBAT_CHOP_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
   <SFX text="COMBAT_CHOP_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby MC Brodie » 31 Dec 2013, 18:37

It would matter for cards like Strionic Resonator or Illusionist's Bracers but those are not possible in DotP yet. The only other problem I can think of is the classic Burning Tree Shaman issue for things that aren't real activated abilities.

You might be able to do it using triggered abilities. If you put the same upkeep trigger twice in a triggered ability will two triggers go off in the upkeep? If it does you could have the triggered ability ask a multiple choice question on which option to resolve first. Then have the RTAs for both options in the same triggered ability. I don't know if I'm explaining myself very well...
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: Formal Request Thread

Postby NeoAnderson » 31 Dec 2013, 19:40

MC Brodie wrote:It would matter for cards like Strionic Resonator or Illusionist's Bracers but those are not possible in DotP yet. The only other problem I can think of is the classic Burning Tree Shaman issue for things that aren't real activated abilities.

You might be able to do it using triggered abilities. If you put the same upkeep trigger twice in a triggered ability will two triggers go off in the upkeep? If it does you could have the triggered ability ask a multiple choice question on which option to resolve first. Then have the RTAs for both options in the same triggered ability. I don't know if I'm explaining myself very well...
I understand your meaning my friend,
I already know i can turn them into triggered ability and add a multiple choice to select wich one to fire first, but in that case you will have to answer each time what you want to do.
And if combine the 2 abilities into one trigger will override the MTG rules, because as this card is ruled the abilities must trigger separately.
But with my solution the main empty trigger fire, and only if you want you can activate the one, both or nothing.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby RiiakShiNal » 31 Dec 2013, 21:10

NeoAnderson wrote:I think we could find a walk around, but i have to ask something to understand if it could be done.
When a card make a copy, does it changes also is CardRef? If the card ref remains unchanged probably we could make something.
I try to exaplain, supposing that the copy card card ref is fixed, we could do :
1. Add a primal clay ability who retrieve a datachest indexed with copying card ref number, when primal clay become target of a spell or ability. Set into this chest the choosen values.
2. Another ability who set the Primal clay to the stored value if the datachest is not nil.
3. Clear the datachest when the ability resolves or at end of that step.
The CardRefs of both the original card and the card becoming the copy should technically remain unchanged (the card doing the copying simply changed state it did not become a new instance). This method might work using the DuelDataChest() (or my ObjectDC functions) though it is definitely a crap shoot method of doing it as you would have to create a data chest for every card that targets Primal Clay even if it is not doing any copying. It would add quite a bit of overhead (especially when making sure there are no collisions) so it may impact game performance.

NeoAnderson wrote:Theoretically I agree with you for this reason i have exposed this issue, i only would be sure that this should be the behaviour to be compliant with official rules.
If it is sure i think will be not so complicated to add a check to understand if this kind of cards have to add, remove or do nothing when they come back onto battlefield.
For a definitive official compliant answer we would need a DCI judge. Since I don't happen to have one on speed dial and I assume you don't either (hence why you posted in the forum) we should go with our best guess.

My best guess would be that Oubliette and Tawnos's Coffin would manage the counters it needs to put back on the Clockwork Avian first then Clockwork Avian's ZONECHANGE_TRANSITION trigger should fire (in the middle of Oubliette and/or Tawnos's Coffin resolving) and bring the total counters it enters with to 4 (adding or removing as necessary). Finally Oubliette and/or Tawnos's Coffin would put back in the auras attached to the creature.

NeoAnderson wrote:Last card coded and new doubts :

I have coded Tetravus, i have used Riiak ObjectDC Functions to implement this card.
It works but i would ask to you some opinions :

1. the card as i coded it is compliant to the follow official rules :

10/4/2004: If the Tetravus is destroyed when the Tetravites are off the card, they are not destroyed, they are just orphaned.
10/4/2004: Any +1/+1 counter which is on this card can be turned into a Tetravite token. It does not care where the +1/+1 counter came from.
10/4/2004: Only Tetravites from this specific Tetravus may be used for the ability. Ones from a different Tetravus can't.
8/1/2008: This card now has two upkeep-triggered abilities. Its controller chooses the order they are put on the stack, and thus the order in which they resolve each upkeep.


About the last rule i have used this idea :
I made an empty trigger ability for the Upkeep, and i have turned the 2 upkeep-triggered abilities of Tetravus into activated ability. These Activated ability can only be played into upkeep and just once per turn. Doing this way we can decide if we want or not to activate them, and we also can enstabilish the order.
Do you think this will be enough compliant to the Mtg rules, or the fact to have changed them from triggered into Activated abilities means a lot?
This change does have some implications the worst of which (which can actually be coded) would be abilities like Burning-Tree Shaman (granted this one can be worked around by having the activated abilities claim they are mana abilities using my manual mana functions, though you would obviously leave off the forced_skip because it really isn't a mana ability). Another issue would be with cards that prevent the activation of activated abilities (Linvala, Keeper of Silence, etc...) and this could be worked around by having the card detect if it is being affected in that way and switch back to using real triggered abilities which are unaffected. Also to make sure they can't activate the abilities more than once in the upkeep you would need to make sure they each have a per turn limit set as with activated abilities without that you could activate them more than once which would definitely not be rule compliant.

Overall, this simply makes the card considerably more complex for something that could be considered relatively minor (ordering of which triggered ability to use first). Personally I would stick with keeping them as triggered abilities because it would make coding the card easier, but if you want to go for the more complex route feel free.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby MC Brodie » 31 Dec 2013, 22:51

NeoAnderson wrote:I understand your meaning my friend,
I already know i can turn them into triggered ability and add a multiple choice to select wich one to fire first, but in that case you will have to answer each time what you want to do.
And if combine the 2 abilities into one trigger will override the MTG rules, because as this card is ruled the abilities must trigger separately.
But with my solution the main empty trigger fire, and only if you want you can activate the one, both or nothing.
Ok, if they must be in their own triggered abilities, how about doing it with 4 triggered abilities and 1 static ability? :lol:
- Triggered ability
  • Trigger on controller PHASE_BEGINNING
  • If Tetravus has no counters set LinkedDC to 1
  • elseif there are no Tetravites tokens set LinkedDC to 2
  • else ask a multiple choice question on which trigger should go on the stack first
  • Save MC answer to a LinkedDC

- Triggered ability (Priority 0)
  • Trigger on controller STEP_UPKEEP
  • Resolution Time Actions for moving counter off Tetravus

- Triggered ability (Priority High, resource id 1)
  • Trigger on controller STEP_UPKEEP
  • Resolution Time Actions for exiling Tetravites

- Triggered ability (Priority Low, resource id 2)
  • Trigger on controller STEP_UPKEEP
  • Resolution Time Actions for exiling Tetravites

- Static ability
  • Grants ability 1 or 2 depending on LinkedDC


I'm sure there will be some issues. If anything, I'm sure I'm amusing to the people that actually know what they are doing :D. As far as an engine always asking you to stack triggers even if it is pointless, I don't know if there is an easy way around that. Try playing a game with multiple copies of Essence of the Wild on the battlefield on an engine that allows for trigger stacking. It is the same trigger for each copy but you still have to stack them :) .

Also Happy New Years Neo. Even if you are about 6 hours early :wink: .
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: Formal Request Thread

Postby NeoAnderson » 01 Jan 2014, 00:20

RiiakShiNal wrote:The CardRefs of both the original card and the card becoming the copy should technically remain unchanged (the card doing the copying simply changed state it did not become a new instance). This method might work using the DuelDataChest() (or my ObjectDC functions) though it is definitely a crap shoot method of doing it as you would have to create a data chest for every card that targets Primal Clay even if it is not doing any copying. It would add quite a bit of overhead (especially when making sure there are no collisions) so it may impact game performance.
This should not happen, because the main Primal Clay create the first Datachest when is targetted, the other DataChest will be created only inside the card eventually copy it. Cards who will target it for other reason will not create other datachests.
RiiakShiNal wrote:For a definitive official compliant answer we would need a DCI judge. Since I don't happen to have one on speed dial and I assume you don't either (hence why you posted in the forum) we should go with our best guess.

My best guess would be that Oubliette and Tawnos's Coffin would manage the counters it needs to put back on the Clockwork Avian first then Clockwork Avian's ZONECHANGE_TRANSITION trigger should fire (in the middle of Oubliette and/or Tawnos's Coffin resolving) and bring the total counters it enters with to 4 (adding or removing as necessary). Finally Oubliette and/or Tawnos's Coffin would put back in the auras attached to the creature.
I agree with your reasoning and i will make some tests to
understand how to modify the cards, also if i believe that Oubliette and Tawnos's Coffin are coded right, the one to change is Clockwork Avian.
RiiakShiNal wrote:This change does have some implications the worst of which (which can actually be coded) would be abilities like Burning-Tree Shaman (granted this one can be worked around by having the activated abilities claim they are mana abilities using my manual mana functions, though you would obviously leave off the forced_skip because it really isn't a mana ability). Another issue would be with cards that prevent the activation of activated abilities (Linvala, Keeper of Silence, etc...) and this could be worked around by having the card detect if it is being affected in that way and switch back to using real triggered abilities which are unaffected. Also to make sure they can't activate the abilities more than once in the upkeep you would need to make sure they each have a per turn limit set as with activated abilities without that you could activate them more than once which would definitely not be rule compliant.

Overall, this simply makes the card considerably more complex for something that could be considered relatively minor (ordering of which triggered ability to use first). Personally I would stick with keeping them as triggered abilities because it would make coding the card easier, but if you want to go for the more complex route feel free.
I was already thinking about these kind of conflicts, honestly i was only thinking to find a solution to make the usability of these kind cards who trigger into upkeep more easy to manage. About the Upkeep limit if you have looked the code it was already implemented. About the card who inhibit the possibility to use Activable abilities, i was thinking to a walkaround, but i don't know if it works, what happens if into the Availability Block i check the CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES and always retun true, also when this value is enabled?
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby NeoAnderson » 01 Jan 2014, 00:34

MC Brodie wrote:
NeoAnderson wrote:I understand your meaning my friend,
I already know i can turn them into triggered ability and add a multiple choice to select wich one to fire first, but in that case you will have to answer each time what you want to do.
And if combine the 2 abilities into one trigger will override the MTG rules, because as this card is ruled the abilities must trigger separately.
But with my solution the main empty trigger fire, and only if you want you can activate the one, both or nothing.
Ok, if they must be in their own triggered abilities, how about doing it with 4 triggered abilities and 1 static ability? :lol:
- Triggered ability
  • Trigger on controller PHASE_BEGINNING
  • If Tetravus has no counters set LinkedDC to 1
  • elseif there are no Tetravites tokens set LinkedDC to 2
  • else ask a multiple choice question on which trigger should go on the stack first
  • Save MC answer to a LinkedDC

- Triggered ability (Priority 0)
  • Trigger on controller STEP_UPKEEP
  • Resolution Time Actions for moving counter off Tetravus

- Triggered ability (Priority High, resource id 1)
  • Trigger on controller STEP_UPKEEP
  • Resolution Time Actions for exiling Tetravites

- Triggered ability (Priority Low, resource id 2)
  • Trigger on controller STEP_UPKEEP
  • Resolution Time Actions for exiling Tetravites

- Static ability
  • Grants ability 1 or 2 depending on LinkedDC


I'm sure there will be some issues. If anything, I'm sure I'm amusing to the people that actually know what they are doing :D. As far as an engine always asking you to stack triggers even if it is pointless, I don't know if there is an easy way around that. Try playing a game with multiple copies of Essence of the Wild on the battlefield on an engine that allows for trigger stacking. It is the same trigger for each copy but you still have to stack them :) .

Also Happy New Years Neo. Even if you are about 6 hours early :wink: .
Honestly i am not sure to have completely followed your reasoning, anyway i think we don't need to use grant ability.
Just make the first trigger with a multiple choice and set LinkedDC Value to 1 or 2.
The first ability Trigger should play when the LinkedDC is 1 or 3 so the second when is 2 or 4. With a clean up fire once block.
When the first ability trigger it set the LinkedDC to 4.
When the second ability trigger it set the LinkedDC to 3.
Some example.
a. Player make the choice choose sequence 1/2
b. The linkedDC is set to 1
c. The first ability fire and set the LinkedDC to 4 because the starting value was 1.
d. The second ability fire and set the LinkedDC to 0 because the starting value was 4.

Example B :
a. Player make the choice choose sequence 2/1
b. The linkedDC is set to 2
c. The second ability fire and set the LinkedDC to 3 because the starting value was 2.
d. The first ability fire and after resolve set the linkedDC to 0 because the starting value was 3.

Thi should work.

About the greatings, you're right but i was not sure about the time zone of other users :-)
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby drleg3nd » 01 Jan 2014, 01:25

i am looking through other planeswalkers trying to figure out my issues and looking a Elspeth, Sun's Champion and Sorin i noticed a filter was in place for there emblem ability that i dont have in my last ability for Kiora ..is that a possibility why i'm having trouble with this card ? here's the aforementioned code :
Filter | Open
Code: Select all
<FILTER filter_id="0" reevaluates="1">
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby RiiakShiNal » 01 Jan 2014, 02:51

NeoAnderson wrote:This should not happen, because the main Primal Clay create the first Datachest when is targetted, the other DataChest will be created only inside the card eventually copy it. Cards who will target it for other reason will not create other datachests.
I think there is some misunderstanding here. Having Primal Clay create a data chest for itself is pointless there is no way for a copy of Primal Clay to get that chest. Also as far as I know there is no way to determine why a card has been targeted only that it has been targeted. As such to get the copy to have the same choice as the original the original would have to set the value on the copy before the "copy" actually becomes a copy and the only way to do this is to set the value on all cards that target the original (because we have no way of knowing whether it was targeted for a copy or for something else). Due to this it may impact game performance.

NeoAnderson wrote:I was already thinking about these kind of conflicts, honestly i was only thinking to find a solution to make the usability of these kind cards who trigger into upkeep more easy to manage. About the Upkeep limit if you have looked the code it was already implemented. About the card who inhibit the possibility to use Activable abilities, i was thinking to a walkaround, but i don't know if it works, what happens if into the Availability Block i check the CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES and always retun true, also when this value is enabled?
Actually, I didn't look at your code, I was merely thinking of problems that would be encountered.

Trying to override the can't activate non-mana abilities won't work because the availability won't be checked if activated abilities can't be used due to a characteristic. Also CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES is not the only characteristic that can prevent activated abilities from being used. For an example of how to get around activated abilities can't be used sometimes look at my RSN_CheckSwitchToFallback() function.

RSN_CheckSwitchToFallback | Open
Code: Select all
RSN_CheckSwitchToFallback = function( oCard )
   local bUseFallback = false
   if (oCard ~= nil) then
      if (oCard:GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES )) then
         bUseFallback = true
      else
         local oPlayer = oCard:GetController()
         if (oPlayer ~= nil) then
            if (oPlayer:GetCurrentCharacteristics():Bool_Get( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES )) then
               bUseFallback = true
            elseif (oPlayer:GetCurrentCharacteristics():Bool_Get( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_ARTIFACT_CREATURE_ENCHANTMENT_ABILITIES )) then
               if ((oCard:GetCardType():Test( CARD_TYPE_ARTIFACT )) or
                  (oCard:GetCardType():Test( CARD_TYPE_CREATURE )) or
                  (oCard:GetCardType():Test( CARD_TYPE_ENCHANTMENT ))) then
                  bUseFallback = true
               end
            end
         end
      end
   end
   return bUseFallback
end
As you can see there is quite a bit that has to be checked and you still have to code the static ability that will reference the function to check to see if the fallback need to be used and code the fallback abilities.

NeoAnderson wrote:Honestly i am not sure to have completely followed your reasoning, anyway i think we don't need to use grant ability.
Just make the first trigger with a multiple choice and set LinkedDC Value to 1 or 2.
The first ability Trigger should play when the LinkedDC is 1 or 3 so the second when is 2 or 4. With a clean up fire once block.
When the first ability trigger it set the LinkedDC to 4.
When the second ability trigger it set the LinkedDC to 3.
Some example.
a. Player make the choice choose sequence 1/2
b. The linkedDC is set to 1
c. The first ability fire and set the LinkedDC to 4 because the starting value was 1.
d. The second ability fire and set the LinkedDC to 0 because the starting value was 4.

Example B :
a. Player make the choice choose sequence 2/1
b. The linkedDC is set to 2
c. The second ability fire and set the LinkedDC to 3 because the starting value was 2.
d. The first ability fire and after resolve set the linkedDC to 0 because the starting value was 3.

Thi should work.

About the greatings, you're right but i was not sure about the time zone of other users :-)
Actually, you can simulate choosing the stack ordering with just 2 triggered abilities without GrantAbility() or CreateDelayedTrigger() (so no need for CLEANUPs).

  1. TRIGGERED_ABILITY (upkeep, goes on stack 1st)
    • PLAY_TIME_ACTION Check conditions to see if there is any point to asking the user about ordering (for example you would not want to resolve moving Tetravites on Tetravus first if no valid Tetravites exist yet).
    • PLAY_TIME_ACTION Ask user which effect they want to resolve first if necessary.
    • PLAY_TIME_ACTION Set LinkedDC() value indicating which effect should resolve first.
    • RESOLUTION_TIME_ACTION If should move counters off 2nd then do that otherwise nothing.
    • RESOLUTION_TIME_ACTION If should move Tetravites on 2nd then do that otherwise nothing.
  2. TRIGGERED_ABILITY (upkeep, goes on stack 2nd)
    • RESOLUTION_TIME_ACTION If should move counters off 1st then do that otherwise nothing.
    • RESOLUTION_TIME_ACTION If should move Tetravites on 1st then do that otherwise nothing.

Granted to properly code in the "May" clauses you may want to move the PLAY_TIME_ACTIONs to a 3rd TRIGGERED_ABILITY (which would go onto the stack first, or last if you change them to RESOLUTION_TIME_ACTIONs) so you can simply put the <MAY> tag in the two TRIGGERED_ABILITYs that actually do something.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby NeoAnderson » 01 Jan 2014, 03:56

RiiakShiNal wrote:I think there is some misunderstanding here. Having Primal Clay create a data chest for itself is pointless there is no way for a copy of Primal Clay to get that chest. Also as far as I know there is no way to determine why a card has been targeted only that it has been targeted. As such to get the copy to have the same choice as the original the original would have to set the value on the copy before the "copy" actually becomes a copy and the only way to do this is to set the value on all cards that target the original (because we have no way of knowing whether it was targeted for a copy or for something else). Due to this it may impact game performance.
I understand what you said. Do you think this will occurs also if we delete that temporary chest at end of the step?
RiiakShiNal wrote:Actually, I didn't look at your code, I was merely thinking of problems that would be encountered.
Trying to override the can't activate non-mana abilities won't work because the availability won't be checked if activated abilities can't be used due to a characteristic. Also CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES is not the only characteristic that can prevent activated abilities from being used. For an example of how to get around activated abilities can't be used sometimes look at my RSN_CheckSwitchToFallback() function.

RSN_CheckSwitchToFallback | Open
Code: Select all
RSN_CheckSwitchToFallback = function( oCard )
   local bUseFallback = false
   if (oCard ~= nil) then
      if (oCard:GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES )) then
         bUseFallback = true
      else
         local oPlayer = oCard:GetController()
         if (oPlayer ~= nil) then
            if (oPlayer:GetCurrentCharacteristics():Bool_Get( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES )) then
               bUseFallback = true
            elseif (oPlayer:GetCurrentCharacteristics():Bool_Get( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_ARTIFACT_CREATURE_ENCHANTMENT_ABILITIES )) then
               if ((oCard:GetCardType():Test( CARD_TYPE_ARTIFACT )) or
                  (oCard:GetCardType():Test( CARD_TYPE_CREATURE )) or
                  (oCard:GetCardType():Test( CARD_TYPE_ENCHANTMENT ))) then
                  bUseFallback = true
               end
            end
         end
      end
   end
   return bUseFallback
end
As you can see there is quite a bit that has to be checked and you still have to code the static ability that will reference the function to check to see if the fallback need to be used and code the fallback abilities.
I know your function and i understand this will make the card coding complex. I was looking about the avaible TRIGGERS and i found this one CONSIDERED_FOR_ACTIVATION, and if we temporary disable (into a resolution time block) the CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES when the card considered for activation is the object? Something similar used to reduce the casting cost of a card.
RiiakShiNal wrote:Actually, you can simulate choosing the stack ordering with just 2 triggered abilities without GrantAbility() or CreateDelayedTrigger() (so no need for CLEANUPs).

  1. TRIGGERED_ABILITY (upkeep, goes on stack 1st)
    • PLAY_TIME_ACTION Check conditions to see if there is any point to asking the user about ordering (for example you would not want to resolve moving Tetravites on Tetravus first if no valid Tetravites exist yet).
    • PLAY_TIME_ACTION Ask user which effect they want to resolve first if necessary.
    • PLAY_TIME_ACTION Set LinkedDC() value indicating which effect should resolve first.
    • RESOLUTION_TIME_ACTION If should move counters off 2nd then do that otherwise nothing.
    • RESOLUTION_TIME_ACTION If should move Tetravites on 2nd then do that otherwise nothing.
  2. TRIGGERED_ABILITY (upkeep, goes on stack 2nd)
    • RESOLUTION_TIME_ACTION If should move counters off 1st then do that otherwise nothing.
    • RESOLUTION_TIME_ACTION If should move Tetravites on 1st then do that otherwise nothing.

Granted to properly code in the "May" clauses you may want to move the PLAY_TIME_ACTIONs to a 3rd TRIGGERED_ABILITY (which would go onto the stack first, or last if you change them to RESOLUTION_TIME_ACTIONs) so you can simply put the <MAY> tag in the two TRIGGERED_ABILITYs that actually do something.
If i correctly understand in this way i have to make one trigger able to do both actions, then i have to duplicate it into 2 different triggers, just checking inverse value into LinkedDC.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby RiiakShiNal » 01 Jan 2014, 04:29

NeoAnderson wrote:I understand what you said. Do you think this will occurs also if we delete that temporary chest at end of the step?
Yes, in fact that could cause additional computational overhead depending on how it is processed.

NeoAnderson wrote:I know your function and i understand this will make the card coding complex. I was looking about the avaible TRIGGERS and i found this one CONSIDERED_FOR_ACTIVATION, and if we temporary disable (into a resolution time block) the CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES when the card considered for activation is the object? Something similar used to reduce the casting cost of a card.
Again, CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES is not the only characteristic you have to worry about and handle which is why I don't use a single simple if statement to check whether I need to use a fallback. Additionally, if the card has the characteristic then how can one of its abilities be "CONSIDERED_FOR_ACTIVATION" (you can't even try to activate what isn't allowed)?

NeoAnderson wrote:If i correctly understand in this way i have to make one trigger able to do both actions, then i have to duplicate it into 2 different triggers, just checking inverse value into LinkedDC.
Yeah, that is about the gist of it.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 5 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 5 guests

Login Form