--Cyberse Quantum Dragon Recoded function c249000978.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_CYBERSE),aux.NonTuner(nil),1) c:EnableReviveLimit() --repeat attack local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_START) e1:SetTarget(c249000978.thtg) e1:SetOperation(c249000978.thop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY) e2:SetCondition(c249000978.sccon) e2:SetTarget(c249000978.sctg) e2:SetOperation(c249000978.scop) c:RegisterEffect(e2) end function c249000978.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local tc=c:GetBattleTarget() if chk==0 then return tc and tc:IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,0,0) end function c249000978.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetAttacker() if c==tc then tc=Duel.GetAttackTarget() end if tc and tc:IsRelateToBattle() then Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) end if c:IsRelateToEffect(e) and c:IsChainAttackable() then Duel.ChainAttack() end end function c249000978.sccon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT))) and c:IsPreviousPosition(POS_FACEUP) end function c249000978.filter(c,e,tp) return (c:IsSetCard(0x1FE) or c:IsCode(70238111)) and c:IsCanBeSpecialSummoned(e,nil,tp,false,false) end function c249000978.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(c249000978.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c249000978.scop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE) <= 0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c249000978.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) end end