Making Magic : Planeswalkers ( sort of working elspeth)

I wanted to try and implement some planeswalkers into the game ( They do add a lot) but it seems like the "Planeswalker" card type is buggy ( they appear in the deck list but when you draw them you get an invisible card).
So I sort of bypassed it by making a legendary enchantment with charge counters instead of loyalty one.
The goal is to add some static abilities to allow the other player to redirect damage to the Planeswalker in form of losing counters :Every time the opponent attack he may choose the enchantment or the player which in turn will turn on {if the planeswalker was selected} an ability that cancels the damage but instead remove charge counters from the card ( it shouldn't be super hard).
The card itself should be indestructible or shroud( I know PW don't have indestructible but it's a better compromise then allowing them to be destroyed by enchantment killers, plus there aren't many permanent killers in this game) and use the same tool set in the example.
SO HERE IS THE PROGRESS :
Done:
Sample enchant-PW in the form of Elspeth ( bonus of working emblem
)
Simple Check functions ( see if the PW can actually use the ability/ is it dead etc.)
Basic skeleton for damage dealing ( not posted as it's still an early work and will probably see revision tomorrow
To Do:
1)Damage redirection /Attacker redirection script ( the lion share of the work , and something that will probably take long to debug
)
2)Add indestructible /shroud to Elspeth : Still need to figure which is better to put ( Actually that's an excuse I am just to tired to add it today ...)-Will take two minutes tomorrow
3)Make the .tdx file for Elspeth and the emblems ( Emblem just needs a pic but Elspeth need a frame as well)-IF SOMEONE CAN DO THIS IT WOULD BE A MAJOR HELP (hate dealing with it)
4) Write a function to add the initial charge counters : currently you can only add the INITIAL counters with AddChargeCounterToSelf() for some reason { I think it might have something to do with the layer it runs in , in other places the normal methods worked fine}
5) Build some more PW ( Elspeth was the hardest so this should be easier
Here's the code :
Elspeth Knight Errant
)
So I sort of bypassed it by making a legendary enchantment with charge counters instead of loyalty one.
The goal is to add some static abilities to allow the other player to redirect damage to the Planeswalker in form of losing counters :Every time the opponent attack he may choose the enchantment or the player which in turn will turn on {if the planeswalker was selected} an ability that cancels the damage but instead remove charge counters from the card ( it shouldn't be super hard).
The card itself should be indestructible or shroud( I know PW don't have indestructible but it's a better compromise then allowing them to be destroyed by enchantment killers, plus there aren't many permanent killers in this game) and use the same tool set in the example.
SO HERE IS THE PROGRESS :
Done:
Sample enchant-PW in the form of Elspeth ( bonus of working emblem

Simple Check functions ( see if the PW can actually use the ability/ is it dead etc.)
Basic skeleton for damage dealing ( not posted as it's still an early work and will probably see revision tomorrow
To Do:
1)Damage redirection /Attacker redirection script ( the lion share of the work , and something that will probably take long to debug

2)Add indestructible /shroud to Elspeth : Still need to figure which is better to put ( Actually that's an excuse I am just to tired to add it today ...)-Will take two minutes tomorrow
3)Make the .tdx file for Elspeth and the emblems ( Emblem just needs a pic but Elspeth need a frame as well)-IF SOMEONE CAN DO THIS IT WOULD BE A MAJOR HELP (hate dealing with it)
4) Write a function to add the initial charge counters : currently you can only add the INITIAL counters with AddChargeCounterToSelf() for some reason { I think it might have something to do with the layer it runs in , in other places the normal methods worked fine}
5) Build some more PW ( Elspeth was the hardest so this should be easier

Here's the code :
Elspeth Knight Errant
- Code: Select all
<?xml version="1.0"?>
<MULTICARDS>
<CARD>
<!--
///////////////////////////////////////////////////////////////////////////////////
CARD INFORMATIONS
///////////////////////////////////////////////////////////////////////////////////
-->
<FILENAME text = "ELSPETH_KNIGHT_ERRANT" />
<ARTID Value = "88882200" />
<TITLE text = "ELSPETH_KNIGHT_ERRANT_TITLE" />
<TYPE metaname = "Enchantment" />
<SUPERTYPE metaname = "Legendary" />
<SUBTYPE metaname = "ELSPETH" />
<CASTING_COST cost = "{2}{W}{W}" />
<COLOR value = "W" />
<FRAMECOLOUR name = "W" />
<EXPANSION metaname = "8888" />
<RARITY metaname = "Mythic" />
<COLLECTIONMAX value = "0" />
<COLLECTORNUMBER value = "0" />
<CARDNUMBER value = "0" />
<ARTIST name = "Volkan Baga" />
<!--
///////////////////////////////////////////////////////////////////////////////////
START OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
<TRIGGERED_ABILITY forced_skip="1" layer="0">
<TRIGGER value="COMES_INTO_PLAY">
return SelfTriggered()
</TRIGGER>
<EFFECT>
AddChargeCounterToSelf()
AddChargeCounterToSelf()
AddChargeCounterToSelf()
AddChargeCounterToSelf()
</EFFECT>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY tag="ELSPETH_KNIGHT_ERRANT_RULE_2" layer="1" forced_skip="0" sorcery_time="1">
<COST type="TapSelf" />
<COST type="COUNTERSSELF" name="CHARGE" number="+4" />
<AVAILABILITY>
return isPlayable(1)
</AVAILABILITY>
<EFFECT>
PutTokensIntoPlay( "Soldier11_Token", 1)
</EFFECT>
</ACTIVATED_ABILITY>
<ACTIVATED_ABILITY tag="ELSPETH_KNIGHT_ERRANT_RULE_3" layer="7c" forced_skip="0" sorcery_time="1">
<COST type="TapSelf" />
<COST type="COUNTERSSELF" name="CHARGE" number="+4" />
<AVAILABILITY>
return isPlayable(1)
</AVAILABILITY>
<TARGET_DETERMINATION>
return TargetCreatureGood()
</TARGET_DETERMINATION>
<PLAYTIME>
ChooseTargetCreature()
</PLAYTIME>
<EFFECT>
PlusThreePlusThreeToTargetCard()
GiveFlying( Object():GetTargetCard() )
</EFFECT>
<DURATION>
return UntilEndOfTurn()
</DURATION>
</ACTIVATED_ABILITY>
<ACTIVATED_ABILITY tag="ELSPETH_KNIGHT_ERRANT_RULE_4" layer="1" forced_skip="0" sorcery_time="1">
<COST type="TapSelf" />
<COST type="COUNTERSSELF" name="CHARGE" number="-8" />
<AVAILABILITY>
return isPlayable(-8)
</AVAILABILITY>
<EFFECT>
PutTokensIntoPlay("_INDESTRUCTABLE_EMB",1)
if ( checkPWdeath() )
then
SacrificeThisCard()
end
</EFFECT>
</ACTIVATED_ABILITY>
<!--
///////////////////////////////////////////////////////////////////////////////////
END OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
</CARD>
</MULTICARDS>
- Code: Select all
<?xml version="1.0"?>
<MULTICARDS>
<CARD>
<!--
///////////////////////////////////////////////////////////////////////////////////
CARD INFORMATIONS
///////////////////////////////////////////////////////////////////////////////////
-->
<FILENAME text = "_INDESTRUCTABLE_EMB" />
<ARTID value = "77771101" />
<TITLE text = "_INDESTRUCTABLE_EMB_TITLE" />
<TYPE metaname = "Land" />
<SUB_TYPE metaname = "Desert" />
<COLOR value = "C" />
<FRAMECOLOUR name = "W" />
<EXPANSION metaname = "8888" />
<ARTIST name = "" />
<!--
///////////////////////////////////////////////////////////////////////////////////
START OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
<STATIC_ABILITY layer="0" tag="_INDESTRUCTABLE_EMB_RULE_1">
<FILTER>
return (OwnedByYou() and InPlay())
</FILTER>
<EFFECT>
Indestructible()
</EFFECT>
</STATIC_ABILITY>
<STATIC_ABILITY layer="0">
<EFFECT>
Shroud()
</EFFECT>
</STATIC_ABILITY>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!--
///////////////////////////////////////////////////////////////////////////////////
END OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
</CARD>
</MULTICARDS>
