--The Grandwalker Dragon --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) c:EnableReviveLimit() --copy effect local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(cid.atktg) e1:SetOperation(cid.atkop) c:RegisterEffect(e1) --toextra local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id+100) e2:SetCost(cid.sscost) e2:SetTarget(cid.sstg) e2:SetOperation(cid.ssop) c:RegisterEffect(e2) --register tributes if not cid.global_check then cid.global_check=true local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_RELEASE) ge1:SetOperation(cid.regop) Duel.RegisterEffect(ge1,0) end end cid.FELGRAND={1639384,3954901,6075801,33460840,60681103} --REGISTER TRIBUTES function cid.regop(e,tp,eg,ep,ev,re,r,rp) local c=eg:GetFirst() while c do if c:GetFlagEffect(id)<=0 then c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) end c=eg:GetNext() end end --COPY EFFECT function cid.atkfilter(c) return (c:IsSetCard(0xfe9) or c:IsCode(table.unpack(cid.FELGRAND))) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_EFFECT) and c:GetFlagEffect(id)>0 end ------------- function cid.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cid.atkfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.atkfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,cid.atkfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil) end function cid.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_EFFECT) and not tc:IsType(TYPE_TOKEN) then local code=tc:GetOriginalCodeRule() local card_id=0 if not tc:IsType(TYPE_TRAPMONSTER) then card_id=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1) end local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetLabel(card_id) e1:SetOperation(cid.rstop) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end end function cid.rstop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local card_id=e:GetLabel() if card_id~=0 then c:ResetEffect(card_id,RESET_COPY) end Duel.HintSelection(Group.FromCards(c)) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) end --TOEXTRA function cid.cfilter(c) return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_DRAGON) and (c:IsLevel(7,8) or c:IsRank(7,8)) end function cid.ssfilter(c,e,tp) return c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.ctfilter(c) return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_DRAGON) and c:IsLevel(7,8) end --------- function cid.sscost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.CheckReleaseGroup(tp,cid.cfilter,1,c) end local rg=Duel.SelectReleaseGroup(tp,cid.cfilter,1,1,c) Duel.Release(rg,REASON_COST) end function cid.sstg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToExtra() end Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,c,1,0,0) end function cid.ssop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsAbleToExtra() and c:IsRelateToEffect(e) then Duel.SendtoDeck(c,nil,2,REASON_EFFECT) end if Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(cid.ssfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.ssfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil) if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then local ct=Duel.GetMatchingGroupCount(cid.ctfilter,tp,LOCATION_GRAVE,0,nil) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(ct*300) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end end end