name: Blackwing
card_text: If you control no monsters and have this card in your hand: You can banish 1 other "Blackwing" monster from your hand; place 1 "Black Whirlwind" from your Deck face-up in your Spell & Trap Zone, then, either send this card to the GY, or immediately after this effect resolves, Normal Summon it without Tributing. You cannot Special Summon monsters from the Extra Deck for the rest of this turn, except DARK monsters. You can only use this effect of "Blackwing - Simoon the Poison Wind" once per turn. During the End Phase, send the "Black Whirlwind" placed by this effect to the GY, and if you do, take 1000 damage.
external_ids: local CARD_ID_0 = 91351370 --Black Whirlwind
  local SETCARD_ID_0 = 0x33 --Blackwing
  
lua: local CARD_ID_0 = 91351370 --Black Whirlwind
  local SETCARD_ID_0 = 0x33 --Blackwing
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--search and normal summon / gy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SUMMON + CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.sumcon)
  	e1:SetCost(s.sumcost)
  	e1:SetTarget(s.sumtg)
  	e1:SetOperation(s.sumop)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SUMMON_PROC)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetCondition(s.ntcon)
  	e2:SetValue(SUMMON_TYPE_NORMAL)
  	c:RegisterEffect(e2)
  	e1:SetLabelObject(e2)
  end
  function s.ntcon(e, c, minc)
  	if c == nil then
  		return true
  	end
  	return minc == 0 and Duel.CheckTribute(c, 0)
  end
  function s.sumcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) == 0
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.sumcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, c)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, c)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.acfilter(c, tp)
  	return c:IsCode(CARD_ID_0) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 or not Duel.IsExistingMatchingCard(s.acfilter, tp, LOCATION_DECK, 0, 1, nil, tp) then
  			return false
  		end
  		return e:GetHandler():IsSummonable(true, e:GetLabelObject()) or e:GetHandler():IsAbleToGrave()
  	end
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOFIELD)
  	local tc = Duel.SelectMatchingCard(tp, s.acfilter, tp, LOCATION_DECK, 0, 1, 1, nil, tp):GetFirst()
  	if tc and Duel.MoveToField(tc, tp, tp, LOCATION_SZONE, POS_FACEUP, true) ~= 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetCode(EVENT_PHASE + PHASE_END)
  		e1:SetRange(LOCATION_SZONE)
  		e1:SetCountLimit(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e1:SetOperation(s.tgop)
  		tc:RegisterEffect(e1)
  		if not c:IsRelateToEffect(e) then
  			return
  		end
  		local se = e:GetLabelObject()
  		if c:IsSummonable(true, se) and (not c:IsAbleToGrave() or Duel.SelectOption(tp, 1151, 1191) == 0) then
  			Duel.BreakEffect()
  			Duel.Summon(tp, c, true, se)
  		else
  			Duel.BreakEffect()
  			Duel.SendtoGrave(c, REASON_EFFECT)
  		end
  	end
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_DARK) and c:IsLocation(LOCATION_EXTRA)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_CARD, 0, id)
  	local c = e:GetHandler()
  	if Duel.SendtoGrave(c, REASON_EFFECT) ~= 0 then
  		Duel.Damage(tp, 1000, REASON_EFFECT)
  	end
  end
  
  
source_text: Blackwing
  If you control no monsters and have this card in your hand: You can banish 1 other "Blackwing" monster from your hand; place 1 "Black Whirlwind" from your Deck face-up in your Spell & Trap Zone, then, either send this card to the GY, or immediately after this effect resolves, Normal Summon it without Tributing. You cannot Special Summon monsters from the Extra Deck for the rest of this turn, except DARK monsters. You can only use this effect of "Blackwing - Simoon the Poison Wind" once per turn. During the End Phase, send the "Black Whirlwind" placed by this effect to the GY, and if you do, take 1000 damage.
target_text: -- Blackwing
  local CARD_ID_0 = 91351370 --Black Whirlwind
  local SETCARD_ID_0 = 0x33 --Blackwing
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--search and normal summon / gy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SUMMON + CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.sumcon)
  	e1:SetCost(s.sumcost)
  	e1:SetTarget(s.sumtg)
  	e1:SetOperation(s.sumop)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SUMMON_PROC)
  	e2:SetRange(LOCATION_HAND)
  	e2:SetCondition(s.ntcon)
  	e2:SetValue(SUMMON_TYPE_NORMAL)
  	c:RegisterEffect(e2)
  	e1:SetLabelObject(e2)
  end
  function s.ntcon(e, c, minc)
  	if c == nil then
  		return true
  	end
  	return minc == 0 and Duel.CheckTribute(c, 0)
  end
  function s.sumcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) == 0
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.sumcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, c)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, c)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.acfilter(c, tp)
  	return c:IsCode(CARD_ID_0) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 or not Duel.IsExistingMatchingCard(s.acfilter, tp, LOCATION_DECK, 0, 1, nil, tp) then
  			return false
  		end
  		return e:GetHandler():IsSummonable(true, e:GetLabelObject()) or e:GetHandler():IsAbleToGrave()
  	end
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOFIELD)
  	local tc = Duel.SelectMatchingCard(tp, s.acfilter, tp, LOCATION_DECK, 0, 1, 1, nil, tp):GetFirst()
  	if tc and Duel.MoveToField(tc, tp, tp, LOCATION_SZONE, POS_FACEUP, true) ~= 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetCode(EVENT_PHASE + PHASE_END)
  		e1:SetRange(LOCATION_SZONE)
  		e1:SetCountLimit(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e1:SetOperation(s.tgop)
  		tc:RegisterEffect(e1)
  		if not c:IsRelateToEffect(e) then
  			return
  		end
  		local se = e:GetLabelObject()
  		if c:IsSummonable(true, se) and (not c:IsAbleToGrave() or Duel.SelectOption(tp, 1151, 1191) == 0) then
  			Duel.BreakEffect()
  			Duel.Summon(tp, c, true, se)
  		else
  			Duel.BreakEffect()
  			Duel.SendtoGrave(c, REASON_EFFECT)
  		end
  	end
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_DARK) and c:IsLocation(LOCATION_EXTRA)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_CARD, 0, id)
  	local c = e:GetHandler()
  	if Duel.SendtoGrave(c, REASON_EFFECT) ~= 0 then
  		Duel.Damage(tp, 1000, REASON_EFFECT)
  	end
  end
  
  