--Gardrenial Spirit - Rain local ref,id=GetID() Duel.LoadScript("GardrenialCommons.lua") function ref.initial_effect(c) --Extra Fusion local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetOperation(ref.fusop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Special Summon local e3=Gardrenial.CreateDualityEffect(c,RACE_INSECT) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_HAND+LOCATION_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(ref.sstg) e3:SetOperation(ref.ssop) c:RegisterEffect(e3) end --Extra Fusion function ref.fusop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() --Extra Fusion Material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_GLITCHY_EXTRA_FUSION_MATERIAL) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCountLimit(1,{id,2}) e1:SetTargetRange(1,0) e1:SetTarget(ref.fustg) e1:SetValue(function(e,fc) return true,1 end) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function ref.fustg(e,c) return c:IsRace(RACE_PLANT) and c:IsLocation(LOCATION_DECK) and c:IsControler(e:GetHandlerPlayer()) and (#(gardrenial_mats:Filter(Card.IsLocation,nil,LOCATION_DECK))==0 or gardrenial_mats:IsContains(c)) end --[[function ref.fusop(e,tc,tp,sg) Duel.Remove(sg,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) sg:Clear() end]] --Special Summon function ref.sstg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,c:GetLocation()) end function ref.ssop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end