--Shadowbrave - Gryrard function c1392007.initial_effect(c) --Synchro Summon c:EnableReviveLimit() aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x920),aux.NonTuner(nil),1) --Special Summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(1392007,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,1392007) e1:SetCondition(c1392007.spcon) e1:SetTarget(c1392007.sptg) e1:SetOperation(c1392007.spop) c:RegisterEffect(e1) --Special Summon (destroyed) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(1392007,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,1392015) e2:SetCondition(c1392007.condition) e2:SetTarget(c1392007.target) e2:SetOperation(c1392007.operation) c:RegisterEffect(e2) end function c1392007.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO end function c1392007.spfilter(c,e,tp) return c:IsSetCard(0x920) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY) end function c1392007.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(c1392007.spfilter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE) end function c1392007.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local c=e:GetHandler() local g=Duel.GetMatchingGroup(c1392007.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) if g:GetCount()>=2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,2,2,nil) local tc=sg:GetFirst() while tc do Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(3) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e2:SetValue(c1392007.matlimit) e2:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) tc:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EFFECT_UNRELEASABLE_SUM) tc:RegisterEffect(e4) local e5=e2:Clone() e5:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL) tc:RegisterEffect(e5) local e6=e2:Clone() e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) tc:RegisterEffect(e6) local e7=e2:Clone() e7:SetCode(EFFECT_CANNOT_BE_POLARITY_MATERIAL) tc:RegisterEffect(e7) local e9=e2:Clone() e9:SetCode(EFFECT_CANNOT_BE_EVOLUTE_MATERIAL) tc:RegisterEffect(e9) local e10=e2:Clone() e10:SetCode(EFFECT_CANNOT_BE_BIGBANG_MATERIAL) tc:RegisterEffect(e10) local e11=e2:Clone() e11:SetCode(EFFECT_CANNOT_BE_TIMELEAP_MATERIAL) tc:RegisterEffect(e11) local e12=e2:Clone() e12:SetCode(EFFECT_CANNOT_BE_SPACE_MATERIAL) tc:RegisterEffect(e12) tc=sg:GetNext() end end end function c1392007.matlimit(e,c) if not c then return false end return not c:IsSetCard(0x920) end function c1392007.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():IsReason(REASON_BATTLE+REASON_EFFECT) end function c1392007.filter(c,e,tp,code) return c:IsSetCard(0x920) and c:GetCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c1392007.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c1392007.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,e:GetHandler():GetCode()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) end function c1392007.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c1392007.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,e:GetHandler():GetCode()) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end