name: 封印されしエクゾディア
card_text: このカードと「封印されし者の右腕」「封印されし者の左腕」「封印されし者の右足」「封印されし者の左足」が手札に全て揃った時、自分はデュエルに勝利する。
external_ids: local CARD_ID_0 = 70903634 --封印されし者の右腕
  local CARD_ID_1 = 44519536 --封印されし者の左足
  local CARD_ID_2 = 7902349 --封印されし者の左腕
  local CARD_ID_3 = 8124921 --封印されし者の右足
  
lua: local CARD_ID_0 = 70903634 --封印されし者の右腕
  local CARD_ID_1 = 44519536 --封印されし者の左足
  local CARD_ID_2 = 7902349 --封印されし者の左腕
  local CARD_ID_3 = 8124921 --封印されし者の右足
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--win
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_TO_HAND)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsCode(CARD_ID_3, CARD_ID_1, CARD_ID_0, CARD_ID_2, id)
  end
  function s.check(g)
  	local a1 = false
  	local a2 = false
  	local a3 = false
  	local a4 = false
  	local a5 = false
  	local tc = g:GetFirst()
  	while tc do
  		local code = tc:GetCode()
  		if code == CARD_ID_3 then
  			a1 = true
  		elseif code == CARD_ID_1 then
  			a2 = true
  		elseif code == CARD_ID_0 then
  			a3 = true
  		elseif code == CARD_ID_2 then
  			a4 = true
  		elseif code == id then
  			a5 = true
  		end
  		tc = g:GetNext()
  	end
  	return a1 and a2 and a3 and a4 and a5
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local WIN_REASON_EXODIA = 0x10
  	local g1 = Duel.GetFieldGroup(tp, LOCATION_HAND, 0):Filter(s.filter, nil)
  	local g2 = Duel.GetFieldGroup(tp, 0, LOCATION_HAND):Filter(s.filter, nil)
  	local wtp = s.check(g1)
  	local wntp = s.check(g2)
  	if wtp and not wntp then
  		Duel.ConfirmCards(1 - tp, g1)
  		Duel.Win(tp, WIN_REASON_EXODIA)
  	elseif not wtp and wntp then
  		Duel.ConfirmCards(tp, g2)
  		Duel.Win(1 - tp, WIN_REASON_EXODIA)
  	elseif wtp and wntp then
  		Duel.ConfirmCards(1 - tp, g1)
  		Duel.ConfirmCards(tp, g2)
  		Duel.Win(PLAYER_NONE, WIN_REASON_EXODIA)
  	end
  end
  
  
source_text: 封印されしエクゾディア
  このカードと「封印されし者の右腕」「封印されし者の左腕」「封印されし者の右足」「封印されし者の左足」が手札に全て揃った時、自分はデュエルに勝利する。
target_text: -- 封印されしエクゾディア
  local CARD_ID_0 = 70903634 --封印されし者の右腕
  local CARD_ID_1 = 44519536 --封印されし者の左足
  local CARD_ID_2 = 7902349 --封印されし者の左腕
  local CARD_ID_3 = 8124921 --封印されし者の右足
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--win
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_TO_HAND)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsCode(CARD_ID_3, CARD_ID_1, CARD_ID_0, CARD_ID_2, id)
  end
  function s.check(g)
  	local a1 = false
  	local a2 = false
  	local a3 = false
  	local a4 = false
  	local a5 = false
  	local tc = g:GetFirst()
  	while tc do
  		local code = tc:GetCode()
  		if code == CARD_ID_3 then
  			a1 = true
  		elseif code == CARD_ID_1 then
  			a2 = true
  		elseif code == CARD_ID_0 then
  			a3 = true
  		elseif code == CARD_ID_2 then
  			a4 = true
  		elseif code == id then
  			a5 = true
  		end
  		tc = g:GetNext()
  	end
  	return a1 and a2 and a3 and a4 and a5
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local WIN_REASON_EXODIA = 0x10
  	local g1 = Duel.GetFieldGroup(tp, LOCATION_HAND, 0):Filter(s.filter, nil)
  	local g2 = Duel.GetFieldGroup(tp, 0, LOCATION_HAND):Filter(s.filter, nil)
  	local wtp = s.check(g1)
  	local wntp = s.check(g2)
  	if wtp and not wntp then
  		Duel.ConfirmCards(1 - tp, g1)
  		Duel.Win(tp, WIN_REASON_EXODIA)
  	elseif not wtp and wntp then
  		Duel.ConfirmCards(tp, g2)
  		Duel.Win(1 - tp, WIN_REASON_EXODIA)
  	elseif wtp and wntp then
  		Duel.ConfirmCards(1 - tp, g1)
  		Duel.ConfirmCards(tp, g2)
  		Duel.Win(PLAYER_NONE, WIN_REASON_EXODIA)
  	end
  end
  
  