--Zodiakieri Ascendant function c9945545.initial_effect(c) --Cannot Trigger local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetCondition(c9945545.condition) c:RegisterEffect(e1) --Activate local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1,9945545+EFFECT_COUNT_CODE_OATH) c:RegisterEffect(e2) --Special local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(9945545,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_TO_HAND) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1,9945546) e3:SetCondition(c9945545.spcon) e3:SetTarget(c9945545.sptg) e3:SetOperation(c9945545.spop) c:RegisterEffect(e3) --Set local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(9945545,1)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCode(EVENT_DESTROYED) e4:SetTarget(c9945545.settg) e4:SetCountLimit(1,9945547) e4:SetOperation(c9945545.setop) c:RegisterEffect(e4) end function c9945545.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return not (c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)) and not (c:IsFaceup() and c:IsLocation(LOCATION_SZONE)) end function c9945545.cfilter(c,tp) return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSetCard(0x12D7) and c:IsPreviousPosition(POS_FACEUP) and c:IsControler(tp) end function c9945545.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c9945545.cfilter,1,nil,tp) end function c9945545.spfilter(c,e,tp) return c:IsSetCard(0x12D7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c9945545.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c9945545.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c9945545.spop(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,c9945545.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) end end function c9945545.setfilter(c) return c:IsSetCard(0x12D7) and not c:IsCode(9945545) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() end function c9945545.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c9945545.setfilter,tp,LOCATION_DECK,0,1,nil) end end function c9945545.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,c9945545.setfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SSet(tp,g:GetFirst()) Duel.ConfirmCards(1-tp,g) end end