Page 1 of 1

Help with Worldslayer

PostPosted: 22 Dec 2013, 21:28
by otakusensei
I haven't found Worldslayer in any of the card packs this time around, so I'm trying to add it. I'm pretty green on making cards, but I was able to take a world slayer from 2013, update the image, update the equip function but got totally lost on the trigger. I tried to include what I have already, but the forum won't let me upload the code because it says I'm too new and it apparently makes my post look spammy. Lovely.

Thanks

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 00:11
by RiiakShiNal
The trigger would essentially trigger off of SOURCE_DEALS_DAMAGE_TO_PLAYER then check that the source is the parent creature (and not nil) and that the damage is combat damage with Damage():IsCombat() so it would look something like this:
Code: Select all
<TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER">
  return (EffectSource() ~= nil) and (EffectSource():GetParent() ~= nil) and (Damage() ~= nil) and
    (Damage():GetSource() == EffectSource():GetParent()) and (Damage():GetAmount() &gt; 0) and
    (Damage():IsCombat())
</TRIGGER>
As for not being able to post code, you should be able to once you reach 5 posts. It is a precaution to try and stop spam bots though it can prove frustrating for new users until they reach the required number of posts.

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 03:36
by otakusensei
Ok, I think I follow the trigger. Thank you!

I then have it building a filter for all Artifact, Creature, Enchantment and Land cards. I'm building it type by type, if there a way to just have it filter permanents?

For the RESOLUTION_TIME_ACTION I have it FilteredCard():Destroy(), if that looks right.

I wish I could just post it, I understand the reasoning and I'll just keep talking about it till I can post it.

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 09:49
by NeoAnderson
otakusensei wrote:Ok, I think I follow the trigger. Thank you!
I then have it building a filter for all Artifact, Creature, Enchantment and Land cards. I'm building it type by type, if there a way to just have it filter permanents?
For the RESOLUTION_TIME_ACTION I have it FilteredCard():Destroy(), if that looks right.
I wish I could just post it, I understand the reasoning and I'll just keep talking about it till I can post it.
To filter permants you can set a filter as the follow :
Code: Select all
<FILTER filter_id="0">
    local filter = ClearFilter()
    local subfilter = filter:AddSubFilter_Or()
    subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
    subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
    subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
    subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
    </FILTER>
Another way is to use :
Code: Select all
<FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add( FE_IS_PERMANENT, true )
    </FILTER>
To avoid the destruction of the equipment artifact you have also to add :
Code: Select all
filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource())
I just made the code of this card but i haven't tested and i made it quickly so i hope i haven't miss anything.
Worldslayer untested | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="WORLDSLAYER_227302" />
  <CARDNAME text="WORLDSLAYER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Worldslayer]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Pourfendeur de monde]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Destruyemundos]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Weltenerschlager]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Spaccamondo]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[世界薙ぎの剣]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Worldslayer]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Мироубийца]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Finda-Mundo]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="227302" />
  <ARTID value="227302" />
  <ARTIST name="Greg Staples" />
  <CASTING_COST cost="{5}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“If that is what you seek, try looking in craters.”
—Fodrus, mastersmith]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Si c’est ce que tu cherches, essaie les cratères. »
—Fodrus, maître-forgeron]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Si eso es lo que buscas, intenta en los cráteres.”
—Fodrus, maestro herrero]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Falls du danach suchst, musst du die Krater durchsuchen.”
—Fodrus, Meisterschmied]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Se è questo che cerchi, prova a guardare nei crateri.”
—Fodrus, mastro fabbro]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「お前の探してるのがこれだって言うなら、噴火口でも覗くんだな。」
――熟達の鍛冶屋、フォドラス]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“If that is what you seek, try looking in craters.”
—Fodrus, mastersmith]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Если это то, что вы ищете, попробуйте заглянуть в жерла».
— Фодрус, искусный кузнец]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Se é isso que você busca, experimente procurar nas crateras.”
— Fodrus, ferreiro mestre]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Artifact" />
  <SUB_TYPE metaname="Equipment" />
  <EXPANSION value="M12" />
  <RARITY metaname="R" />
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever equipped creature deals combat damage to a player, destroy all permanents other than Worldslayer.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que la créature équipée inflige des blessures de combat à un joueur, détruisez tous les permanents autres que le Pourfendeur de monde.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que la criatura equipada haga daño de combate a un jugador, destruye todos los permanentes que no sean el Destruyemundos.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn die ausgerüstete Kreatur einem Spieler Kampfschaden zufügt, zerstöre alle bleibenden Karten außer dem Weltenerschlager.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta la creatura equipaggiata infligge danno da combattimento a un giocatore, distruggi tutti i permanenti diversi dallo Spaccamondo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[装備しているクリーチャーがいずれかのプレイヤーに戦闘ダメージを与えるたび、世界薙ぎの剣以外のすべてのパーマネントを破壊する。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever equipped creature deals combat damage to a player, destroy all permanents other than Worldslayer.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз когда снаряженное существо наносит боевые повреждения игроку, уничтожьте все перманенты, кроме Мироубийцы.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que a criatura equipada causar dano de combate a um jogador, destrua todas as permanentes que não forem Finda-Mundo.]]></LOCALISED_TEXT>
   <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" to_zone="ZONE_ANY" from_zone="ZONE_ANY" damage_type="combat">
   if (EffectSource() ~= nil) and (EffectSource():GetParent() ~= nil) and (Damage() ~= nil) and (Damage():GetAmount() &gt; 0) then
       return TriggerObject() == EffectSource():GetParent()
     end
    </TRIGGER>
    <FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add( FE_IS_PERMANENT, true )
    filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource())
    </FILTER>
    <RESOLUTION_TIME_ACTION filter_id="0">
    if FilteredCard() ~= nil then   
       FilteredCard():Destroy() 
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <STATIC_ABILITY>
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Equip {5}]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Équipement {5}]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Equipar {5}.]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Ausrüsten {5}]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Equipaggiare {5}]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[装備 {5}]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[장착 {5}]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Снарядить {5}]]></LOCALISED_TEXT>
   <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Equipar {5}]]></LOCALISED_TEXT>
    <COST mana_cost="{5}" type="Mana" />
    <AVAILABILITY sorcery_time="1" />
    <AI_AVAILABILITY type="restriction" restriction_type="equip" />
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_EQUIP" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    local target_card = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if (target_card ~= nil and EffectSource() ~= nil) then
       EffectSource():Attach( target_card )   
    end
    </RESOLUTION_TIME_ACTION>
    <AUTO_SKIP>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       return false
    else
       return true
    end
    </AUTO_SKIP>
   </ACTIVATED_ABILITY>
   <AI_BASE_SCORE score="900" zone="ZONE_BATTLEFIELD" />
   <AI_BASE_SCORE score="1200" type="Parent" zone="ZONE_BATTLEFIELD" />
