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 Zambooo » 04 Feb 2015, 17:43
Crush Underfoot still doesn't work
the code is the one from RSN last post:

the code is the one from RSN last post:
- | Open
- Code: Select all
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
EffectController():ChooseItem( "CARD_QUERY_CHOOSE_GIANT", EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_DEAL_DAMAGE" definition="1" compartment="0" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local chosen_giant = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if chosen_giant ~= nil then
local power = chosen_giant:GetCurrentPower()
local target_creature = EffectDC():Get_Targets(1) and EffectDC():Get_Targets(1):Get_CardPtr(0)
if target_creature ~= nil then
chosen_giant:DealDamageTo( power, target_creature )
end
end
</RESOLUTION_TIME_ACTION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
Re: Formal Request Thread
by Xander9009 » 04 Feb 2015, 17:47
You could try the code I posted. I tested it and it worked. Just change the prefixes in the filename, multiverseid, and artid back to yours.Zambooo wrote:Crush Underfoot still doesn't work![]()
the code is the one from RSN last post:
but still no damage assigned :/ really don't know where to turn now
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by RiiakShiNal » 05 Feb 2015, 00:02
That would be because I somehow missed changing the compartment to 1 in the TARGET tag (even though I mentioned it).Zambooo wrote:Crush Underfoot still doesn't work![]()
the code is the one from RSN last post:but still no damage assigned :/ really don't know where to turn now
- | Open
- Code: Select all
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
EffectController():ChooseItem( "CARD_QUERY_CHOOSE_GIANT", EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_DEAL_DAMAGE" definition="1" compartment="0" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local chosen_giant = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if chosen_giant ~= nil then
local power = chosen_giant:GetCurrentPower()
local target_creature = EffectDC():Get_Targets(1) and EffectDC():Get_Targets(1):Get_CardPtr(0)
if target_creature ~= nil then
chosen_giant:DealDamageTo( power, target_creature )
end
end
</RESOLUTION_TIME_ACTION>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
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 Zambooo » 05 Feb 2015, 00:22
LOL now it works though, thank you both for the patience 

Re: Formal Request Thread
by RiiakShiNal » 05 Feb 2015, 02:00
No problem, I think we all learn more by debugging something rather than just re-coding it (though for some problems recoding is much easier and sometimes better). The original author gains confidence when there are just a couple of small errors (though sometimes they kick themselves for not seeing it first if it was really simple). People following the conversation get to see examples and see what some common problems are (sometimes they are rare tough problems though). The people looking over the code get to analyze the code and sometimes get to see things from a different perspective or it sometimes provides an extra creative kick for an unrelated problem that they are having.Zambooo wrote:LOL now it works though, thank you both for the patience
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 Zambooo » 06 Feb 2015, 18:06
Here I am again 
This time I would like to request a fix (if possible) to Deflecting Palm
-my opponent attacks with Primeval Titan and Sundering Titan (I just named 2 creatures)
-I cast Deflecting Palm on Primeval Titan
-the spell prevents the damage coming from both Creatures, but inflict to its controller only the one from Primeval Titan.
Can it be fixed somehow?
PS: I know someone already asked for a similar issue but noone answered

This time I would like to request a fix (if possible) to Deflecting Palm
- | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="DEFLECTING_PALM_283387861" />
<CARDNAME text="DEFLECTING_PALM" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Deflecting Palm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Paume déflectrice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Palma bloqueadora]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Abwehrende Hand]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Palmo della Deviazione]]></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[Palma Defletora]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="283387861" />
<ARTID value="A283387861" />
<ARTIST name="Eric Deschamps" />
<CASTING_COST cost="{R}{W}" />
<TYPE metaname="Instant" />
<EXPANSION value="KTK" />
<RARITY metaname="R" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[The next time a source of your choice would deal damage to you this turn, prevent that damage. If damage is prevented this way, Deflecting Palm deals that much damage to that source’s controller.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[La prochaine fois qu’une source de votre choix devrait vous infliger des blessures ce tour-ci, prévenez ces blessures. Si des blessures sont prévenues de cette manière, la Paume déflectrice inflige autant de blessures au contrôleur de cette source.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[La próxima vez que una fuente de tu elección fuera a hacerte daño este turno, prevén ese daño. Si se previene daño de esta manera, la Palma bloqueadora hace esa misma cantidad de daño al controlador de esa fuente.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Das nächste Mal, dass dir eine Quelle, die du bestimmst, in diesem Zug Schaden zufügen würde, verhindere diesen Schaden. Falls auf diese Weise Schaden verhindert wurde, fügt die Abwehrende Hand dem Beherrscher der Quelle entsprechend viele Schadenspunkte zu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La prossima volta che una fonte a tua scelta ti sta per infliggere danno in questo turno, previeni quel danno. Se viene prevenuto danno in questo modo, il Palmo della Deviazione infligge altrettanti danni al controllore di quella fonte.]]></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[Na próxima vez que uma fonte de sua escolha for lhe causar dano neste turno, previna aquele dano. Se o dano for prevenido desta maneira, Palma Defletora causará uma quantidade equivalente de dano ao controlador daquela fonte.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_SOURCE_PREVENT_DAMAGE" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS )
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_ZONE, OP_IS, ZONE_STACK )
subfilter:Add( FE_ZONE, OP_IS, ZONE_GRAVEYARD )
subfilter:Add( FE_ZONE, OP_IS, ZONE_BATTLEFIELD )
subfilter:Add( FE_ZONE, OP_IS, ZONE_EXILE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = 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>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
<SFX text="TARGET_SUN_PLAY" />
<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="1" replacement_effect="1">
<TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" pre_trigger="1" damage_type="all">
return SecondaryPlayer() == EffectController() and TriggerObject() == EffectDC():Get_CardPtr(0)
</TRIGGER>
<CLEANUP fire_once="1" />
<CLEANUP simple_cleanup="EndOfTurn" />
<RESOLUTION_TIME_ACTION>
local card = EffectDC():Get_CardPtr(0)
local player = card:GetPlayer()
EffectSourceLKI():DealDamageTo(Damage():PreventAll(), player)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<AI_BASE_SCORE score="900" zone="ZONE_HAND" />
</CARD_V2>
-my opponent attacks with Primeval Titan and Sundering Titan (I just named 2 creatures)
-I cast Deflecting Palm on Primeval Titan
-the spell prevents the damage coming from both Creatures, but inflict to its controller only the one from Primeval Titan.
Can it be fixed somehow?
PS: I know someone already asked for a similar issue but noone answered
Re: Formal Request Thread
by Xander9009 » 06 Feb 2015, 19:12
I didn't respond to it before because I don't see what's wrong. Pay No Heed works as intended, but I tested Deflecting Palm and it didn't. They're so similar that they should either both work or both fail. I'm not seeing what's wrong.
I put in a debug call to give me 100 life every time it fires, and it properly fires only once no matter how many creature are attacking. But all of the damage is prevented from all creatures. I'm not sure what's going on.
I put in a debug call to give me 100 life every time it fires, and it properly fires only once no matter how many creature are attacking. But all of the damage is prevented from all creatures. I'm not sure what's going on.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by Zambooo » 06 Feb 2015, 19:38
also (not sure if I know rules correctly on this one), but with Deflecting Palm I can't choose as a source an Instant/Sorcery on the Stack. Is it right? I thought a "source" could be any cards..
Re: Formal Request Thread
by Xander9009 » 06 Feb 2015, 19:45
You're correct. I think this might be a limitation with the AddSubFilter_Or() function not working with zones. In that case, it will need changed to ask which zone to target prior to targeting.Zambooo wrote:also (not sure if I know rules correctly on this one), but with Deflecting Palm I can't choose as a source an Instant/Sorcery on the Stack. Is it right? I thought a "source" could be any cards..
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by sweetLu » 06 Feb 2015, 19:53
Yes "choose a source" can be a card on the stack. I made a similar card (or tried to) and I believe I had to first ask which zone the "to-be-chosen" card was in and then have the "choose a card" query. I don't think a subfilter with multiple zones works.
Second, it is not a target ability so it cannot be in a target block. Choose a source is confusing to me. Since it isn't a target ability I think the chosen card is remembered across multiple zone changes. I asked a question on a separate forum for a judges ruling on it. I'll try to dig it up. There is also some discussion on this forum on it. Try searching the Programming Talk or 2014 subforums for "choose a source".
Edit - here is the beginning of the discussion for a similar card. I don't think I could get it to work correctly. viewtopic.php?f=63&t=3062&hilit=choose+a+source&start=300#p134247
Edit 2 - I can't find the post where I asked a judge on the ruling. The closest thing I could find was this: http://community.wizards.com/forum/rule ... ds/4075076
But that doesn't really tell us anything new. I think choose a source doesn't care about any zone changes. But if you Pay No Heed an Inferno Titan, Unsummon the titan and replay it, I'm not sure what would happen with the damage. If we really don't care about any zone changes we could try using Neo's trick of storing the actual ID of the card instead of its typical pointer.
Second, it is not a target ability so it cannot be in a target block. Choose a source is confusing to me. Since it isn't a target ability I think the chosen card is remembered across multiple zone changes. I asked a question on a separate forum for a judges ruling on it. I'll try to dig it up. There is also some discussion on this forum on it. Try searching the Programming Talk or 2014 subforums for "choose a source".
Edit - here is the beginning of the discussion for a similar card. I don't think I could get it to work correctly. viewtopic.php?f=63&t=3062&hilit=choose+a+source&start=300#p134247
Edit 2 - I can't find the post where I asked a judge on the ruling. The closest thing I could find was this: http://community.wizards.com/forum/rule ... ds/4075076
But that doesn't really tell us anything new. I think choose a source doesn't care about any zone changes. But if you Pay No Heed an Inferno Titan, Unsummon the titan and replay it, I'm not sure what would happen with the damage. If we really don't care about any zone changes we could try using Neo's trick of storing the actual ID of the card instead of its typical pointer.
Re: Formal Request Thread
by Zambooo » 06 Feb 2015, 20:38
Really no clue on how to do that, so I'm still demanding helpsweetLu wrote:Yes "choose a source" can be a card on the stack. I made a similar card (or tried to) and I believe I had to first ask which zone the "to-be-chosen" card was in and then have the "choose a card" query. I don't think a subfilter with multiple zones works.

Re: Formal Request Thread
by Xander9009 » 06 Feb 2015, 20:48
Thanks. I hadn't thought about anything like this, and I really like know the subtle interactions of cards and rules. So, this was interesting. I found a thread (before you posted those edits) discussing it (linked straight to the two answers).sweetLu wrote:Yes "choose a source" can be a card on the stack. I made a similar card (or tried to) and I believe I had to first ask which zone the "to-be-chosen" card was in and then have the "choose a card" query. I don't think a subfilter with multiple zones works.
Second, it is not a target ability so it cannot be in a target block. Choose a source is confusing to me. Since it isn't a target ability I think the chosen card is remembered across multiple zone changes. I asked a question on a separate forum for a judges ruling on it. I'll try to dig it up. There is also some discussion on this forum on it. Try searching the Programming Talk or 2014 subforums for "choose a source".
Edit - here is the beginning of the discussion for a similar card. I don't think I could get it to work correctly. viewtopic.php?f=63&t=3062&hilit=choose+a+source&start=300#p134247
Edit 2 - I can't find the post where I asked a judge on the ruling. The closest thing I could find was this: http://community.wizards.com/forum/rule ... ds/4075076
But that doesn't really tell us anything new. I think choose a source doesn't care about any zone changes. But if you Pay No Heed an Inferno Titan, Unsummon the titan and replay it, I'm not sure what would happen with the damage. If we really don't care about any zone changes we could try using Neo's trick of storing the actual ID of the card instead of its typical pointer.
http://community.wizards.com/comment/48 ... t-48964381
In these thread posts it's said that the reason it sometimes appears that it doesn't care about zone changes is because technically the source of the damage from a dead Goblin Arsonist isn't the card itself in the card itself in the graveyard, but rather the now non-extant creature that was on the battlefield. So, even though the game shows the effect from the graveyard, and even though casting Pay No Heed on a Goblin Arsonist creature on the battlefield would prevent the damage from its death, other zone changes would still be considered. This is because an ability itself never causes damage, only the card the ability is on. Combine that with the fact that the ability triggers while it's on the battlefield (in the process of dying), the card that is going to deal the damage is the creature on the battlefield. Even though the goblin is in the graveyard by the time the ability resolves, the real source is still the same object it was when it was on the battlefield, not the card in the graveyard.
I hope that made sense. Also, wow you've been gone awhile haha.
I'll see if I can find the exact moment it fails between converting from Pay No Head to Deflecting Palm.Zambooo wrote:Really no clue on how to do that, so I'm still demanding help
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by Xander9009 » 06 Feb 2015, 21:49
Alright, so, I've found the exact moment it starts preventing everything instead of only what it should.
This code only prevents the chosen damage.
Even when I split it up into two resolution time actions, if I deal the damage to the player, then it prevents damage from all attacking creatures.
This code only prevents the chosen damage.
- Code: Select all
<RESOLUTION_TIME_ACTION>
local card = EffectDC():Get_CardPtr(0)
local player = card:GetPlayer()
local damage = Damage():PreventAll()
--EffectSourceLKI():DealDamageTo(damage, player)
</RESOLUTION_TIME_ACTION>
- Code: Select all
<RESOLUTION_TIME_ACTION>
local card = EffectDC():Get_CardPtr(0)
local player = card:GetPlayer()
local damage = Damage():PreventAll()
EffectSourceLKI():DealDamageTo(damage, player)
</RESOLUTION_TIME_ACTION>
Even when I split it up into two resolution time actions, if I deal the damage to the player, then it prevents damage from all attacking creatures.
- Code: Select all
<RESOLUTION_TIME_ACTION>
local damage = Damage():PreventAll()
EffectDC():Set_Int(1, damage)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local card = EffectDC():Get_CardPtr(0)
if card ~= nil then
local player = card:GetPlayer()
if player ~= nil then
local damage = EffectDC():Get_Int(1)
if damage > 0 then
EffectSourceLKI():DealDamageTo(damage, player) --Prevents everything. Comment out this line and only target's damage is prevented.
end
end
end
</RESOLUTION_TIME_ACTION>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by RiiakShiNal » 07 Feb 2015, 00:00
My guess would be is that it is an engine bug where you can't properly prevent damage to one player and do damage to another in the same ability. You could making a delayed trigger (fire once) and passing the damage and player to that delayed ability through the delay DC and have the delayed trigger activate on ABILITY_RESOLVED. That would move the dealing of the damage out of the source ability and into a second ability which may work.
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 Xander9009 » 07 Feb 2015, 00:20
I momentarily considered that solution earlier but figured there had to be something I was overlooking. But you're right, it's probably just a bug. ABILITY_RESOLVED didn't fire so I went with STATE_BASED_EFFECTS. If there's a problem with that, you'll have to tell me, 'cause I don't know and it seemed to finally work. Thanks.RiiakShiNal wrote:My guess would be is that it is an engine bug where you can't properly prevent damage to one player and do damage to another in the same ability. You could making a delayed trigger (fire once) and passing the damage and player to that delayed ability through the delay DC and have the delayed trigger activate on ABILITY_RESOLVED. That would move the dealing of the damage out of the source ability and into a second ability which may work.
This works.
- Deflecting Palm - Tested | Open
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[The next time a source of your choice would deal damage to you this turn, prevent that damage. If damage is prevented this way, Deflecting Palm deals that much damage to that source’s controller.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[La prochaine fois qu’une source de votre choix devrait vous infliger des blessures ce tour-ci, prévenez ces blessures. Si des blessures sont prévenues de cette manière, la Paume déflectrice inflige autant de blessures au contrôleur de cette source.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[La próxima vez que una fuente de tu elección fuera a hacerte daño este turno, prevén ese daño. Si se previene daño de esta manera, la Palma bloqueadora hace esa misma cantidad de daño al controlador de esa fuente.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Das nächste Mal, dass dir eine Quelle, die du bestimmst, in diesem Zug Schaden zufügen würde, verhindere diesen Schaden. Falls auf diese Weise Schaden verhindert wurde, fügt die Abwehrende Hand dem Beherrscher der Quelle entsprechend viele Schadenspunkte zu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La prossima volta che una fonte a tua scelta ti sta per infliggere danno in questo turno, previeni quel danno. Se viene prevenuto danno in questo modo, il Palmo della Deviazione infligge altrettanti danni al controllore di quella fonte.]]></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[Na próxima vez que uma fonte de sua escolha for lhe causar dano neste turno, previna aquele dano. Se o dano for prevenido desta maneira, Palma Defletora causará uma quantidade equivalente de dano ao controlador daquela fonte.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[选择一个来源。于本回合中,防止该来源下一次将对你造成的伤害。如果以此法防止伤害,则馈击掌对该来源的操控者造成等量的伤害。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[選擇一個來源。於本回合中,防止該來源下一次將對你造成的傷害。如果以此法防止傷害,則饋擊掌對該來源的操控者造成等量的傷害。]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_SOURCE_PREVENT_DAMAGE" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS )
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_ZONE, OP_IS, ZONE_STACK )
subfilter:Add( FE_ZONE, OP_IS, ZONE_GRAVEYARD )
subfilter:Add( FE_ZONE, OP_IS, ZONE_BATTLEFIELD )
subfilter:Add( FE_ZONE, OP_IS, ZONE_EXILE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = 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>
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
<SFX text="TARGET_SUN_PLAY" />
<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="1" replacement_effect="1">
<TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" pre_trigger="1">
return SecondaryPlayer() == EffectController() and TriggerObject() == EffectDC():Get_CardPtr(0)
</TRIGGER>
<CLEANUP fire_once="1" simple_cleanup="EndOfTurn" />
<RESOLUTION_TIME_ACTION>
local damage = Damage():PreventAll()
EffectDC():Set_Int(1, damage)
MTG():CreateDelayedTrigger(2, EffectDC())
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="2" replacement_effect="1">
<TRIGGER value="STATE_BASED_EFFECTS" pre_trigger="1" />
<CLEANUP fire_once="1" />
<RESOLUTION_TIME_ACTION>
EffectController():DisplayMessage("Start 2")
local card = EffectDC():Get_CardPtr(0)
if card ~= nil then
local player = card:GetController()
if player ~= nil then
local damage = EffectDC():Get_Int(1)
if damage > 0 then
EffectSourceLKI():DealDamageTo(damage, player)
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Who is online
Users browsing this forum: No registered users and 7 guests