--created by Seth, coded by Lyris local cid,id=GetID() function cid.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x83e),3,3) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e0:SetCode(EVENT_SPSUMMON_SUCCESS) e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e0:SetTarget(cid.tg) e0:SetOperation(cid.op) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsRelateToBattle() end) e1:SetTarget(cid.hdtg) e1:SetOperation(cid.hdop) c:RegisterEffect(e1) end function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:GetLinkedGroup():IsContains(chkc) and chkc:IsFaceup() and not chkc:IsType(TYPE_TUNER) end if chk==0 then return Duel.IsExistingTarget(function(tc) return c:GetLinkedGroup():IsContains(tc) and tc:IsFaceup() and not tc:IsType(TYPE_TUNER) end,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,function(tc) return c:GetLinkedGroup():IsContains(tc) and tc:IsFaceup() and not tc:IsType(TYPE_TUNER) end,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function cid.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then c:SetCardTarget(tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(TYPE_TUNER) e1:SetCondition(function(e) return e:GetOwner():IsHasCardTarget(e:GetHandler()) end) tc:RegisterEffect(e1) end end function cid.hdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND) end function cid.hdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,1,nil) local tc=g:GetFirst() if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then local sg=Duel.GetMatchingGroup(aux.AND(Card.IsFaceup,Card.IsSetCard,Card.IsAbleToHand),tp,LOCATION_REMOVED,0,nil,0x83e) if #sg==0 or Duel.GetFlagEffect(tp,id)~=0 or not Duel.SelectYesNo(tp,1190) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sc=sg:Select(tp,1,1,nil) Duel.SendtoHand(sc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sc) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) end end