Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
General Help For Coding Cards thread
Moderator: CCGHQ Admins
General Help For Coding Cards thread
by Uresti » 15 Jul 2010, 01:20
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.
<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.
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Epiphany » 15 Jul 2010, 10:22
Hmm, I'm trying to get it to work but I can't find the right syntax so far.
It seems happy to use:
It seems happy to use:
- Code: Select all
<FILTER>
return Creatures() and Subject():GetConvertedManaCost() < 2
</FILTER>
-------
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
- Epiphany
- Posts: 95
- Joined: 30 Jun 2010, 13:27
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Uresti » 15 Jul 2010, 14:13
well then we use a filter like this....
Object():GetFilter:NOTargetting()
Object():GetFilter:SetZone( ZONE_HAND )
Object():GetFilter:GetConvertedManaCost( 2 ) < 2
Object():GetFilter:NOTargetting()
Object():GetFilter:SetZone( ZONE_HAND )
Object():GetFilter:GetConvertedManaCost( 2 ) < 2
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Uresti » 16 Jul 2010, 02:34
I just Finished Aether Vial works perfect!
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Epiphany » 16 Jul 2010, 08:20
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.
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.
-------
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
- Epiphany
- Posts: 95
- Joined: 30 Jun 2010, 13:27
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Uresti » 16 Jul 2010, 14:54
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 )
TRGGER value "ATTACKING">
TRIGGER SelfTriggered>
TARGET DETERMINATION>
return TArgetCreatureBad()
PLAYTIME>
ChooseTarget)
EFFECT>
Object():GetCurrentCaharcteristics():Bool_Set( CHARACTERISTIC_MUST_BLOCK )
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Epiphany » 16 Jul 2010, 16:25
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?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 )
-------
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
- Epiphany
- Posts: 95
- Joined: 30 Jun 2010, 13:27
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Yanna » 16 Jul 2010, 17:42
It makes sense... I would have sayed like Uresti indeed, using the CHARACTERISTIC_MUST_BLOCK boolean...
I guess provoke will be hard to code
I guess provoke will be hard to code
Aluren Resolved
by Uresti » 19 Jul 2010, 18:44
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
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by pun1sher666 » 21 Jul 2010, 17:16
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 I don't get to find why...
Here is my code :
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 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>
- pun1sher666
- Posts: 37
- Joined: 09 Jul 2010, 13:49
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by Yanna » 21 Jul 2010, 20:25
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 ?
Can you still destroy the creature again when you disenchant the animate dead ?
Re: General Help For Coding Cards thread
by pun1sher666 » 21 Jul 2010, 22:14
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.
I didn't try with Lightning Bolt or Incinerate, didn't try to disenchant Animate Dead too. I wanted to solve this problem before.
- pun1sher666
- Posts: 37
- Joined: 09 Jul 2010, 13:49
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by pun1sher666 » 21 Jul 2010, 22:28
I just tried with : combat damage, Lightning Bolt and Disenchant.
Nothing is working, the creature is indestructible
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...
Nothing is working, the creature is indestructible
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...
- pun1sher666
- Posts: 37
- Joined: 09 Jul 2010, 13:49
- Has thanked: 0 time
- Been thanked: 0 time
Re: General Help For Coding Cards thread
by kevlahnota » 23 Jul 2010, 01:38
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:
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>
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: General Help For Coding Cards thread
by pun1sher666 » 23 Jul 2010, 07:42
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.
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>
- pun1sher666
- Posts: 37
- Joined: 09 Jul 2010, 13:49
- Has thanked: 0 time
- Been thanked: 0 time
28 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 10 guests