--Felgrandrise Kaiser Vermillion --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --link summon aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),3,99,cid.lcheck) c:EnableReviveLimit() --negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_NEGATE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(cid.discon) e1:SetCost(cid.discost) e1:SetTarget(cid.distg) e1:SetOperation(cid.disop) c:RegisterEffect(e1) --disable chain local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id+100) e2:SetCondition(cid.discon2) e2:SetTarget(cid.distg2) e2:SetOperation(cid.disop2) c:RegisterEffect(e2) --spsummon (equip) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND) 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.lcheck(g) return g:IsExists(cid.ffilter,1,nil) end function cid.ffilter(c) return c:IsLinkSetCard(0xfe9) or c:IsLinkCode(table.unpack(c43954163.FELGRAND)) end --NEGATE function cid.cfilter(c) return (c:IsLinkSetCard(0xfe9) or c:IsLinkCode(table.unpack(c43954163.FELGRAND))) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost() end -------- function cid.discon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) end function cid.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) Duel.SendtoDeck(g,nil,2,REASON_COST) e:SetLabel(id) end function cid.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function cid.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end --DISABLE CHAIN function cid.discon2(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetCurrentChain() if ct<2 then return end local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT) return te and rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and te:GetLabel()==id end function cid.distg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ng,sg,dg=Group.CreateGroup(),Group.CreateGroup(),Group.CreateGroup() for i=1,ev do local te,tep=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER) local tc=te:GetHandler() if tep==1-tp then ng:AddCard(tc) if tc:IsRelateToEffect(te) then if tc:IsOnField() and tc:IsFaceup() and not tc:IsDisabled() then sg:AddCard(tc) end if tc:IsDestructable() then dg:AddCard(tc) end end end end local target_group=Group.CreateGroup() target_group:Merge(sg) target_group:Merge(dg) Duel.SetTargetCard(target_group) Duel.SetOperationInfo(0,CATEGORY_NEGATE,ng,ng:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,dg:GetCount(),0,0) end function cid.disop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local dg=Group.CreateGroup() for i=1,ev do local te,tep=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER) local tc=te:GetHandler() if tep==1-tp then if Duel.NegateActivation(i) and tc:IsRelateToEffect(te) then if not tc:IsDisabled() then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2) if tc:IsType(TYPE_TRAPMONSTER) then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e3) end end dg:AddCard(tc) end end end Duel.Destroy(dg,REASON_EFFECT) end --TOHAND (EQUIP) function cid.ssfilter(c) return (c:IsSetCard(0xfe9) or c:IsCode(table.unpack(c43954163.FELGRAND))) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsLevelBelow(4) 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.IsExistingMatchingCard(cid.ssfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function cid.ssop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cid.ssfilter),tp,LOCATION_GRAVE,0,nil) if g:GetCount()==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,2) Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end