It is currently 19 Jul 2025, 10:44
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby RiiakShiNal » 30 Dec 2013, 03:11

NeoAnderson wrote:I have another silly question.
When we have a card with an Activable ability available only during the upkeep, how can we activate it if the game autoskip the upkeep step?
I mean if we don't have any trigger this step will not give us possibility to interact.
To avoid this problem i am using an empty trigger for these kind of cards, so while the card is triggering we can activate the ability, but i would know if there is something i am missing, because this is a way to walk around the problem, but probably i am missing something more clean and simple, like some to change into game settings?
The best solution is to have any card that has an upkeep activated ability put into play a common upkeep time manager if and only if one does not already exist and have the upkeep time manager's triggered ability trigger during the upkeep. That way regardless of how many cards that have activated abilities that can only be used during upkeep you only get one trigger rather than X triggers. For example you have 7 cards with upkeep only activated abilities you only really need 1 window rather than 7 windows with which to activate them.

NeoAnderson wrote:Probably just 2 with some compromises (Metamorphosis as i discussed with Riiak) and (Nafs Asp if we decide how the player affected can pay anytime to prevent the damage)
Metamorphosis should be able to be coded once I can find some time to finish up the work to my Manual Mana functions so that some mana conditions can be coded.

With Nafs Asp, we can't code a 100% compliant solution for the pay {1} before that player's next draw step. It can be approximated either by including an activated ability that the player would be able to activate or through a set of triggered abilities that ask whether the player wants to pay the {1} at specific times. With the activated ability you would have to manage the storage so that even if Nafs Asp leaves play its activated ability could still be activated, but this poses a problem if Nafs Asp is returned to hand, library, or exiled as then the player would not be able to access the ability. If you use the set of triggered abilities then you would have to manage the storage such that each of the triggered abilities would only trigger if it hasn't already been paid and only if the player could pay it, though it wouldn't be able to cover every situation such as paying it mid step between other plays. So this card is going to be a royal pain to even approximate and still won't technically be correct.

NeoAnderson wrote:I also have a question :
Now i am coding Antiquities Set, the card Primal Clay, the normal ability of this card is easy to code but i have a doubt about these additional Rules :
7/1/2012: If another permanent enters the battlefield as a copy of Primal Clay, the controller of that permanent will get to make a new choice. The copy won't necessarily have the same power, toughness, and abilities as the original.
7/1/2012: If a creature that's already on the battlefield becomes a copy of Primal Clay, it copies the power, toughness, and abilities that were chosen for Primal Clay when it entered the battlefield.


Honestly i can't figure a way to retrieve information when a spell is copying the card.
I could check when it BECAME_TARGET_OF_SPELL or ABILITY but not when its values are copied.
There is no way to properly code this without changing several cards. The first of the two rulings should be simple as it would simply use the same ZONECHANGE_TRANSITION trigger. The second ruling, however, can't be coded properly without re-coding every card that can copy cards while on the battlefield to specifically check for Primal Clay and applying that specific ruling inside their effect. It is generally bad form to include specific workarounds for one card in another card (though I did do this for manual mana abilities and Burning-Tree Shaman).
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby NeoAnderson » 30 Dec 2013, 03:52

RiiakShiNal wrote:The best solution is to have any card that has an upkeep activated ability put into play a common upkeep time manager if and only if one does not already exist and have the upkeep time manager's triggered ability trigger during the upkeep. That way regardless of how many cards that have activated abilities that can only be used during upkeep you only get one trigger rather than X triggers. For example you have 7 cards with upkeep only activated abilities you only really need 1 window rather than 7 windows with which to activate them.
For this could be useful to use a PlayerDataChest, check for a value to activate the trigger. Example : First card who needs to trigger check the Chest(8000) int(10), if is 0 then set it to 1 and trigger.
Other card will use this trigger also and they skip their trigger because the value is 1, at beginning of the next step reset it to 0. So the most important thing is to define fixed values for it.
RiiakShiNal wrote:Metamorphosis should be able to be coded once I can find some time to finish up the work to my Manual Mana functions so that some mana conditions can be coded.
Yeah i remember our discussion last time and i know what you mean for this reason i haven't coded it, too much work only for this card.
RiiakShiNal wrote:With Nafs Asp, we can't code a 100% compliant solution for the pay {1} before that player's next draw step. It can be approximated either by including an activated ability that the player would be able to activate or through a set of triggered abilities that ask whether the player wants to pay the {1} at specific times. With the activated ability you would have to manage the storage so that even if Nafs Asp leaves play its activated ability could still be activated, but this poses a problem if Nafs Asp is returned to hand, library, or exiled as then the player would not be able to access the ability. If you use the set of triggered abilities then you would have to manage the storage such that each of the triggered abilities would only trigger if it hasn't already been paid and only if the player could pay it, though it wouldn't be able to cover every situation such as paying it mid step between other plays. So this card is going to be a royal pain to even approximate and still won't technically be correct.
These are all solutions i also thought, but in any case they don't replay the exact meaning of the card. You could also consider to put a token on battlefield just to pay or deal the damage with auto expiring time.

