name: Delta
card_text: If you control a "Blackwing" monster: Destroy all face-down Spells and Traps your opponent controls. If you control exactly 3 "Blackwing" monsters, you can activate this card from your hand.
external_ids: local SETCARD_ID_0 = 0x33 --Blackwing
  
lua: local SETCARD_ID_0 = 0x33 --Blackwing
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--act in hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
  	e2:SetCondition(s.handcon)
  	c:RegisterEffect(e2)
  end
  function s.handcon(e)
  	return Duel.GetMatchingGroupCount(s.cfilter, e:GetHandler():GetControler(), LOCATION_MZONE, 0, nil) == 3
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsFacedown()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, 0, LOCATION_SZONE, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_SZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_SZONE, nil)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  
source_text: Delta
  If you control a "Blackwing" monster: Destroy all face-down Spells and Traps your opponent controls. If you control exactly 3 "Blackwing" monsters, you can activate this card from your hand.
target_text: -- Delta
  local SETCARD_ID_0 = 0x33 --Blackwing
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--act in hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
  	e2:SetCondition(s.handcon)
  	c:RegisterEffect(e2)
  end
  function s.handcon(e)
  	return Duel.GetMatchingGroupCount(s.cfilter, e:GetHandler():GetControler(), LOCATION_MZONE, 0, nil) == 3
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsFacedown()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, 0, LOCATION_SZONE, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_SZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_SZONE, nil)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  