Aerixeth
  • Aerixeth
  • Advanced Member Topic Starter
2014-08-11T08:17:09Z
For those that aren't aware, this is the effect of De-Synchro :

Quote:

Target 1 face-up Synchro Monster; return that target to the Extra Deck, then, if all of the monsters that were used for the Synchro Summon of that monster are in your Graveyard, you can Special Summon them.



I'm trying to script a field spell card that has the following effect:

Quote:

When a Synchro Monster you control leaves the field, you can return it to the Extra Deck, then if you do, if all of the monsters that were used for the Synchro Summon of that Monster are in your Graveyard, you can Special Summon them.



Here's the lua script for De-Synchro:

Quote:

--シンクロキャンセル
function c32441317.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c32441317.target)
e1:SetOperation(c32441317.activate)
c:RegisterEffect(e1)
end
function c32441317.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToExtra()
end
function c32441317.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c32441317.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c32441317.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c32441317.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c32441317.mgfilter(c,e,tp,sync)
return not c:IsControler(tp) or not c:IsLocation(LOCATION_GRAVE)
or bit.band(c:GetReason(),0x80008)~=0x80008 or c:GetReasonCard()~=sync
or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c32441317.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local mg=tc:GetMaterial()
local sumable=true
local sumtype=tc:GetSummonType()
if Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)==0 or sumtype~=SUMMON_TYPE_SYNCHRO or mg:GetCount()==0
or mg:GetCount()>Duel.GetLocationCount(tp,LOCATION_MZONE)
or mg:IsExists(c32441317.mgfilter,1,nil,e,tp,tc) then
sumable=false
end
if sumable and Duel.SelectYesNo(tp,aux.Stringid(32441317,0)) then
Duel.BreakEffect()
Duel.SpecialSummon(mg,0,tp,tp,false,false,POS_FACEUP)
end
end



I've figured out how to get it so that destroyed Synchro Monsters return to the Extra deck (by manipulating the script of Dimensional Fissure), but I've encountered two things I don't know how to do:

1. I want the card's effect to apply when a Synchro Monster leaves the field, not just when it's destroyed.
2. I don't know how to take De-Synchro's Special Summoning effect and make it apply as a Continuous/Field effect.

Any help would be greatly appreciated.
Michael Lawrence Dee
2014-08-17T10:37:34Z
Done. Replace c10002 with cXXXX wherein XXXX is your card number. Have fun.
File Attachment(s):
c10002.lua (2kb) downloaded 5 time(s).

You cannot view/download attachments. Try to login or register.

Now this is how I play:
Aerixeth
  • Aerixeth
  • Advanced Member Topic Starter
2014-08-20T02:38:46Z
Much appreciated! That was a big help.
Aerixeth
  • Aerixeth
  • Advanced Member Topic Starter
2014-08-20T04:23:20Z
I do have a question, though.

When I use a Synchro monster as a material in the Synchro Summon of another Synchro monster, I'm not given the chance to return the material monster to my Extra deck; it just goes to the grave. Any idea what I might change to fix that?
Michael Lawrence Dee
2014-08-22T01:43:17Z
Originally Posted by: Aerixeth 

I do have a question, though.

When I use a Synchro monster as a material in the Synchro Summon of another Synchro monster, I'm not given the chance to return the material monster to my Extra deck; it just goes to the grave. Any idea what I might change to fix that?



Probably missing the timing. Try changing TRIGGER_O to QUICK_O if it will fix it?
Now this is how I play:
Aerixeth
  • Aerixeth
  • Advanced Member Topic Starter
2014-08-22T01:58:02Z
Hm, same problem, even after changing it to a quick effect.