Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
poison counters
Moderator: CCGHQ Admins
20 posts
• Page 1 of 2 • 1, 2
poison counters
by BlindWillow » 09 Oct 2012, 22:52
I was thinking of a way to approximate adding poison counters, and it seems like we might be able to use a mana-token-like process only with tokens that deal infect damage.
Here's what I've come up with so far:
Problems? Suggestions?
Edit: Tested it against Doubling Season, and it works.
Here's what I've come up with so far:
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="TOKEN_POISON_T_11381001" />
<CARDNAME text="POISON_T" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ ]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="11381001" />
<ARTID value="88888888" />
<ARTIST name="" />
<CASTING_COST cost="" />
<TYPE metaname="" />
<EXPANSION value="DPG" />
<RARITY metaname="L" />
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<CONTINUOUS_ACTION>
local filter = Object():GetFilter()
filter:Clear()
filter:SetConvertedCostMax( 25 )
Object():Protection()
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<CONTINUOUS_ACTION>
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_SHROUD, 1 )
characteristics:Characteristic_Set( CHARACTERISTIC_INDESTRUCTIBLE, 1 )
characteristics:Characteristic_Set( CHARACTERISTIC_INFECT, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY LKI_shield_effect_source="1" forced_skip="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<RESOLUTION_TIME_ACTION>
local source = EffectSource()
if source == nil then
source = Object()
end
if (source:GetCurrentCharacteristics():Characteristic_Get( CHARACTERISTIC_INFECT ) ~= 0 and EffectController() ~= nil and ObjectDC():Get_Int(0) ~= 1) then
EffectController():DealDamageFullParams(1, source, 0, 1 )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():RemoveFromGame()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="ABILITY_RESOLVED">
if TriggerObject():GetCardName() == Object():GetCardName() then
ObjectDC():Set_Int(0, 1)
return true
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
</CARD_V2>
Problems? Suggestions?
Edit: Tested it against Doubling Season, and it works.
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by BlindWillow » 10 Oct 2012, 00:53
One problem I just realized would be effects that double damage. The only way to deal with that, that I can think of, would be to check for the presence of the individual cards that double damage (Anthem of Rakdos, Furnace of Rath, etc.) and adjust the damage dealt accordingly. Anyone have any better ideas?
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by BlindWillow » 10 Oct 2012, 03:13
Another option: apply LoseAllAbilities() to a filter that checks for the names of all problem cards.
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by BlindWillow » 10 Oct 2012, 04:57
Alright, here's where I'm leaving it for tonight. Adding the following code shuts down the problem cards (damage multipliers) that I think have actually been coded for 2013. Others can be added as needed, of course. There's a brief flicker for the cards as they have their abilities momentarily shut down, which might turn some people off, I don't know. You'd have to be looking for it.
- Code: Select all
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<FILTER>
return (FilteredCard() ~= nil and
FilteredCard():GetZone() == ZONE_IN_PLAY and
(FilteredCard():GetCardName() == "FURNACE_OF_RATH" or
FilteredCard():GetCardName() == "GISELA_BLADE_OF_GOLDNIGHT" or
FilteredCard():GetCardName() == "CURSE_OF_BLOODLETTING"))
</FILTER>
<CONTINUOUS_ACTION layer="6">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
if characteristics ~= nil then
characteristics:LoseAllAbilities()
end
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by thefiremind » 10 Oct 2012, 08:22
I thought about doing something like this, but then I gave up because this would also trigger things like No Mercy... not that it matters for the token, given that you exile it, but we should be careful with similar cards.
< 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: poison counters
by RiiakShiNal » 10 Oct 2012, 13:06
Actually in this case No Mercy would not trigger because the token is not a creature (no types). Though I agree we should still be careful because if a card is not written properly it could trigger on this even if it is not supposed to.thefiremind wrote:I thought about doing something like this, but then I gave up because this would also trigger things like No Mercy... not that it matters for the token, given that you exile it, but we should be careful with similar cards.
I do wonder how this will work with a Melira, Sylvok Outcast in play, since it is set to do unpreventable damage would the player still get the poison counter even though Melira, Sylvok Outcast should prevent it? Or does Melira's ability (as currently coded) already shut this down without any changes?
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: 2189
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: poison counters
by BlindWillow » 10 Oct 2012, 16:09
I was meaning to test that too. That's what the source:GetCurrentCharacteristics():Characteristic_Get( CHARACTERISTIC_INFECT ) ~= 0 check is for.RiiakShiNal wrote:I do wonder how this will work with a Melira, Sylvok Outcast in play, since it is set to do unpreventable damage would the player still get the poison counter even though Melira, Sylvok Outcast should prevent it? Or does Melira's ability (as currently coded) already shut this down without any changes?
Edit: Of course, I just realized, she only affects creatures. So that won't work. I guess I'll just do a filter:Count() check to see if Melira's in play.
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by BlindWillow » 10 Oct 2012, 21:24
Latest code (tested against Melira):
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="TOKEN_POISON_T_11381001" />
<CARDNAME text="POISON_T" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[ ]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ ]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="11381001" />
<ARTID value="88888888" />
<ARTIST name="" />
<CASTING_COST cost="" />
<TYPE metaname="" />
<EXPANSION value="DPG" />
<RARITY metaname="L" />
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<CONTINUOUS_ACTION>
local filter = Object():GetFilter()
filter:Clear()
filter:SetConvertedCostMax( 25 )
Object():Protection()
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<CONTINUOUS_ACTION>
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_SHROUD, 1 )
characteristics:Characteristic_Set( CHARACTERISTIC_INDESTRUCTIBLE, 1 )
characteristics:Characteristic_Set( CHARACTERISTIC_INFECT, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<FILTER>
return (FilteredCard() ~= nil and
FilteredCard():GetZone() == ZONE_IN_PLAY and
(FilteredCard():GetCardName() == "FURNACE_OF_RATH" or
FilteredCard():GetCardName() == "GISELA_BLADE_OF_GOLDNIGHT" or
FilteredCard():GetCardName() == "CURSE_OF_BLOODLETTING"))
</FILTER>
<CONTINUOUS_ACTION layer="6">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
if characteristics ~= nil then
characteristics:LoseAllAbilities()
end
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY LKI_shield_effect_source="1" forced_skip="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<RESOLUTION_TIME_ACTION>
local source = EffectSource()
if source == nil then
source = Object()
end
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_IN_PLAY )
filter:AddCardName( "MELIRA_SYLVOK_OUTCAST" )
filter:SetController( EffectController() )
filter:NotTargetted()
if (filter:CountStopAt(1) == 0 and EffectController() ~= nil and ObjectDC():Get_Int(0) ~= 1) then
EffectController():DealDamageFullParams(1, source, 0, 1 )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():RemoveFromGame()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="ABILITY_RESOLVED">
if TriggerObject():GetCardName() == Object():GetCardName() then
ObjectDC():Set_Int(0, 1)
return true
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
</CARD_V2>
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by nabeshin » 10 Oct 2012, 22:10
I used such option, it works, but I didn't test it against different types of protection
- Code: Select all
<TRIGGERED_ABILITY internal="1" forced_skip="1">
<TRIGGER value="ABILITY_RESOLVED">
if TriggerObject() == Object() and ObjectDC():Get_Int(1) == 1 then
ObjectDC():Set_Int(1,0)
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_INFECT, 1 )
Object():GetTargetPlayer():DealDamageFullParams(1, Object(), 1, 1 )
return true
else
return false
end
</TRIGGER>
</TRIGGERED_ABILITY>
Re: poison counters
by BlindWillow » 10 Oct 2012, 23:41
nabeshin, could you post the full code you're using? I can't see how that would fit into my code above, so I assume you're using it in a different context.
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by nabeshin » 11 Oct 2012, 00:45
excuse I too shortly wrote, really I went some other way, without use of additional tokens, counters of poison are done by the card.BlindWillow wrote:nabeshin, could you post the full code you're using? I can't see how that would fit into my code above, so I assume you're using it in a different context.
Re: poison counters
by BlindWillow » 11 Oct 2012, 00:51
Some research on Gatherer yields the following list of problem cards:
1. Anthem of Rakdos: not currently coded; would merely need to add to the LoseAllAbilities() filter.
2. Ghosts of the Innocent: listed just because it might be easy to code improperly (have to check if damage is unpreventable).
3. Tamanoa: same as Anthem.
4. Cloudstone Curio: not currently coded; would merely need to make sure only objects with card types trigger it.
5. Azor's Elocutors: from Return to Ravnica; would need to be coded accordingly or added to the LoseAllAbilities() filter.
6. Quest for Pure Flame: RiiakShiNal has coded; would need to modify that, as I see no workaround from the standpoint of the token's code.
1. Anthem of Rakdos: not currently coded; would merely need to add to the LoseAllAbilities() filter.
2. Ghosts of the Innocent: listed just because it might be easy to code improperly (have to check if damage is unpreventable).
3. Tamanoa: same as Anthem.
4. Cloudstone Curio: not currently coded; would merely need to make sure only objects with card types trigger it.
5. Azor's Elocutors: from Return to Ravnica; would need to be coded accordingly or added to the LoseAllAbilities() filter.
6. Quest for Pure Flame: RiiakShiNal has coded; would need to modify that, as I see no workaround from the standpoint of the token's code.
Last edited by BlindWillow on 11 Oct 2012, 00:56, edited 1 time in total.
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by BlindWillow » 11 Oct 2012, 00:53
Ah, I see. My fear about going that route was indeed issues with protection. Let me know if you figure out how to get around such issues. We should pursue both methods, I think, and see which is least problematic.nabeshin wrote:excuse I too shortly wrote, really I went some other way, without use of additional tokens, counters of poison are done by the card.
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: poison counters
by nabeshin » 11 Oct 2012, 01:22
here full worked card with my code
- Attachments
-
DECIMATOR_WEB_214055.rar- (107.61 KiB) Downloaded 310 times
Re: poison counters
by RiiakShiNal » 11 Oct 2012, 02:18
Actually, any card that triggers on damage dealt to a player could be problematic, for example Sun Droplet (which I coded) would get a charge counter from your token at least with the current way Sun Droplet is coded even though just adding a poison counter should not trigger the ability. LoseAllAbilities() would probably work in this case, but there may be other cards with abilities that trigger on damage or count how much damage is done in a turn (if they check with Interrogate_DamageDealtToAnyPlayerThisTurn or something similar then it could be a fairly bad bug) which may not be so easy to deal with.
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: 2189
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
20 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 7 guests