function c500319350.initial_effect(c) --to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(500319350,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCountLimit(1) e1:SetCondition(c500319350.con) e1:SetTarget(c500319350.tg) e1:SetOperation(c500319350.op) c:RegisterEffect(e1) --summon success local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(500319350,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,500319350) e2:SetCost(c500319350.spcost) e2:SetCountLimit(1,500319350) e2:SetTarget(c500319350.sptg) e2:SetOperation(c500319350.spop) c:RegisterEffect(e2) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_ATTACK) c:RegisterEffect(e3) --summon limit local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetCode(EFFECT_CANNOT_MSET) e6:SetCondition(c500319350.sumcon) c:RegisterEffect(e6) --spsummon limit local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetRange(LOCATION_MZONE) e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetTargetRange(1,0) e4:SetTarget(c500319350.sumlimit) c:RegisterEffect(e4) Duel.AddCustomActivityCounter(500319350,ACTIVITY_SPSUMMON,c500319350.counterfilter) end function c500319350.counterfilter(c) return c:IsSetCard(0x485a) end function c500319350.con(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function c500319350.filter(c) return c:IsSetCard(0x85a) and c:IsType(TYPE_MONSTER) and c:IsLevelBelow(4) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY) end function c500319350.tg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(c500319350.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,0,1,0,LOCATION_DECK+LOCATION_GRAVE) end function c500319350.op(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c500319350.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c500319350.sfilter(c) return c:IsFaceup() and c:IsSetCard(0x485a) end function c500319350.sumcon(e) return not Duel.IsExistingMatchingCard(c500319350.sfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function c500319350.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(500319350,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(c500319350.splimit) Duel.RegisterEffect(e1,tp) end function c500319350.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(0x485a) end function c500319350.spfilter(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x485a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c500319350.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp)end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c500319350.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK) end function c500319350.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c500319350.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,2,nil,e,tp) if g:GetCount()>0 then local tc=g:GetFirst() while tc do Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_ATTACK) e3:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e3) tc=g:GetNext() end end end function c500319350.sumlimit(e,c,sump,sumtype,sumpos,targetp) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x85a) end