--VECTOR Frame: Spiegel --Scripted by Boos local cod,id=GetID() function cod.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x2a6),7,2) c:EnableReviveLimit() --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCondition(cod.spcon) e1:SetTarget(cod.sptg) e1:SetOperation(cod.spop) c:RegisterEffect(e1) --Equip local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_EQUIP) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id+100) e2:SetCondition(cod.eqcon) e2:SetTarget(cod.eqtg) e2:SetOperation(cod.eqop) c:RegisterEffect(e2) end function cod.cfilter(c) return c:IsFaceup() and c:IsSetCard(0x2a6) and c:IsType(TYPE_LINK) end function cod.checkzone(tp) local zone=0 local g=Duel.GetMatchingGroup(cod.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) for tc in aux.Next(g) do zone=bit.bor(zone,tc:GetLinkedZone(tp)) end return bit.band(zone,0x1f) end function cod.spcon(e,tp,eg,ep,ev,re,r,rp) return 2^e:GetHandler():GetSequence()&cod.checkzone(tp)~=0 end function cod.spfilter(c,e,tp) return c:IsSetCard(0x2a6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end function cod.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cod.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cod.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,cod.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function cod.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function cod.eqcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end function cod.eqfilter(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToChangeControler() end function cod.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cod.eqfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(cod.eqfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,cod.eqfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) end function cod.eqlimit(e,c) return e:GetOwner()==c and not c:IsDisabled() end function cod.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then local atk=tc:GetTextAttack() if atk<0 then atk=0 end if not Duel.Equip(tp,tc,c,false) then return end --Add Equip limit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(cod.eqlimit) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetValue(atk/2) tc:RegisterEffect(e2) tc:RegisterFlagEffect(67864673,RESET_EVENT+RESETS_STANDARD,0,1) end end