</CARD_V2>

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 10:16
by thefiremind
NeoAnderson wrote:Another way is to use :
Code: Select all
    <FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add( FE_IS_PERMANENT, true )
    </FILTER>
Note that this also includes cards with no types. This is due to the fact that, according to Magic rules, a permanent that loses all types still counts as a permanent. Modders sometimes need to implement rules through invisible tokens, which are made invisible by giving them no types, and should never leave the battlefield during the duel. They usually have indestructible, so as long as you destroy this isn't a problem, but keep it in mind in case you need to exile or return to hand all permanents.

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 10:35
by sumomole
thefiremind wrote:This is due to the fact that, according to Magic rules, a permanent that loses all types still counts as a permanent.
Permanent loses all types and colors, may be used to code Phasing? :lol:

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 11:01
by NeoAnderson
thefiremind wrote:
NeoAnderson wrote:Another way is to use :
Code: Select all
    <FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add( FE_IS_PERMANENT, true )
    </FILTER>
Note that this also includes cards with no types. This is due to the fact that, according to Magic rules, a permanent that loses all types still counts as a permanent. Modders sometimes need to implement rules through invisible tokens, which are made invisible by giving them no types, and should never leave the battlefield during the duel. They usually have indestructible, so as long as you destroy this isn't a problem, but keep it in mind in case you need to exile or return to hand all permanents.
Noted and useful as always, :wink:

sumomole wrote:Permanent loses all types and colors, may be used to code Phasing? :lol:
I was wondering why there is a "CHARACTERISTIC_PHASING" if they haven't coded this ability. 8-[

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 11:20
by thefiremind
sumomole wrote:Permanent loses all types and colors, may be used to code Phasing? :lol:
What about devotion count? :mrgreen:

NeoAnderson wrote:I was wondering why there is a "CHARACTERISTIC_PHASING" if they haven't coded this ability. 8-[
It's a placeholder. The developers added all the characteristics they could think about, but not all of them work.

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 11:51
by sumomole
thefiremind wrote:
sumomole wrote:Permanent loses all types and colors, may be used to code Phasing? :lol:
What about devotion count? :mrgreen:
Does devotion count include permanent that has phased out? If not, we can use five permanent types instead of FE_IS_PERMANENT. :lol:

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 12:10
by thefiremind
sumomole wrote:
thefiremind wrote:
sumomole wrote:Permanent loses all types and colors, may be used to code Phasing? :lol:
What about devotion count? :mrgreen:
Does devotion count include permanent that has phased out? If not, we can use five permanent types instead of FE_IS_PERMANENT. :lol:
OK and what about a Festering Newt giving -4/-4 because of a phased-out Bogbrew Witch?

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 12:28
by sumomole
thefiremind wrote:OK and what about a Festering Newt giving -4/-4 because of a phased-out Bogbrew Witch?
Can make Bogbrew Witch becomes a copy of a card without types, colors, and name until it phased in, like your transform cards? Seems more and more trouble. :lol:

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 14:55
by thefiremind
sumomole wrote:Seems more and more trouble. :lol:
I agree, in fact I wouldn't even start troubling myself for an old complicated mechanic like phasing. If you want to try, then go ahead. :D

Re: Help with Worldslayer

PostPosted: 23 Dec 2013, 15:00
by GrovyleXShinyCelebi
I would try to make phasing if I know EXACTLY what does "treated as though it doesn't exist" mean in Magic terms, as in card interactions and stuff. Does that mean that it's made invisible with no attributes whatsoever, or is there anything else that needs to be done with it?

Re: Help with Worldslayer

PostPosted: 24 Dec 2013, 00:25
by otakusensei
Thanks for the example card. I did have a problem testing it first though because the equip action was being called as a static action and closed as an activated one. Fixed that and I'm testing now. Could be a bit.

Edit - Works perfectly!