if anybody want it... here all about mana tokens 2013
function, token cards, Izzet Signet as working example, func file contains also nice scry code, i add card with it - Foresee
High Quality Resources for Collectible Card Games
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=63&t=7655
<PLAY_TIME_ACTION>
Object():GetPlayer():ChooseColour( "CARD_QUERY_CHOOSE_COLOUR", 1 )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local LNG_COLOUR = Object():GetPlayer():GetChosenColour()
if (LNG_COLOUR == 4) then
ProduceMana( "U", 1 )
end
if (LNG_COLOUR == 3) then
ProduceMana( "B", 1 )
end
if (LNG_COLOUR == 1) then
ProduceMana( "R", 1 )
end
if (LNG_COLOUR == 2) then
ProduceMana( "G", 1 )
end
if (LNG_COLOUR == 5) then
ProduceMana( "W", 1 )
end
</RESOLUTION_TIME_ACTION> <PLAY_TIME_ACTION>
EffectController():ChooseColour( "CARD_QUERY_CHOOSE_COLOUR", 1 )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local LNG_COLOUR = GetChosenColour()
if (LNG_COLOUR == COLOUR_RED) then
ProduceMana( "R", 1 )
end
if (LNG_COLOUR == COLOUR_GREEN) then
ProduceMana( "G", 1 )
end
if (LNG_COLOUR == COLOUR_BLACK) then
ProduceMana( "B", 1 )
end
if (LNG_COLOUR == COLOUR_BLUE) then
ProduceMana( "U", 1 )
end
if (LNG_COLOUR == COLOUR_WHITE) then
ProduceMana( "W", 1 )
end
</RESOLUTION_TIME_ACTION>Well, that's not entirely true, he did have the numbers wrong, but GetChosenColour() does return numbers (which relate to the colour constants as follows):Aiodren wrote:Your problem is not the mana functions but the colour choice. In 2013 ChooseColour doesn't return numbers but the actual colours (COLOUR_RED,COLOUR_BLUE,...). You could use the following example to code it:
Yes, I'm sure if you look at the decoded lol files the COLOUR_ constants are defined there (that's where I pulled the list from in my previous post). The chosen colour can be stored using either Int_Set() or Set_Int() and later retrieved using Int_Get() or Get_Int() (I actually depend on this to work for Voice of All).Aiodren wrote:@Riiak: Are you sure? First i had the same code as Tyrany and it didn't work at all, so i assumed after seeing the code of fireminds Apostle's Blessing that the function now doesn't return numbers anymore.
The fact is that COLOUR_WHITE, COLOUR_BLUE, etc. are numbers, because each of them is a constant whose value is a number. So it doesn't matter if you use the constant or the number: the constants exist because it's faster to write COLOUR_BLUE instead of having to check what number stands for blue (and you can adjust the value, if needed, only on the constant declaration, rather than everywhere you used that value). If you look at my Silhana Starfletcher, I use the numbers to select which mana ability he should grant to himself.Aiodren wrote:@Riiak: Are you sure? First i had the same code as Tyrany and it didn't work at all, so i assumed after seeing the code of fireminds Apostle's Blessing that the function now doesn't return numbers anymore.
it is adaptation from 2012, collaboration, it is not necessary to thank.Persee wrote:Thx for the job nabeshin.
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="DARK_RITUAL_3285" />
<CARDNAME text="DARK_RITUAL" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Dark Ritual]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="3285" />
<ARTID value="3285" />
<ARTIST name="John Coulthart" />
<CASTING_COST cost="{B}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“The ceremony ended with a voice from the shadows, a voice with vast, ominous power.”
—Kifimbo, Shadow Guildmage]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Instant" />
<EXPANSION value="DPG" />
<RARITY metaname="C" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Add {B}{B}{B} to your mana pool.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
ProduceMana( "B", 3 )
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
You need to register the black mana tokens.alexandreonly wrote:I'm having problems with dark ritual.
<TOKEN_REGISTRATION reservation="1" type="MANATOKEN_B"/>I did it now, but dark ritual still go to graveyard without producing mana.BlindWillow wrote:You need to register the black mana tokens.alexandreonly wrote:I'm having problems with dark ritual.
- Code: Select all
<TOKEN_REGISTRATION reservation="1" type="MANATOKEN_B"/>
I tested it, and it worked for me. Make sure you have all of the mana token cards in the "CARDS" folder (there should be six), 01_FUNC.lol in the "FUNCTIONS" folder (which you have to create, if you haven't already), and 88888888.tdx in the ART_ASSETS/ILLUSTRATIONS folder.alexandreonly wrote:I did it now, but dark ritual still go to graveyard without producing mana.
CreateManaTokens = function(color, number, chest)
-- creates the selected number of mana tokens of the selected color (it needs a chest for storing tokens and allowing use of the next function)
local color_letter = {"W", "U", "B", "R", "G", "C"}
local fixed_color = color
if color == 0 then
fixed_color = 6
end
local file_name = "_MANA_TOKEN_"..color_letter[fixed_color].."_1999200"..fixed_color
MTG():PutTokensIntoPlay( file_name, number, EffectController(), chest )
end
RemoveRedundantTokens = function(number, chest)
-- removes tokens beyond number from chest (against effects like Doubling Season)
if chest ~= nil then
local i = number
local token = chest:Get_NthCardPtr(i)
while token ~= nil do
token:RemoveFromGame()
i = i+1
token = chest:Get_NthCardPtr(i)
end
end
end
CheckManaPool = function()
-- gives a message that displays the available mana tokens
local player = EffectController()
if player:IsAI() == 0 then
local color_letter = {"W", "U", "B", "R", "G"}
local message = ""
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone(ZONE_IN_PLAY)
filter:SetController(player)
filter:AddCardName("_MANA_TOKEN_C")
filter:NotTargetted()
local count = filter:Count()
if count > 0 then
message = "{"..count.."}"
end
for i=1,5 do
filter:Clear()
filter:SetZone(ZONE_IN_PLAY)
filter:SetController(player)
filter:AddCardName("_MANA_TOKEN_"..color_letter[i])
filter:NotTargetted()
count = filter:Count()
if count > 0 then
for j=1,count do
message = message.."{"..color_letter[i].."}"
end
end
end
player:DisplayMessage(" mana pool: \]\n\n\["..message)
end
end<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="PYRETIC_RITUAL_205067" />
<CARDNAME text="PYRETIC_RITUAL" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Pyretic Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Rituale Febbrile]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Pyretisches Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Rituel pyrétique]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Ritual febril]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[発熱の儀式]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Pyretic Ritual]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пирогенный Ритуал]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Ritual Pirético]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="205067" />
<ARTID value="A205067" />
<ARTIST name="James Paick" />
<CASTING_COST cost="{1}{R}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[The Multiverse is filled with limitless power just waiting for someone to reach out and seize it.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Multiverso è pieno di potere illimitato in attesa di qualcuno che allunghi la mano per coglierlo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Das Multiversum steckt voll mit unendlicher Kraft, die nur darauf wartet, dass jemand nach ihr greift und sie nutzt.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le Multivers contient une puissance illimitée qui n’attend que celui qui s’en emparera.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El Multiverso está lleno de poder infinito esperando a ser alcanzado y aprovechado.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[多元宇宙は、誰かが手を伸ばして捕まえるのを待ち続ける無限の力に満ちている。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[The Multiverse is filled with limitless power just waiting for someone to reach out and seize it.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Мультивселенная наполнена безграничной силой — осталось лишь сделать усилие и заполучить ее.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[O multiverso está repleto de poder ilimitado aguardando por alguém que estenda a mão e o capture.]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Instant" />
<EXPANSION value="M11" />
<RARITY metaname="C" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Add {R}{R}{R} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Aggiungi {R}{R}{R} alla tua riserva di mana.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Erhöhe deinen Manavorrat um {R}{R}{R}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Ajoutez {R}{R}{R} à votre réserve.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Agrega {R}{R}{R} a tu reserva de maná.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのマナ・プールに{R}{R}{R}を加える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{R}{R}{R}를 당신의 마나풀에 담는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Добавьте {R}{R}{R} в ваше хранилище маны.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Adicione {R}{R}{R} à sua reserva de mana.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
CreateManaTokens( COLOUR_RED, 3, EffectDC():Make_Chest(1) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
RemoveRedundantTokens( 3, EffectDC():Get_Chest(1) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
CheckManaPool()
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<AI_AVAILABILITY type="in_response" />
<AI_AVAILABILITY step="main_1" turn="my_turn" />
<AI_AVAILABILITY step="main_2" turn="my_turn" />
<TOKEN_REGISTRATION reservation="1" type="_MANA_TOKEN_R_19992004" />
<AI_BASE_SCORE score="150" zone="ZONE_HAND" />
</CARD_V2>