name: Blackwing
card_text: You can send this card from your hand or field to the GY, then target 1 face-up monster your opponent controls; send 1 "Blackwing" Synchro Monster or 1 "Black-Winged Dragon" from your Extra Deck to the GY, and if you do, until the end of this turn, the targeted monster loses 700 ATK, also negate its effects. This is a Quick Effect if you control a DARK Synchro Monster. You can only use this effect of "Blackwing - Chinook the Snow Blast" once per turn.
external_ids: local CARD_ID_0 = 9012916 --Black-Winged Dragon
  local SETCARD_ID_0 = 0x33 --Blackwing
  
lua: local CARD_ID_0 = 9012916 --Black-Winged Dragon
  local SETCARD_ID_0 = 0x33 --Blackwing
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOGRAVE + CATEGORY_ATKCHANGE + CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE + LOCATION_HAND)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.discon1)
  	e1:SetCost(s.discost)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP)
  	e2:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e2:SetCondition(s.discon2)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
  end
  function s.discon1(e, tp, eg, ep, ev, re, r, rp)
  	return not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.discon2(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and aux.dscon(e, tp, eg, ep, ev, re, r, rp)
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.filter(c)
  	return c:IsFaceup() and (aux.NegateMonsterFilter(c) or c:GetAttack() > 0)
  end
  function s.tgfilter(c)
  	return c:IsAbleToGrave() and ((c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SYNCHRO)) or c:IsCode(CARD_ID_0))
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil) and Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_EXTRA, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil)
  	if g:GetCount() > 0 and Duel.SendtoGrave(g, REASON_EFFECT) > 0 and g:GetFirst():IsLocation(LOCATION_GRAVE) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetValue(RESET_TURN_SET)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_SINGLE)
  		e3:SetCode(EFFECT_UPDATE_ATTACK)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e3:SetValue(-700)
  		tc:RegisterEffect(e3)
  	end
  end
  
  
source_text: Blackwing
  You can send this card from your hand or field to the GY, then target 1 face-up monster your opponent controls; send 1 "Blackwing" Synchro Monster or 1 "Black-Winged Dragon" from your Extra Deck to the GY, and if you do, until the end of this turn, the targeted monster loses 700 ATK, also negate its effects. This is a Quick Effect if you control a DARK Synchro Monster. You can only use this effect of "Blackwing - Chinook the Snow Blast" once per turn.
target_text: -- Blackwing
  local CARD_ID_0 = 9012916 --Black-Winged Dragon
  local SETCARD_ID_0 = 0x33 --Blackwing
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOGRAVE + CATEGORY_ATKCHANGE + CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE + LOCATION_HAND)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.discon1)
  	e1:SetCost(s.discost)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP)
  	e2:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e2:SetCondition(s.discon2)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
  end
  function s.discon1(e, tp, eg, ep, ev, re, r, rp)
  	return not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.discon2(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and aux.dscon(e, tp, eg, ep, ev, re, r, rp)
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.filter(c)
  	return c:IsFaceup() and (aux.NegateMonsterFilter(c) or c:GetAttack() > 0)
  end
  function s.tgfilter(c)
  	return c:IsAbleToGrave() and ((c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SYNCHRO)) or c:IsCode(CARD_ID_0))
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil) and Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_EXTRA, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil)
  	if g:GetCount() > 0 and Duel.SendtoGrave(g, REASON_EFFECT) > 0 and g:GetFirst():IsLocation(LOCATION_GRAVE) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetValue(RESET_TURN_SET)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_SINGLE)
  		e3:SetCode(EFFECT_UPDATE_ATTACK)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e3:SetValue(-700)
  		tc:RegisterEffect(e3)
  	end
  end
  
  