--机空队 夕云五式 function c40009025.initial_effect(c) --link summon c:EnableReviveLimit() aux.AddLinkProcedure(c,c40009025.matfilter,1,1) --equip local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(40009025,0)) e2:SetCategory(CATEGORY_EQUIP) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1,40009025) e2:SetCondition(c40009025.thcon) e2:SetTarget(c40009025.eqtg) e2:SetOperation(c40009025.eqop) c:RegisterEffect(e2) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(40009025,1)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,40009026) e1:SetCost(c40009025.descost) e1:SetTarget(c40009025.seqtg) e1:SetOperation(c40009025.seqop) c:RegisterEffect(e1) end function c40009025.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function c40009025.matfilter(c) return not c:IsLink(1) and c:GetBaseAttack()==0 and c:IsType(TYPE_EFFECT) end function c40009025.eqfilter(c,tp) return c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0xf13) and c:CheckUniqueOnField(tp) and not c:IsForbidden() end function c40009025.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c40009025.eqfilter,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_HAND,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_HAND) end function c40009025.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if c:IsFacedown() or not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectMatchingCard(tp,c40009025.eqfilter,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_HAND,0,1,1,nil,tp) local tc=g:GetFirst() if tc then if not Duel.Equip(tp,tc,c) then return end local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(c40009025.eqlimit) tc:RegisterEffect(e1) end end function c40009025.eqlimit(e,c) return e:GetOwner()==c end function c40009025.costfilter(c) return c:IsFaceup() and c:IsSetCard(0xf13) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost() end function c40009025.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c40009025.costfilter,tp,LOCATION_ONFIELD,0,1,nil) end if Duel.IsExistingMatchingCard(c40009025.costfilter,tp,LOCATION_ONFIELD,0,1,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c40009025.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end end function c40009025.seqfilter(c) local tp=c:GetControler() return c:IsFaceup() and c:GetSequence()<5 and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end function c40009025.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and c40009025.seqfilter(chkc) and chkc~=c end if chk==0 then return Duel.IsExistingTarget(c40009025.seqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(40009025,1)) Duel.SelectTarget(tp,c40009025.seqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c) end function c40009025.seqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local ttp=tc:GetControler() if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) or Duel.GetLocationCount(ttp,LOCATION_MZONE,ttp,LOCATION_REASON_CONTROL)<=0 then return end local p1,p2 if tc:IsControler(tp) then p1=LOCATION_MZONE p2=0 else p1=0 p2=LOCATION_MZONE end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) local seq=math.log(Duel.SelectDisableField(tp,1,p1,p2,0),2) if tc:IsControler(1-tp) then seq=seq-16 end Duel.MoveSequence(tc,seq) end