--Cyber-Varia Beast function c249000951.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c249000951.spcon) c:RegisterEffect(e1) --atk up local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(c249000951.target) e2:SetOperation(c249000951.operation) c:RegisterEffect(e2) --chain attack local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(78274190,0)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_DESTROYING) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(c249000951.catg) e3:SetOperation(c249000951.caop) c:RegisterEffect(e3) --search local e4=Effect.CreateEffect(c) e4:SetDescription(1190) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_TO_GRAVE) e4:SetCountLimit(1,249000951) e4:SetTarget(c249000951.target2) e4:SetOperation(c249000951.operation2) c:RegisterEffect(e4) end function c249000951.filter(c) return c:IsFaceup() and c:IsSetCard(0x1FD) and c:GetCode()~=249000951 end function c249000951.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c249000951.filter,c:GetControler(),LOCATION_MZONE,0,1,nil) end function c249000951.tgfilter(c) return c:IsFaceup() and c:IsSetCard(0x1FD) end function c249000951.target(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 c249000951.tgfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c249000951.tgfilter,tp,LOCATION_MZONE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,c249000951.tgfilter,tp,LOCATION_MZONE,0,1,1,c) end function c249000951.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(-500) e2:SetReset(RESET_EVENT+RESETS_STANDARD) g:GetFirst():RegisterEffect(e2) end end end function c249000951.afilter(c,tp) return c:IsControler(tp) and c:IsSetCard(0x1FD) and c:IsChainAttackable() end function c249000951.catg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(c249000951.afilter,1,nil,tp) end local a=eg:Filter(c249000951.afilter,nil,tp):GetFirst() Duel.SetTargetCard(a) end function c249000951.caop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsControler(tp) and tc:IsRelateToBattle() then Duel.ChainAttack() end end function c249000951.thfilter(c) return c:IsSetCard(0x11FD) and c:IsAbleToHand() end function c249000951.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249000951.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c249000951.operation2(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c249000951.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end