--Crocell, Angel of the Black Lotus --Script by TaxingCorn117 function c27796622.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,27796622) e1:SetCondition(c27796622.spcon) e1:SetOperation(c27796622.spop) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(27796622,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,20796622) e2:SetCost(c27796622.tdcost) e2:SetTarget(c27796622.tdtg) e2:SetOperation(c27796622.tdop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) Duel.AddCustomActivityCounter(27796622,ACTIVITY_SPSUMMON,c27796622.counterfilter) end --filters function c27796622.spfilter(c) return c:IsSetCard(0x42d) and c:IsAbleToGraveAsCost() end function c27796622.counterfilter(c) return c:IsSetCard(0x42d) end function c27796622.filter(c,e,tp) return c:IsLevelBelow(3) and c:IsSetCard(0x42d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end --special summon function c27796622.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c27796622.spfilter,tp,LOCATION_DECK,0,2,nil) end function c27796622.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c27796622.spfilter,tp,LOCATION_DECK,0,2,2,nil) Duel.SendtoGrave(g,REASON_COST) end --spsummon function c27796622.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c27796622.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetCustomActivityCount(27796622,tp,ACTIVITY_SPSUMMON)==0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c27796622.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(c27796622.splimit) Duel.RegisterEffect(e1,tp) end function c27796622.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(0x42d) end function c27796622.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,e:GetHandler()) and not Duel.IsExistingMatchingCard(Card.IsPublic,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function c27796622.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Select(tp,1,1,nil) Duel.SendtoDeck(g,nil,2,REASON_EFFECT) end