--ESPergear Armor:Wings function c16000026.initial_effect(c) --equip local e0=Effect.CreateEffect(c) e0:SetDescription(aux.Stringid(16000026,0)) e0:SetProperty(EFFECT_FLAG_CARD_TARGET) e0:SetCategory(CATEGORY_EQUIP) e0:SetType(EFFECT_TYPE_IGNITION) e0:SetRange(LOCATION_MZONE) e0:SetTarget(c16000026.eqtg) e0:SetOperation(c16000026.eqop) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(16000026,1)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetRange(LOCATION_HAND) e1:SetTarget(c16000026.eqtg2) e1:SetOperation(c16000026.eqop2) c:RegisterEffect(e1) --unequip local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(16000026,2)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_SZONE) e2:SetTarget(c16000026.sptg) e2:SetOperation(c16000026.spop) c:RegisterEffect(e2) --destroy sub local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetCode(EFFECT_DESTROY_SUBSTITUTE) e3:SetValue(c16000026.repval) c:RegisterEffect(e3) --special summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(16000026,3)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) --e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetCountLimit(1,16000026) e4:SetRange(LOCATION_SZONE) e4:SetCondition(c16000026.spcon2) e4:SetTarget(c16000026.sptg2) e4:SetOperation(c16000026.spop2) c:RegisterEffect(e4) --eqlimit local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_SINGLE) e7:SetCode(EFFECT_EQUIP_LIMIT) e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e7:SetValue(1) c:RegisterEffect(e7) local e8=Effect.CreateEffect(c) e8:SetDescription(aux.Stringid(16000026,4)) e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e8:SetCode(EVENT_DAMAGE_STEP_END) e8:SetRange(LOCATION_SZONE) e8:SetCountLimit(1) e8:SetCondition(c16000026.drcon) e8:SetOperation(c16000026.drop) c:RegisterEffect(e8) c16000026.global_check=true c16000026[0]=0 c16000026[1]=0 local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_ATTACK_ANNOUNCE) ge1:SetOperation(c16000026.checkop) Duel.RegisterEffect(ge1,0) local ge2=Effect.CreateEffect(c) ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW) ge2:SetOperation(c16000026.clear) Duel.RegisterEffect(ge2,0) end function c16000026.filter(c) local ct1,ct2=c:GetUnionCount() return c:IsFaceup() and c:IsCode(16000020) and ct2==0 end function c16000026.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c16000026.filter(chkc) end if chk==0 then return e:GetHandler():GetFlagEffect(16000026)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c16000026.filter,tp,LOCATION_MZONE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,c16000026.filter,tp,LOCATION_MZONE,0,1,1,c) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) c:RegisterFlagEffect(16000026,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1) end function c16000026.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then Duel.SendtoGrave(c,REASON_EFFECT) return end Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(c16000021.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) --Atk up 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() e3:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) end function c16000026.eqtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c16000026.filter(chkc) end if chk==0 then return e:GetHandler():GetFlagEffect(16000026)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c16000026.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c16000026.filter,tp,LOCATION_MZONE,0,1,1,nil) c:RegisterFlagEffect(16000026,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1) end function c16000026.eqop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then Duel.SendtoGrave(c,REASON_EFFECT) return end Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(c16000026.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) --Atk up 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() e3:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) end function c16000026.eqlimit(e,c) return c==e:GetLabelObject() end function c16000026.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:GetFlagEffect(16000026)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) c:RegisterFlagEffect(16000026,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1) end function c16000026.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) and not c:IsFaceup() then return end if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) then Duel.SendtoGrave(c,REASON_RULE) end end function c16000026.repval(e,re,r,rp) return bit.band(r,REASON_BATTLE)~=0 or bit.band(r,REASON_EFFECT)~=0 end function c16000026.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetEquipTarget():IsCode(16000020) end function c16000026.xfilter(c,e,tp) return c:IsSetCard(0x668f) and c:IsType(TYPE_MONSTER) and not c:IsCode(16000026) and c:IsAbleToHand() end function c16000026.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(c16000026.xfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) end function c16000026.spop2(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if c:IsFaceup() then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c16000026.xfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end end function c16000026.atkcon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ep==tp end function c16000026.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ec=c:GetEquipTarget() if not c:IsRelateToEffect(e) and Duel.ChainAttack()~=0 then return end Duel.Destroy(c,REASON_EFFECT) end function c16000026.checkop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if tc:GetFlagEffect(16000026)==0 then c16000026[ep]=c16000026[ep]+1 tc:RegisterFlagEffect(16000026,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) end end function c16000026.clear(e,tp,eg,ep,ev,re,r,rp) c16000026[0]=0 c16000026[1]=0 end function c16000026.drcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker()==e:GetHandler():GetEquipTarget() end function c16000026.ftarget(e,c) return e:GetLabel()~=c:GetFieldID() end function c16000026.drop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetValue(1) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE) e:GetHandler():GetEquipTarget():RegisterEffect(e1) --extra attack local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(16000026,5)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(c16000026.drcon) e2:SetTarget(c16000026.destg) e2:SetOperation(c16000026.desop) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE) c:RegisterEffect(e2) end end function c16000026.destg(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 c16000026.desop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end