--created by Lyris / NovaTsukimori, coded by Lyris, art at https://www.zerochan.net/632949 --襲雷メカドラゴン・ニ local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_HAND) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_ATTACK) c:RegisterEffect(e2) local e0=Effect.CreateEffect(c) e0:SetCategory(CATEGORY_DESTROY) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e0:SetCode(EVENT_BE_BATTLE_TARGET) e0:SetTarget(s.destg) e0:SetOperation(s.desop) c:RegisterEffect(e0) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,id) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCategory(CATEGORY_TOHAND) e3:SetCondition(function(e,tp,eg,ep,ev,re,r) return r&0x41==0x41 end) e3:SetTarget(s.tg) e3:SetOperation(s.op) c:RegisterEffect(e3) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end function s.spfilter(c,tp) return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x7c4) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.spfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(aux.AND(aux.FilterBoolFunction(Card.IsAbleToHand),aux.FilterBoolFunction(Card.IsFaceup)),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,aux.AND(aux.FilterBoolFunction(Card.IsAbleToHand),aux.FilterBoolFunction(Card.IsFaceup)),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.op(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end