氷結界の龍
チューナー+チューナー以外の水属性モンスター1体以上
1:1ターンに1度、手札を2枚まで墓地へ捨て、捨てた数だけ相手フィールドのカードを対象として発動できる。
そのカードを破壊する。
local CARD_ID_0 = 18319762 --氷結界の照魔師
local SETCARD_ID_0 = 0x2f --氷結界

local CARD_ID_0 = 18319762 --氷結界の照魔師
local SETCARD_ID_0 = 0x2f --氷結界
local s, id, o = GetID()
function s.initial_effect(c)
	--synchro summon
	aux.AddSynchroProcedure(c, nil, aux.NonTuner(Card.IsAttribute, ATTRIBUTE_WATER), 1)
	c:EnableReviveLimit()
	--destroy
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_DESTROY)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetCountLimit(1)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.costfilter(c, e, tp)
	if c:IsLocation(LOCATION_HAND) then
		return c:IsDiscardable() and c:IsAbleToGraveAsCost()
	else
		return e:GetHandler():IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove() and c:IsHasEffect(CARD_ID_0, tp)
	end
end
function s.fselect(g)
	return g:FilterCount(Card.IsLocation, nil, LOCATION_GRAVE) <= 1
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil, e, tp)
	end
	local rt = Duel.GetTargetCount(aux.TRUE, tp, 0, LOCATION_ONFIELD, nil)
	if rt > 2 then
		rt = 2
	end
	local g = Duel.GetMatchingGroup(s.costfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, nil, e, tp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
	local cg = g:SelectSubGroup(tp, s.fselect, false, 1, rt)
	e:SetLabel(cg:GetCount())
	local tc = cg:Filter(Card.IsLocation, nil, LOCATION_GRAVE):GetFirst()
	if tc then
		local te = tc:IsHasEffect(CARD_ID_0, tp)
		te:UseCountLimit(tp)
		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT + REASON_REPLACE)
		cg:RemoveCard(tc)
	end
	Duel.SendtoGrave(cg, REASON_COST + REASON_DISCARD)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsOnField() and chkc:IsControler(1 - tp)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(aux.TRUE, tp, 0, LOCATION_ONFIELD, 1, nil)
	end
	local ct = e:GetLabel()
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
	local eg = Duel.SelectTarget(tp, aux.TRUE, tp, 0, LOCATION_ONFIELD, ct, ct, nil)
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, ct, 0, 0)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local tg = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
	local rg = tg:Filter(Card.IsRelateToEffect, nil, e)
	if rg:GetCount() > 0 then
		Duel.Destroy(rg, REASON_EFFECT)
	end
end


氷結界の龍
チューナー+チューナー以外の水属性モンスター1体以上
1:1ターンに1度、手札を2枚まで墓地へ捨て、捨てた数だけ相手フィールドのカードを対象として発動できる。
そのカードを破壊する。
-- 氷結界の龍
local CARD_ID_0 = 18319762 --氷結界の照魔師
local SETCARD_ID_0 = 0x2f --氷結界
local s, id, o = GetID()
function s.initial_effect(c)
	--synchro summon
	aux.AddSynchroProcedure(c, nil, aux.NonTuner(Card.IsAttribute, ATTRIBUTE_WATER), 1)
	c:EnableReviveLimit()
	--destroy
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_DESTROY)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetCountLimit(1)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.costfilter(c, e, tp)
	if c:IsLocation(LOCATION_HAND) then
		return c:IsDiscardable() and c:IsAbleToGraveAsCost()
	else
		return e:GetHandler():IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove() and c:IsHasEffect(CARD_ID_0, tp)
	end
end
function s.fselect(g)
	return g:FilterCount(Card.IsLocation, nil, LOCATION_GRAVE) <= 1
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil, e, tp)
	end
	local rt = Duel.GetTargetCount(aux.TRUE, tp, 0, LOCATION_ONFIELD, nil)
	if rt > 2 then
		rt = 2
	end
	local g = Duel.GetMatchingGroup(s.costfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, nil, e, tp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
	local cg = g:SelectSubGroup(tp, s.fselect, false, 1, rt)
	e:SetLabel(cg:GetCount())
	local tc = cg:Filter(Card.IsLocation, nil, LOCATION_GRAVE):GetFirst()
	if tc then
		local te = tc:IsHasEffect(CARD_ID_0, tp)
		te:UseCountLimit(tp)
		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT + REASON_REPLACE)
		cg:RemoveCard(tc)
	end
	Duel.SendtoGrave(cg, REASON_COST + REASON_DISCARD)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsOnField() and chkc:IsControler(1 - tp)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(aux.TRUE, tp, 0, LOCATION_ONFIELD, 1, nil)
	end
	local ct = e:GetLabel()
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
	local eg = Duel.SelectTarget(tp, aux.TRUE, tp, 0, LOCATION_ONFIELD, ct, ct, nil)
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, ct, 0, 0)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local tg = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
	local rg = tg:Filter(Card.IsRelateToEffect, nil, e)
	if rg:GetCount() > 0 then
		Duel.Destroy(rg, REASON_EFFECT)
	end
end

