--Felgrandrise Dauntless Drive --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,cid.ffilter,7,2) c:EnableReviveLimit() --change position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCost(cid.atkcost) e1:SetTarget(cid.atktg) e1:SetOperation(cid.atkop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_POSITION+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id+100) e2:SetCondition(cid.drycon) e2:SetTarget(cid.drytg) e2:SetOperation(cid.dryop) c:RegisterEffect(e2) --tohand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE+CATEGORY_DEFCHANGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,id+200) e3:SetCost(cid.sscost) e3:SetTarget(cid.sstg) e3:SetOperation(cid.ssop) c:RegisterEffect(e3) end --FILTERS function cid.ffilter(c) return c:IsSetCard(0xfe9) or c:IsCode(table.unpack(c43954163.FELGRAND)) end --CHANGE POSITION function cid.filter(c,val) return c:IsFaceup() and not c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition() and c:IsType(TYPE_MONSTER) and c:IsAttackBelow(val) end function cid.gfilter(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) end ----------------- function cid.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function cid.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE):Filter(cid.gfilter,nil) if #g<=0 then return false end local _,val=g:GetMaxGroup(Card.GetDefense) return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler(),val) end local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE):Filter(cid.gfilter,nil) if #g<=0 then return end local _,val=g:GetMaxGroup(Card.GetDefense) local sg=Duel.GetMatchingGroup(cid.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler(),val) Duel.SetOperationInfo(0,CATEGORY_POSITION,sg,#sg,0,0) end function cid.atkop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE):Filter(cid.gfilter,nil) if #g<=0 then return end local _,val=g:GetMaxGroup(Card.GetDefense) local sg=Duel.GetMatchingGroup(cid.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler(),val) if #sg>0 then Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE) end end --DESTROY function cid.dryfilter(c) return c:IsFacedown() or c:IsType(TYPE_MONSTER) end --------- function cid.drycon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsAttackPos() and e:GetHandler():IsType(TYPE_XYZ) and e:GetHandler():GetOverlayCount()==0 end function cid.drytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanChangePosition() and Duel.IsExistingMatchingCard(cid.dryfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_ALL,LOCATION_MZONE) end function cid.dryop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or Duel.ChangePosition(c,POS_FACEUP_DEFENSE)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,cid.dryfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) if #g>0 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end --TOHAND function cid.thfilter(c) return (c:IsSetCard(0xfe9) or c:IsCode(table.unpack(c43954163.FELGRAND))) and c:IsAbleToHand() end -------- function cid.sscost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToExtraAsCost() end Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST) Duel.ShuffleExtra(tp) end function cid.sstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.thfilter,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 c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.thfilter),tp,LOCATION_GRAVE,0,1,1,nil):GetFirst() if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,tc) if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.BreakEffect() if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then 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) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_SET_DEFENSE_FINAL) e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetValue(tc:GetDefense()*2) tc:RegisterEffect(e3) end end end end