name: Twin
card_text: 2 "Photon" monsters
  You can Tribute this card; Special Summon, from your Graveyard, both of the Fusion Material Monsters used for the Fusion Summon of this card.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x55 --Photon
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x55 --Photon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), 2, true)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable()
  	end
  	Duel.Release(e:GetHandler(), REASON_COST)
  end
  function s.mgfilter(c, e, tp, fusc, mg)
  	return c:IsControler(tp)
  		and c:IsLocation(LOCATION_GRAVE)
  		and c:GetReason() & (REASON_FUSION + REASON_MATERIAL) == (REASON_FUSION + REASON_MATERIAL)
  		and c:GetReasonCard() == fusc
  		and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  		and fusc:CheckFusionMaterial(mg, c, PLAYER_NONE, true)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = e:GetHandler():GetMaterial()
  	if chk == 0 then
  		local ct = g:GetCount()
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		if e:GetHandler():GetSequence() < 5 then
  			ft = ft + 1
  		end
  		return ct > 0
  			and ft >= ct
  			and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  			and e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  			and g:FilterCount(s.mgfilter, nil, e, tp, e:GetHandler(), g) == ct
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		return
  	end
  	local g = e:GetHandler():GetMaterial()
  	local ct = g:GetCount()
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) >= ct and g:FilterCount(s.mgfilter, nil, e, tp, e:GetHandler(), g) == ct then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Twin
  2 "Photon" monsters
  You can Tribute this card; Special Summon, from your Graveyard, both of the Fusion Material Monsters used for the Fusion Summon of this card.
target_text: -- Twin
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local SETCARD_ID_0 = 0x55 --Photon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), 2, true)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable()
  	end
  	Duel.Release(e:GetHandler(), REASON_COST)
  end
  function s.mgfilter(c, e, tp, fusc, mg)
  	return c:IsControler(tp)
  		and c:IsLocation(LOCATION_GRAVE)
  		and c:GetReason() & (REASON_FUSION + REASON_MATERIAL) == (REASON_FUSION + REASON_MATERIAL)
  		and c:GetReasonCard() == fusc
  		and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  		and fusc:CheckFusionMaterial(mg, c, PLAYER_NONE, true)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = e:GetHandler():GetMaterial()
  	if chk == 0 then
  		local ct = g:GetCount()
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		if e:GetHandler():GetSequence() < 5 then
  			ft = ft + 1
  		end
  		return ct > 0
  			and ft >= ct
  			and not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  			and e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  			and g:FilterCount(s.mgfilter, nil, e, tp, e:GetHandler(), g) == ct
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		return
  	end
  	local g = e:GetHandler():GetMaterial()
  	local ct = g:GetCount()
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) >= ct and g:FilterCount(s.mgfilter, nil, e, tp, e:GetHandler(), g) == ct then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  