name: Multiple
card_text: "Big Piece Golem" + "Medium Piece Golem"
  At the end of the Battle Phase, if this card attacked or was attacked, you can return it to the Extra Deck. Then, if all of the Fusion Material Monsters that were used for the Fusion Summon of this card are in your Graveyard, you can Special Summon them.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 25247218 --Big Piece Golem
  local CARD_ID_2 = 58843503 --Medium Piece Golem
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 25247218 --Big Piece Golem
  local CARD_ID_2 = 58843503 --Medium Piece Golem
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode2(c, CARD_ID_1, CARD_ID_2, true, true)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOEXTRA + CATEGORY_SPECIAL_SUMMON + CATEGORY_GRAVE_SPSUMMON)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_BATTLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetBattledGroupCount() > 0
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToDeck()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOEXTRA, e:GetHandler(), 1, 0, 0)
  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.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	local mg = c:GetMaterial()
  	local ct = mg:GetCount()
  	if
  		Duel.SendtoDeck(c, nil, SEQ_DECKTOP, REASON_EFFECT) ~= 0
  		and c:IsLocation(LOCATION_EXTRA)
  		and c:IsSummonType(SUMMON_TYPE_FUSION)
  		and ct > 0
  		and ct <= Duel.GetLocationCount(tp, LOCATION_MZONE)
  		and mg:FilterCount(aux.NecroValleyFilter(s.mgfilter), nil, e, tp, c, mg) == ct
  		and (not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) or ct == 1)
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 1))
  	then
  		Duel.BreakEffect()
  		Duel.SpecialSummon(mg, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Multiple
  "Big Piece Golem" + "Medium Piece Golem"
  At the end of the Battle Phase, if this card attacked or was attacked, you can return it to the Extra Deck. Then, if all of the Fusion Material Monsters that were used for the Fusion Summon of this card are in your Graveyard, you can Special Summon them.
target_text: -- Multiple
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 25247218 --Big Piece Golem
  local CARD_ID_2 = 58843503 --Medium Piece Golem
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode2(c, CARD_ID_1, CARD_ID_2, true, true)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOEXTRA + CATEGORY_SPECIAL_SUMMON + CATEGORY_GRAVE_SPSUMMON)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_BATTLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetBattledGroupCount() > 0
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToDeck()
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOEXTRA, e:GetHandler(), 1, 0, 0)
  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.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	local mg = c:GetMaterial()
  	local ct = mg:GetCount()
  	if
  		Duel.SendtoDeck(c, nil, SEQ_DECKTOP, REASON_EFFECT) ~= 0
  		and c:IsLocation(LOCATION_EXTRA)
  		and c:IsSummonType(SUMMON_TYPE_FUSION)
  		and ct > 0
  		and ct <= Duel.GetLocationCount(tp, LOCATION_MZONE)
  		and mg:FilterCount(aux.NecroValleyFilter(s.mgfilter), nil, e, tp, c, mg) == ct
  		and (not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) or ct == 1)
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 1))
  	then
  		Duel.BreakEffect()
  		Duel.SpecialSummon(mg, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  