--created by Jake, coded by Lyris --Overload Artificial Intelligence local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:HOPT(true) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(s.target) e2:SetValue(aux.tgoval) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_ATTACK) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e3:SetTarget(s.limtg) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_CANNOT_TRIGGER) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetRange(LOCATION_SZONE) e5:SetCountLimit(1) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCategory(CATEGORY_EQUIP) e5:SetTarget(s.eqtg) e5:SetOperation(s.eqop) c:RegisterEffect(e5) local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e6:SetCode(EVENT_CUSTOM+id) e6:SetRange(LOCATION_SZONE) e6:SetCategory(CATEGORY_DESTROY) e6:SetCondition(s.sdcon) e6:SetTarget(s.sdtg) e6:SetOperation(s.sdop) c:RegisterEffect(e6) local g=Group.CreateGroup() g:KeepAlive() aux.RegisterMergedDelayedEvent(c,id,EVENT_LEAVE_FIELD,g) aux.RegisterMergedDelayedEvent(c,id,EVENT_SUMMON_SUCCESS,g) aux.RegisterMergedDelayedEvent(c,id,EVENT_FLIP_SUMMON_SUCCESS,g) aux.RegisterMergedDelayedEvent(c,id,EVENT_SPSUMMON_SUCCESS,g) end function s.target(e,c) return c:IsRace(RACE_MACHINE) and c:IsStatus(STATUS_SUMMON_TURN+STATUS_FLIP_SUMMON_TURN+STATUS_SPSUMMON_TURN) end function s.limtg(e,c) local ec=c:GetEquipTarget() return ec and ec:IsRace(RACE_MACHINE) and c:IsStatus(STATUS_SUMMON_TURN+STATUS_FLIP_SUMMON_TURN+STATUS_SPSUMMON_TURN) and not c:IsRace(RACE_MACHINE) end function s.filter(c,tp) return c:IsRace(RACE_MACHINE) and c:CheckUniqueOnField(tp) and not c:IsForbidden() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToChain() or tc:IsFacedown() or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local sc=Duel.SelectMatchingCard(tp,1,nil,tp):GetFirst() if not (sc and Duel.Equip(tp,sc,tc,true)) then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetLabelObject(tc) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(s.eqlimit) sc:RegisterEffect(e1) end function s.eqlimit(e,c) return e:GetLabelObject()==c end function s.cfilter() return (c:IsFaceupEx() or c:IsLocation(LOCATION_REMOVED)) and c:IsRace(RACE_MACHINE) end function s.sdcon(e,tp,eg,ep,ev,re,r,rp) return #eg>1 and eg:IsExists(s.cfilter,2,nil) end function s.sdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function s.sdop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end