Transform ability

Thought I would post real quick my progress working on thefiremind's transform functions (reason why I didn't release my latest update over the weekend as I had planned). See here for the discussion that prompted me to explore transform ability and here for thefiremind's transform functions.
Anyway, one-way transformations are no problem. It's cards that transform repeatedly that are the problem. I don't know the specifics, but something doesn't get fully reset when a card transforms back. Here is where delayed triggers come in handy, as they seem to become almost totally independent of the original EffectSource.
So if you add a delayed trigger to a "repeat transformer" (for lack of a better term) like this:
Any suggestions would be most welcome.
Edit: Just realized the solution to that last problem, which I'll implement later tonight. It was right in front of me the whole time (in fact it has been the solution to all my problems with transform so far), namely: another delayed trigger. Since I'm already handling Huntmaster's transform ability on Ravager (since there is no "transform" trigger), I only need to replace Huntmaster's initial entry ability with a delayed trigger version of it.
Anyway, one-way transformations are no problem. It's cards that transform repeatedly that are the problem. I don't know the specifics, but something doesn't get fully reset when a card transforms back. Here is where delayed triggers come in handy, as they seem to become almost totally independent of the original EffectSource.
So if you add a delayed trigger to a "repeat transformer" (for lack of a better term) like this:
- Code: Select all
<TRIGGERED_ABILITY internal="1" resource_id="99">
<CLEANUP fire_once="1" />
<TRIGGER value="STATE_BASED_EFFECTS">
return ( IsNotTransformed( Object() ) and EffectDC():Get_CardPtr(99) == Object() )
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectDC():Get_CardPtr(99) ~= nil then
EffectDC():Get_CardPtr(99):StoreCopiableValues(EffectDC():Make_Chest(98))
Object():UseCopiableValues(EffectDC():Get_Chest(98))
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Code: Select all
GetResetData = function()
-- creates delayed trigger with front face card's characteristics
local delayDC = EffectDC():Make_Chest(100)
delayDC:Set_CardPtr(99, Object())
MTG():CreateDelayedTrigger(99, delayDC)
end
- Code: Select all
<TRIGGERED_ABILITY internal="1" active_zone="ZONE_ANY">
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="self" to_zone="ZONE_IN_PLAY">
return Object():IsToken() == 0
</TRIGGER>
<RESOLUTION_TIME_ACTION>
GetResetData()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
MTG():CreateDelayedTrigger(1, nil)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Code: Select all
<TRIGGERED_ABILITY auto_skip="1">
<TRIGGER value="BEGINNING_OF_STEP">
return ( CanTransform( Object() ) and TriggeredForMe() and MTG():GetStep() == STEP_UPKEEP and ObjectDC():Get_Int(COMPARTMENT_ID_INT_REGISTER_0) == 1 )
</TRIGGER>
<RESOLUTION_TIME_ACTION>
GetResetData()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
StartTransform( Object() )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Any suggestions would be most welcome.
Edit: Just realized the solution to that last problem, which I'll implement later tonight. It was right in front of me the whole time (in fact it has been the solution to all my problems with transform so far), namely: another delayed trigger. Since I'm already handling Huntmaster's transform ability on Ravager (since there is no "transform" trigger), I only need to replace Huntmaster's initial entry ability with a delayed trigger version of it.