It is currently 27 Apr 2024, 17:14
   
Text Size

Needing suggestions for Renegade Doppelganger + Shapesharer

Moderator: CCGHQ Admins

Needing suggestions for Renegade Doppelganger + Shapesharer

Postby thefiremind » 27 Jul 2013, 11:22

I'd like to make a Shapeshifter-themed deck, but I stumbled upon the same bug that afflicted DotP2013: if a clone effect ends while the cloning card is still on the battlefield, the original card won't trigger any of its triggered abilities anymore. The only solution I found is the same that I used for the transform mechanic: make the card copy its original self when it's not copying something else. I managed to apply the solution to Renegade Doppelganger by giving it a static ability that switches between the copy of the original self or the copy of the creature that entered the battlefield through a flag in the LinkedDC, but I have no clue about how to apply the solution to Shapesharer, since it should be able to make any other creature copy something for a limited amount of time.

Leaving Shapesharer aside for now, does anyone have an idea to make Renegade Doppelganger work well by only using triggered abilities (also delayed if needed) and no static abilities? After that, the solution would be easily extended to Shapesharer.
Last edited by thefiremind on 28 Jul 2013, 08:57, edited 2 times in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Needing suggestions for Renegade Doppelganger + Shapesha

Postby sumomole » 27 Jul 2013, 21:30

I coded Renegade Doppelganger, use static ability and grant ability, it seems to work fine, I don't know what is the bug that you said about static ability. And Shapesharer, I coded Cytoshape, so I think Shapesharer can be coded by same way.
But I found a more serious bug when I try to code storm ability, CopySpell, if the original spell is no longer on the stack, I also get copies, but I can't choose new target and the copies have no effect, then I test your Melek, Izzet Paragon, the result is the same, since we both used TriggerObjectLKI, and then I test kev's storm code that used Object, it can't make any copy.
Cytoshape | Open
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose a nonlegendary creature on the battlefield. Target creature becomes a copy of that creature until end of turn.]]></LOCALISED_TEXT>
    <SFX text="TARGET_PLASMA_PLAY" />
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_BECOME_COPY" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target_creature ~= nil then
      local filter = ClearFilter()
      filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
      filter:Add( FE_SUPERTYPE, OP_NOT, SUPERTYPE_LEGENDARY )
       EffectController():ChooseItem( "CARD_QUERY_CHOOSE_NONLEGENDARY_CREATURE_COPY", EffectDC():Make_Targets(1) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
    local target_copy = EffectDC():Get_Targets(1):Get_CardPtr(0)
    if target_creature ~= nil and target_copy ~= nil then   
      local delayDC = EffectDC():Make_Chest(3)
       target_copy:StoreCopiableValues(EffectDC():Make_Chest(2))
       target_creature:StoreCopiableValues(delayDC:Make_Chest(0))
      delayDC:Set_CardPtr(4, target_creature)
      MTG():CreateDelayedTrigger(2, delayDC)
    end
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="1">
    local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target_creature ~= nil and EffectDC():Get_Chest(2) ~= nil then
       target_creature:UseCopiableValues(EffectDC():Get_Chest(2))
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
  </SPELL_ABILITY>
  <TRIGGERED_ABILITY resource_id="2" replacement_effect="1">
    <CLEANUP fire_once="1" />
    <TRIGGER value="BEGINNING_OF_STEP">
    return MTG():GetStep() == STEP_CLEANUP
    </TRIGGER>
    <CONTINUOUS_ACTION layer="1">
    local target_creature = EffectDC():Get_CardPtr(4)
    if target_creature ~= nil and EffectDC():Get_Chest(0) ~= nil then
       target_creature:UseCopiableValues(EffectDC():Get_Chest(0))
    end
    </CONTINUOUS_ACTION>
    <DURATION>
    return EffectDC():Get_CardPtr(4) == nil
    </DURATION>
  </TRIGGERED_ABILITY>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Needing suggestions for Renegade Doppelganger + Shapesha

Postby thefiremind » 27 Jul 2013, 22:10

Thanks, I was hoping to see your Cytoshape code. I didn't think about putting the self-copy on a delayed trigger. And there's no bug with Renegade Doppelganger, I'd just want to code both cards similarly.

EDIT: I think that using delayed triggers actually has a flaw: if multiple copy effects are stacked on a single creature, we can't guarantee that the delayed triggers will go off in the right order to bring the creature back to its original form.
It seems that the triggers keep working if the creature keeps an active copy of itself, no matter if it's applied before or after the real copy effect. So here's my idea: Cytoshape and Shapesharer will need to have this ability:
Code: Select all
  <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
    <TRIGGER value="ZONECHANGE_BEGIN" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
    return [function I'm working on]
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local tobj = TriggerObject()
    if tobj ~= nil then
       tobj:StoreCopiableValues( EffectDC():Make_Chest(1) )
    end
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="1">
    local tobj = TriggerObject()
    local self_chest = EffectDC():Get_Chest(1)
    if tobj ~= nil and self_chest ~= nil then
       tobj:UseCopiableValues(self_chest)
    end
    </CONTINUOUS_ACTION>
    <DURATION>
    return TriggerObject() == nil
    </DURATION>
  </TRIGGERED_ABILITY>
while Renegade Doppelganger will need to do this only for itself. This will give each permanent "a layer of itself" when coming onto the battlefield. It's not compatible with my transform mechanic, that's the reason for the trigger condition (I don't know how to modify it so that it knows what to do even without having my mod, maybe "return TFM_Transform == nil or TFM_Transform().GetStatus( TriggerObject() ) == 0", just a guess).

EDIT 2: Nope, this screws up Clone, Phantasmal Image and similar. I need to find a way to issue this effect in a safer moment.

EDIT 3: Changed the trigger to a ZONECHANGE_BEGIN one and the condition to some [function I'm working on], which will make the trigger go off only if the permanent isn't a transform card nor a card like Clone.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 34 guests


Who is online

In total there are 34 users online :: 0 registered, 0 hidden and 34 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 34 guests

Login Form