--Verglascent Fletchling local cid,id=GetID() function cid.initial_effect(c) --cannot link local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e1:SetValue(cid.linklimit) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1,id) e2:SetTarget(cid.sptg2) e2:SetOperation(cid.spop2) c:RegisterEffect(e2) --atk local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetTarget(cid.target) e3:SetOperation(cid.operation) c:RegisterEffect(e3) end function cid.linklimit(e,c) if not c then return false end return not c:IsRace(RACE_DRAGON) end function cid.spfilter2(c,e,tp) return c:IsSetCard(0x1996) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function cid.spop2(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,cid.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetReset(RESET_PHASE+PHASE_END) e2:SetTargetRange(1,0) e2:SetTarget(cid.splimit) Duel.RegisterEffect(e2,tp) end end function cid.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsRace(RACE_DRAGON) end function cid.filter(c) return c:IsFaceup() and c:GetBaseAttack()>0 end function cid.desfilter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and cid.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,cid.filter,tp,0,LOCATION_MZONE,1,1,nil) end function cid.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local atk=tc:GetAttack() local batk=tc:GetBaseAttack() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) if atk>=batk then e1:SetValue(-300) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,cid.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.Destroy(g,REASON_EFFECT) end end end