Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)
2014




Formal Request Thread
Moderator: CCGHQ Admins
Re: Formal Request Thread
by NeoAnderson » 05 Dec 2013, 00:03
Thank you so much my dear friend, you RSN_ObjectDC is really helpful, it let me work around many limitations avoiding to use DuelDataChest.RiiakShiNal wrote:I designed my ObjectDC functions to key off the instance of a card, thus if there are multiple copies in a deck (or multiple decks), a card is copied, or is re-cast from another zone that it will always have its own unique ObjectDC chest. So if you are using my ObjectDC functions you should not have to worry about such problems.
For a card to access another card's ObjectDC it has to have that object's instance to access it. For example if we wanted to access CardB's ObjectDC from CardA then CardA would have to access it like:I used false here because CardA doesn't want to create an ObjectDC for CardB if it doesn't already have one. If CardA did want to create an ObjectDC for CardB if it didn't already have one then it would use true instead of false.
- Code: Select all
local oBCardDC = RSN_GetObjectDC( oCardB, false )
For any card to access its own ObjectDC it only has to call RSN_ObjectDC() as that will automatically use EffectSource() to link the ObjectDC.
I got it and definitely it works fine thanks.RiiakShiNal wrote:Given that we can't get Effect objects in current DotP versions it should give you the correct TriggerObject(). As for how the trigger works it should fire just after an ability resolves (at which point your LinkedDC() value should be set). If you need a trigger that fires after an ability is played, but before it resolves (between PLAY_TIME_ACTIONs and RESOLUTION_TIME_ACTIONs) then try ABILITY_ABOUT_TO_RESOLVE.
Yeah probably i was tired and i forgot that sometimes without any reasonable causes AVAILIBILITY forgot what means EffectSource()...RiiakShiNal wrote:EffectSource() is not always available in AVAILABILITY blocks so instead try using Object() which should always be available for linking the ObjectDC. Also if you are just going to call RSN_GetObjectDC() with EffectSource() you could just as easily use RSN_ObjectDC() which uses EffectSource() without you having to type it.
Also when you use a false parameter on RSN_GetObjectDC() you need to add a check for the possibility that the ObjectDC is nil. For example if you initialize the ObjectDC in a TRIGGERED_ABILITY on an Artifact or Enchantment then try to access it in an ACTIVATED_ABILITY on the same card then if the player uses the ACTIVATED_ABILITY before the TRIGGERED_ABILITY has resolved then the ObjectDC will be nil because it hasn't been initialized yet. The same situation arises with AVAILABILITY blocks as they are checked during state-based effects to see if the ability can be activated and this will occur before ETB TRIGGERED_ABILITYs finish resolving as such the ObjectDC won't be initialized yet.

