Synchro Monsters are too complex.
Percy created the function "c:CheckFusionMaterial()", that allows Check a Fusion Material of a Fusion Monster (is very easy to use it).
But, why "Duel.CheckSynchroMaterial(), is very complex? since you need the following parameters in this function. "synchro card, function 1, function 2, min count, max count, synchro material, group material".
I'm tryed to create a Spell Card with the following effect.
"Send Synchro Material Monsters that are listed on a Synchro Monster Card from your hand or your Deck to the Graveyard, and Special Summon that Synchro Monster from your Extra Deck."
This is my currently progress.
function c5959.filter1(c,e)
return c:IsCanBeSynchroMaterial() and not c:IsImmuneToEffect(e)
end
function c5959.filter2(c,e,tp,m,f1,f2,smat)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
local minc=mt.minntct
local maxc=mt.maxntct
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.CheckSynchroMaterial(c,f1,f2,minc,maxc,smat,m)
end
function c5959.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
local res=Duel.IsExistingMatchingCard(c5959.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,nil,nil)
return res and ft>0
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
It sends no error, but also not active. I don't know the reason.
Edited by user
2016-05-23T00:29:31Z
|
Reason: Not specified