--Ancient Fairy Pixie of the Signer Dragon local cid,id=GetID() function cid.initial_effect(c) --position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCost(cid.poscost) e1:SetTarget(cid.postg) e1:SetOperation(cid.posop) e1:SetCountLimit(1,id) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --material effect local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(cid.effcon) e2:SetOperation(cid.effop) c:RegisterEffect(e2) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,cid.counterfilter) end function cid.counterfilter(c) return c:IsRace(RACE_DRAGON) or c:GetSummonLocation()~=LOCATION_EXTRA end --POSITION function cid.spfilter(c,e,tp) return c:IsSetCard(0xcd01) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.poscost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetTarget(cid.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function cid.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not cid.counterfilter(c) end function cid.postg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanChangePosition() end Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0) end function cid.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsCanChangePosition() and Duel.ChangePosition(c,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.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 end end --MATERIAL EFFECT function cid.effcon(e,tp,eg,ep,ev,re,r,rp) local rc=e:GetHandler():GetReasonCard() return r==REASON_SYNCHRO and rc:IsSetCard(0xcd01) end function cid.effop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,tp,id) Duel.Hint(HINT_CARD,1-tp,id) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetOperation(cid.sumop) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAINING) e2:SetOperation(cid.actop) e2:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e2,tp) end function cid.sumcheck(c) return c:IsType(TYPE_SYNCHRO) and c:IsSummonType(TYPE_SYNCHRO) end function cid.sumop(e,tp,eg,ep,ev,re,r,rp) if eg:IsExists(cid.sumcheck,1,nil) then Duel.SetChainLimitTillChainEnd(cid.chainlm) end end function cid.chainlm(e,rp,tp) return tp==rp end function cid.actop(e,tp,eg,ep,ev,re,r,rp) local rc=re:GetHandler() if re:IsActiveType(TYPE_MONSTER) and cid.sumcheck(rc) then Duel.SetChainLimit(cid.chainlm) end end