--VECTOR Legion Sky Trooper --Scripted by Zerry local cod,id=GetID() function cod.initial_effect(c) --Equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetTarget(cod.eqtg) e1:SetOperation(cod.eqop) c:RegisterEffect(e1) --Unequip local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_SZONE) e2:SetTarget(cod.sptg) e2:SetOperation(cod.spop) c:RegisterEffect(e2) --Equip Limit local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_UNION_LIMIT) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetValue(cod.eqlimit) c:RegisterEffect(e4) --Indes local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_EQUIP) e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e5:SetValue(1) c:RegisterEffect(e5) --spsummon local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,2)) e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetType(EFFECT_TYPE_IGNITION) e6:SetRange(LOCATION_HAND) e6:SetCountLimit(1,id) e6:SetCondition(cod.spcon1) e6:SetTarget(cod.sptg1) e6:SetOperation(cod.spop1) c:RegisterEffect(e6) end --Equip function cod.filter(c) local ct1,ct2=c:GetUnionCount() return c:IsFaceup() and c:IsSetCard(0x2a6) and ct2==0 end function cod.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 cod.filter(chkc) end if chk==0 then return e:GetHandler():GetFlagEffect(id)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(cod.filter,tp,LOCATION_MZONE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,cod.filter,tp,LOCATION_MZONE,0,1,1,c) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) c:RegisterFlagEffect(id,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1) end function cod.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if not c:IsRelateToEffect(e) or c:IsFacedown() then return end if not tc:IsRelateToEffect(e) or not cod.filter(tc) then Duel.SendtoGrave(c,REASON_EFFECT) return end if not Duel.Equip(tp,c,tc,false) then return end aux.SetUnionState(c) end --Special Summon function cod.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:GetFlagEffect(id)==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(id,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1) end function cod.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) 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 --Equip Limit function cod.eqlimit(e,c) return (c:IsSetCard(0x2a6) or e:GetHandler():GetEquipTarget()==c) end --special summon function cod.spfilter(c) return (c:IsSetCard(0x2a6) and not c:IsAttribute(ATTRIBUTE_WIND)) and c:IsFaceup() end function cod.spcon1(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(cod.spfilter,tp,LOCATION_MZONE,0,1,nil) end function cod.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cod.spop1(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end