I'm a bit pessimistic on
Curse of Misfortunes... besides the complications of the "different name restriction" which should be possible to code with a bit of work, we don't have a version of PutIntoPlayAttachedTo for players. I'll try to use that function anyway (but the game will probably crash or do nothing), then I'll try to use PutIntoPlay and AttachToPlayer in the same action (the aura shouldn't have the time to go to the graveyard if we aren't checking state-based effects before attaching it). I'll let you know.
EDIT: OK, the second idea works:
- Code: Select all
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:PutIntoPlay( EffectController() )
target:AttachToPlayer( Object():GetParentPlayer() )
end
This achieves the same result as having a version of PutIntoPlayAttachedTo for players. Now I just have to work on the "different name restriction" and
Curse of Misfortunes will be ready.
EDIT 2: Complete code for the trigger of
Curse of Misfortunes:
- Code: Select all
<TRIGGERED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, you may search your library for a Curse card that doesn’t have the same name as a Curse attached to enchanted player, put it onto the battlefield attached to that player, then shuffle your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, puoi passare in rassegna il tuo grimorio per una carta Anatema che non ha lo stesso nome di un Anatema assegnato al giocatore incantato, metterla sul campo di battaglia assegnata a quel giocatore, poi rimescolare il tuo grimorio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zu Beginn deines Versorgungssegments kannst du deine Bibliothek nach einer Fluch-Karte durchsuchen, die nicht den gleichen Namen wie ein an den verzauberten Spieler angelegter Fluch hat, sie an diesen Spieler angelegt ins Spiel bringen und dann deine Bibliothek mischen.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de votre entretien, vous pouvez chercher dans votre bibliothèque une carte de malédiction qui n’a pas le même nom qu’une malédiction attachée au joueur enchanté, la mettre sur le champ de bataille attachée à ce joueur, puis mélanger votre bibliothèque.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de tu mantenimiento, puedes buscar en tu biblioteca una carta de Maldición que no tenga el mismo nombre que una Maldición anexada al jugador encantado, ponerla en el campo de batalla anexada a ese jugador y luego barajar tu biblioteca.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[キープの開始時に、あなたはエンチャントされているプレイヤーにつけられているどの呪いとも同じ名前を持たない呪いカードを1枚探してもよい。そうしたなら、それをそのプレイヤーにつけられた状態で戦場に出し、その後あなたのライブラリーを切り直す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신의 유지단 시작에, 당신은 부여된 플레이어에게 부착되어있는 저주와 카드명이 다른 저주 카드 한 장을 당신의 서고에서 찾아 그 플레이어에게 부착된 채로 전장에 놓을 수 있다. 그렇게 한다면, 당신의 서고를 섞는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале вашего шага поддержки вы можете найти в вашей библиотеке карту Проклятия, имя которой отличается от Проклятия, прикрепленного к зачарованному игроку, положить ее на поле битвы прикрепленной к тому игроку, затем перетасовать вашу библиотеку.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de sua manutenção, você pode procurar em seu grimório um card de Maldição que não tenha o mesmo nome que uma Maldição anexada ao jogador encantado, colocá-lo no campo de batalha anexado àquele jogador e depois embaralhar seu grimório.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
if EffectController():MyTurn() ~= 0 and MTG():GetStep() == STEP_UPKEEP then
local cursed = Object():GetParentPlayer()
if cursed ~= nil then
EffectDC():Set_PlayerPtr(1, cursed)
return true
end
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local filter = Object():GetFilter()
filter:Clear()
filter:NotTargetted()
filter:AddSubType( ENCHANTMENT_TYPE_CURSE )
filter:SetZone( ZONE_IN_PLAY )
filter:SetParentPlayer( EffectDC():Get_PlayerPtr(1) )
local n_curses = filter:EvaluateObjects()
local names_array = {}
if n_curses > 0 then
for i=0,n_curses-1 do
names_array[i] = filter:GetNthEvaluatedObject(i):GetCardName()
end
end
EffectController():MarkSearchedLibrary()
filter:Clear()
filter:NotTargetted()
filter:AddSubType( ENCHANTMENT_TYPE_CURSE )
filter:May()
filter:SetZone( ZONE_LIBRARY )
filter:SetPlayer( EffectController() )
if n_curses > 0 then
for i=0,n_curses-1 do
filter:AddCardName( names_array[i] )
end
filter:AddExtra( FILTER_EXTRA_FLIP_NAMES )
end
EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_AURA_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:PutIntoPlay( EffectController() )
target:AttachToPlayer( EffectDC():Get_PlayerPtr(1) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Easier than I thought.

Well, to make it more correct I could add a query that asks if I really want to search my library (which I'll probably do), but what I wanted to share is the core of the code.
EDIT 3: I just noticed that kev wrote NotTargetted() in the target definition for the curse, but just as all other Auras, they target what they enchant. Zambooo followed him and I was about to follow him, too...
...and people probably wonder why I trust only the cards that I make by myself...
