--ドライトロン流星群

--Scripted by mallu11
function c100415036.initial_effect(c)
	--Activate
	local e1=Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TODECK)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_SUMMON)
	e1:SetCountLimit(1,100415036+EFFECT_COUNT_CODE_OATH)
	e1:SetCondition(c100415036.condition)
	e1:SetTarget(c100415036.target)
	e1:SetOperation(c100415036.activate)
	c:RegisterEffect(e1)
	local e2=e1:Clone()
	e2:SetCode(EVENT_SPSUMMON)
	c:RegisterEffect(e2)
end
function c100415036.filter(c)
	return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function c100415036.cfilter(c,tp)
	return c:GetSummonPlayer()==1-tp and c:IsAbleToDeck()
end
function c100415036.condition(e,tp,eg,ep,ev,re,r,rp)
	return Duel.IsExistingMatchingCard(c100415036.filter,tp,LOCATION_MZONE,0,1,nil)
		and Duel.GetCurrentChain()==0 and eg:IsExists(c100415036.cfilter,1,nil,tp)
end
function c100415036.target(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return true end
	Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
	Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,eg:GetCount(),0,0)
end
function c100415036.activate(e,tp,eg,ep,ev,re,r,rp)
	Duel.NegateSummon(eg)
	Duel.SendtoDeck(eg,nil,2,REASON_EFFECT)
end