Using RSN_GetObjectDC() it works fine thanks a lot.
I have finished my card this is the final code i also make some check about the possibility the card is removed from battlefield also if have a card nailonto itself.
About this last possibility i have to use Trigger ZONECHANGE_CONSIDERED and i haven't seen any other possibility to fire manually the trigger, otherwise i should duplicate the code of ABILITY_RESOLVED and make another one for TRIGGERED_ABILITY_RESOLVED, but in this case i should also create another delayedDC and remove it when not necessary, so i preferred to keep 1 resource trigger and work on the RSN_Object values. What you think about it??
- Elysian Fields | Open
- Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="6">
<FILENAME text="ELYSIAN_FIELDS_W_7272130" />
<CARDNAME text="ELYSIAN_FIELDS_W" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Elysian Fields]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Champs-Elysées]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Campos Elíseos]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Elysischen Felder]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Campi Elisi]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エリージャン·フィールズ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[엘리 시안 필드]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[елисейские поля]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Campos Elíseos]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="7272130" />
<ARTID value="7227130" />
<ARTIST name="Applibot© Legend of Cryptids" />
<CASTING_COST cost="{W}{W}{W}" />
<SUPERTYPE metaname="Legendary" />
<TYPE metaname="Tribal" />
<TYPE metaname="Enchantment" />
<SUB_TYPE metaname="Divinity" />
<EXPANSION value="DPI" />
<RARITY metaname="R" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, if a creature is exiled in the Elysian Fields put a Elysium, onto Elysian Fields.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de votre entretien, si une créature est exilé dans les Champs-Elysées mettre un Elysium, sur les champs Elysées.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de tu mantenimiento, si una criatura se exilió en los Campos Elíseos poner un Elysium, en Campos Elíseos.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Elysischen Felder]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All'inizio del tuo mantenimento, se una creatura è esiliata nei Campi Elisi metti un segnalino Elysium, sui Campi Elisi.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのアップキープの開始時に、クリーチャーはエリュシオンのフィールドに追放されている場合はエリシアンのフィールド上に、エリュシオンを置く。]]></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, se uma criatura é exilado nos Campos Elíseos colocar um Elysium, em Campos Elíseos.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[在你的維持開始時,若一個生物被放逐在天堂領域投入了極樂世界,到極樂世界。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[在你的維持開始時,若一個生物被放逐在天堂領域投入了極樂世界,到極樂世界。]]></LOCALISED_TEXT>
<COUNTER_REGISTRATION name="Elysium" proliferate="11" />
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
local oDC = RSN_ObjectDC()
if oDC:Int_Get(4857) ~= nil then
return MTG():GetStep() == STEP_UPKEEP and oDC:Int_Get(4857) == 2
else
return false
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():GetCountersType("Elysium"), 1)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY forced_skip="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
local oDC = RSN_ObjectDC()
oDC:Int_Set( 4857, 1 )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If the Elysian Fields are going to leave the battlefield while a creature is exiled on the inside, remove all Elysium counters, return the creature to the battlefield with +X/+X, where X is the number of counters removed added to the power and toughness at the time when it was exiled. Shuffle the Elysian Fields in your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si les Champs-Elysées vont quitter le champ de bataille tandis qu'une créature est exilé à l'intérieur, retirez tous les marqueurs Elysium, retourner la créature au champ de bataille avec + X/+X, où X est le nombre de compteurs supprimé, ajouté à la force et l'endurance au moment où il a été exilé. Mélangez les Champs-Elysées dans votre bibliothèque.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si los Campos Elíseos se va a dejar el campo de batalla, mientras que una criatura se exilió en el interior, remueve todos los contadores Elysium, devolver la criatura al campo de batalla con + X/+X, donde X es el número de contadores retirados, sumado a la fuerza y resistencia en el momento en que fue exiliado. Baraja el Elysian Fields en su biblioteca.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn das Elysian Fields gehen, um das Schlachtfeld zu verlassen, während eine Kreatur auf der Innenseite verbannt, entfernen Sie alle Elysium Zähler, die Kreatur zurück auf das Schlachtfeld mit + X/+X, wobei X die Anzahl der Zähler entfernt, um die Stärke hinzugefügt und Zähigkeit zu der Zeit, als er ins Exil geschickt. Mische den Elysian Fields in Ihrer Bibliothek.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se i Campi Elisi stanno per lasciare il campo di battaglia mentre una creatura è esiliata al suo interno, rimuovi tutti i segnalini Elysium, rimetti la creatura sul campo di battaglia con +X/+X, dove X è il numero di segnalini rimossi, sommati alla forza e alla costituzione della creatura al momento in cui è stata esiliata. Rimescola i Campi Elisi nel tuo grimorio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エリシアンフィールズはクリーチャーが内側に追放されている間に戦場を離れしようとしている場合は、すべてのエリュシオンカウンターを取り除く+ X/+ X、Xは取り除かカウンタの数が、強さに追加されたところで戦場にクリーチャーを戻すそしてそれは当時の靭追放されたとき。ライブラリ内のエリシアン·フィールドを切り直す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[엘리 시안 필즈는 생물이 내부에 유배되어있는 동안 전장을 떠나려고하는 경우, 모든 엘리시움 카운터를 제거 + X/+X, X가 제거 카운터의 수, 강도에 추가되는 경우로 전장에 생물을 반환 그것은시 인성 추방 될 때. 라이브러리에있는 엘리 시안 필즈 셔플.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Если Елисейские поля собираются покинуть поле боя в то время как существо сослан на внутренней части, удалить все счетчики Elysium, верните существо на поле битвы с + X / + X, где Х число счетчиков удаленных, добавляется в силе и твердость в то время, когда он был сослан. Перемешайте Елисейских полях в вашей библиотеке.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Se os Campos Elísios vão deixar o campo de batalha, enquanto uma criatura é exilado no interior, remova todos os marcadores Elysium, retorne a criatura para o campo de batalha com + X/+X, onde X é o número de contadores removidas, adicionadas à força e resistência no momento em que ele foi exilado. Embaralhe os Campos Elísios em sua biblioteca.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[如果極樂世界將要離開戰場,而一個生物被放逐在裡面,刪除所有極樂世界櫃,生物與+ X/+ X,其中X被刪除計數器的數量,加入到實力重返戰場而當它被放逐韌性的時間。洗牌的極樂世界在您的圖書館。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[如果極樂世界將要離開戰場,而一個生物被放逐在裡面,刪除所有極樂世界櫃,生物與+ X/+ X,其中X被刪除計數器的數量,加入到實力重返戰場而當它被放逐韌性的時間。洗牌的極樂世界在您的圖書館。]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_CONSIDERED" simple_qualifier="self" to_zone="ZONE_ANY" from_zone="ZONE_BATTLEFIELD" pre_trigger="1">
local oDC = RSN_ObjectDC()
if oDC:Int_Get(4857) ~= 4 then
MTG():OverrideEvent()
return true
end
</TRIGGER>
<CLEANUP fire_once="1" />
<RESOLUTION_TIME_ACTION>
local oDC = RSN_ObjectDC()
if oDC:Int_Get(4857) ~= 1 then
local oDC = RSN_ObjectDC()
oDC:Int_Set( 4857, 3 )
MTG():FireTrigger( TRIGGER_ABILITY_RESOLVED, EffectSource() )
else
if Object() ~= nil then
oDC:Int_Set( 4857, 4 )
EffectDC():Set_PlayerPtr( 10, Object():GetOwner() )
Object():PutOnTopOfLibrary()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_PlayerPtr(10)
if player ~= nil then
player:ShuffleLibrary()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY >
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{0}: Exile a non-token creature in the Elysian Fields. You can use this ability once per turn and can be only one creature at a time exiled in the Elysian Fields.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{0}: Exiler une créature non-jeton dans les Champs-Elysées. Vous pouvez utiliser cette capacité une fois par tour et peut être seulement une créature à la fois en exil dans les Champs-Elysées.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{0}: Exilio una criatura que no sea ficha en los Campos Elíseos. Usted puede utilizar esta habilidad una vez por turno y puede haber sólo una criatura en un momento en el exilio en los Campos Elíseos.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{0}: Verbannung ein nicht-Token Geschöpf in der Elysian Fields. Sie können diese Fähigkeit einmal pro Runde und kann nur eine Kreatur in einer Zeit, in der Elysian Fields verbannt sein.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{0}: Esilia una creatura non pedina nei Campi Elisi. Puoi usare quesata abilità una volta per turno e può esserci solo una creatura per volta esiliata nei Campi Elisi.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{0}:エリュシオンの野に亡命非トークン生き物。あなたは1ターンに1度、この機能を使用することができますし、エリュシオンのフィールドに追放され、一度に1生き物です。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{0}: 엘리 시안 필즈에서 망명 아닌 토큰 생물. 당신은 1 턴에 1 번이 기능을 사용할 수 있으며, 엘리 시안 필즈에서 망명 한 번에 하나의 생물이 될 수 있습니다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{0}: Изгнание не-маркер существо на Елисейских полях. Вы можете использовать эту способность один раз за ход и может быть только одно существо в то время в изгнании на Елисейских полях.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{0}: Exile uma criatura não-símbolo nos Campos Elísios. Você pode usar esta habilidade uma vez por turno e pode ser apenas uma criatura de cada vez exilado nos Campos Elísios.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{0}: 流亡的非標記的生物在極樂世界。您可以使用此功能每一次轉彎,可在放逐中的極樂世界一時間只有一個生物。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{0}: 流亡的非標記的生物在極樂世界。您可以使用此功能每一次轉彎,可在放逐中的極樂世界一時間只有一個生物。]]></LOCALISED_TEXT>
<COST mana_cost="{0}" type="Mana" />
<AVAILABILITY>
local filter = ClearFilter()
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_IS_TOKEN, false )
local count = filter:Count()
if count > 0 then
local oDC = RSN_ObjectDC()
if oDC:Int_Get(4857) ~= nil and oDC:Int_Get(4857) == 1 then
return true
else
return false
end
else
return false
end
</AVAILABILITY>
<AVAILABILITY per_turn_limit="1" />
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
local filter = ClearFilter()
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_IS_TOKEN, false )
local count = filter:Count()
if count > 0 then
player:SetItemCount( 1 )
for i = 0,(1-1) do
player:SetItemPrompt (i, "CARD_QUERY_CHOOSE_CREATURE_TO_EXILE" )
end
end
player:ChooseItems( EffectDC():Make_Targets(0) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local toughness = target:GetCurrentToughness()
local power = target:GetCurrentPower()
local oDC = RSN_ObjectDC()
oDC:Int_Set( 4858, power )
oDC:Int_Set( 4859, toughness )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
EffectDC():Get_Targets(0):Protect_CardPtr(0)
target:Exile()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr(0, target)
delayDC:Protect_CardPtr(0)
MTG():CreateDelayedTrigger(1, delayDC)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
local source = EffectSource()
if target ~= nil and source ~= nil then
target:NailOnto(source)
local oDC = RSN_ObjectDC()
oDC:Int_Set( 4857, 2 )
end
</RESOLUTION_TIME_ACTION>
<AI_AVAILABILITY window_step="upkeep" type="window" />
<AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
<AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
<AI_AVAILABILITY window_step="declare_blockers" type="window" />
<AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="end_of_turn" type="window" />
<AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
<AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
<AI_AVAILABILITY type="in_response" response_source="1" />
<AI_AVAILABILITY type="in_response" response_target="1" />
<AUTO_SKIP>
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
return false
else
return true
end
</AUTO_SKIP>
</ACTIVATED_ABILITY>
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{0}: Remove all Elysium counters, from Elysian Fields, return to the battlefield the exiled creature with power and toughness X/X, where X is the number of counters removed added to the power and toughness at the time when it was exiled. You can use this ability once per turn and only if there is at least one Elysium counter on the Elysian Fields.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{0}: Retirez tous les compteurs Elysium, de Elysian Fields, retourner au champ de bataille de la créature exilée avec force et l'endurance X / X, où X est le nombre de compteurs retirés ajoutés à la force et l'endurance à l'époque où il a été exilé. Vous pouvez utiliser cette capacité une fois par tour et seulement si il est au moins un compteur Elysée sur les Champs-Elysées.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{0}: Remueve todos los contadores Elysium, de los Campos Elíseos, volver al campo de batalla a la criatura exiliada con fuerza como la resistencia X / X, donde X es el número de contadores retirados añadidos a la fuerza y la resistencia en el momento en que fue exiliado. Usted puede utilizar esta habilidad una vez por turno y sólo si hay al menos un contador Elysium en los Campos Elíseos.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{0}: Entfernen Sie alle Elysium Zähler, von lysischen Felder, zurück auf das Schlachtfeld im Exil lebenden Kreatur mit Stärke und Widerstandskraft X / X, wobei X die Anzahl der Zähler entfernt, um die Stärke und Widerstandskraft zu der Zeit hinzugefügt, wenn sie ins Exil geschickt wurde. Sie können diese Fähigkeit nur einmal pro Zug und nur, wenn es mindestens ein Elysium Zähler auf den Elysischen Felder aus.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{0} : Rimuovi tutti i segnalini Elysium dai Campi Elisi, rimetti sul campo di battaglia la creatura esiliata con forza e costituzione X/X, dove X è il numero di segnalini rimossi sommati alla forza e alla costituzione della creatura al momento in cui è stata esiliata. Puoi usare questa abilità una volta per turno e solo se c'è almeno un segnalino Elysium sui Campi Elisi. ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{0}: 、エリシアン分野から、すべてのエリュシオンカウンターを取り除く戦場にXは、それが追放された時点でのパワーとタフネスを追加、削除カウンタの数であり、パワーとタフネスX / Xと追放されたクリーチャーを返す。 エリシアンフィールド上に少なくとも1エリュシオンカウンターがあるターンとする場合にのみ、一度この機能を使用することができます。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{0}: , 엘리 시안 필드에서, 모든 엘리시움 카운터를 제거 전장에 X가이 추방 된 시간의 공격력과 방어력을 추가, 제거 카운터의 수 공격력과 방어력 X / X와 추방 생물을 반환합니다. 엘리 시안 필드에 적어도 하나의 엘리시움 카운터가 회전 당 경우에만 다시이 기능을 사용할 수 있습니다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{0}: Удалите все счетчики Elysium, от Елисейских полей, вернуться на поле боя в изгнании существо с силой и прочностью X / X, где Х число счетчиков удаленных, добавленных в силы и выносливости во время, когда он был сослан. Вы можете использовать эту способность один раз за ход и только тогда, когда по крайней мере один Элизиум счетчик на Елисейские поля.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{0}: Remova todos os contadores de Elysium, de Campos Elíseos, retornar ao campo de batalha a criatura exilado com o poder ea resistência X / X, onde X é o número de balcões removidos adicionados ao poder ea resistência no momento em que ele foi exilado. Você pode usar esta habilidade uma vez por turno e somente se houver pelo menos um contador de Elysium nos Campos Elíseos.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[{0}: 卸下所有極樂世界計數器,從極樂世界,重返戰場流亡的生物力量與防禦力X / X,其中X是去掉專櫃添加到力量與防禦力的時候,當它被流放的數量。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[{0}: 卸下所有極樂世界計數器,從極樂世界,重返戰場流亡的生物力量與防禦力X / X,其中X是去掉專櫃添加到力量與防禦力的時候,當它被流放的數量。]]></LOCALISED_TEXT>
<COUNTER_REGISTRATION name="Elysium" proliferate="11" />
<COST mana_cost="{0}" type="Mana" />
<AVAILABILITY>
local count = Object():CountCounters(MTG():GetCountersType("Elysium"))
if count > 0 then
local oDC = RSN_ObjectDC()
if oDC:Int_Get(4857) ~= nil and oDC:Int_Get(4857) == 2 then
return true
else
return false
end
else
return false
end
</AVAILABILITY>
<AVAILABILITY per_turn_limit="1" />
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
local oDC = RSN_ObjectDC()
local counters = EffectSource():CountCounters(MTG():GetCountersType("Elysium"))
if counters > 0 and oDC ~= nil then
oDC:Int_Set( 4860, counters )
EffectSource():RemoveCounters( MTG():GetCountersType("Elysium"), counters)
end
oDC:Int_Set( 4857, 0 )
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY resource_id="1" forced_skip="1" active_zone="ZONE_ANY">
<TRIGGER value="ABILITY_RESOLVED">
local oDC = RSN_ObjectDC()
if TriggerObject() == EffectSource() then
return oDC:Int_Get(4857) == 0 or oDC:Int_Get(4857) == 3
else
return false
end
</TRIGGER>
<CLEANUP fire_once="1" />
<PLAY_TIME_ACTION>
local oDC = RSN_ObjectDC()
if oDC:Int_Get(4857) == 3 then
local counters = EffectSource():CountCounters(MTG():GetCountersType("Elysium"))
if counters > 0 then
oDC:Int_Set( 4860, counters )
EffectSource():RemoveCounters( MTG():GetCountersType("Elysium"), counters)
else
oDC:Int_Set( 4860, 0 )
end
end
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local oDC = RSN_ObjectDC()
if oDC:Int_Get(4857) == 3 then
if Object() ~= nil then
oDC:Int_Set( 4857, 4 )
EffectDC():Set_PlayerPtr( 10, Object():GetOwner() )
Object():PutOnTopOfLibrary()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_PlayerPtr(10)
if player ~= nil then
player:ShuffleLibrary()
end
</RESOLUTION_TIME_ACTION>
<PLAY_TIME_ACTION>
local target = EffectDC():Get_CardPtr(0)
local oDC = RSN_ObjectDC()
if target ~= nil then
target:PutOntoBattlefield()
local power = oDC:Int_Get(4858)
local toughness = oDC:Int_Get(4859)
local Bonus = oDC:Int_Get(4860)
local NewPower = power + Bonus
local NewToughness = toughness + Bonus
EffectDC():Set_Int(5,NewPower)
EffectDC():Set_Int(6,NewToughness)
end
oDC:Int_Set( 4860, 0 )
if oDC:Int_Get(4857) == 0 then
oDC:Int_Set( 4857, 1 )
end
</PLAY_TIME_ACTION>
<CONTINUOUS_ACTION layer="7B">
local target = EffectDC():Get_CardPtr(0)
if target ~= nil then
local oToughness= EffectDC():Get_Int(6)
local oPower= EffectDC():Get_Int(5)
local characteristics = target:GetCurrentCharacteristics()
characteristics:Power_Set( oPower )
characteristics:Toughness_Set( oToughness )
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectController() == nil
</DURATION>
</TRIGGERED_ABILITY>
</CARD_V2>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by RiiakShiNal » 05 Dec 2013, 02:37
You forgot to make the last TRIGGERED_ABILITY able to access the LinkedDC() by adding linked_ability_group="1" to the tag.drleg3nd wrote:hey thx for help riiak but I guess I messed up somewhere lolgot this error:
- Utopia Sprawl | Open
- Code: Select all
<SPELL_ABILITY attach_definition="0">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Enchant Forest]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Enchanter : forêt]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Encantar bosque.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Waldverzauberung]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Incanta Foresta]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャント(森)]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Enchant Forest]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Зачаровать Лес]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Encantar Floresta]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_FOREST_TO_ENCHANT" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_FOREST )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if (target ~= nil and EffectSource() ~= nil) then
EffectSource():Attach( target )
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Utopia Sprawl enters the battlefield, choose a color.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au moment où l’Étendue de l’utopie arrive en jeu, choisissez une couleur.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto la Expansión utópica entre en juego, elige un color.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie die Utopia-Ausbreitung ins Spiel kommt, bestimme eine Farbe.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre la Propagazione dell’Utopia entra nel campo di battaglia, scegli un colore.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[楽園の拡散が場に出るに際し、色を1色選ぶ。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Utopia Sprawl enters the battlefield, choose a color.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Утопический рост вступает в игру, выберите цвет.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conforme Propagação da Utopia entra em jogo, escolha uma cor.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
-- Get the chosen colour.
LinkedDC():Int_Set(0, GetChosenColour())
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que la forêt enchantée est engagée pour du mana, son contrôleur ajoute un mana de la couleur choisie à sa réserve.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el bosque encantado se gire para obtener maná, su controlador agrega un maná del color elegido a su reserva de maná.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der verzauberte Wald für Mana getappt wird, erhöht sein Beherrscher seinen Manavorrat um ein zusätzliches Mana der bestimmten Farbe.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta la Foresta incantata è TAPpata per attingere mana, il suo controllore aggiunge un mana del colore scelto alla sua riserva di mana.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャントされている森がマナを引き出す目的でタップされるたび、それのコントローラーは選ばれた色のマナ1点を自分のマナ・プールに加える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда зачарованный Лес поворачивается для получения маны, контролирующий его игрок добавляет одну ману выбранного цвета в свой запас маны.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que a floresta encantada é virada para gerar mana, seu controlador adiciona um mana da cor escolhida à sua própria reserva de mana.]]></LOCALISED_TEXT>
<TRIGGER value="BECAME_TAPPED_FOR_MANA">
return EffectSource():GetParent() ~= nil and EffectSource():GetParent() == TriggerObject()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local nColour = LinkedDC():Int_Get(0)
local oPlayer = EffectSourceLKI():GetParent() ~= nil and EffectSourceLKI():GetParent():GetController()
if (nColour == COLOUR_BLACK) then
RSN_ProduceForPlayerNoTrigger( "{B}", 1, oPlayer )
elseif (nColour == COLOUR_BLUE) then
RSN_ProduceForPlayerNoTrigger( "{U}", 1, oPlayer )
elseif (nColour == COLOUR_GREEN) then
RSN_ProduceForPlayerNoTrigger( "{G}", 1, oPlayer )
elseif (nColour == COLOUR_RED) then
RSN_ProduceForPlayerNoTrigger( "{R}", 1, oPlayer )
else
RSN_ProduceForPlayerNoTrigger( "{W}", 1, oPlayer )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
RSN_EliminateExtraManaTokens()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
- Error | Open
- Code: Select all
[lua] [string "UTOPIA_SPRAWL_812107569_TITLE (RESOLUTION_TIME_ACTION)~0x0000043c"]:2: attempt to index a nil value
As for the error it told you where to look:
- UTOPIA_SPRAWL_812107569_TITLE = Card Name (this is obvious and you probably already knew that)
- RESOLUTION_TIME_ACTION = The problem is in one of the RESOLUTION_TIME_ACTION blocks (also obvious)
- ~0x0000043c = Unknown (we don't know what this is yet)
- :2: = The error is on the second line of the block (note that the line the block starts on is line 1).
- attempt to index a nil value = Description of the error which lets us know what to look for.
So given the error these are the possible lines the error could be on:
- local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
- -- Get the chosen colour.
- local nColour = LinkedDC():Int_Get(0)
- RSN_EliminateExtraManaTokens()
The problem could have been on line 1 (Get_Targets(0) could have been nil) except that because a TARGET block is used and there are virtually no restrictions that would prevent it from being selected and still have the spell be cast that line is out. Line 2 is just a comment so it is out. With line 3 the only way it could have that problem is if LinkedDC() is nil which can be checked by looking for linked_ability_group="1" in the ability tag which is missing so this is a problem. Line 4 can't be the problem because the game didn't complain about a missing function and if the problem were in the function it would have listed the LOL file as the problem fine and the line number of the problem in that file.
I don't think anyone has coded it yet (though I could be wrong), but it is quite possible to make in DotP 2014 (using either mana tokens or as auto-tap) because we don't have the same problems we had in DotP 2013 (which required it to use mana tokens).drleg3nd wrote:is Joraga Treespeaker floating around some where ? otherwise i'll attempt to make if Tfm or someone made level up ability
It still uses DuelDataChest() and still has to work with the same restrictions, but the method in how I use it allows it to work more like the old ObjectDC() from DotP 2013. It isn't perfect due to the added overhead so for some things it is better to use other options like LinkedDC(), Delayed Triggers, and so forth. The ObjectDC functions are merely another tool for us to make use of.NeoAnderson wrote:Thank you so much my dear friend, you RSN_ObjectDC is really helpful, it let me work around many limitations avoiding to use DuelDataChest.
ABILITY_RESOLVED should fire when any ability resolves so as long as your TRIGGERED_ABILITY sets the ObjectDC value like your ACTIVATED_ABILITY it should still trigger.NeoAnderson wrote:I have finished my card this is the final code i also make some check about the possibility the card is removed from battlefield also if have a card nailonto itself.
About this last possibility i have to use Trigger ZONECHANGE_CONSIDERED and i haven't seen any other possibility to fire manually the trigger, otherwise i should duplicate the code of ABILITY_RESOLVED and make another one for TRIGGERED_ABILITY_RESOLVED, but in this case i should also create another delayedDC and remove it when not necessary, so i preferred to keep 1 resource trigger and work on the RSN_Object values. What you think about it??[/size][/b]
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: Formal Request Thread
by MC Brodie » 05 Dec 2013, 03:45
My bad I meant to post this earlierdrleg3nd wrote:is Joraga Treespeaker floating around some where ? otherwise i'll attempt to make if Tfm or someone made level up ability
viewtopic.php?f=109&t=11726&p=132648&hilit=joraga#p132648
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
Song of the Day: 46 and 2 (cover)
Re: Formal Request Thread
by drleg3nd » 05 Dec 2013, 06:52
ok I had put the tag in but it still doesn't work..when i cast card it attaches to land but doesn't give me option to chose color and makes my forest a dead card. fortunately error log is gone
- Utopia Sprawl | Open
- Code: Select all
<SPELL_ABILITY attach_definition="0">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Enchant Forest]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Enchanter : forêt]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Encantar bosque.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Waldverzauberung]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Incanta Foresta]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャント(森)]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Enchant Forest]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Зачаровать Лес]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Encantar Floresta]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_FOREST_TO_ENCHANT" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_FOREST )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if (target ~= nil and EffectSource() ~= nil) then
EffectSource():Attach( target )
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Utopia Sprawl enters the battlefield, choose a color.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au moment où l’Étendue de l’utopie arrive en jeu, choisissez une couleur.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto la Expansión utópica entre en juego, elige un color.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie die Utopia-Ausbreitung ins Spiel kommt, bestimme eine Farbe.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre la Propagazione dell’Utopia entra nel campo di battaglia, scegli un colore.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[楽園の拡散が場に出るに際し、色を1色選ぶ。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Utopia Sprawl enters the battlefield, choose a color.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Утопический рост вступает в игру, выберите цвет.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conforme Propagação da Utopia entra em jogo, escolha uma cor.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
-- Get the chosen colour.
LinkedDC():Int_Set(0, GetChosenColour())
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que la forêt enchantée est engagée pour du mana, son contrôleur ajoute un mana de la couleur choisie à sa réserve.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el bosque encantado se gire para obtener maná, su controlador agrega un maná del color elegido a su reserva de maná.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der verzauberte Wald für Mana getappt wird, erhöht sein Beherrscher seinen Manavorrat um ein zusätzliches Mana der bestimmten Farbe.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta la Foresta incantata è TAPpata per attingere mana, il suo controllore aggiunge un mana del colore scelto alla sua riserva di mana.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャントされている森がマナを引き出す目的でタップされるたび、それのコントローラーは選ばれた色のマナ1点を自分のマナ・プールに加える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда зачарованный Лес поворачивается для получения маны, контролирующий его игрок добавляет одну ману выбранного цвета в свой запас маны.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que a floresta encantada é virada para gerar mana, seu controlador adiciona um mana da cor escolhida à sua própria reserva de mana.]]></LOCALISED_TEXT>
<TRIGGER value="BECAME_TAPPED_FOR_MANA">
return EffectSource():GetParent() ~= nil and EffectSource():GetParent() == TriggerObject()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local nColour = LinkedDC():Int_Get(0)
local oPlayer = EffectSourceLKI():GetParent() ~= nil and EffectSourceLKI():GetParent():GetController()
if (nColour == COLOUR_BLACK) then
RSN_ProduceForPlayerNoTrigger( "{B}", 1, oPlayer )
elseif (nColour == COLOUR_BLUE) then
RSN_ProduceForPlayerNoTrigger( "{U}", 1, oPlayer )
elseif (nColour == COLOUR_GREEN) then
RSN_ProduceForPlayerNoTrigger( "{G}", 1, oPlayer )
elseif (nColour == COLOUR_RED) then
RSN_ProduceForPlayerNoTrigger( "{R}", 1, oPlayer )
else
RSN_ProduceForPlayerNoTrigger( "{W}", 1, oPlayer )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
RSN_EliminateExtraManaTokens()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
Re: Formal Request Thread
by sumomole » 05 Dec 2013, 09:11
drleg3nd wrote:ok I had put the tag in but it still doesn't work..when i cast card it attaches to land but doesn't give me option to chose color and makes my forest a dead card. fortunately error log is gone
- | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Utopia Sprawl enters the battlefield, choose a color.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
EffectController():ChooseColour( "CARD_QUERY_CHOOSE_COLOUR", true )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
LinkedDC():Set_Int(0, GetChosenColour() )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool.]]></LOCALISED_TEXT>
<TRIGGER value="BECAME_TAPPED_FOR_MANA">
return EffectSource():GetParent() == TriggerObject()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local nColour = LinkedDC():Int_Get(0)
local oPlayer = TriggerObjectLKI():GetPlayer()
if (nColour == COLOUR_BLACK) then
RSN_ProduceForPlayerNoTrigger( "{B}", 1, oPlayer )
elseif (nColour == COLOUR_BLUE) then
RSN_ProduceForPlayerNoTrigger( "{U}", 1, oPlayer )
elseif (nColour == COLOUR_GREEN) then
RSN_ProduceForPlayerNoTrigger( "{G}", 1, oPlayer )
elseif (nColour == COLOUR_RED) then
RSN_ProduceForPlayerNoTrigger( "{R}", 1, oPlayer )
else
RSN_ProduceForPlayerNoTrigger( "{W}", 1, oPlayer )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
RSN_EliminateExtraManaTokens()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by NeoAnderson » 05 Dec 2013, 16:14
Dear friend,RiiakShiNal wrote:ABILITY_RESOLVED should fire when any ability resolves so as long as your TRIGGERED_ABILITY sets the ObjectDC value like your ACTIVATED_ABILITY it should still trigger.NeoAnderson wrote:I have finished my card this is the final code i also make some check about the possibility the card is removed from battlefield also if have a card nailonto itself.
About this last possibility i have to use Trigger ZONECHANGE_CONSIDERED and i haven't seen any other possibility to fire manually the trigger, otherwise i should duplicate the code of ABILITY_RESOLVED and make another one for TRIGGERED_ABILITY_RESOLVED, but in this case i should also create another delayedDC and remove it when not necessary, so i preferred to keep 1 resource trigger and work on the RSN_Object values. What you think about it??[/size][/b]
I would just let you know, i tried what you said, but probably the engine make difference between Trigger_Abilities and other abilities. It doesn't trigger. So i decided to left it with manual FireTrigger it works fine.
Now i have made a new card is not so complicated but i had to approach a new situation :
It is an Instant spell, "Olympus Recall"
The effect is : exile X target permanents you control until the beginning of your next turn. Add X

