name: Junk
card_text: "Junk Synchron" + 1+ non-Tuner monsters
  If this card is Synchro Summoned: It gains ATK equal to the total ATK of all Level 2 or lower monsters you currently control.
external_ids: local CARD_ID_0 = 63977008 --Junk Synchron
  local CARD_ID_1 = 20932152 --Quickdraw Synchron
  
lua: local CARD_ID_0 = 63977008 --Junk Synchron
  local CARD_ID_1 = 20932152 --Quickdraw Synchron
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddMaterialCodeList(c, CARD_ID_0)
  	--synchro summon
  	aux.AddSynchroProcedure(c, s.tfilter, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.con)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  end
  s.material_setcode = 0x1017
  function s.tfilter(c)
  	return c:IsCode(CARD_ID_0) or c:IsHasEffect(CARD_ID_1)
  end
  function s.con(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsLevelBelow(2)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	if g:GetCount() > 0 and c:IsFaceup() and c:IsRelateToEffect(e) then
  		local atk = 0
  		local tc = g:GetFirst()
  		while tc do
  			atk = atk + tc:GetAttack()
  			tc = g:GetNext()
  		end
  		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)
  	end
  end
  
  
source_text: Junk
  "Junk Synchron" + 1+ non-Tuner monsters
  If this card is Synchro Summoned: It gains ATK equal to the total ATK of all Level 2 or lower monsters you currently control.
target_text: -- Junk
  local CARD_ID_0 = 63977008 --Junk Synchron
  local CARD_ID_1 = 20932152 --Quickdraw Synchron
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddMaterialCodeList(c, CARD_ID_0)
  	--synchro summon
  	aux.AddSynchroProcedure(c, s.tfilter, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.con)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  end
  s.material_setcode = 0x1017
  function s.tfilter(c)
  	return c:IsCode(CARD_ID_0) or c:IsHasEffect(CARD_ID_1)
  end
  function s.con(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsLevelBelow(2)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	if g:GetCount() > 0 and c:IsFaceup() and c:IsRelateToEffect(e) then
  		local atk = 0
  		local tc = g:GetFirst()
  		while tc do
  			atk = atk + tc:GetAttack()
  			tc = g:GetNext()
  		end
  		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)
  	end
  end
  
  