--Gardrenial Boughweaver local ref,id=GetID() Duel.LoadScript("GardrenialCommons.lua") function ref.initial_effect(c) Gardrenial.EnableTrackers(c) --SelfSummon 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:SetCondition(function(e,tp) return Gardrenial.NSInsect(tp) end) c:RegisterEffect(e1) --Fusion local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_HAND+LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end) e2:SetTarget(ref.fustg) e2:SetOperation(ref.fusop) c:RegisterEffect(e2) --Draw local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY) e3:SetCondition(function(e,tp) Debug.Message("Checking for Draw...") return Gardrenial.DidFusion(tp) end) e3:SetTarget(ref.drtg) e3:SetOperation(ref.drop) c:RegisterEffect(e3) end function ref.fusfilter(c,e,tp,gc) return c:IsType(TYPE_FUSION) and c:CheckFusionMaterial(Duel.GetFusionMaterial(tp),gc,tp) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) end function ref.fustg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(ref.fusfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function ref.fusop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return false end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local fg=Duel.SelectMatchingCard(tp,ref.fusfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c) if #fg>0 then local fc=fg:GetFirst() local mg=Duel.SelectFusionMaterial(tp,fc,Duel.GetFusionMaterial(tp),c,tp) fc:SetMaterial(mg) Duel.SendtoGrave(mg,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SpecialSummon(fc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) end end --Draw function ref.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,0,0,tp,1) end function ref.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end