name: 青き眼の激臨
card_text: このカードを発動するターン、自分は「青眼の白龍」しか召喚・特殊召喚できない。
  1:このカードを含む、自分の手札・フィールド・墓地のカードを全て裏側表示で除外し、デッキから「青眼の白龍」を3体まで特殊召喚する。
external_ids: local CARD_ID_0 = 59822133 --青眼の精霊龍
  local CARD_ID_1 = 89631139 --青眼の白龍
  
lua: local CARD_ID_0 = 59822133 --青眼の精霊龍
  local CARD_ID_1 = 89631139 --青眼の白龍
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SUMMON, s.counterfilter)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SPSUMMON, s.counterfilter)
  end
  function s.counterfilter(c)
  	return c:IsCode(CARD_ID_1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetCustomActivityCount(id, tp, ACTIVITY_SUMMON) == 0 and Duel.GetCustomActivityCount(id, 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(s.splimit)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c)
  	return not c:IsCode(CARD_ID_1)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCode(CARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_HAND + LOCATION_ONFIELD + LOCATION_GRAVE, 0, nil, tp, POS_FACEDOWN)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp) and g:GetCount() > 0 and Duel.GetMZoneCount(tp, g) > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, g:GetCount(), tp, LOCATION_HAND + LOCATION_ONFIELD + LOCATION_GRAVE)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if not e:GetHandler():IsRelateToEffect(e) then
  		return
  	end
  	local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_HAND + LOCATION_ONFIELD + LOCATION_GRAVE, 0, nil, tp, POS_FACEDOWN)
  	if Duel.Remove(g, POS_FACEDOWN, REASON_EFFECT) > 0 then
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		if ft <= 0 then
  			return
  		end
  		if ft > 3 then
  			ft = 3
  		end
  		if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  			ft = 1
  		end
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, ft, nil, e, tp)
  		if sg:GetCount() > 0 then
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  
source_text: 青き眼の激臨
  このカードを発動するターン、自分は「青眼の白龍」しか召喚・特殊召喚できない。
  1:このカードを含む、自分の手札・フィールド・墓地のカードを全て裏側表示で除外し、デッキから「青眼の白龍」を3体まで特殊召喚する。
target_text: -- 青き眼の激臨
  local CARD_ID_0 = 59822133 --青眼の精霊龍
  local CARD_ID_1 = 89631139 --青眼の白龍
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SUMMON, s.counterfilter)
  	Duel.AddCustomActivityCounter(id, ACTIVITY_SPSUMMON, s.counterfilter)
  end
  function s.counterfilter(c)
  	return c:IsCode(CARD_ID_1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetCustomActivityCount(id, tp, ACTIVITY_SUMMON) == 0 and Duel.GetCustomActivityCount(id, 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(s.splimit)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.splimit(e, c)
  	return not c:IsCode(CARD_ID_1)
  end
  function s.spfilter(c, e, tp)
  	return c:IsCode(CARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_HAND + LOCATION_ONFIELD + LOCATION_GRAVE, 0, nil, tp, POS_FACEDOWN)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp) and g:GetCount() > 0 and Duel.GetMZoneCount(tp, g) > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, g:GetCount(), tp, LOCATION_HAND + LOCATION_ONFIELD + LOCATION_GRAVE)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if not e:GetHandler():IsRelateToEffect(e) then
  		return
  	end
  	local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_HAND + LOCATION_ONFIELD + LOCATION_GRAVE, 0, nil, tp, POS_FACEDOWN)
  	if Duel.Remove(g, POS_FACEDOWN, REASON_EFFECT) > 0 then
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		if ft <= 0 then
  			return
  		end
  		if ft > 3 then
  			ft = 3
  		end
  		if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  			ft = 1
  		end
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, ft, nil, e, tp)
  		if sg:GetCount() > 0 then
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  