--Warrior Child function c500317890.initial_effect(c) c:EnableReviveLimit() aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionType,TYPE_NORMAL),2,true) --synchro custom local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCondition(c500317890.syncon) e1:SetTarget(c500317890.syntg) e1:SetValue(1) e1:SetOperation(c500317890.synop) c:RegisterEffect(e1) end function c500317890.synfilter1(c,syncard,tuner,f) return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c)) end function c500317890.synfilter2(c,syncard,tuner,f,g,lv,minc,maxc) if c:IsCanBeSynchroMaterial(syncard,tuner) and (c:IsLevelBelow(2) and not c:IsType(TYPE_EFFECT)) and (f==nil or f(c)) then lv=lv-c:GetLevel() if lv<0 then return false end if lv==0 then return minc==1 end return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc-1,maxc-1,syncard) else return false end end function c500317890.syncon(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function c500317890.syntg(e,syncard,f,minc,maxc) local c=e:GetHandler() local tp=syncard:GetControler() local lv=syncard:GetLevel()-c:GetLevel() if lv<=0 then return false end local g1=Duel.GetMatchingGroup(c500317890.synfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f) return g1:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard) or Duel.IsExistingMatchingCard(c500317890.synfilter2,tp,LOCATION_HAND,0,1,nil,syncard,c,f,g1,lv,minc,maxc) end function c500317890.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc) local c=e:GetHandler() local lv=syncard:GetLevel()-c:GetLevel() local g1=Duel.GetMatchingGroup(c500317890.synfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f) local g2=Duel.GetMatchingGroup(c500317890.synfilter2,tp,LOCATION_HAND,0,nil,syncard,c,f,g1,lv,minc,maxc) if not g1:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard) or (g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(500317890,0))) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local sg=g2:Select(tp,1,1,nil) local tc=sg:GetFirst() if lv>tc:GetLevel() then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local tg=g1:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv-tc:GetLevel(),minc-1,maxc-1,syncard) sg:Merge(tg) end Duel.SetSynchroMaterial(sg) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local sg=g1:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard) Duel.SetSynchroMaterial(sg) end end