--created & coded by Lyris --サイバー・ドラゴン・レッシュ local s,id,o=GetID() function s.initial_effect(c) aux.EnableChangeCode(c,CARD_CYBER_DRAGON,LOCATION_MZONE+LOCATION_GRAVE) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_TO_GRAVE) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(2) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetCost(aux.bfgcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CHANGE_RACE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetValue(RACE_MACHINE) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function s.filter(c) return c:IsPreviousPosition(POS_FACEUP) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1093) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil) and (not eg:IsContains(e:GetHandler()) or not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)) end function s.thfilter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1093) and c:IsAbleToHand() end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end