Page 1 of 2

General Help For Coding Cards thread

PostPosted: 15 Jul 2010, 01:20
by Uresti
Im trying to code AEther Vial almost all the code is there except for filtering the converted mana cost SetConvertedCostMin()

<TRIGGER value="BEGINNING_OF_STEP">
return MyUpkeep()
</TRIGGER>
<EFFECT>
AddChargeCounterToSelf()
</EFFECT>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY tag="AETHER_VIAL_RULE_1" auto_skip="1" layer="0">
<COST type="TapSelf" />
<PRE_EFFECT>
ChooseNCreatureCardsFromHand( Object():GetPlayer(), Object():GetPlayer(), { "ChooseCreatureBringIntoPlay" })
</PRE_EFFECT>
<EFFECT>
PutTargetCardIntoPlay( Object():GetPlayer() )
YouGainLife(Object():CountCounters( MTG():ChargeCounters() ) )Added this line to track Number of counters
</EFFECT>

i already tried with Object():Getfilter():SetConvertedCostMin and max and Value.

Re: General Help For Coding Cards thread

PostPosted: 15 Jul 2010, 10:22
by Epiphany
Hmm, I'm trying to get it to work but I can't find the right syntax so far.

It seems happy to use:

Code: Select all
<FILTER>
    return Creatures() and Subject():GetConvertedManaCost() &lt; 2
</FILTER>
but I don't know how to apply it as a target rather than a filter. :(

Re: General Help For Coding Cards thread

PostPosted: 15 Jul 2010, 14:13
by Uresti
well then we use a filter like this....

Object():GetFilter:NOTargetting()
Object():GetFilter:SetZone( ZONE_HAND )
Object():GetFilter:GetConvertedManaCost( 2 ) &lt; 2

Re: General Help For Coding Cards thread

PostPosted: 16 Jul 2010, 02:34
by Uresti
I just Finished Aether Vial works perfect!

Re: General Help For Coding Cards thread

PostPosted: 16 Jul 2010, 08:20
by Epiphany
Does anyone know if it's possible to get provoke to work?

Like on here Brontotherium.

Grats on the vial by the way, can't wait to see it! :)

Edit: I've found the word SetBlockVictim in the EXE and I've tried to apply it to a provoke style effect, but I can't find any combination of words to get it to work.

Re: General Help For Coding Cards thread

PostPosted: 16 Jul 2010, 14:54
by Uresti
i think yo are going for the wrong direction try somethin like
TRGGER value "ATTACKING">
TRIGGER SelfTriggered>
TARGET DETERMINATION>
return TArgetCreatureBad()
PLAYTIME>
ChooseTarget)
EFFECT>
Object():GetCurrentCaharcteristics():Bool_Set( CHARACTERISTIC_MUST_BLOCK )

Re: General Help For Coding Cards thread

PostPosted: 16 Jul 2010, 16:25
by Epiphany
Uresti wrote:i think yo are going for the wrong direction try somethin like
TRGGER value "ATTACKING">
TRIGGER SelfTriggered>
TARGET DETERMINATION>
return TArgetCreatureBad()
PLAYTIME>
ChooseTarget)
EFFECT>
Object():GetCurrentCaharcteristics():Bool_Set( CHARACTERISTIC_MUST_BLOCK )
Not a bad idea, but presumably if you attack with more than one creature then that creature you choose is free to block whoever the opponent wants?

Re: General Help For Coding Cards thread

PostPosted: 16 Jul 2010, 17:42
by Yanna
It makes sense... I would have sayed like Uresti indeed, using the CHARACTERISTIC_MUST_BLOCK boolean...

I guess provoke will be hard to code #-o

Aluren Resolved

PostPosted: 19 Jul 2010, 18:44
by Uresti
Aluren is workin now as giving flash and decreasing cost by 3 of all creatures wiyh converted mana cost 3 or less its not as aluren should work but is a good work around

Re: General Help For Coding Cards thread

PostPosted: 21 Jul 2010, 17:16
by pun1sher666
Hi guys,

I'm working on Animate Dead. I got to make it work but i have a very bad issue, when enchanted the creature cannot be destroyed or sacrified anymore :D I don't get to find why...

Here is my code :
Code: Select all
<?xml version="1.0"?>
<MULTICARDS>
  <CARD>
    <TITLE text="ANIMATE_DEAD_TITLE" />
    <FILENAME text="Animate_Dead" />
    <COLLECTIONMAX value="0" />
    <COLLECTORNUMBER value="171" />
    <ARTID value="666065" />
    <FRAMECOLOUR name="B" />
    <COLOR value="B" />
    <ARTIST name="Anson Maddock" />
    <CASTING_COST cost="{1}{B}" />
    <FLAVOURTEXT text="ANIMATE_DEAD_FLAVOUR" />
    <TYPE metaname="Enchantment" />
   <SUB_TYPE metaname="Aura" />
    <EXPANSION metaname="PUNXTD" />
    <RARITY metaname="uncommon" />
    <STATIC_ABILITY layer="0" tag="ANIMATE_DEAD_RULE_1">
      <TARGET_DETERMINATION>
        return TargetCreatureInAnyGraveyard()
      </TARGET_DETERMINATION>
      <PLAYTIME>
        ChooseTarget( "ChooseCreatureInGraveyardToPlay" )
      </PLAYTIME>
      <EFFECT>
      PutTargetCardIntoPlay( Object():GetPlayer() )
      EnchantCreature()
      </EFFECT>
    </STATIC_ABILITY>
    <STATIC_ABILITY layer="7c" simple_filter="Parent">
      <EFFECT>      
      AddPowerAndToughness( -1, 0 )       
      </EFFECT>
    </STATIC_ABILITY>
    <TRIGGERED_ABILITY auto_skip="1" layer="0">
      <TRIGGER value="DESTROYED">
        return SelfTriggered()
      </TRIGGER>
      <EFFECT>      
      Object():GetParent():Destroy()       
      </EFFECT>     
    </TRIGGERED_ABILITY>
  </CARD>
