--机空援护 导流屏障 function c40009041.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(40009041,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,40009041) e2:SetCondition(c40009041.thcon) e2:SetTarget(c40009041.thtg) e2:SetOperation(c40009041.thop) c:RegisterEffect(e2) -- local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xf13)) e3:SetValue(c40009041.atkval) c:RegisterEffect(e3) end function c40009041.cfilter(c,tp) return c:IsSetCard(0xf13) and c:IsControler(tp) and c:IsType(TYPE_QUICKPLAY) end function c40009041.atkval(e,c) return Duel.GetFieldGroupCount(0,LOCATION_GRAVE,LOCATION_GRAVE)*100 end function c40009041.thcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c40009041.cfilter,1,nil,tp) end function c40009041.thfilter(c,tp) return c:IsSetCard(0xf13) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand() and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode()) end function c40009041.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c40009041.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c40009041.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c40009041.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end