--Cycle of the Shya function c11000513.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_TO_GRAVE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,11000513+EFFECT_COUNT_CODE_OATH) e1:SetCondition(c11000513.condition) e1:SetCost(c11000513.cost) e1:SetTarget(c11000513.target) e1:SetOperation(c11000513.activate) c:RegisterEffect(e1) end function c11000513.cfilter(c,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1FD) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) end function c11000513.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c11000513.cfilter,1,nil,tp) end function c11000513.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,e:GetHandler()) end function c11000513.spfilter(c,e,tp) return c:IsSetCard(0x1FD) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c11000513.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c11000513.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c11000513.activate(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,c11000513.spfilter,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 end