--Ignitronix Torcorex local s,id=GetID() function s.initial_effect(c) --You can target 1 face-up monster on the field; equip this card from your hand or GY to it, but if you equipped this card from the GY, banish it when it leaves the field. local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) 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 600 ATK/DEF, also it cannot attack. local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(600) c:RegisterEffect(e2) local e3=e2:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_EQUIP) e4:SetCode(EFFECT_CANNOT_ATTACK) c:RegisterEffect(e4) --If this card is destroyed, except by a card effect: You can add 1 "Ignitronix Engine" from your Deck to your hand, or if you have an Engaged "Ignitronix Engine", you can draw 1 card instead. local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e5:SetCode(EVENT_DESTROYED) e5:SetCountLimit(1,{id,1}) e5:SetCondition(s.thcon) e5:SetTarget(s.thtg) e5:SetOperation(s.thop) c:RegisterEffect(e5) end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,Card.IsFaceup,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) if c:IsPreviousLocation(LOCATION_GRAVE) then local e2=Effect.CreateEffect(c) e2:SetDescription(702) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e2:SetReset(RESET_EVENT+RESETS_REDIRECT) e2:SetValue(LOCATION_REMOVED) c:RegisterEffect(e2) end end function s.eqlimit(e,c) return c==e:GetLabelObject() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return not c:IsReason(REASON_EFFECT) end function s.thfilter(c) return c:IsAbleToHand() and c:IsCode(77222587) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local en=Duel.GetEngagedCard(tp) op1 = (en and en:IsMonster() and en:IsCode(77222587)) op2 = Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) if chk==0 then return op1 or op2 end if op1 then Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end if op2 then Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end end function s.thop(e,tp,eg,ep,ev,re,r,rp) local en=Duel.GetEngagedCard(tp) op1 = Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) op2 = (en and en:IsMonster() and en:IsCode(77222587)) if op1 and op2 then op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) elseif op1 then op=0 else op=1 end if op==0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end if op==1 then Duel.Draw(tp,1,REASON_EFFECT) end end