I had to define the number of targets, while the player was choosing and then i had to set this number to store the card's pointers into a chest to use with a delayedDC.
I used this solution, and it works fine.
I had only a problem, i was trying to understand if there was a function who let me know, how many cards were targeted ( i tried GetTargetCount() but it doesn't work, probably i have used a wrong syntax, i have not found any example of implementation for this function)
anyway, i have made my own function, CountHowManyTargets it is a simple for cycle 0 - 99 (is reasonable to think there will not be more then 100 targets ) to count the targets.
Can you let me know your opinion?
- Olympus Recall | Open
- Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="6">
<FILENAME text="OLYMPUS_RECALL_W_7272135" />
<CARDNAME text="OLYMPUS_RECALL_W" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Olympus Recall]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Rappel de l'Olympe]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Retirada de Olimpo]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Rückruf von Olymp]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Richiamo dell'Olimpo]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[オリンパスのリコール]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[올림푸스의 리콜]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Напомним Олимпа]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Retirada de Olimpo]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[奧林巴斯召回]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[奧林巴斯召回]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="7272135" />
<ARTID value="7227135" />
<ARTIST name="Applibot© Legend of Cryptids" />
<CASTING_COST cost="{W}" />
<TYPE metaname="Tribal" />
<TYPE metaname="Instant" />
<SUB_TYPE metaname="Divinity" />
<EXPANSION value="DPI" />
<RARITY metaname="M" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Exile X target permanents you control until the beginning of your next turn. Add X {W} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Exilez X permanents ciblés que vous contrôlez jusqu'au début de votre prochain tour. Ajouter X {W} à votre réserve de mana.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Exilio X permanentes objetivo que controlas hasta el comienzo de tu siguiente turno. Agrega X {W} a tu reserva de maná.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Exile X Zielbleib Sie bis zum Beginn der nächsten Abbiegung zu steuern. In X {W}, um Ihren Mana-Pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Esilia X permanenti bersaglio che controlli fino all'inizio del tuo prossimo turno. Aggiungi X {W} alla tua riserva di mana.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたの次のターンの開始まで、制御亡命のXターゲットパーマネント。あなたのマナ·プールに、X{W}を加える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신은 당신의 다음 턴의 시작 부분까지 제어 망명 X 대상 파마. 마나 풀에 X {W}를 추가합니다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Изгнание X целевые перманенты вы не контролируют до начала вашего следующего хода. Добавить X {W} в ваше хранилище маны.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Exile X permanentes alvo que você controla até o início do seu próximo turno. Adicionar X {W} à sua reserva de mana.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[流亡X個目標永久控制你直到你的下回合開始。添加x{W}到你的法術力池中。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[流亡X個目標永久控制你直到你的下回合開始。添加x{W}到你的法術力池中。]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_TO_EXILE" definition="0" compartment="0" up_to="1" >
local filter = ClearFilter()
filter:Add( FE_IS_PERMANENT, true )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
local oTargets = filter:Count()
MTG():SetTargetCount( oTargets )
</TARGET>
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_IS_PERMANENT, true )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_Int(0, 0)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local delayDC = EffectDC():Get_Chest(1)
local oTargets = CountHowManyTargets(0)
local count_so_far = delayDC:Get_Int(0)
for i=0,(oTargets-1) do
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(i)
if target ~= nil then
count_so_far = delayDC:Get_Int(0)
delayDC:Set_CardPtr(1 + count_so_far, target)
delayDC:Protect_CardPtr(1 + count_so_far)
delayDC:Set_Int(0, count_so_far + 1)
target:Exile()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local delayDC = EffectDC():Get_Chest(1)
if delayDC:Get_Int(0) > 0 then
MTG():CreateDelayedTrigger(2, delayDC)
end
</RESOLUTION_TIME_ACTION>
<PLAY_TIME_ACTION>
RSN_MarkManaAbilityStart()
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local delayDC = EffectDC():Get_Chest(1)
local cmc = delayDC:Get_Int(0)
local WhiteString =""
for i = 1, (cmc) do
WhiteString = WhiteString.."{W}"
end
RSN_Produce( WhiteString, 1 )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
RSN_EliminateExtraManaTokens()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
S_DisplayManaPool(EffectController())
RSN_MarkManaAbilityEnd()
</RESOLUTION_TIME_ACTION>
<AI_AVAILABILITY window_step="upkeep" type="window" />
<AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
<AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
<AI_AVAILABILITY window_step="declare_blockers" type="window" />
<AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="end_of_turn" type="window" />
<AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
<AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
<AI_AVAILABILITY type="in_response" response_source="1" />
<AI_AVAILABILITY type="in_response" response_target="1" />
</SPELL_ABILITY>
<TRIGGERED_ABILITY resource_id="2">
<TRIGGER value="BEGINNING_OF_STEP">
return MTG():GetStep() == STEP_UPKEEP and EffectController():MyTurn() == true
</TRIGGER>
<CLEANUP fire_once="1" />
<SFX text="GLOBAL_EPIPHANY_PLAY" />
<RESOLUTION_TIME_ACTION>
local count_so_far = EffectDC():Get_Int(0)
for i = 1, (count_so_far) do
local target = EffectDC():Get_CardPtr(i)
if target ~= nil then
EffectDC():Protect_CardPtr(i)
target:PutOntoBattlefield( target:GetOwner() )
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by xxd34thx » 05 Dec 2013, 17:28
I was wondering if anyone had coding for Mycosynth Lattice and Copy Artifact. Thanks
-
xxd34thx - Posts: 17
- Joined: 08 Nov 2013, 18:41
- Has thanked: 0 time
- Been thanked: 0 time
Re: Formal Request Thread
by thefiremind » 05 Dec 2013, 17:39
First of all, you should change the ability text because it's not really clear. I was searching forNeoAnderson wrote:i was trying to understand if there was a function who let me know, how many cards were targeted ( i tried GetTargetCount() but it doesn't work, probably i have used a wrong syntax, i have not found any example of implementation for this function)