RiiakShiNal wrote:There is no way to properly code this without changing several cards. The first of the two rulings should be simple as it would simply use the same ZONECHANGE_TRANSITION trigger. The second ruling, however, can't be coded properly without re-coding every card that can copy cards while on the battlefield to specifically check for Primal Clay and applying that specific ruling inside their effect. It is generally bad form to include specific workarounds for one card in another card (though I did do this for manual mana abilities and Burning-Tree Shaman).
Yeah i was supposing that, but this can't be a right approach to code a card. Anytime comes out a problem we cannot recode hundreds of cards just for this.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby thefiremind » 30 Dec 2013, 09:36

Maybe I'm forgetting something, but I really can't see where's the problem with Primal Clay... if something enters the battlefield copying Primal Clay, it will have a re-firing of the ZONECHANGE_TRANSITION triggers and this will make it ask for the choice; if something is already on the battlefield, it won't have the re-firing (unless the copying card was wrongly coded).
< 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 drleg3nd » 30 Dec 2013, 10:50

hey TFM having some trouble here with kiora, I changed her name but now im getting crashes..i don't have access to PLW_TEXT because I don't have Microsoft office on this computer so I don't know if that is causing me problems but here is what I have so far..
kiora | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="2">
  <FILENAME text="KIORA_THE_CRASHING_WAVE_812195297" />
  <CARDNAME text="KIORA_THE_CRASHING_WAVE" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="812195297" />
  <ARTID value="812195297" />
  <ARTIST name="Scott M Fischer" />
  <CASTING_COST cost="{2}{G}{U}" />
  <TYPE metaname="Planeswalker" />
  <TYPE metaname="Enchantment" />
  <SUB_TYPE metaname="Kiora" />
  <EXPANSION value="WWK" />
  <RARITY metaname="M" />
  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[|(Loyalty 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[|(Loyauté 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[|(Lealtad 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[|(Loyalität 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[|(Fedeltà 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(忠誠 2)]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[|(충성 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[|(Верность 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[|(Lealdade 2)|]]></LOCALISED_TEXT>
    <COUNTER_REGISTRATION name="Loyalty" proliferate="11" />
    <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():GetCountersType("Loyalty"), 2 )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
    <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(+1): Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls.]]></LOCALISED_TEXT>
    <AVAILABILITY sorcery_time="1" per_turn_limit="1" />
    <COST type="generic">
      <PREREQUISITE>
      return true
      </PREREQUISITE>
      <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil then
         PLW_ShutDownDoublingSeason()
         EffectSource():AddCounters( MTG():GetCountersType("Loyalty"), 1 )
      end
      </RESOLUTION_TIME_ACTION>
    </COST>
    <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_AN_OPPONENT_CONTROLS" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
    PLW_FilterPermanents(filter)
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    EffectDC():Set_Int( 1, MTG():GetTurnNumber() )
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set(CHARACTERISTIC_DOESNT_RECEIVE_DAMAGE, 1)
       characteristics:Bool_Set(CHARACTERISTIC_DOESNT_DEAL_DAMAGE, 1)
    end
    </CONTINUOUS_ACTION>
    <DURATION>
    return EffectDC():Get_Targets(0):Get_CardPtr(0) == nil or PLW_UntilMyNextTurn( EffectDC():Get_Int(1) )
    </DURATION>
    <SFX text="TARGET_PLASMA_PLAY" />
  </ACTIVATED_ABILITY>


  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-1): Draw a card, You may play an additional land this turn.]]></LOCALISED_TEXT>
    <AVAILABILITY sorcery_time="1" per_turn_limit="1" />
    <COST type="RemoveCountersSelf" amount="1" counter_type="Loyalty" />
    <RESOLUTION_TIME_ACTION>
    EffectController():DrawCards(1)
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
    local player_characteristics = EffectController():GetCurrentCharacteristics()
    player_characteristics:Int_Increment( PLAYER_INTCHARACTERISTIC_EXTRA_LAND_DROPS )
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
  </ACTIVATED_ABILITY>



    <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-5): You get an emblem with “At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield.”]]></LOCALISED_TEXT>
    <AVAILABILITY sorcery_time="1" per_turn_limit="1" />
    <COST type="RemoveCountersSelf" amount="5" counter_type="Loyalty" />
    <RESOLUTION_TIME_ACTION>
    MTG():CreateDelayedTrigger(1, nil)
    </RESOLUTION_TIME_ACTION>
    <SFX text="GLOBAL_TIDE_PLAY" />
  </ACTIVATED_ABILITY>
  <TRIGGERED_ABILITY resource_id="1">
    <CLEANUP>
    return EffectController() == nil
    </CLEANUP>
    <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
    return MTG():GetStep() == STEP_END_OF_TURN
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    MTG():PutTokensOntoBattlefield( "TOKEN_KRAKEN_9_9_812082656", 1, EffectController() )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="TOKEN_KRAKEN_9_9_812082656" />

  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
    <TRIGGER value="BEGINNING_OF_STEP">
    return MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    PLW_CreateUniqueToken( "_PLANESWALKERS_MANAGER_991800002", "_PLANESWALKERS_MANAGER", EffectController() )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="_PLANESWALKERS_MANAGER_991800002" />

  <AI_COUNTER_SCORE type="Loyalty" score="100" />
  <AI_BASE_SCORE score="600" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
token | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="TOKEN_KRAKEN_9_9_812082656" />
  <CARDNAME text="KRAKEN" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[KRAKEN]]></LOCALISED_TEXT>

  </TITLE>
  <MULTIVERSEID value="812082656" />
  <ARTID value="812082656" />
  <COLOUR value="U" />
  <ARTIST name="Lars Grant-West" />
  <CASTING_COST cost="" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Kraken" />
  <EXPANSION value="DPI" />
  <RARITY metaname="T" />
  <POWER value="9" />
  <TOUGHNESS value="9" />
  <TOKEN />
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
  <SFX text="COMBAT_PLASMA_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_PLASMA_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby thefiremind » 30 Dec 2013, 11:00

drleg3nd wrote:hey TFM having some trouble here with kiora, I changed her name but now im getting crashes
Did you change the name also on the actual file name (in Windows) and in the test deck that you are using?
< 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 drleg3nd » 30 Dec 2013, 12:10

thefiremind wrote:
drleg3nd wrote:hey TFM having some trouble here with kiora, I changed her name but now im getting crashes
Did you change the name also on the actual file name (in Windows) and in the test deck that you are using?
ok that resolved the crashes, but I still can't produce my blue kraken and 2nd ability can still be done multiple times a turn, and without any loyalty counters on card it remains on battlefield
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby RiiakShiNal » 30 Dec 2013, 13:27

NeoAnderson wrote:These are all solutions i also thought, but in any case they don't replay the exact meaning of the card. You could also consider to put a token on battlefield just to pay or deal the damage with auto expiring time.
Using a token for paying the cost would mean the token would need to be visible which would mean it would need a type which will lead to unwanted interactions with other cards so this is not really a viable solution.

NeoAnderson wrote:Yeah i was supposing that, but this can't be a right approach to code a card. Anytime comes out a problem we cannot recode hundreds of cards just for this.
Agreed, not a good approach. The reason it works for the manual mana and Burning-Tree Shaman is because I took it into account as I was writing all the manual mana functions with Burning-Tree Shaman in mind (as it was a main detractor from the DotP 2013 mana token solution). Additionally, my manual mana functions were the first mana token solution to come out for DotP 2014 so we weren't recoding hundreds of cards, we were coding them for the first time for this engine.

Also, because of the way the manual mana functions are coded many upgrades can be put in seamlessly (as long as I'm careful) without breaking older cards that depend on the functions. Which allows me to add new functionality such as what I did in v2 by upgrading the functionality to allow cards like Shizuko, Caller of Autumn.

thefiremind wrote:Maybe I'm forgetting something, but I really can't see where's the problem with Primal Clay... if something enters the battlefield copying Primal Clay, it will have a re-firing of the ZONECHANGE_TRANSITION triggers and this will make it ask for the choice; if something is already on the battlefield, it won't have the re-firing (unless the copying card was wrongly coded).
As I stated before the first ruling isn't a problem because ZONECHANGE_TRANSITION will refire. The problem is with the second ruling:
If a creature that's already on the battlefield becomes a copy of Primal Clay, it copies the power, toughness, and abilities that were chosen for Primal Clay when it entered the battlefield.
Trying to get the exact same choice when a card is already on the battlefield copies Primal Clay. There isn't any good way to "copy" the choice (which would be stored internally in a data chest) so either the copy would use a pre-configured default or would be */* (essentially 0/0) because a choice hasn't been made and would leave the battlefield. StoreCopiableValues() doesn't store data chest values for the object being copied.

If the card doing the copying has been coded with Primal Clay in mind then it could "copy" the choice by using my ObjectDC functions or a custom DuelDataChest() solution. However, that requires the card doing the copying to be aware of Primal Clay and other cards like it.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby thefiremind » 30 Dec 2013, 14:25

drleg3nd wrote:ok that resolved the crashes, but I still can't produce my blue kraken and 2nd ability can still be done multiple times a turn, and without any loyalty counters on card it remains on battlefield
I don't know what's going on with the Kraken. Try to make Kiora produce another kind of token that is already in the game (a Saproling for example) and see if it works. About the other problems, you still don't have Kiora properly declared as a Planeswalker. Either you forgot an entry in the LOL file, or you still have the original LOL file that gets read instead of your new one.

RiiakShiNal wrote:The problem is with the second ruling:
If a creature that's already on the battlefield becomes a copy of Primal Clay, it copies the power, toughness, and abilities that were chosen for Primal Clay when it entered the battlefield.
Trying to get the exact same choice when a card is already on the battlefield copies Primal Clay. There isn't any good way to "copy" the choice (which would be stored internally in a data chest) so either the copy would use a pre-configured default or would be */* (essentially 0/0) because a choice hasn't been made and would leave the battlefield. StoreCopiableValues() doesn't store data chest values for the object being copied.
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.
< 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 drleg3nd » 30 Dec 2013, 19:34

how do i edit a LOL file ? i'm sry i thought PLW_TEXT was the LOL file you was talking about until i looked at your files again and saw the actual ext.
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby drleg3nd » 30 Dec 2013, 21:22

question is open to any one on how to edit LOL files btw :)
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby MC Brodie » 30 Dec 2013, 21:29

Open with notepad, open with notepad ++, or right click it and hit "Edit".
-----------------------------------------------------------------------
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 drleg3nd » 30 Dec 2013, 22:19

MC Brodie wrote:Open with notepad, open with notepad ++, or right click it and hit "Edit".
thx brodie, i right clicked it but it kept saying i dont have program to open it, i got it now
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby NeoAnderson » 30 Dec 2013, 23:31

drleg3nd wrote:
MC Brodie wrote:Open with notepad, open with notepad ++, or right click it and hit "Edit".
thx brodie, i right clicked it but it kept saying i dont have program to open it, i got it now
If you are under windows O.S. when you click on a file with an Extension not paired with a program to open it doesn't know how to open it.
Normally these kind of file have white icons, when you right click on it you should see "Open with" then you can select a program to open that kind of file. For these kind of file you can use any kind of word editor(notepad, notepad ++ etc..) before to click ok ensure to enable the option "Always open this kind of file with this program". Now the icons should change, and in future when you double click on these kind of file,the O.S. automatically open the file with the paired program.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby NeoAnderson » 30 Dec 2013, 23:40

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>
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, 05:42

ok TFM here's all the functions and codes I have, I'm still having trouble with same issues.
kiora | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="2">
  <FILENAME text="KIORA_THE_CRASHING_WAVE_812195297" />
  <CARDNAME text="KIORA_THE_CRASHING_WAVE" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Kiora, the Crashing Wave]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="812195297" />
  <ARTID value="812195297" />
  <ARTIST name="Scott M Fischer" />
  <CASTING_COST cost="{2}{G}{U}" />
  <TYPE metaname="Planeswalker" />
  <TYPE metaname="Enchantment" />
  <SUB_TYPE metaname="Kiora" />
  <EXPANSION value="WWK" />
  <RARITY metaname="M" />
  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_TRANSITION">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[|(Loyalty 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[|(Loyauté 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[|(Lealtad 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[|(Loyalität 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[|(Fedeltà 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[(忠誠 2)]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[|(충성 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[|(Верность 2)|]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[|(Lealdade 2)|]]></LOCALISED_TEXT>
    <COUNTER_REGISTRATION name="Loyalty" proliferate="11" />
    <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():GetCountersType("Loyalty"), 2 )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
    <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(+1): Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls.]]></LOCALISED_TEXT>
    <AVAILABILITY sorcery_time="1" per_turn_limit="1" />
    <COST type="generic">
      <PREREQUISITE>
      return true
      </PREREQUISITE>
      <RESOLUTION_TIME_ACTION>
      if EffectSource() ~= nil then
         PLW_ShutDownDoublingSeason()
         EffectSource():AddCounters( MTG():GetCountersType("Loyalty"), 1 )
      end
      </RESOLUTION_TIME_ACTION>
    </COST>
    <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_AN_OPPONENT_CONTROLS" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
    PLW_FilterPermanents(filter)
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    EffectDC():Set_Int( 1, MTG():GetTurnNumber() )
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set(CHARACTERISTIC_DOESNT_RECEIVE_DAMAGE, 1)
       characteristics:Bool_Set(CHARACTERISTIC_DOESNT_DEAL_DAMAGE, 1)
    end
    </CONTINUOUS_ACTION>
    <DURATION>
    return EffectDC():Get_Targets(0):Get_CardPtr(0) == nil or PLW_UntilMyNextTurn( EffectDC():Get_Int(1) )
    </DURATION>
    <SFX text="TARGET_PLASMA_PLAY" />
  </ACTIVATED_ABILITY>


  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-1): Draw a card, You may play an additional land this turn.]]></LOCALISED_TEXT>
    <AVAILABILITY sorcery_time="1" per_turn_limit="1" />
    <COST type="RemoveCountersSelf" amount="1" counter_type="Loyalty" />
    <RESOLUTION_TIME_ACTION>
    EffectController():DrawCards(1)
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
    local player_characteristics = EffectController():GetCurrentCharacteristics()
    player_characteristics:Int_Increment( PLAYER_INTCHARACTERISTIC_EXTRA_LAND_DROPS )
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
  </ACTIVATED_ABILITY>



    <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[(-5): You get an emblem with “At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield.”]]></LOCALISED_TEXT>
    <AVAILABILITY sorcery_time="1" per_turn_limit="1" />
    <COST type="RemoveCountersSelf" amount="5" counter_type="Loyalty" />
    <RESOLUTION_TIME_ACTION>
    MTG():CreateDelayedTrigger(1, nil)
    </RESOLUTION_TIME_ACTION>
    <SFX text="GLOBAL_TIDE_PLAY" />
  </ACTIVATED_ABILITY>
  <TRIGGERED_ABILITY resource_id="1">
    <CLEANUP>
    return EffectController() == nil
    </CLEANUP>
    <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
    return MTG():GetStep() == STEP_END_OF_TURN
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    MTG():PutTokensOntoBattlefield( "TOKEN_KRAKEN_9_9_812082656", 1, EffectController() )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="TOKEN_KRAKEN_9_9_812082656" />

  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
    <TRIGGER value="BEGINNING_OF_STEP">
    return MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    PLW_CreateUniqueToken( "_PLANESWALKERS_MANAGER_991800002", "_PLANESWALKERS_MANAGER", EffectController() )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="_PLANESWALKERS_MANAGER_991800002" />

  <AI_COUNTER_SCORE type="Loyalty" score="100" />
  <AI_BASE_SCORE score="600" zone="ZONE_BATTLEFIELD" />
</CARD_V2>
LOL 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
I also put KIORA in planeswalker types
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 4 guests

Main Menu

User Menu

Our Partners


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 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 4 guests

Login Form