Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Documentation
HOW TO: Additional and Kicker Cost and Card Text Formatting
Moderator: CCGHQ Admins
HOW TO: Additional and Kicker Cost and Card Text Formatting
by kevlahnota » 02 Sep 2010, 21:02
Just want to share my findings since i have already DLC2.(the sample codes below will work even without dlc 2 )
Now we must have 2 additional tags in our card text.
example:
GATEKEEPER_OF_MALAKIR_KICKED - if kicked, target player sacrifices a creature
GATEKEEPER_OF_MALAKIR_UNKICKED - cast Gatekeeper of Malakir
KICKER example:
Additional Cost Example:
Card text formatting:
We can use ASCII Character Reference and ASCII Device Control Characters
to format the text box of the card in our card_text.xml
this sample image doesn't use flavour text.
example:
-- this is the line feed or next line.
  -- this is a non breaking space
etc...
| sample text | -- to italicized text.
Now we must have 2 additional tags in our card text.
example:
GATEKEEPER_OF_MALAKIR_KICKED - if kicked, target player sacrifices a creature
GATEKEEPER_OF_MALAKIR_UNKICKED - cast Gatekeeper of Malakir
KICKER example:
- Code: Select all
<UTILITY_ABILITY tag="GATEKEEPER_OF_MALAKIR_RULE_1" layer="0">
<COST qualifier="Kicker" type="Mana" cost="{B}" />
</UTILITY_ABILITY>
<TRIGGERED_ABILITY layer="0" tag="GATEKEEPER_OF_MALAKIR_RULE_2" forced_skip="1" >
<TRIGGER value="COMES_INTO_PLAY">
return SelfTriggered() and Object():Kicked() ~= 0
</TRIGGER>
<TARGET_DETERMINATION>
return TargetPlayerBad()
</TARGET_DETERMINATION>
<PLAYTIME>
ChooseTarget( "CHOOSEPLAYER" )
</PLAYTIME>
<PRE_EFFECT>
Object():GetFilter():Clear()
Object():GetFilter():SetPlayer( Object():GetTargetPlayer() )
Object():GetFilter():SetZone( ZONE_IN_PLAY )
Object():GetFilter():SetController( Object():GetTargetPlayer() )
Object():GetFilter():AddCardType( CARD_TYPE_CREATURE )
Object():GetFilter():NotTargetted()
Object():GetTargetPlayer():ChooseTarget( "CHOOSETARGETCREATURE" )
</PRE_EFFECT>
<EFFECT>
SacrificeTargetCard()
</EFFECT>
</TRIGGERED_ABILITY>
Additional Cost Example:
- Code: Select all
<UTILITY_ABILITY tag="HARROW_RULE_1" layer="0">
<COST qualifier="Additional" type="Sacrifice">
<TARGET_DETERMINATION>
return TargetLandYouControl()
</TARGET_DETERMINATION>
<PLAYTIME>
ChooseTarget( "ChooseLandToSacrifice" )
</PLAYTIME>
</COST>
</UTILITY_ABILITY>
<SPELL_ABILITY tag="HARROW_RULE_2" layer="0">
<PRE_EFFECT>
Object():GetFilter():Clear()
Object():GetFilter():NotTargetted()
Object():GetFilter():AddCardType( CARD_TYPE_LAND )
Object():GetFilter():AddSupertype( SUPERTYPE_BASIC )
Object():GetFilter():SetPlayer( Object():GetOwner() )
Object():GetFilter():SetZone( ZONE_LIBRARY )
Object():GetFilter():May()
Object():GetPlayer():SetTargetCount( 2 )
Object():GetPlayer():SetTargetPrompt( 0, "SearchYourLibraryForBasicLand" )
Object():GetPlayer():SetTargetPrompt( 1, "SearchYourLibraryForAnotherBasicLand" )
Object():GetPlayer():ChooseTargetsWithFlags( QUERY_FLAG_CAN_BE_FINISHED_EARLY )
</PRE_EFFECT>
<EFFECT>
if (Object():GetNthTargetCard( 0 ) ~= nil) then
Object():GetNthTargetCard( 0 ):PutIntoPlay( Object():GetOwner() )
end
if (Object():GetNthTargetCard( 1 ) ~= nil) then
Object():GetNthTargetCard( 1 ):PutIntoPlay( Object():GetOwner() )
end
Object():GetOwner():ShuffleLibrary()
</EFFECT>
</SPELL_ABILITY>
Card text formatting:
We can use ASCII Character Reference and ASCII Device Control Characters
to format the text box of the card in our card_text.xml
this sample image doesn't use flavour text.
example:
-- this is the line feed or next line.
  -- this is a non breaking space
etc...
| sample text | -- to italicized text.
- Code: Select all
<Cell><Data ss:Type="String">KNIGHT_OF_THE_RELIQUARY_RULE_1</Data></Cell>
<Cell ss:Index="3" ss:StyleID="Default"><Data ss:Type="String">Knight of the Reliquary gets +1/+1 for each land card in your graveyard. </Data></Cell>
<Cell><Data ss:Type="String">KNIGHT_OF_THE_RELIQUARY_RULE_2</Data></Cell>
<Cell ss:Index="3" ss:StyleID="s68"><Data ss:Type="String">{T}, Sacrifice a Forest or Plains: Search your library for a land card, put it onto the battlefield, then shuffle your library. | “Knowledge of Bant's landscape and ruins is a weapon that the invaders can't comprehend.”|</Data></Cell>
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: HOW TO: Additional and Kicker Cost and Card Text Formatt
by Yanna » 03 Sep 2010, 17:33
Very interesting finding kev, especially (well for me) the ascii insertion.
Congrats on the findings, that'll sure up the prospects of coding new cards
Congrats on the findings, that'll sure up the prospects of coding new cards
Re: HOW TO: Additional and Kicker Cost and Card Text Formatt
by Uresti » 04 Sep 2010, 05:11
Yes Pack 2 is out now. seems they just "enabled" the extra abilities on the exe because <COST qualifier="Kicker"/> didnt work in the first DLC, we can use now kicker to improve my old "buyback" code...i mean use kicker instead of buyback....
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: HOW TO: Additional and Kicker Cost and Card Text Formatt
by n00854180t » 09 Oct 2010, 05:49
Is there a way to do multikicker, as from M11 (I think?)?
- n00854180t
- Posts: 19
- Joined: 09 Oct 2010, 05:41
- Has thanked: 0 time
- Been thanked: 0 time
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest