Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Help With Phyrexian Vault
Moderator: CCGHQ Admins
4 posts
• Page 1 of 1
Help With Phyrexian Vault
by Xana » 08 Aug 2012, 16:49
Hi
Been trying to code this card, and it almost works, except that it doesn't ask for a creature to sacrifice and still draws a card.
This is the current code, and i can't really seem to see where the problem is.
Been trying to code this card, and it almost works, except that it doesn't ask for a creature to sacrifice and still draws a card.
This is the current code, and i can't really seem to see where the problem is.
- Code: Select all
<ACTIVATED_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{2}, {T}, Sacrifice a creature: Draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{2}, {T}, Sacrifica una creatura: Pesca una carta.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{2}, {T}, opfere eine Kreatur: Ziehe eine Karte.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{2}, {T}, sacrifiez une créature : Piochez une carte.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{2}, {T}, sacrificar una criatura: Roba una carta.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{2}, {T}, クリーチャーを1体生け贄に捧げる:カードを1枚引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{2}, {T}, Sacrifice a creature: Draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{2}, {T}, Пожертвуйте существо: Возьмите карту.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{2}, {T}, Sacrifique uma criatura: Compre um card.]]></LOCALISED_TEXT>
<COST type="Mana" cost="{2}" />
<COST type="Sacrifice">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetPlayer( EffectController() )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
</COST>
<COST type="TapSelf" />
<RESOLUTION_TIME_ACTION>
EffectController():DrawCard()
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
Re: Help With Phyrexian Vault
by RiiakShiNal » 08 Aug 2012, 18:17
In your cost try using <PLAYTIME></PLAYTIME> instead of <PLAY_TIME_ACTION></PLAY_TIME_ACTION>. I've noticed that some costs use PLAYTIME and maybe it is required to use it for those costs.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Help With Phyrexian Vault
by thefiremind » 08 Aug 2012, 18:41
That's right, and to be more precise, <PLAYTIME> is needed for all the costs not marked as "generic", where the chosen target is handled automatically according to the cost type. The "generic" costs, on the contrary, allow you to do anything you want with the chosen target, so they are coded as a normal ability, with <PLAY_TIME_ACTION> and/or <RESOLUTION_TIME_ACTION>.RiiakShiNal wrote:In your cost try using <PLAYTIME></PLAYTIME> instead of <PLAY_TIME_ACTION></PLAY_TIME_ACTION>. I've noticed that some costs use PLAYTIME and maybe it is required to use it for those costs.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Help With Phyrexian Vault
by Xana » 08 Aug 2012, 18:46
Hey
Tried adding <PLAYTIME></PLAYTIME> instead, and now i can't activate the ability without having a creature to sacrifice, but i still don't get to choose a creature to sacrifice, and it is still cast without requiring a sacrifice.
EDIT: Nevermind, that was me being an idiot, forgot to update my main package, it now works correctly, thanks for the info
Tried adding <PLAYTIME></PLAYTIME> instead, and now i can't activate the ability without having a creature to sacrifice, but i still don't get to choose a creature to sacrifice, and it is still cast without requiring a sacrifice.
EDIT: Nevermind, that was me being an idiot, forgot to update my main package, it now works correctly, thanks for the info

4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests