--Infinite Gem- Time function c249000936.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCondition(c249000936.condition) e1:SetCost(c249000936.cost) e1:SetTarget(c249000936.target) e1:SetOperation(c249000936.activate) c:RegisterEffect(e1) --act in hand local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e2:SetCondition(c249000936.handcon) c:RegisterEffect(e2) end function c249000936.confilter(c) return c:IsSetCard(0x47) end function c249000936.condition(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(c249000936.confilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil) local ct=g:GetClassCount(Card.GetCode) return ct>1 end function c249000936.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLPCost(tp,1000) end Duel.PayLPCost(tp,1000) end function c249000936.filter(c,e,tp) return c:GetTurnID()==Duel.GetTurnCount() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c249000936.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c249000936.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c249000936.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g if Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE,nil)-Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0,nil)>=2 then g=Duel.SelectTarget(tp,c249000936.filter,tp,LOCATION_GRAVE,0,1,2,nil,e,tp) else g=Duel.SelectTarget(tp,c249000936.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) end function c249000936.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local ct=Duel.GetLocationCount(tp,LOCATION_MZONE) if g:GetCount()<=ct then if g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function c249000936.handcon(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)==0 end