About the function, what you are looking for is EffectDC():Get_Targets(0):Count().
The "Players may spend mana as though it were mana of any color" ability is impossible to code.xxd34thx wrote:Mycosynth Lattice
Copy Artifact is identical to Copy Enchantment, which is in my mod, except it works on artifacts.xxd34thx wrote:Copy Artifact

- Copy Artifact ability (untested) | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_TRANSITION">
-- Localised text omitted
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT)
EffectController():ChooseItem( "CARD_QUERY_CHOOSE_ARTIFACT_TO_COPY", EffectDC():Make_Targets(0), QUERY_FLAG_MAY )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local copy_chest = EffectDC():Make_Chest(1)
target:StoreCopiableValues(copy_chest)
EffectSource():UseCopiableValues(copy_chest)
EffectDC():Protect_CardPtr(COMPARTMENT_ID_EFFECT_SOURCE)
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="1">
local source = EffectSource()
local copy_chest = EffectDC():Get_Chest(1)
if source ~= nil and copy_chest ~= nil then
source:UseCopiableValues(copy_chest)
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectSource() == nil
</DURATION>
</TRIGGERED_ABILITY>
< 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: Formal Request Thread
by Gideon1919 » 05 Dec 2013, 17:58
has anyone coded scion of the ur-dragon.
- Gideon1919
- Posts: 13
- Joined: 03 Sep 2013, 16:32
- Has thanked: 0 time
- Been thanked: 0 time
Re: Formal Request Thread
by sumomole » 05 Dec 2013, 18:16
have you tested your Copy Enchantment to copy an Aura? I think it isn't feasible, it's too late to choose a permanent enchanted.thefiremind wrote:Copy Artifact is identical to Copy Enchantment, which is in my mod, except it works on artifacts.
- Copy Artifact ability (untested) | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_TRANSITION">
-- Localised text omitted
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT)
EffectController():ChooseItem( "CARD_QUERY_CHOOSE_ARTIFACT_TO_COPY", EffectDC():Make_Targets(0), QUERY_FLAG_MAY )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local copy_chest = EffectDC():Make_Chest(1)
target:StoreCopiableValues(copy_chest)
EffectSource():UseCopiableValues(copy_chest)
EffectDC():Protect_CardPtr(COMPARTMENT_ID_EFFECT_SOURCE)
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="1">
local source = EffectSource()
local copy_chest = EffectDC():Get_Chest(1)
if source ~= nil and copy_chest ~= nil then
source:UseCopiableValues(copy_chest)
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectSource() == nil
</DURATION>
</TRIGGERED_ABILITY>
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by NeoAnderson » 05 Dec 2013, 18:32
Thanks you my friend,thefiremind wrote:First of all, you should change the ability text because it's not really clear. I was searching forNeoAnderson wrote:i was trying to understand if there was a function who let me know, how many cards were targeted ( i tried GetTargetCount() but it doesn't work, probably i have used a wrong syntax, i have not found any example of implementation for this function)in the cost but couldn't find it.
A more correct wording would be: "Exile any number of target permanents you control until the beginning of your next upkeep. Add X
to your mana pool, where X is the number of permanents exiled this way."
About the function, what you are looking for is EffectDC():Get_Targets(0):Count().
About the text you're right

