--Felgrandrise Waterfall --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,nil,aux.NonTuner(cid.matfilter),1) c:EnableReviveLimit() --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(cid.spcon) e1:SetTarget(cid.sptg) e1:SetOperation(cid.spop) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetCountLimit(1,id+100) e2:SetRange(LOCATION_MZONE) e2:SetCondition(cid.discon) e2:SetTarget(cid.distg) e2:SetOperation(cid.disop) c:RegisterEffect(e2) --spsummon (equip) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1,id+200) e3:SetCondition(cid.sscon) e3:SetCost(cid.sscost) e3:SetTarget(cid.sstg) e3:SetOperation(cid.ssop) c:RegisterEffect(e3) end --FILTERS function cid.matfilter(c) return c:IsSetCard(0xfe9) or c:IsCode(table.unpack(c43954163.FELGRAND)) end --SPECIAL SUMMON function cid.spfilter(c,e,tp) return (c:IsSetCard(0xfe9) or c:IsCode(table.unpack(c43954163.FELGRAND))) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end ----------- function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function cid.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,cid.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end --NEGATE function cid.discon(e,tp,eg,ep,ev,re,r,rp) return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) end function cid.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,PLAYER_ALL,e:GetHandler():GetBaseAttack()) end function cid.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.NegateEffect(ev) and c:IsRelateToEffect(e) and c:IsFaceup() and c:GetBaseAttack()>0 then Duel.Recover(tp,c:GetBaseAttack(),REASON_EFFECT,true) Duel.Recover(1-tp,c:GetBaseAttack(),REASON_EFFECT,true) Duel.RDComplete() end end --SPSUMMON (EQUIP) function cid.ssfilter(c,e,tp) return (c:IsSetCard(0xfe9) or c:IsCode(table.unpack(c43954163.FELGRAND))) and c:IsType(TYPE_MONSTER) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end ------------------ function cid.sscon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ec and ec:IsType(TYPE_MONSTER) end function cid.sscost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) end function cid.sstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.ssfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetChainLimit(cid.chlimit) end function cid.chlimit(e,ep,tp) return tp==ep end function cid.ssop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local g=Duel.GetMatchingGroup(cid.ssfilter,tp,LOCATION_GRAVE,0,nil,e,tp) if ft<1 or g:GetCount()==0 then return end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,math.min(ft,2)) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end