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 thefiremind » 15 Nov 2013, 19:01
There it is:Real wrote:I know Grisly Spectacle has been requested before but no one has code it yet. So may I request it again?
- Grisly Spectacle (untested) | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="GRISLY_SPECTACLE_366396" />
<CARDNAME text="GRISLY_SPECTACLE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Grisly Spectacle]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sinistre spectacle]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Espectáculo macabro]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Entsetzliches Spektakel]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Spettacolo Orripilante]]></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[Espetáculo Aterrador]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="366396" />
<ARTID value="366396" />
<ARTIST name="Zoltan Boros" />
<CASTING_COST cost="{2}{B}{B}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Watch people flock to a murder scene. Then tell me we’re not all a little sick in the head.”
—Juri, proprietor of the Juri Revue]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Observez l’affluence des badauds sur une scène de crime. Puis osez m’affirmer que nous sommes parfaitement sains d’esprit. »
—Juri, propriétaire de la Revue de Juri]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Mira cómo se reúne la gente en torno a la escena de un crimen. Luego dime si no estamos todos un poco perturbados.”
—Juri, propietario del elenco de Juri]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Sieh dir nur an, wie viele Menschen am Schauplatz eines Mordes zusammenlaufen. Und dann erzähl mir noch, wir seien nicht alle etwas krank im Kopf.”
—Juri, Inhaber von Juris Revue]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Osserva come la gente accorre sulla scena di un delitto. Dimmi se non siamo tutti un po’ morbosi.”
—Juri, proprietario della Rivista di Juri]]></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[“Veja como as pessoas se aglomeram em uma cena de assassinato. Agora me diga que não somos todos um pouco doentes da cabeça.”
— Juri, proprietário da Trupe de Juri]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Instant" />
<EXPANSION value="GTC" />
<RARITY metaname="C" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Destroy target nonartifact creature. Its controller puts a number of cards equal to that creature’s power from the top of his or her library into his or her graveyard.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Détruisez la créature non-artefact ciblée. Son contrôleur met dans son cimetière, depuis le dessus de sa bibliothèque, un nombre de cartes égal à la force de cette créature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Destruye la criatura objetivo que no sea artefacto. Su controlador pone una cantidad de cartas igual a la fuerza de esa criatura de la parte superior de su biblioteca en su cementerio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zerstöre eine Nichtartefaktkreatur deiner Wahl. Ihr Beherrscher legt so viele Karten von oben von seiner Bibliothek auf seinen Friedhof, wie die Stärke dieser Kreatur beträgt.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Distruggi una creatura non artefatto bersaglio. Il suo controllore mette nel suo cimitero un numero di carte pari alla forza di quella creatura dalla cima del suo grimorio.]]></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[Destrua a criatura alvo que não seja um artefato. Seu controlador coloca um número de cards igual ao poder daquela criatura do topo do grimório dele no próprio cemitério.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_DESTROY" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_ARTIFACT)
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
EffectDC():Set_PlayerPtr( 1, target:GetController() )
EffectDC():Set_Int( 2, target:GetCurrentCharacteristics():Power_Get() )
target:Destroy()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_PlayerPtr(1)
if player ~= nil then
player:MillCards( EffectDC():Get_Int(2) )
end
</RESOLUTION_TIME_ACTION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
<SFX text="TARGET_BLADE_PLAY" />
</SPELL_ABILITY>
<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="main_1" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="declare_blockers" type="window" />
<AI_AVAILABILITY window_step="end_of_turn" type="window" />
<AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
<AI_BASE_SCORE score="1200" zone="ZONE_HAND" />
</CARD_V2>
< 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 NeoAnderson » 15 Nov 2013, 22:30
Thanks my friend, I can confirm to you this code works, i have test with my creatures with "Blood drop" (blood drop triggers if a red source you control deals damage) and it works.thefiremind wrote:I can only think about what I did for Phyrexian Unlife in DotP2013, but in that card I was substituting the original damage with a new issue of it, which was safe to do in DotP2013, while in DotP2014 you can't set damage as combat or unpreventable and this would mean losing any of those 2 characteristics if you do that. I have an idea for a workaround, but I don't know if it works. Test this code (maybe dealing damage to a creature with protection from red) and let me know.If you change a characteristic in a RESOLUTION_TIME_ACTION it should last only until state-based effects are checked (the smallest chunk of time we can have in DotP). So, if my idea works, the source will become red, deal the damage, then turn back to its original color(s), without the players even noticing it.
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1">
<TRIGGER value="SOURCE_DEALS_DAMAGE" simple_qualifier="objectyoucontrol" pre_trigger="1" />
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():GetCurrentCharacteristics():Colour_Set(COLOUR_RED)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
I have only a doubt if something will delay the damage assignment while the card is on the stack , could the color go back to the source color before the effect is resolved?
Anyway i was thinking this function to be used as enchantment effect.
I don't know if this could interest to you, but i was also following another idea : Replace the damage dealt by a source, and let the damage be dealt by the enchantment. (the enchantment is a red card)
Obviously there will be some negative aspects to use this solution, one of them is that in this way all the sources will be reduced to one card, so if something will affect this card you can lose this effect.
here is how i coded the card :
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1">
<TRIGGER value="PLAYER_TAKES_DAMAGE" pre_trigger="1" damage_type="all">
return TriggerPlayer() ~= EffectController()
</TRIGGER>
<TRIGGER value="OBJECT_TAKES_DAMAGE" pre_trigger="1" damage_type="all">
return TriggerObject():GetPlayer() ~= EffectController()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
EffectDC():Set_Int( 5, Damage():PreventAll() )
Damage():PreventAll()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local targetP = TriggerPlayer()
local targetC = TriggerObject()
if targetP ~= nil then
EffectSourceLKI():DealUnpreventableDamageTo( EffectDC():Get_Int(5) , targetP )
elseif targetC ~= nil then
EffectSourceLKI():DealUnpreventableDamageTo( EffectDC():Get_Int(5) , targetC )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by thefiremind » 15 Nov 2013, 22:44
If something delays the damage, the pre-trigger will be delayed as well.NeoAnderson wrote:I have only a doubt if something will delay the damage assignment while the card is on the stack , could the color go back to the source color before the effect is resolved?
The card is yours, so it's up to you to decide how to make it work.NeoAnderson wrote:Anyway i was thinking this function to be used as enchantment effect.
I don't know if this could interest to you, but i was also following another idea : Replace the damage dealt by a source, and let the damage be dealt by the enchantment. (the enchantment is a red card)
Obviously there will be some negative aspects to use this solution, one of them is that in this way all the sources will be reduced to one card, so if something will affect this card you can lose this effect.
-------------------------------------------
EDIT: Does someone find anything wrong with the following idea I had for Prossh, Skyraider of Kher? I tested it and it works as expected, but maybe someone can come up with a scenario where it leads to an unwanted result.
- Code: Select all
<SPELL_ABILITY linked_ability_group="1">
<PLAY_TIME_ACTION>
-- Save the amount of mana available just before casting this card
LinkedDC():Set_Int( 0, EffectController():GetTotalMana() )
</PLAY_TIME_ACTION>
</SPELL_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1" active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When you cast Prossh, Skyraider of Kher, put X 0/1 red Kobold creature tokens named Kobolds of Kher Keep onto the battlefield, where X is the amount of mana spent to cast Prossh.]]></LOCALISED_TEXT>
<TRIGGER value="SPELL_PLAYED" simple_qualifier="self">
-- The previously saved amount minus the current amount of available mana gives the mana spent to cast this card
EffectDC():Set_Int( 0, LinkedDC():Get_Int(0) - EffectController():GetTotalMana() )
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local token_count = EffectDC():Get_Int(0)
if token_count > 0 then
MTG():PutTokensOntoBattlefield( "my_kobold_token", token_count, EffectController() )
end
</RESOLUTION_TIME_ACTION>
</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 NeoAnderson » 16 Nov 2013, 17:39
Hey guys i have another question for you
I am implementing an enchantment card, it should works in this way :
" When in play any creatures controlled by your opponents cannot use their activable abilities.
The controller of that creatures can pay "sacrifice a land" to activate (once time) the abilities of a creature he controls."
I tried in different ways finally i have implemented it so :
1. When the card enter into battefield it adds a counter to all the creatures in play (controlled by opponents)
2. If a creature comes into battefield under control of your opponents add a counter on it.
3. Some check to keep the numeber of counters not greater than 1 for each creature.
4. An activable ability avaible for any player : sacrifice a land and remove a counter from a creature you control.
Now the card is most done but i have an issue when the player sacrifice a land, at end of that turn it comes in play again.
Please could you check the code and let me know what you think about this behaviour?

I am implementing an enchantment card, it should works in this way :
" When in play any creatures controlled by your opponents cannot use their activable abilities.
The controller of that creatures can pay "sacrifice a land" to activate (once time) the abilities of a creature he controls."
I tried in different ways finally i have implemented it so :
1. When the card enter into battefield it adds a counter to all the creatures in play (controlled by opponents)
2. If a creature comes into battefield under control of your opponents add a counter on it.
3. Some check to keep the numeber of counters not greater than 1 for each creature.
4. An activable ability avaible for any player : sacrifice a land and remove a counter from a creature you control.
Now the card is most done but i have an issue when the player sacrifice a land, at end of that turn it comes in play again.
Please could you check the code and let me know what you think about this behaviour?
- Code: Select all
<STATIC_ABILITY>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
--filter:Add( FE_CONTROLLER, OP_NOT, EffectController() )
</FILTER>
<CONTINUOUS_ACTION layer="8" filter_id="0">
if FilteredCard() ~= nil then
if FilteredCard():CountCounters(MTG():GetCountersType("Powerlose")) == 1 then
FilteredCard():GetCurrentCharacteristics():Bool_Set(CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES, 1)
end
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectSource() == nil
</DURATION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY forced_skip="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<COUNTER_REGISTRATION name="Powerlose" proliferate="11" />
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
--filter:Add( FE_CONTROLLER, OP_NOT, EffectController() )
</FILTER>
<RESOLUTION_TIME_ACTION filter_id="0">
if FilteredCard() ~= nil and EffectSource() ~= nil then
if FilteredCard():CountCounters(MTG():GetCountersType("Powerlose")) == 0 then
FilteredCard():AddCounters( MTG():GetCountersType("Powerlose"), 1)
end
end
</RESOLUTION_TIME_ACTION>
<SFX text="TARGET_FANG_PLAY" />
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY>
<TRIGGER value="ZONECHANGE_END" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" forced_skip="1">
return TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE )
</TRIGGER>
<RESOLUTION_TIME_ACTION>
TriggerObject():AddCounters( MTG():GetCountersType("Powerlose"), 1)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY pre_trigger="1" forced_skip="1" active_zone="ZONE_ANY">
<TRIGGER value="COUNTERS_CHANGED" >
return TriggerObject():CountCounters(MTG():GetCountersType("Powerlose")) > 1
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
local oCounters = TriggerObject():CountCounters(MTG():GetCountersType("Powerlose"))
local oMaxCounters = 1
local oCounterstoremove = oCounters - oMaxCounters
TriggerObject():RemoveCounters( MTG():GetCountersType("Powerlose"), oCounterstoremove)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY >
<TRIGGER value="ACTIVATED_ABILITY_PLAYED" >
return TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE )
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil and EffectSource() ~= nil then
if TriggerObject():CountCounters(MTG():GetCountersType("Powerlose")) == 0 then
TriggerObject():AddCounters( MTG():GetCountersType("Powerlose"), 1)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Sacrifice a land: You can unlock the activable abilities of target creature under your control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacrifica una terra: Sblocca le abilità attivabili di una creatura bersaglio che controlli.]]></LOCALISED_TEXT>
<COST type="Sacrifice" definition="0" compartment="1" query_tag="CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE" item_count="1" />
<AVAILABILITY any_player="1" />
<COST_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
</COST_DEFINITION>
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
local filter_count = filter:EvaluateObjects()
if filter_count > 0 then
EffectController():ChooseItem( "CARD_QUERY_CHOOSE_LAND_YOU_CONTROL", EffectDC():Make_Targets(1) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if EffectSource() ~= nil and target ~= nil then
if target:CountCounters(MTG():GetCountersType("Powerlose")) > 0 then
target:RemoveCounters( MTG():GetCountersType("Powerlose"), 1)
end
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_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 drleg3nd » 19 Nov 2013, 02:45
question..if i whip of erebos a creature into play then sacrifice from trading post.does he still get exiled ?
Re: Formal Request Thread
by MC Brodie » 19 Nov 2013, 02:52
Yes. Even if it's a girl creature as welldrleg3nd wrote:question..if i whip of erebos a creature into play then sacrifice from trading post.does he still get exiled ?

-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
Song of the Day: 46 and 2 (cover)
Re: Formal Request Thread
by NeoAnderson » 21 Nov 2013, 03:08
Hey Firemind, Riiak i have a question for you guys!
I would make a new effect, something similar to a "Propagation" but i am not sure how to implement it.
The effect should work so :
Example : I cast an instant, who target a creature. it gives to this creature an ability. when this creature leave the battlefield i would pass the received ability to another creature on the battlefield.
Now about the first part is simple inside the spell ability, I granted an ability into a continuos block level 6 with duration effectcontroller == nil.
I thought to grant also a trigger ability when this creature leave the battlefield, select a random creature on the battlefield, and grant the abilities to it. Something like a recursive call.
Now the problem is that grant an ability from a granted ability doesn't work any idea for me??? Thanks in advance.
I would make a new effect, something similar to a "Propagation" but i am not sure how to implement it.
The effect should work so :
Example : I cast an instant, who target a creature. it gives to this creature an ability. when this creature leave the battlefield i would pass the received ability to another creature on the battlefield.
Now about the first part is simple inside the spell ability, I granted an ability into a continuos block level 6 with duration effectcontroller == nil.
I thought to grant also a trigger ability when this creature leave the battlefield, select a random creature on the battlefield, and grant the abilities to it. Something like a recursive call.
Now the problem is that grant an ability from a granted ability doesn't work any idea for me??? Thanks in advance.
- MY CODING APPROACH | Open
- Code: Select all
<TRIGGERED_ABILITY resource_id="1">
<TRIGGER value="BECAME_TAPPED" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if player ~= nil then
local filter = ClearFilter()
filter:SetZone( ZONE_HAND, player)
local count = filter:Count()
if count == 0 then
player:MillCards( 1 )
else
player:SetItemCount( 1 )
for i = 0,(1-1) do
player:SetItemPrompt (i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD" )
end
end
end
player:ChooseItems( EffectDC():Make_Targets(1) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = SecondaryPlayer()
if player ~= nil then
for i = 0,(1-1) do
local target_card = EffectDC():Get_Targets(1):Get_CardPtr(i)
if target_card ~= nil then
target_card:Discard()
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="2" replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="ZONECHANGE_CONSIDERED" simple_qualifier="self" to_zone="ZONE_ANY" from_zone="ZONE_BATTLEFIELD" pre_trigger="1">
MTG():OverrideEvent()
return true
</TRIGGER>
<FILTER filter_id="0">
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:SetZone( ZONE_BATTLEFIELD, EffectController() )
filter:EvaluateObjects()
local oCard = filter:GetRandomEvaluatedObject()
if oCard ~= nil then
filter:Add (FE_CARD_INSTANCE, OP_IS, oCard )
end
</FILTER>
<CONTINUOUS_ACTION layer="6">
local target = FilteredCard()
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:GrantAbility(1)
characteristics:GrantAbility(2)
end
</CONTINUOUS_ACTION>
<DURATION>
return (EffectController() == nil)
</DURATION>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():Exile()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<SPELL_ABILITY>
<TARGET tag="TFM_CARD_QUERY_CHOOSE_CREATURE" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="6">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:GrantAbility(1)
characteristics:GrantAbility(2)
end
</CONTINUOUS_ACTION>
<DURATION>
return (EffectController() == nil)
</DURATION>
</SPELL_ABILITY>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by MC Brodie » 21 Nov 2013, 05:02
That's a pretty interesting idea. There might be an easy way to grant an ability from a granted ability but I have never tried.
If there isn't, you could have an invisible token handle granting the propagation abilities. And when there are no creatures left on the battlefield for the ability to propagate to you can kill the token. If you do it this way, I think it would be somewhat similar to coding a one sided soulbond (which you can check sumomole's mod out for soulbond code). You will probably have to use Riiak's ObjectDC functions to store the pointer for the initial creature targeted by the spell to the invisible token. If there is a way around that then LinkedDC should suffice. I don't know if that makes sense but that is my take on a workaround
.
If there isn't, you could have an invisible token handle granting the propagation abilities. And when there are no creatures left on the battlefield for the ability to propagate to you can kill the token. If you do it this way, I think it would be somewhat similar to coding a one sided soulbond (which you can check sumomole's mod out for soulbond code). You will probably have to use Riiak's ObjectDC functions to store the pointer for the initial creature targeted by the spell to the invisible token. If there is a way around that then LinkedDC should suffice. I don't know if that makes sense but that is my take on a workaround

-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
Song of the Day: 46 and 2 (cover)
Re: Formal Request Thread
by NeoAnderson » 21 Nov 2013, 05:15
Thanks MC Brodie,
I also thought that using tokens or something similar could be done, i also think at this point is not needed to use an invisible token you could also use the source spell to keep the "propagation" effect from graveyard or exile zone...i don't know exactly right now.
I would also other opinions because before to walk on this way i would check if the affected card could be the source of the propagation, i think it will be more clean, and it could represent better the effect.
Anyway your suggestion is useful also if i have to better understand how to manage with invisible tokens
I also thought that using tokens or something similar could be done, i also think at this point is not needed to use an invisible token you could also use the source spell to keep the "propagation" effect from graveyard or exile zone...i don't know exactly right now.
I would also other opinions because before to walk on this way i would check if the affected card could be the source of the propagation, i think it will be more clean, and it could represent better the effect.
Anyway your suggestion is useful also if i have to better understand how to manage with invisible tokens

- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by RiiakShiNal » 21 Nov 2013, 12:53
Actually you can grant an ability from a granted ability (at least in DotP 2014) Miraika and thefiremind ran across this a while back (end of July, beginning of August). The problem in your case is your TRIGGERED_ABILITY, it is set up wrong. You have a FILTER that is never used by any actions and what you use the FILTER for should actually be in RESOLUTION_TIME_ACTION and saved in an EffectDC() register. Also your DURATIONs should be until target == nil not EffectController(). Also you shouldn't be overriding the ZONECHANGE_CONSIDERED event because that essentially means that the creature will never leave the battlefield.
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 » 21 Nov 2013, 14:34
Thanks a lot my dear friend.RiiakShiNal wrote:Actually you can grant an ability from a granted ability (at least in DotP 2014) Miraika and thefiremind ran across this a while back (end of July, beginning of August). The problem in your case is your TRIGGERED_ABILITY, it is set up wrong. You have a FILTER that is never used by any actions and what you use the FILTER for should actually be in RESOLUTION_TIME_ACTION and saved in an EffectDC() register. Also your DURATIONs should be until target == nil not EffectController(). Also you shouldn't be overriding the ZONECHANGE_CONSIDERED event because that essentially means that the creature will never leave the battlefield.
As always you're right.
1. I missed filter_id="0" into the block i didn't see it.
2. I tried to move the filter block into a resolution block and also tried to store the card pointer to use it into the continuos block, but i think i made some mistakes

3. About the duration if i will be able to store the target i will change it as you said.
4. I ovverride the ZONECHANGE_CONSIDERED just because i was thinking to exile the card anyway also if it is moving to graveyard or returning to hand, as you can see at final resolution block it is exiled.
UPDATED SITUATION :
Thanks to firemind i also tried with EffectDC but unfortunately it seems doesn't work.
I also removed filter_id="0" from CONTINUOS BLOCK DECLARATION still not work.
- TEST 0 | Open
- Code: Select all
<TRIGGERED_ABILITY resource_id="2" replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="ZONECHANGE_CONSIDERED" simple_qualifier="self" to_zone="ZONE_ANY" from_zone="ZONE_BATTLEFIELD" pre_trigger="1">
MTG():OverrideEvent()
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
filter:EvaluateObjects()
EffectDC():Set_CardPtr( 0, filter:GetRandomEvaluatedObject() )
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="6" filter_id="0">
local target = EffectDC():Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:GrantAbility(1)
characteristics:GrantAbility(2)
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectDC():Get_CardPtr(0) == nil
</DURATION>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():Exile()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- TEST 1 | Open
- Code: Select all
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add (FE_CARD_INSTANCE, OP_NOT, EffectSource() )
filter:SetZone( ZONE_BATTLEFIELD, EffectController() )
filter:EvaluateObjects()
local oCard = filter:GetRandomEvaluatedObject()
if oCard ~= nil then
filter:Add (FE_CARD_INSTANCE, OP_IS, oCard )
end
filter:CountStopAt(1)
</FILTER>
<CONTINUOUS_ACTION layer="6" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:GrantAbility(1)
characteristics:GrantAbility(2)
end
</CONTINUOUS_ACTION>
<DURATION>
return (EffectController() == nil)
</DURATION>
- TEST 2 | Open
- Code: Select all
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add (FE_CARD_INSTANCE, OP_NOT, EffectSource() )
filter:SetZone( ZONE_BATTLEFIELD, EffectController() )
filter:EvaluateObjects()
local oCard = filter:GetRandomEvaluatedObject()
if oCard ~= nil then
filter:Add (FE_CARD_INSTANCE, OP_IS, oCard )
end
</FILTER>
<CONTINUOUS_ACTION layer="6" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:GrantAbility(1)
characteristics:GrantAbility(2)
end
</CONTINUOUS_ACTION>
<DURATION filter_id="0">
return (FilteredCard() == nil)
</DURATION>
Now it seems work, i removed the ovverride event, and also the second resolution block where the card is exiled. and now seems to work properly.
- TEST 3 | Open
- Code: Select all
<TRIGGERED_ABILITY resource_id="2" replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="ZONECHANGE_CONSIDERED" simple_qualifier="self" to_zone="ZONE_ANY" from_zone="ZONE_BATTLEFIELD" pre_trigger="1" />
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add (FE_CARD_INSTANCE, OP_NOT, EffectSource() )
filter:SetZone( ZONE_BATTLEFIELD, EffectController() )
filter:EvaluateObjects()
local oCard = filter:GetRandomEvaluatedObject()
if oCard ~= nil then
filter:Add (FE_CARD_INSTANCE, OP_IS, oCard )
end
</FILTER>
<CONTINUOUS_ACTION layer="6" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:GrantAbility(1)
characteristics:GrantAbility(2)
end
</CONTINUOUS_ACTION>
<DURATION filter_id="0">
return (FilteredCard() == nil)
</DURATION>
</TRIGGERED_ABILITY>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by RiiakShiNal » 21 Nov 2013, 20:44
Well, after reading your post it seems like you managed to get it working.
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 » 21 Nov 2013, 21:33
Yeah my friend, it seems to work, but i would understand why i was not able to save the card pointer with EffectDC. It is weird, and what do you think about my solution?
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by NeoAnderson » 22 Nov 2013, 13:38
Ok today question could appears silly but i need to know how to store permanently the pointer to me.
The situation is the follow :
1. I have to play an instant card.
2. The effect of the istant will grant an ability to a creature card controlled by an opponent.
3. The granted ability is a trigger ability (when it will become tapped) i have to set a new controller (myself)
4. Now i should propagate the effect to another creature.
My approach was to use a MTG():DuelDataChest() but i am not sure if i have used it right also because it doesn't work.
Main steps i wrote were :
This is inside the main spell action to store the Player(myself) :

The situation is the follow :
1. I have to play an instant card.
2. The effect of the istant will grant an ability to a creature card controlled by an opponent.
3. The granted ability is a trigger ability (when it will become tapped) i have to set a new controller (myself)
4. Now i should propagate the effect to another creature.
My approach was to use a MTG():DuelDataChest() but i am not sure if i have used it right also because it doesn't work.
Main steps i wrote were :
This is inside the main spell action to store the Player(myself) :
- Code: Select all
<RESOLUTION_TIME_ACTION>
local chest = MTG():DuelDataChest():Make_Chest( 100 )
chest:Set_PlayerPtr(10, EffectController())
</RESOLUTION_TIME_ACTION>
- Code: Select all
<CONTINUOUS_ACTION layer="2">
local chest = MTG():DuelDataChest():Get_Chest( 100 )
if chest ~= nil then
local player = chest:Get_PlayerPtr(10)
if player ~= nil then
TriggerObject():SetController(player)
end
end
</CONTINUOUS_ACTION>

- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by RiiakShiNal » 22 Nov 2013, 13:52
I don't know why you weren't able to save a card pointer to the EffectDC() as I've never encountered that problem. Though I guess it could be an issue where the CONTINUOUS_ACTION block gets processed before the RESOLUTION_TIME_ACTION block though in that case you should be able to fix it by using a PLAY_TIME_ACTION block.
You stated that you were having problems with GetRandomEvaluatedObject() not being random and in that case you can always use MTG():RandomNumberBetween() to get a random number between 0 and the filter count-1 to pull a random card.
I don't really like how there is a FILTER block when you are only processing a single result as it can make trying to fully understand the code more difficult, but I also don't see any reason to change it if it works without problems.
If you really wanted to exile the card as it was changing zones without problems then you would need to set up the TRIGGERED_ABILITY as a delayed trigger with a fire_once CLEANUP so that it wouldn't trigger multiple times when it the creature tries to leave the battlefield. Though this would also require some changes to first save the pointer of "self" into the delayedDC so it could be checked in the TRIGGER.
Other than the FILTER block (and the FilteredCard() calls) instead of a *_TIME_ACTION block it's about like imagined it would end up being.
As for your new question (which you posted while I was composing this post), storing the pointer in the DuelDataChest() is one way to go about it, but in this case I would probably make use of Delayed Triggers and SetBaseController() (which I expect to work like SetPermanentController() in DotP 2013). That way you only have to call SetBaseController() once from a RESOLUTION_TIME_ACTION and you can pass the player pointer through the delayedDC in CreateDelayedTrigger().
You stated that you were having problems with GetRandomEvaluatedObject() not being random and in that case you can always use MTG():RandomNumberBetween() to get a random number between 0 and the filter count-1 to pull a random card.
I don't really like how there is a FILTER block when you are only processing a single result as it can make trying to fully understand the code more difficult, but I also don't see any reason to change it if it works without problems.
If you really wanted to exile the card as it was changing zones without problems then you would need to set up the TRIGGERED_ABILITY as a delayed trigger with a fire_once CLEANUP so that it wouldn't trigger multiple times when it the creature tries to leave the battlefield. Though this would also require some changes to first save the pointer of "self" into the delayedDC so it could be checked in the TRIGGER.
Other than the FILTER block (and the FilteredCard() calls) instead of a *_TIME_ACTION block it's about like imagined it would end up being.
As for your new question (which you posted while I was composing this post), storing the pointer in the DuelDataChest() is one way to go about it, but in this case I would probably make use of Delayed Triggers and SetBaseController() (which I expect to work like SetPermanentController() in DotP 2013). That way you only have to call SetBaseController() once from a RESOLUTION_TIME_ACTION and you can pass the player pointer through the delayedDC in CreateDelayedTrigger().
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
Who is online
Users browsing this forum: No registered users and 3 guests