About the function, sometimes are the simple things who are hard to find

- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by RiiakShiNal » 05 Dec 2013, 18:51
The reason it's not working for you is because you have the ability you are trying to get the ABILITY_RESOLVED trigger from marked with replacement_effect="1". If an ability is marked with replacement_effect or replacement_query then it can't be responded to in any way so it makes sense that abilities marked as such do not generate some events like ABILITY_PLAYED, ABILITY_ABOUT_TO_RESOLVE, and ABILITY_RESOLVED. If you remove the replacement_effect attribute you should find that it will properly fire those events.NeoAnderson wrote:I would just let you know, i tried what you said, but probably the engine make difference between Trigger_Abilities and other abilities. It doesn't trigger. So i decided to left it with manual FireTrigger it works fine.
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: Formal Request Thread
by NeoAnderson » 05 Dec 2013, 19:03
OK Standing ovation for you my friend, it works fineRiiakShiNal wrote:The reason it's not working for you is because you have the ability you are trying to get the ABILITY_RESOLVED trigger from marked with replacement_effect="1". If an ability is marked with replacement_effect or replacement_query then it can't be responded to in any way so it makes sense that abilities marked as such do not generate some events like ABILITY_PLAYED, ABILITY_ABOUT_TO_RESOLVE, and ABILITY_RESOLVED. If you remove the replacement_effect attribute you should find that it will properly fire those events.NeoAnderson wrote:I would just let you know, i tried what you said, but probably the engine make difference between Trigger_Abilities and other abilities. It doesn't trigger. So i decided to left it with manual FireTrigger it works fine.

- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by NEMESiS » 05 Dec 2013, 20:38
Can Not of This World of this world be coded? If it is can someone make one, although I am sure we can't code countering an ability...
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Formal Request Thread
by thefiremind » 05 Dec 2013, 21:14
I totally forgot about that. I made a fix but it's not perfect. If you can make it better than this, let me know.sumomole wrote:have you tested your Copy Enchantment to copy an Aura? I think it isn't feasible, it's too late to choose a permanent enchanted.
- Copy Enchantment ability (mostly working but not perfect) | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You may have Copy Enchantment enter the battlefield as a copy of any enchantment on the battlefield.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vous pouvez faire que la Copie d’enchantement arrive sur le champ de bataille comme une copie de n’importe quelle enchantement sur le champ de bataille.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Puedes hacer que el Encantamiento copia entre al campo de batalla como una copia de cualquier encantamiento en el campo de batalla.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Du kannst den Verzauberungskopie als Kopie einer beliebigen Verzauberung, die sich im Spiel befindet, ins Spiel kommen lassen.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Puoi far entrare Copia Incantesimo nel campo di battaglia come una copia di qualsiasi incantesimo sul campo di battaglia.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エンチャント複製が場に出るに際し、あなたは場に出ているエンチャントを1つ選んでもよい。 そうした場合、エンチャント複製はそのエンチャントのコピーとして場に出る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[You may have Copy Enchantment enter the battlefield as a copy of any enchantment on the battlefield.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Как только Копия чар вступает в игру, вы можете выбрать чары в игре. При этом Копия чар вступит в игру как копия этих чар.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Você pode fazer com que Cópia de Encantamento entre no campo de batalha como uma cópia de qualquer encantamento no campo de batalha.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT)
EffectController():ChooseItem( "TFM_CARD_QUERY_CHOOSE_ENCHANTMENT_TO_COPY", EffectDC():Make_Targets(0), QUERY_FLAG_MAY )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local source = EffectSource()
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if source ~= nil and target ~= nil then
local copy_chest = EffectDC():Make_Chest(1)
target:StoreCopiableValues(copy_chest)
source:UseCopiableValues(copy_chest)
if target:GetSubType():Test(ENCHANTMENT_TYPE_AURA) then
MTG():ClearFilterMark()
local filter = ClearFilter()
local parent_card = target:GetParent()
local parent_player = target:GetParentPlayer()
if parent_card ~= nil then
filter:SetZone( parent_card:GetZone() )
filter:Add(FE_CARD_INSTANCE, OP_NOT, source)
local filter_count = filter:EvaluateObjects()
for i=0,filter_count-1 do
local permanent = filter:GetNthEvaluatedObject(i)
--if source:CanAttachTo(permanent) then -- This would be optimal, but sadly it doesn't work properly
if target:CanAttachTo(permanent) then -- This will fail for "Enchant permanent you control" belonging to other players
permanent:MarkForFilter()
end
end
filter:SetMarkedObjectsOnly()
EffectController():ChooseItem( "CARD_QUERY_CHOOSE_PERMANENT_TO_ENCHANT", EffectDC():Make_Targets(2) )
elseif parent_player ~= nil then
filter:SetFilterType(FILTER_TYPE_PLAYERS)
EffectController():ChooseItem( "CARD_QUERY_CHOOSE_PLAYER_TO_CURSE", EffectDC():Make_Targets(2) )
end
end
EffectDC():Protect_CardPtr(COMPARTMENT_ID_EFFECT_SOURCE)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local parentDC = EffectDC():Get_Targets(2)
if parentDC ~= nil then
local parent_card = parentDC:Get_CardPtr(0)
local parent_player = parentDC:Get_PlayerPtr(0)
if parent_card ~= nil then
EffectSource():Attach(parent_card)
elseif parent_player ~= nil then
EffectSource():AttachToPlayer(parent_player)
end
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="1">
local source = EffectSource()
local copy_chest = EffectDC():Get_Chest(1)
if source ~= nil and copy_chest ~= nil then
source:UseCopiableValues(copy_chest)
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectSource() == nil
</DURATION>
</TRIGGERED_ABILITY>
Not only that, but you also can't adjust the casting cost of a spell according to the targets.NEMESiS wrote:Can Not of This World of this world be coded? If it is can someone make one, although I am sure we can't code countering an ability...
< 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
Who is online
Users browsing this forum: No registered users and 5 guests