name: Unformed
card_text: 3 Level 4 monsters
  Once per turn, during your opponent's Main Phase: You can detach 1 Xyz Material from this card; this card gains ATK and DEF equal to the total ATK of all face-up Xyz Monsters your opponent currently controls (this is a Quick Effect).
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 3)
  	c:EnableReviveLimit()
  	--adup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_MAIN_END)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.atkcon)
  	e1:SetCost(s.atkcost)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp and (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_MZONE, nil)
  		local atk = g:GetSum(Card.GetAttack)
  		if atk > 0 then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_UPDATE_ATTACK)
  			e1:SetValue(atk)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  			c:RegisterEffect(e1)
  			local e2 = e1:Clone()
  			e2:SetCode(EFFECT_UPDATE_DEFENSE)
  			c:RegisterEffect(e2)
  		end
  	end
  end
  
  
source_text: Unformed
  3 Level 4 monsters
  Once per turn, during your opponent's Main Phase: You can detach 1 Xyz Material from this card; this card gains ATK and DEF equal to the total ATK of all face-up Xyz Monsters your opponent currently controls (this is a Quick Effect).
target_text: -- Unformed
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 4, 3)
  	c:EnableReviveLimit()
  	--adup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_MAIN_END)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.atkcon)
  	e1:SetCost(s.atkcost)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp and (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_MZONE, nil)
  		local atk = g:GetSum(Card.GetAttack)
  		if atk > 0 then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_UPDATE_ATTACK)
  			e1:SetValue(atk)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  			c:RegisterEffect(e1)
  			local e2 = e1:Clone()
  			e2:SetCode(EFFECT_UPDATE_DEFENSE)
  			c:RegisterEffect(e2)
  		end
  	end
  end
  
  