name: Shootingcode
card_text: 2+ Cyberse monsters
  At the start of your Battle Phase: You can activate this effect; this Battle Phase, this card can make attacks on your opponent's monsters, up to the number of monsters this card currently points to +1, but this turn, when it attacks your opponent's only monster, this card loses 400 ATK during that damage calculation only. At the end of each Battle Phase: You can draw cards equal to the number of monsters this card destroyed by battle this turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkRace, RACE_CYBERSE), 2)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_BATTLE_START)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--destroy reg
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetOperation(s.regop)
  	c:RegisterEffect(e2)
  	--draw
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_DRAW)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_PHASE + PHASE_BATTLE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1)
  	e3:SetTarget(s.drtg)
  	e3:SetOperation(s.drop)
  	c:RegisterEffect(e3)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetLinkedGroupCount() > 0
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
  		e1:SetValue(e:GetHandler():GetLinkedGroupCount())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE)
  		c:RegisterEffect(e1)
  		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:SetCondition(s.atkcon)
  		e2:SetValue(-400)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e2)
  	end
  end
  function s.atkcon(e)
  	if not Duel.GetCurrentPhase() == PHASE_DAMAGE_CAL then
  		return false
  	end
  	local tp = e:GetHandlerPlayer()
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_MZONE)
  	if #g ~= 1 then
  		return false
  	end
  	local c = e:GetHandler()
  	local bc = g:GetFirst()
  	return (c == Duel.GetAttacker() and bc == Duel.GetAttackTarget()) or (bc == Duel.GetAttacker() and c == Duel.GetAttackTarget())
  end
  function s.regop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToBattle() then
  		return
  	end
  	local ct = c:GetFlagEffectLabel(id)
  	if ct then
  		c:SetFlagEffectLabel(id, ct + 1)
  	else
  		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1, 1)
  	end
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = e:GetHandler():GetFlagEffectLabel(id)
  	if chk == 0 then
  		return ct and Duel.IsPlayerCanDraw(tp, ct)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetHandler():GetFlagEffectLabel(id)
  	Duel.Draw(tp, ct, REASON_EFFECT)
  end
  
  
source_text: Shootingcode
  2+ Cyberse monsters
  At the start of your Battle Phase: You can activate this effect; this Battle Phase, this card can make attacks on your opponent's monsters, up to the number of monsters this card currently points to +1, but this turn, when it attacks your opponent's only monster, this card loses 400 ATK during that damage calculation only. At the end of each Battle Phase: You can draw cards equal to the number of monsters this card destroyed by battle this turn.
target_text: -- Shootingcode
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkRace, RACE_CYBERSE), 2)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_BATTLE_START)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--destroy reg
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetOperation(s.regop)
  	c:RegisterEffect(e2)
  	--draw
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_DRAW)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_PHASE + PHASE_BATTLE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1)
  	e3:SetTarget(s.drtg)
  	e3:SetOperation(s.drop)
  	c:RegisterEffect(e3)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetLinkedGroupCount() > 0
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
  		e1:SetValue(e:GetHandler():GetLinkedGroupCount())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE)
  		c:RegisterEffect(e1)
  		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:SetCondition(s.atkcon)
  		e2:SetValue(-400)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e2)
  	end
  end
  function s.atkcon(e)
  	if not Duel.GetCurrentPhase() == PHASE_DAMAGE_CAL then
  		return false
  	end
  	local tp = e:GetHandlerPlayer()
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_MZONE)
  	if #g ~= 1 then
  		return false
  	end
  	local c = e:GetHandler()
  	local bc = g:GetFirst()
  	return (c == Duel.GetAttacker() and bc == Duel.GetAttackTarget()) or (bc == Duel.GetAttacker() and c == Duel.GetAttackTarget())
  end
  function s.regop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToBattle() then
  		return
  	end
  	local ct = c:GetFlagEffectLabel(id)
  	if ct then
  		c:SetFlagEffectLabel(id, ct + 1)
  	else
  		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1, 1)
  	end
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = e:GetHandler():GetFlagEffectLabel(id)
  	if chk == 0 then
  		return ct and Duel.IsPlayerCanDraw(tp, ct)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetHandler():GetFlagEffectLabel(id)
  	Duel.Draw(tp, ct, REASON_EFFECT)
  end
  
  