--Ignitronix Quantumflare local s,id=GetID() function s.initial_effect(c) --You can target 1 FIRE monster you control; equip this card from your hand or GY to it. local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE) e1:SetCountLimit(1,{id,0}) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) --A monster equipped with this card gains 200 ATK/DEF. local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(200) c:RegisterEffect(e2) local e3=e2:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) --While this card is equipped to a monster: You can decrease the Energy of your Engaged "Ignitronix Engine" by 1, then target 1 card in either GY; banish it. local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1,{id,1}) e3:SetCondition(function(e) return e:GetHandler():GetEquipTarget() end) e3:SetCost(s.rmcost) e3:SetTarget(s.rmtg) e3:SetOperation(s.rmop) c:RegisterEffect(e3) --If this card is destroyed, except by a card effect: You can shuffle 3 of your "Ignitronix" cards that are banished and/or from your GY into the Deck, then draw 1 card. local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetCode(EVENT_DESTROYED) e4:SetCountLimit(1,{id,2}) e4:SetCondition(s.tdcon) e4:SetTarget(s.tdtg) e4:SetOperation(s.tdop) c:RegisterEffect(e4) end function s.eqfilter(c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.eqfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then Duel.SendtoGrave(c,REASON_EFFECT) return end Duel.Equip(tp,c,tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) end function s.eqlimit(e,c) return c==e:GetLabelObject() end function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) local en=Duel.GetEngagedCard(tp) if chk==0 then return en and en:IsMonster(TYPE_DRIVE) and en:IsCode(77222587) and en:IsCanUpdateEnergy(-1,tp,REASON_COST) end en:UpdateEnergy(-1,tp,REASON_COST,true,e:GetHandler()) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function s.tdfilter(c) return c:IsSetCard(0x725) and c:IsAbleToDeck() end function s.tdcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return not c:IsReason(REASON_EFFECT) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,3,tp,LOCATION_GRAVE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil) if #g<3 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local sg=g:Select(tp,3,3,nil) if Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then Duel.ShuffleDeck(tp) Duel.Draw(tp,1,REASON_EFFECT) end end