name: Shooting
card_text: 1 Tuner Synchro Monster + 2+ non-Tuner Synchro Monsters
  Must be Synchro Summoned. This card can attack a number of times each Battle Phase, up to the number of non-Tuners used for its Synchro Summon. Once per turn, when a card or effect is activated (Quick Effect): You can negate the activation, and if you do, destroy it. When this face-up card leaves the field: You can Special Summon 1 "Shooting Star Dragon" from your Extra Deck.
external_ids: local CARD_ID_0 = 24696097 --Shooting Star Dragon
  
lua: local CARD_ID_0 = 24696097 --Shooting Star Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsSynchroType, TYPE_SYNCHRO), aux.NonTuner(Card.IsSynchroType, TYPE_SYNCHRO), 2)
  	c:EnableReviveLimit()
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.synlimit)
  	c:RegisterEffect(e1)
  	--multi attack
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_MATERIAL_CHECK)
  	e3:SetValue(s.valcheck)
  	c:RegisterEffect(e3)
  	--negate
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_CHAINING)
  	e3:SetCountLimit(1)
  	e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCondition(s.discon)
  	e3:SetTarget(s.distg)
  	e3:SetOperation(s.disop)
  	c:RegisterEffect(e3)
  	--Special Summon
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetType(EFFECT_TYPE_TRIGGER_O + EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
  	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e4:SetCode(EVENT_LEAVE_FIELD)
  	e4:SetCondition(s.sumcon)
  	e4:SetTarget(s.sumtg)
  	e4:SetOperation(s.sumop)
  	c:RegisterEffect(e4)
  end
  s.material_type = TYPE_SYNCHRO
  s.cosmic_quasar_dragon_summon = true
  function s.valcheck(e, c)
  	local ct = c:GetMaterialCount() - 1
  	if ct > 1 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE - RESET_TOFIELD)
  		e1:SetValue(ct - 1)
  		c:RegisterEffect(e1)
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  function s.sumcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
  end
  function s.filter(c, e, tp)
  	return c:IsCode(CARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, true) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	local tg = Duel.GetFirstMatchingCard(s.filter, tp, LOCATION_EXTRA, 0, nil, e, tp)
  	if tg then
  		Duel.SpecialSummon(tg, 0, tp, tp, false, true, POS_FACEUP)
  	end
  end
  
  
source_text: Shooting
  1 Tuner Synchro Monster + 2+ non-Tuner Synchro Monsters
  Must be Synchro Summoned. This card can attack a number of times each Battle Phase, up to the number of non-Tuners used for its Synchro Summon. Once per turn, when a card or effect is activated (Quick Effect): You can negate the activation, and if you do, destroy it. When this face-up card leaves the field: You can Special Summon 1 "Shooting Star Dragon" from your Extra Deck.
target_text: -- Shooting
  local CARD_ID_0 = 24696097 --Shooting Star Dragon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsSynchroType, TYPE_SYNCHRO), aux.NonTuner(Card.IsSynchroType, TYPE_SYNCHRO), 2)
  	c:EnableReviveLimit()
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.synlimit)
  	c:RegisterEffect(e1)
  	--multi attack
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_MATERIAL_CHECK)
  	e3:SetValue(s.valcheck)
  	c:RegisterEffect(e3)
  	--negate
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_CHAINING)
  	e3:SetCountLimit(1)
  	e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCondition(s.discon)
  	e3:SetTarget(s.distg)
  	e3:SetOperation(s.disop)
  	c:RegisterEffect(e3)
  	--Special Summon
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetType(EFFECT_TYPE_TRIGGER_O + EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
  	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e4:SetCode(EVENT_LEAVE_FIELD)
  	e4:SetCondition(s.sumcon)
  	e4:SetTarget(s.sumtg)
  	e4:SetOperation(s.sumop)
  	c:RegisterEffect(e4)
  end
  s.material_type = TYPE_SYNCHRO
  s.cosmic_quasar_dragon_summon = true
  function s.valcheck(e, c)
  	local ct = c:GetMaterialCount() - 1
  	if ct > 1 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE - RESET_TOFIELD)
  		e1:SetValue(ct - 1)
  		c:RegisterEffect(e1)
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  function s.sumcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
  end
  function s.filter(c, e, tp)
  	return c:IsCode(CARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, true) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	local tg = Duel.GetFirstMatchingCard(s.filter, tp, LOCATION_EXTRA, 0, nil, e, tp)
  	if tg then
  		Duel.SpecialSummon(tg, 0, tp, tp, false, true, POS_FACEUP)
  	end
  end
  
  