name: Black
card_text: When exactly 1 "Blackwing" monster (and no other monster) is Special Summoned: Target 1 face-up monster your opponent controls; gain LP equal to the ATK of that target, and if you do, return it to the 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_TOHAND + CATEGORY_RECOVER)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return eg:GetCount() == 1 and eg:GetFirst():IsSetCard(SETCARD_ID_0)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsAbleToHand() and c:GetAttack() > 0
  end
  function s.target(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)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_OPPO)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack() > 0 then
  		Duel.Recover(tp, tc:GetAttack(), REASON_EFFECT)
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  	end
  end
  
  
source_text: Black
  When exactly 1 "Blackwing" monster (and no other monster) is Special Summoned: Target 1 face-up monster your opponent controls; gain LP equal to the ATK of that target, and if you do, return it to the hand.
target_text: -- Black
  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_TOHAND + CATEGORY_RECOVER)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return eg:GetCount() == 1 and eg:GetFirst():IsSetCard(SETCARD_ID_0)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsAbleToHand() and c:GetAttack() > 0
  end
  function s.target(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)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_OPPO)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack() > 0 then
  		Duel.Recover(tp, tc:GetAttack(), REASON_EFFECT)
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  	end
  end
  
  