</MULTICARDS>
Any idea ?

Re: General Help For Coding Cards thread

PostPosted: 21 Jul 2010, 20:25
by Yanna
Well your code seems good at first glance. some questions thought, does it takes any damage at all ? or none ?
Can you still destroy the creature again when you disenchant the animate dead ?

Re: General Help For Coding Cards thread

PostPosted: 21 Jul 2010, 22:14
by pun1sher666
I just tried with a Terror and using your Diamond Valley :)
I didn't try with Lightning Bolt or Incinerate, didn't try to disenchant Animate Dead too. I wanted to solve this problem before.

Re: General Help For Coding Cards thread

PostPosted: 21 Jul 2010, 22:28
by pun1sher666
I just tried with : combat damage, Lightning Bolt and Disenchant.
Nothing is working, the creature is indestructible :D
When i disenchant Animate Dead the creature stay in play and Animate Dead goes to graveyard. Don't know if it's because the trigger don't work or if the Destroy() function don't work coz the creature is indestructible... I will try more things...

Re: General Help For Coding Cards thread

PostPosted: 23 Jul 2010, 01:38
by kevlahnota
hello there,

I'm trying to code braids, cabal minion, so far it works good but unfortunately I can't figure how to target the current player(his upkeep or my upkeep) every beginning of the upkeep without choosing players. here's the code:
Code: Select all
<TRIGGERED_ABILITY tag="BRAIDS_CABAL_MINION_RULE_1" auto_skip="1" layer="0">
      <TRIGGER value="BEGINNING_OF_STEP">
        return ( MTG():GetStep() == STEP_UPKEEP and TriggerPlayer():MyTurn() ~= 0 )
      </TRIGGER>
      <TARGET_DETERMINATION>
        return TargetPlayerBad()
      </TARGET_DETERMINATION>
     <PLAYTIME>
      ChooseTargetPlayer()
     </PLAYTIME>
     <PRE_EFFECT>
      local PSacrificeLCA = Object():GetTargetPlayer()
      Object():Register_Player_Set( 0, PSacrificeLCA )
      Object():GetFilter():Clear()
      Object():GetFilter():SetPlayer( PSacrificeLCA )
      Object():GetFilter():SetZone( ZONE_IN_PLAY )
      Object():GetFilter():SetController( PSacrificeLCA )
      Object():GetFilter():AddCardType( CARD_TYPE_LAND )
      Object():GetFilter():AddCardType( CARD_TYPE_CREATURE )
        Object():GetFilter():AddCardType( CARD_TYPE_ARTIFACT )
      PSacrificeLCA:ChooseTarget( "ChooseTarget" )
     </PRE_EFFECT>
      <EFFECT>
        SacrificeTargetCard()
      </EFFECT>
</TRIGGERED_ABILITY>
thanks in advance!

Re: General Help For Coding Cards thread

PostPosted: 23 Jul 2010, 07:42
by pun1sher666
Hi,

To get the current player upkeep turn in your code, you don't need to ask for a target.
You can use TriggerPlayer().

Here an example of what you could write.

Code: Select all
<TRIGGERED_ABILITY tag="BRAIDS_CABAL_MINION_RULE_1" auto_skip="1" layer="0">
      <TRIGGER value="BEGINNING_OF_STEP">
        return ( MTG():GetStep() == STEP_UPKEEP and TriggerPlayer():MyTurn() ~= 0 )
      </TRIGGER>
     <PRE_EFFECT>
      local PSacrificeLCA = TriggerPlayer()
      Object():Register_Player_Set( 0, PSacrificeLCA )
      Object():GetFilter():Clear()
      Object():GetFilter():SetPlayer( PSacrificeLCA )
      Object():GetFilter():SetZone( ZONE_IN_PLAY )
      Object():GetFilter():SetController( PSacrificeLCA )
      Object():GetFilter():AddCardType( CARD_TYPE_LAND )
      Object():GetFilter():AddCardType( CARD_TYPE_CREATURE )
      Object():GetFilter():AddCardType( CARD_TYPE_ARTIFACT )
      PSacrificeLCA:ChooseTarget( "ChooseTarget" )
     </PRE_EFFECT>
     <EFFECT>
        SacrificeTargetCard()
     </EFFECT>
</TRIGGERED_ABILITY>
Hope it will help :)