--created by manu, coded by Lyris local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() 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(s.spcon) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e9=Effect.CreateEffect(c) e9:SetType(EFFECT_TYPE_SINGLE) e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e9:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e9) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetDescription(aux.Stringid(id,0)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_TO_DECK) e3:SetRange(LOCATION_MZONE) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCondition(function(e,tp,eg) return eg:IsExists(s.cfilter,1,e:GetHandler(),1-tp) end) e3:SetTarget(s.tg) e3:SetOperation(s.op) c:RegisterEffect(e3) end function s.filter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x70b) and not c:IsPublic() end function s.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,c:GetControler(),LOCATION_HAND,0,3,e:GetHandler()) end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,3,3,c) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc:IsSetCard(0x70b) and chkc~=e:GetHandler() end if chk==0 then return true end local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,0x70b) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) for tc in aux.Next(g) do if tc:IsFaceup() and tc:IsRelateToEffect(e) then local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAINING) e2:SetOperation(s.chainop) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2,true) end end end function s.chainop(e,tp,eg,ep,ev,re,r,rp) if re:GetHandler():IsSetCard(0x70b) then Duel.SetChainLimit(function(fe,frp,ftp) return ftp==frp end) end end function s.cfilter(c,p) return c:IsSetCard(0x70b) and c:IsControler(p) and c:GetOwner()~=p end function s.spfilter(c,e,tp,t) return not t[c:GetCode()] and c:IsSetCard(0x70b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.op(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local t={} for ec in aux.Next(eg) do t[ec:GetCode()]=true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,t) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end