name: Dragunity
card_text: 1 Dragon Tuner + 1+ non-Tuner Winged Beast monsters
  When this card is Synchro Summoned: You can target any number of Dragon "Dragunity" monsters in your GY; equip those Dragon monsters to this card. This card gains 300 ATK for each "Dragunity" card equipped to it.
external_ids: local SETCARD_ID_0 = 0x29 --Dragunity
  
lua: local SETCARD_ID_0 = 0x29 --Dragunity
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsRace, RACE_DRAGON), aux.NonTuner(Card.IsRace, RACE_WINDBEAST), 1)
  	c:EnableReviveLimit()
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_LEAVE_GRAVE + CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCondition(s.eqcon)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.atkval)
  	c:RegisterEffect(e2)
  end
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsRace(RACE_DRAGON) and not c:IsForbidden()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	local ft = Duel.GetLocationCount(tp, LOCATION_SZONE)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, ft, nil)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, g, g:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, g:GetCount(), 0, 0)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
  	local sg = g:Filter(Card.IsRelateToEffect, nil, e)
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) < sg:GetCount() then
  		return
  	end
  	local c = e:GetHandler()
  	if c:IsFacedown() or not c:IsRelateToEffect(e) then
  		return
  	end
  	local tc = sg:GetFirst()
  	while tc do
  		Duel.Equip(tp, tc, c, false, true)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  		e1:SetCode(EFFECT_EQUIP_LIMIT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetValue(s.eqlimit)
  		tc:RegisterEffect(e1)
  		tc = sg:GetNext()
  	end
  	Duel.EquipComplete()
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.atkval(e, c)
  	return c:GetEquipGroup():FilterCount(Card.IsSetCard, nil, 0x29) * 300
  end
  
  
source_text: Dragunity
  1 Dragon Tuner + 1+ non-Tuner Winged Beast monsters
  When this card is Synchro Summoned: You can target any number of Dragon "Dragunity" monsters in your GY; equip those Dragon monsters to this card. This card gains 300 ATK for each "Dragunity" card equipped to it.
target_text: -- Dragunity
  local SETCARD_ID_0 = 0x29 --Dragunity
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsRace, RACE_DRAGON), aux.NonTuner(Card.IsRace, RACE_WINDBEAST), 1)
  	c:EnableReviveLimit()
  	--equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_LEAVE_GRAVE + CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCondition(s.eqcon)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.atkval)
  	c:RegisterEffect(e2)
  end
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsRace(RACE_DRAGON) and not c:IsForbidden()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	local ft = Duel.GetLocationCount(tp, LOCATION_SZONE)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, ft, nil)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, g, g:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, g:GetCount(), 0, 0)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
  	local sg = g:Filter(Card.IsRelateToEffect, nil, e)
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) < sg:GetCount() then
  		return
  	end
  	local c = e:GetHandler()
  	if c:IsFacedown() or not c:IsRelateToEffect(e) then
  		return
  	end
  	local tc = sg:GetFirst()
  	while tc do
  		Duel.Equip(tp, tc, c, false, true)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  		e1:SetCode(EFFECT_EQUIP_LIMIT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetValue(s.eqlimit)
  		tc:RegisterEffect(e1)
  		tc = sg:GetNext()
  	end
  	Duel.EquipComplete()
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.atkval(e, c)
  	return c:GetEquipGroup():FilterCount(Card.IsSetCard, nil, 0x29) * 300
  end
  
  